Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Dev Docs: Describe Serialized Block Header And Block Format #638
Conversation
saivann
and 1 other
commented on an outdated diff
Nov 8, 2014
| + sha256(sha256("82501c1178fa0b222c1f3d474ec726b832013f0a532b44bb620cce8624a5feb1169e1e83e930853391bc6f35f605c6754cfead57cf8387639d3b4096c54f18f4".decode("hex")).digest()).digest().encode("hex_codec") | ||
| +--> | ||
| + | ||
| + | ||
| + | ||
| +TXIDs and intermediate hashes are always in internal byte order when they're | ||
| +concatenated, and the resulting merkle root is also in internal byte | ||
| +order when it's placed in the block header. | ||
| + | ||
| +{% endautocrossref %} | ||
| + | ||
| +#### Target nBits | ||
| + | ||
| +{% autocrossref %} | ||
| + | ||
| +The target threshold is a 256-bit unsigned integer compared the 256-bit |
saivann
Contributor
|
|
Will read everything tomorrow, but looks awesome at a first glance! Thanks for sharing work and questions with @minium, perhaps both projects can benefit from each other. |
minium
commented
Nov 8, 2014
|
@saivann They sure will, I'm already on it! |
saivann
commented on an outdated diff
Nov 8, 2014
| -As of version 2 blocks, each block consists of four root elements: | ||
| +| Bytes | Name | Data Type | Description | ||
| +|-------|---------------------|-----------|---------------- | ||
| +| 4 | version | uint32_t | The [block version][]{:#term-block-version}{:.term} number indicates which set of block validation rules to follow. See the list of block versions below. | ||
| +| 32 | previous block hash | char[32] | A SHA256(SHA256()) hash in internal byte order of the previous block's header. This ensures no previous block can be changed without also changing this block's header. | ||
| +| 32 | merkle root hash | char[32] | A SHA256(SHA256()) hash in internal byte order. The merkle root is derived from hashes of all transaction included in this block, ensuring none of those transactions can be modified without modifying the header. See the [merkle trees section][section merkle trees] below. |
|
|
saivann
commented on an outdated diff
Nov 8, 2014
| -3. An 80-byte block header described in the section below. | ||
| +{% highlight text %} | ||
| +02000000 .......................... Block version: 2 |
saivann
Contributor
|
harding commentedNov 8, 2014
Preview: http://dg0.dtrt.org/en/developer-reference#block-chain
Similar to pull #631, this is background documentation about the consensus-covered stuff for the upcoming non-consensus P2P reference section. Specificially, the goal here is to document the header format used in the P2P
headersmessage and the serialized block format used in the P2Pblocksmessage.