刘小点读比特币白皮书7-回收硬盘空间

7. Reclaiming Disk Space Once the latest transaction in a coin is buried under enough blocks, the spent transactions before it can be discarded to save disk space. To facilitate this without breaking the block's hash, transactions are hashed in a Merkle Tree [7][2][5], with only the root included in the block's hash. Old blocks can then be compacted by stubbing off branches of the tree. The interior hashes do not need to be stored.


刘小点读比特币白皮书7-回收硬盘空间_第1张图片

A block header with no transactions would be about 80 bytes. If we suppose blocks are generated every 10 minutes, 80 bytes * 6 * 24 * 365 = 4.2MB per year. With computer systems typically selling with 2GB of RAM as of 2008, and Moore's Law predicting current growth of 1.2GB per year, storage should not be a problem even if the block headers must be kept in memory.

7. 回收硬盘空间 如果最近的交易已经被纳入了足够多的区块之中,那么就可以丢弃该交易之前的数据,以回 收硬盘空间。为了同时确保不损害区块的随机散列值,交易信息被随机散列时,被构建成一 种Merkle 树(Merkle tree)[7] 的形态,使得只有根(root)被纳入了区块的随机散列值。 通过将该树(tree)的分支拔除(stubbing)的方法,老区块就能被压缩。而内部的随机 散列值是不必保存的。


刘小点读比特币白皮书7-回收硬盘空间_第2张图片

不含交易信息的区块头(Block header)大小仅有80 字节。如果我们设定区块生成的速率 为每10 分钟一个,那么每一年产生的数据位4.2MB。(80 bytes * 6 * 24 * 365 = 4.2MB)。 2008 年,PC 系统通常的内存容量为2GB,按照摩尔定律的预言,即使将全部的区块头存 储于内存之中都不是问题。

【小点点评】:如何解决一个很现实的问题,硬盘空间问题。

你可能感兴趣的:(刘小点读比特币白皮书7-回收硬盘空间)