首页 » InfoTech »

比特币的区块结构

2018年9月12日 / 17次阅读
比特币

打开支付宝首页,搜索“529018372”,即可领取红包!可重复领。

特色图片

比特币的区块结构如下图:

比特币的区块结构

比特币的区块结构

一个比特币的区块就是包含了区块头和一系列的交易的集合,每个区块内包含的交易的数量是不等的。

The sequence of hashes linking each block to its parent creates a chain going back all the way to the first block ever created, known as the genesis block. (创世区块,这个区块是在软件里面写死的,不可更改)

 

比特币的区块头结构,如下图所示:

比特币的区块头结构

比特币的区块头结构

4个Bytes的版本号;

32个Bytes的前一个区块头的HASH值;这个区域就相当于一个向前的指针;(Each block within the blockchain is identified by a hash, generated using the SHA256 cryptographic hash algorithm on the header of the block. Each block also references a previous block, known as the parent block, through the “previous block hash” field in the block header. )

The primary identifier of a block is its cryptographic hash, a digital fingerprint, made
by hashing the block header twice through the SHA256 algorithm. The resulting 32-
byte hash is called the block hash but is more accurately the block header hash,
because only the block header is used to compute it.

计算这个HASH值,要用SHA256跑两次。

32个Bytes的Merkle Root,这也是一个HASH值,相当于这个区块中所有交易的一个数字指纹;

4个Bytes的Timesstamp;

4个Bytes的Difficulty Tagget;

4个Bytes的Nonce;

The nonce, difficulty target, and timestamp are used in the mining process。

整个区块的头部一共80个Bytes。

 

The “previous block hash” field is inside the block header and thereby affects the current block’s hash. The child’s own identity changes if the parent’s identity changes. When the parent is modified in any way, the parent’s hash changes. The parent’s changed hash necessitates a change in the “previous block hash” pointer of the child. This in turn causes the child’s hash to change, which requires a change in the pointer of the grandchild, which in turn changes the grandchild, and so on. This cascade effect ensures that once a block has many generations following it, it cannot be changed without forcing a recalculation of all subsequent blocks. Because such a recalculation would require enormous computation (and therefore energy consumption), the existence of a long chain of blocks makes the blockchain’s deep history immutable, which is a key feature of bitcoin’s security.

如果上一个区块头(只关注区块头,因为有Merkle Root这个数字指纹来代表区块中的所有交易)发生变化,后面的区块头就会跟着变化,因为后面的区块头中含有前一个区块头的HASH。所以,如果某一个区块头发生变化,其后面所有的区块都要跟着变化。如果要改变某一个区块头及其后面所有的区块,需要大量的计算和店里消耗,长区块链的存在是的区块深处保持了一定的历史不可更改性,这也是比特币系统的一个关键的安全特性。

本文链接:http://www.maixj.net/ict/btc-block-18871
云上小悟 麦新杰(QQ:1093023102)

相关文章

评论是美德

无力满足评论实名制,评论对非实名注册用户关闭,有事QQ:1093023102.


前一篇:
后一篇:

栏目精选

云上小悟,麦新杰的独立博客

Ctrl+D 收藏本页

栏目


©Copyright 麦新杰 Since 2014 云上小悟独立博客版权所有 备案号:苏ICP备14045477号-1。云上小悟网站部分内容来源于网络,转载目的是为了整合信息,收藏学习,服务大家,有些转载内容也难以判断是否有侵权问题,如果侵犯了您的权益,请及时联系站长,我会立即删除。

网站二维码
go to top