pull down to refresh
202 sats \ 3 replies \ @netstatic 5 Jan 2024 \ on: Bitcoin Mining And PoW; From candidate block to decentralized consensus: bitcoin
Nice work, it's very informative and reads fairly well!
One thing that could improve the document is fewer run-on sentences. For example the sentences starting with the following lines could be made shorter:
- "Through the process of mining and utilization of the Proof-of-Work algorithm..."
- "The miner changes the block header’s nonce value into a different arbitrary number each time.." is a little wordy.
- "If one were to try and change the contents of block #824000..."
It might also be interesting to include that it's possible for the nonce values to be exhausted and briefly mention the values that can be changed when that happens (timestamp, block template, etc).
Another thing that might be interesting to add is how nodes reject blocks 2 hrs ahead of their adjusted time. I posted a [link to a PR review containing a change to how this validation works] (#376647). The linked bitcoincore.reviews page does a great job at both explaining the current mechanics and the proposed change.
Thanks for the compliment! Would you say the information is correct so-far?
Yeah, I wanted it to be clear and complete, maybe I took it a bit too far.
How would you word the examples?
I'll have a look at the addition on the nonce... That's the thing with Bitcoin, huh? You can always go deeper... :)
reply
Yeah, the information is correct. Honestly it's so good I'm going to recommend it to my technical Bitcoin-curious friends.
The information in the write-up is good, I was just thinking it might read better with more periods. For example the first paragraph could be re-written like so:
"New bitcoins are created and issued through the process of mining and the utilization of the Proof-of-Work algorithm. New transactions are validated and confirmed in this process and new blocks are also added to the blockchain. This is done all whilst aligning the interests of miners towards the security, integrity and
reliability of the Bitcoin blockchain and enabling decentralized (emergent) consensus within the Bitcoin network."
Not sure if that read better to you but please disregard if it doesn't since I was still able to understand everything as-is.
If you want to look into things you can do after the nonce's search space is exhausted, you can use reference this test in Bitcoin Core showing how to use the scriptsig of the coinbase to reset the nonce search space:
Another fun fact is Luke Dash Jr's old pool used to put bible verses in the coinbase as an extraNonce (what we call values used to reset the nonce search space):
Today, the coinbase script sig is used by mining pools to tag the blocks they mine. Take a look at:
If you expand the details and look at the hex of the script sig you'll see:
03cb940c1b4d696e656420627920416e74506f6f6c3937307a000003b19040a5fabe6d6dc95c71cd8d22a707455142bd55b9579145e3f46a316b001a565d53ac9007ba2c10000000000000000000f801f6580e0000000000
The first couple bytes (
03cb940c
) decodes the block height because of BIP34 (The value cb940c
, or 0c94cb
in big endian, decodes to 824523), the second sequence of bytes 1b4d696e656420627920416e74506f6f6c3
decodes to 'Mined by AntPool`, and the final sequence of bytes is solely used as the extra nonce.Even though this was probably more information than you were looking for, I hope you still find it interesting lol
reply
Oh wow, didn't expect that, thanks!
I've got some other topics which I'll post this weekend for the ones interested, you sure make me want to continue! :)
I will give the whole doc a re-read and see where I can hone the edges around the wording of the given texts, and see if I can implement the nonce-details you've provided.
You sure seem to know a-lot, too!
Edit: after looking at your profile, it looks like you breath Bitcoin... 😄