-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev Docs: Describe Serialized Block Header And Block Format #638
Conversation
* Replace current description of the block header with a better description. * Describe the various version numbers. * Describe how the merkle root is constructed. * Describe how nBits is parsed and how to correctly create it to avoid negative values. * Describe the serialized block format used to calculate max block size.
|
||
{% autocrossref %} | ||
|
||
The target threshold is a 256-bit unsigned integer compared the 256-bit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harding Perhaps I'm missing something, but is there some wrong formulation or missing word in this sentence? I don't get what "compared the..." means in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saivann How about:
The target threshold is a 256-bit unsigned integer which a header hash must be equal to or below in order for that header to be a valid part of the block chain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harding Sounds good to me!
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. |
@saivann They sure will, I'm already on it! |
|-------|---------------------|-----------|---------------- | ||
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/all transaction included/all transactions included/ ?
Based on feedback from @saivann (thanks!)
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
headers
message and the serialized block format used in the P2Pblocks
message.