比特币究竟有多少个,看完此文不再困惑!! - Blockchain.News
News

比特币究竟有多少个,看完此文不再困惑!!

比特币创始人中本聪在发布第一个版本时表示:比特币有二千一百万个,第一个四年挖出10, 500, 00个,每4年减半。究竟为什么选择这个数字?


  • Oct 27, 2018 11:25
比特币究竟有多少个,看完此文不再困惑!!

dmitry-moraine-1379002-unsplash.jpg Photo by Dmitry Moraine on Unsplash

比特币创始人中本聪在发布第一个版本时表示:比特币有二千一百万个,第一个四年挖出10, 500, 00个,每4年减半。究竟为什么选择这个数字,目前的各种解释还不是很到位。这可能需要创始人中本聪(Satoshi Nakamoto)来现身说法了。中本聪在发布第一个版本时,关于bitcoin数量的原文如下:
Total circulation will be 21,000,000 coins.  It'll be distributed to network nodes when they make blocks, with the amount cut in half every 4 years.
first 4 years: 10,500,000 coins
next 4 years: 5,250,000 coins
next 4 years: 2,625,000 coins
next 4 years: 1,312,500 coins
etc...
When that runs out, the system can support transaction fees if needed.  It's based on open market competition, and there will probably always be nodes willing to process transactions for free.
第一个四年周期,每一个新区块会产生50个比特币。为什么会选择50呢?大概原因如下:
50 + 25 + 12.5 + 6.25 + 3.125 + ... = 100。这个是等比数列,和值是100,看起来还不错。
基于上面的约束,需要考虑一种现实的实现机制。
对于的计算如下:大概每10分钟生成一个区块(block), 一小时生成6个区块,每天24小时,每年365天,每4年为一个周期。最开始每个区块奖励奖励50枚。下一个周期,奖励数量减半。
第一个4年周期:6*24*365*4*50=10512000~=10,500,000
第二个4年周期:6*24*365*4*25=5256000~=5,250,000
。。。
当然这是大概的等价。程序通过动态调整难度来大概实现预期的比特币生成数量和时间的控制。
我们看看具体的源代码,如下:
consensus.nSubsidyHalvingInterval = 210000;
.........
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return 0;
CAmount nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy;
代码通过位左移操作实现奖励减半,所以并不是无限可以一分为二的。所以21,000,000是理论值,是极限。
具体看下精确生成的数量:
第1个210000区块,每个奖励50个,
第2个210000区块,每个奖励25个,
.....
第33个210000区块,每个奖励0.00000001个
之后将不再给予奖励,所以比特币的总量是20999999.9769个,当然这是理论值。现实情况是,也会有减少流动量的少量操作。可以在blockchain.info上查看每个块的具体交易,来产生感性认识,下面是最新的Block #516914的截图,

blockchain-transaction.PNG

更详细的可以查看。

https://blockchain.info/blocks

每个区块的第一个交易纪录是:新挖出的比特币和此块中所有交易的手续费。

bc-t.PNG


Image source: Shutterstock
. . .

Tags