
Bitesize Bitcoin - Block Creation
Discussed in this episode
Boost this Episode
Send sats directly to the creators. Value for Value.
Plus 1% to Podcast Index, 1% to Boost Bot.
Show Notes
Bitesize Bitcoin
Block Creation
Mining is still in the infrastructure-building phase, that’s hard to believe 13 + years after the genesis block was created, but yes, we’re still building out the foundations of the Bitcoin network, at least as far as mining is concerned. We know this because the incentive to mine is clearly dominated by the coinbase reward. Driven by new coin generation, miners pay less attention to the fees generated by the transactions included within the block than they do the block subsidy. Comb through past blocks though and you’ll see some spikes in Tx Fees vs Block subsidy, sometimes quite impressive. For instance, on December 21, 2017 it was a banner day for transactions. In block 500,439, …13 or so Bitcoin were paid for the 2,335 transactions in that block, fees made up 51% of the total payout to miners. All in all, block subsidy is king, but fee are on the rise due to recent, uh, developments.
Well this could be a fine time to brush up on the particulars of block creation and the handling of transactions. Now to the exiting stuff
In this episode of Bitesize Bitcoin, we will cover the creation of a block template, a candidate block, and the components of a completed block
Don’t forget, commit to memory: The candidate block header fields are version number, previous block hash, the merkle root of proposed transactions, timestamp, target for Proof of Work, and a nonce.
To begin with, what is Bitcoin? When bit 47? A lot of people are familiar with lightning and liquid is effectively a layer two. That one, two, nine. What is taproot? Sure, in taproot, that's the first new protocol upgrade since Zagwet.
Difficulty adjustments. How do mnemonic seed words work? UTXO management.
Hey guys, welcome back. Today we have a bite-sized Bitcoin on block construction. If you're new to the show and you don't know what bite-sized Bitcoin is, it is short, sharp, 10, 15 minute explainers to break down more technical details in Bitcoin.
My hope with these episodes is when you hear different terminology in the main podcast and you think, "Oh, I'm not sure what that is. I want to dig into it a little bit more." You can hop over to the bite-sized Bitcoins and learn quickly.
If after listening to this, you want to hear more, we do have a new episode of plebminer monthly. It will be coming out in the next couple of days, so look out for that. And it will also be animated, so if you haven't checked out our YouTube video, go and have a look.
I hope you enjoy, and if you have any questions, you can always reach out to me or John. Mining is still in the infrastructure building phase. That's hard to believe 13 years after the Genesis block was created, but yes, we're still building out the foundations of the Bitcoin network.
At least as far as mining is concerned. We know this because the incentive to mine is clearly dominated by the Coinbase reward. Driven by new coin generation, miners pay less attention to the fees generated by the transactions included within the block.
Then they do the block subsidy. Comb through past blocks though, and you'll see some spikes in transaction fees versus blocks subsidy. Sometimes quite impressive. For instance, on December 21st, 2017, it was a banner day for transactions.
In block 500,439, 13 or so Bitcoin were paid for the 2,335 transactions in that block. Fees made up 51% of the total payout to miners. All in all, blocks subsidy is king, but fees are on the rise due to recent developments.
Well, this could be a fine time to brush up on the particulars of block creation and the handling of transactions. Now to the exciting stuff. In this episode of Bite Size Bitcoin, we will cover the creation of a block template, a candidate block, and the components of a completed block.
Fame's exuberance. Come on, we'll have fun with it. We know that our miners, pool-oriented or not, are competing for a chance at finding a valid block. But they don't do it all willy-nilly, mind you.
There are certain criteria that the block must have to be considered valid. A Bitcoin block template is used as a data structure to help construct a candidate block. A sort of "fill in the blank" for the construction of the next block.
The miner requests a block template from the network. This request includes information about the miner's current knowledge of the blockchain and any other criteria they want to specify, such as the maximum size of the block they are willing to mine.
Miners use the "get block template gbt" command to retrieve a block template from a full node, which they then modify. Notice to all pool miners, what does your pool's block template or block candidates look like?
That's something you might want to look into. The network responds with a block template, which contains a list of transactions that the miner can choose from to include in the block. It's up to the miner to fill in the blanks here, but the data in the fields must adhere to the network protocols.
It isn't like a mad libs or something. Blocks can be created with invalid fields, and if found, the block will be rejected by the network. A 100-terra hash machine has something like a 1 in 3 million or so chance at finding a block, so you just wasted that chance by mining an invalid block.
From the block template, a miner creates a candidate block. The candidate block header fields are version number, previous block hash, the Merkle root of proposed transactions, time stamp, target for proof of work, and a nonce.
Okay, first one. The block version number. This indicates the version of the block, and it can be used to implement changes to the structure and format of the block. It can also be used to signal a miner's choice on software and protocol upgrades or changes.
Signaling an activation and their relation to soft forks are absolutely fascinating subjects, but beyond the scope of this bite-sized Bitcoin. It is a lot more exciting of a story than you may think.
It is high drama indeed, compelling and rich. Next is the previous block's hash. This is a reference to the previous block in the block chain and is used to link blocks together. It's this linking of the previous block's hash that ensures the miner is mining the longest valid chain, kind of like proving the previous miner's work.
If he did it right, then I'm doing it right. The Merkle root. Now bear with me on this one because I'm far from a cryptographer or computer scientist, but I'll give you the best explanation I have, kind of like the dummy version of it.
You can depend on me for that. This is a hash of all the transactions included in the block, and is used to ensure the integrity and validity of the transactions. The Merkle root is a key component of the Bitcoin block header.
It is a cryptographic hash that summarizes the contents of all transactions into a single neat little 32-byte value. In a Merkle tree, transactions are grouped into pairs and hash together, forming a new set of hashes.
This process is repeated until a single hash called the Merkle root is generated. So picture a tree with a bunch of leaves and you hash them together to have less leaves and less leaves and less leaves until you get to the root.
Now that we've gotten to the root of it all, the Merkle root is included in the block header. Then broadcast to the network whenever a new block is mined. When a node receives a block, it can use the Merkle root to verify the integrity of the transactions in the block without having to validate each individual transaction.
It is a compact and efficient way to verify the contents of a block, and it ensures the transactions are too legit to quit. Hey, fun fact, there has to be an even number of leaves on the Merkle tree.
So if there are an odd number of transactions like take the Coinbase transaction, that's one, and then add 998 transactions, the last transaction will be duplicated. That 999th transaction will be duplicated to make it an even number, in this case 1000.
Are you guys loving the spike size Bitcoin or what? Huh? This is cool stuff. Timestamp. This is the time at which the block was mined. The timestamp records the time at which a block was created.
Timestamps arrive from the miner's local clock, and it can vary based on the accuracy of the miner's clock and the level of synchronization with the other nodes on the network. If a block is propagated slowly across the network, the timestamp may not reflect the
actual time at which the block was created. Timestamp in a block is ultimately determined by the miner who creates the block, but it is subject to the validation and adjustment by the network. Another kind of consensus mechanism here. Another fun fact, it's based on the number of
seconds from midnight January 1st, 1970. So that's kind of neat if you know why it is up on YouTube in the comments or let us know on Twitter why that is so because I'd like to know the back story there. And now the difficulty target. This is a value that sets the target for the mining difficulty,
which determines level of effort necessary to find a valid block. The difficulty target in the block template is encoded as a 256 bit number that represents the required level of computational effort necessary to create a new block. You guys know all about difficulty and difficulty adjustment,
but if you require a refresher, see our Bite Size Bitcoin on mining statistics either on ungovernable misfits dot com under Bite Size Bitcoin slash floodbusters or search for it on the ungovernable misfits YouTube channel, newly revamped by Mr. Crown. And it looks fantastic.
This target is adjusted every 2016 blocks by the network to maintain stability and security and to maintain the beloved and revered 10 minute block target. The difficulty target is specified as a bits field in the block header. The bits field is a compact representation of the
target, which allows for efficient encoding and storage of the target within the block header. I bet all you coding nerds love the efficiency there. The difficulty target is compared to the hash of the block candidate to determine if the required computational effort has been expended to create
a valid block. Or rather, did you put in the appropriate amount of work? If the hash of the block candidate jives with the difficulty target, that block is good to go. The Nance. This is a random value that is used by miners to try different combinations until a valid block is found.
When a miner creates a block candidate, they increment the Nance field in the block header and compute the hash of the block candidate. If the hash of the block candidate is less than the difficulty target specified in the block template, the block is considered valid and can
be added to the blockchain. I think we could do an entire Bite Size Bitcoin on just explaining the Nance, but I will leave that Bite Size Bitcoin to someone else. Those are the components of the block header. The header makes up just a tiny part of the block important but tiny. The bulk of the
block is naturally transaction data. Bitcoin isn't just a cool computer science experiment, it's a peer-to-peer cashless transaction system, so you need transactions. Transaction data includes a list of transactions that are included in the block and contains information such as the input
and output addresses. The amount of Bitcoin being transferred and the transaction fee, but believe the particulars of transaction data like how a miner chooses what transactions to mine, how those transactions are put into the block, and those particulars for another Bite Size Bitcoin.
Don't forget, commit to memory, the candidate block header fields are, version number, previous block hash, the Merkle root of proposed transactions, timestamp, target for proof of work, and a Nance. Thanks for listening, I hope you found that useful and if you have any feedback
or questions you can reach out to me or John. If you haven't already checked it out, go to ungovernablemisfits.com. We have all the podcasts, articles and other details on there.
Machine transcript; expect the odd mishearing. Click a passage to play from there.




