-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbtcCoinConfig.js
265 lines (256 loc) · 9.41 KB
/
btcCoinConfig.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
const Decimal = require("decimal.js");
Decimal8 = Decimal.clone({ precision:8, rounding:8 });
const currencyUnits = [
{
type:"native",
name:"BTC",
multiplier:1,
default:true,
active:true,
values:["btc", "BTC"],
decimalPlaces:8
},
{
type:"native",
name:"mBTC",
active:false,
multiplier:1000,
values:["mbtc"],
decimalPlaces:5
},
{
type:"native",
name:"bits",
active:false,
multiplier:1000000,
values:["bits"],
decimalPlaces:2
},
{
type:"native",
name:"sat",
active:true,
multiplier:100000000,
values:["sat", "satoshi"],
decimalPlaces:0
},
{
type:"native",
name:"msat",
active:true,
multiplier:100000000000,
values:["msat", "millisatoshi"],
decimalPlaces:0
},
{
type:"native",
name:"milli-msat",
active:true,
multiplier:100000000000000,
values:["milli-msat"],
decimalPlaces:0
},
{
type:"exchanged",
name:"USD",
multiplier:"usd",
values:["usd"],
decimalPlaces:2,
symbol:"$"
},
{
type:"exchanged",
name:"EUR",
multiplier:"eur",
values:["eur"],
decimalPlaces:2,
symbol:"€"
},
];
module.exports = {
name:"Bitcoin",
ticker:"BTC",
logoUrl:"/img/logo/btc.svg",
siteTitle:"Bitcoin Explorer",
siteDescriptionHtml:"<b>BTC Explorer</b> is <a href='https://github.com/janoside/btc-rpc-explorer). If you run your own [Bitcoin Full Node](https://bitcoin.org/en/full-node), **BTC Explorer** can easily run alongside it, communicating via RPC calls. See the project [ReadMe](https://github.com/janoside/btc-rpc-explorer) for a list of features and instructions for running.",
nodeTitle:"Bitcoin Full Node",
nodeUrl:"https://bitcoin.org/en/full-node",
demoSiteUrl: "https://explorer.btc21.org",
miningPoolsConfigUrls:[
"https://raw.githubusercontent.com/blockchain/Blockchain-Known-Pools/master/pools.json",
"https://raw.githubusercontent.com/btccom/Blockchain-Known-Pools/master/pools.json"
],
maxBlockWeight: 4000000,
currencyUnits:currencyUnits,
currencyUnitsByName:{"BTC":currencyUnits[0], "mBTC":currencyUnits[1], "bits":currencyUnits[2], "sat":currencyUnits[3], "msat":currencyUnits[4], "milli-msat":currencyUnits[5]},
baseCurrencyUnit:currencyUnits[3],
defaultCurrencyUnit:currencyUnits[0],
feeSatoshiPerByteBucketMaxima: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 50, 75, 100, 150],
genesisBlockHash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
genesisCoinbaseTransactionId: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
genesisCoinbaseTransaction: {
"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d02fd04ffffffff0100f2052a01000000434104f5eeb2b10c944c6b9fbcfff94c35bdeecd93df977882babc7f3a2cf7f5c81d3b09a68db7f0e04f21de5d4230e75e6dbe7ad16eefe0d4325a62067dc6f369446aac00000000",
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"size": 204,
"vsize": 204,
"version": 1,
"confirmations":475000,
"vin": [
{
"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73",
"sequence": 4294967295
}
],
"vout": [
{
"value": 50,
"n": 0,
"scriptPubKey": {
"asm": "04f5eeb2b10c944c6b9fbcfff94c35bdeecd93df977882babc7f3a2cf7f5c81d3b09a68db7f0e04f21de5d4230e75e6dbe7ad16eefe0d4325a62067dc6f369446a OP_CHECKSIG",
"hex": "4104f5eeb2b10c944c6b9fbcfff94c35bdeecd93df977882babc7f3a2cf7f5c81d3b09a68db7f0e04f21de5d4230e75e6dbe7ad16eefe0d4325a62067dc6f369446aac",
"reqSigs": 1,
"type": "pubkey",
"addresses": [
"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
]
}
}
],
"blockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"time": 1230988505,
"blocktime": 1230988505
},
genesisCoinbaseOutputAddressScripthash:"8b01df4e368ea28f8dc0423bcf7a4923e3a12d307c875e47a0cfbf90b5c39161",
historicalData: [
{
type: "blockheight",
date: "2009-01-03",
blockHeight: 0,
blockHash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
summary: "The Bitcoin Genesis Block.",
alertBodyHtml: "This is the first block in the Bitcoin blockchain, known as the 'Genesis Block'. This block was mined by Bitcoin's creator Satoshi Nakamoto. You can read more about <a href='https://en.bitcoin.it/wiki/Genesis_block'>the genesis block</a>.",
referenceUrl: "https://en.bitcoin.it/wiki/Genesis_block"
},
{
type: "tx",
date: "2009-01-03",
txid: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
summary: "The coinbase transaction of the Genesis Block.",
alertBodyHtml: "This transaction doesn't really exist! This is the coinbase transaction of the <a href='/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'>Bitcoin Genesis Block</a>. For more background about this special-case transaction, you can read <a href='https://github.com/bitcoin/bitcoin/issues/3303'>this brief discussion</a> among some of the <a href='https://bitcoin.org'>Bitcoin</a> developers.",
referenceUrl: "https://github.com/bitcoin/bitcoin/issues/3303"
},
{
type: "tx",
date: "2009-10-12",
txid: "7dff938918f07619abd38e4510890396b1cef4fbeca154fb7aafba8843295ea2",
summary: "First bitcoin traded for fiat currency.",
alertBodyHtml: "In this first-known BTC-to-fiat transaction, 5,050 BTC were exchanged for 5.02 USD, at an effective exchange rate of ~0.001 USD/BTC.",
referenceUrl: "https://twitter.com/marttimalmi/status/423455561703624704"
},
{
type: "blockheight",
date: "2017-08-24",
blockHeight: 481824,
blockHash: "0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893",
summary: "First SegWit block.",
referenceUrl: "https://twitter.com/conio/status/900722226911219712"
},
{
type: "tx",
date: "2017-08-24",
txid: "8f907925d2ebe48765103e6845C06f1f2bb77c6adc1cc002865865eb5cfd5c1c",
summary: "First SegWit transaction.",
referenceUrl: "https://twitter.com/KHS9NE/status/900553902923362304"
},
{
type: "tx",
date: "2014-06-16",
txid: "143a3d7e7599557f9d63e7f224f34d33e9251b2c23c38f95631b3a54de53f024",
summary: "Star Wars: A New Hope",
referenceUrl: ""
},
{
type: "tx",
date: "2010-05-22",
txid: "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
summary: "The 'Bitcoin Pizza' transaction.",
alertBodyHtml: "This is the famous 'Bitcoin Pizza' transaction.",
referenceUrl: "https://bitcointalk.org/index.php?topic=137.0"
},
{
type: "tx",
date: "2011-05-18",
txid: "5d80a29be1609db91658b401f85921a86ab4755969729b65257651bb9fd2c10d",
summary: "Destroyed bitcoin.",
referenceUrl: "https://www.reddit.com/r/Bitcoin/comments/7mhoks/til_in_2011_a_user_running_a_modified_mining/"
},
{
type: "blockheight",
date: "2009-01-12",
blockHeight: 170,
blockHash: "00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee",
summary: "First block containing a (non-coinbase) transaction.",
alertBodyHtml: "This block comes 9 days after the genesis block and is the first to contain a transfer of bitcoin. Before this block all blocks contained only coinbase transactions which mint new bitcoin.",
referenceUrl: "https://bitcointalk.org/index.php?topic=91806.msg1012234#msg1012234"
},
{
type: "blockheight",
date: "2017-08-25",
blockHeight: 481947,
blockHash: "00000000000000000139cb443e16442fcd07a4a0e0788dd045ee3cf268982016",
summary: "First block mined that was greater than 1MB.",
referenceUrl: "https://en.bit.news/bitfury-mined-first-segwit-block-size-1-mb/"
},
{
type: "blockheight",
date: "2018-01-20",
blockHeight: 505225,
blockHash: "0000000000000000001bbb529c64ddf55edec8f4ebc0a0ccf1d3bb21c278bfa7",
summary: "First block mined that was greater than 2MB.",
referenceUrl: "https://twitter.com/BitGo/status/954998877920247808"
},
{
type: "tx",
date: "2017-12-30",
txid: "9bf8853b3a823bbfa1e54017ae11a9e1f4d08a854dcce9f24e08114f2c921182",
summary: "Block reward lost",
alertBodyHtml: "This coinbase transaction completely fails to collect the block's mining reward. 12.5 BTC were lost.",
referenceUrl: "https://bitcoin.stackexchange.com/a/67012/3397"
},
{
type:"address",
date:"2011-12-03",
address:"1JryTePceSiWVpoNBU8SbwiT7J4ghzijzW",
summary:"Brainwallet address for 'Satoshi Nakamoto'",
referenceUrl:"https://twitter.com/MrHodl/status/1041448002005741568",
alertBodyHtml:"This address was generated from the SHA256 hash of 'Satoshi Nakamoto' as example of the 'brainwallet' concept."
}
],
exchangeRateData:{
jsonUrl:"https://api.coindesk.com/v1/bpi/currentprice.json",
responseBodySelectorFunction:function(responseBody) {
//console.log("Exchange Rate Response: " + JSON.stringify(responseBody));
let exchangedCurrencies = ["USD", "GBP", "EUR"];
if (responseBody.bpi) {
let exchangeRates = {};
for (let i = 0; i < exchangedCurrencies.length; i++) {
if (responseBody.bpi[exchangedCurrencies[i]]) {
exchangeRates[exchangedCurrencies[i].toLowerCase()] = responseBody.bpi[exchangedCurrencies[i]].rate_float;
}
}
return exchangeRates;
}
return null;
}
},
blockRewardFunction:function(blockHeight) {
let eras = [ new Decimal8(50) ];
for (let i = 1; i < 34; i++) {
let previous = eras[i - 1];
eras.push(new Decimal8(previous).dividedBy(2));
}
let index = Math.floor(blockHeight / 210000);
return eras[index];
}
};