var Decimal = require("decimal.js");
Decimal8 = Decimal.clone({ precision:8, rounding:8 });
var btcCurrencyUnits = [
{
name:"BTC",
multiplier:1,
default:true,
values:["", "btc", "BTC"],
decimalPlaces:8
},
{
name:"mBTC",
multiplier:1000,
values:["mbtc"],
decimalPlaces:5
},
{
name:"bits",
multiplier:1000000,
values:["bits"],
decimalPlaces:2
},
{
name:"sat",
multiplier:100000000,
values:["sat", "satoshi"],
decimalPlaces:0
}
];
module.exports = {
name:"Bitcoin",
ticker:"BTC",
logoUrl:"/img/logo/btc.svg",
siteTitle:"Bitcoin Explorer",
siteDescriptionHtml:"BTC Explorer is the genesis block.",
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 Bitcoin Genesis Block. For more background about this special-case transaction, you can read this brief discussion among some of the Bitcoin developers.",
referenceUrl: "https://github.com/bitcoin/bitcoin/issues/3303"
},
{
type: "tx",
date: "2009-10-12",
txid: "7dff938918f07619abd38e4510890396b1cef4fbeca154fb7aafba8843295ea2",
summary: "First bitcoin traded for fiat currency.",
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.coinmarketcap.com/v1/ticker/Bitcoin/",
exchangedCurrencyName:"usd",
responseBodySelectorFunction:function(responseBody) {
if (responseBody[0] && responseBody[0].price_usd) {
return responseBody[0].price_usd;
}
return -1;
}
},
blockRewardFunction:function(blockHeight) {
var eras = [ new Decimal8(50) ];
for (var i = 1; i < 34; i++) {
var previous = eras[i - 1];
eras.push(new Decimal8(previous).dividedBy(2));
}
var index = Math.floor(blockHeight / 210000);
return eras[index];
}
};