Genesis block and coinbase transactions

Answers Andreas Antonopoulos on questions about the Genesis of the block and coinbase transactions.

Andrew asks: “In the Bitcoin ecosystem, how were the initial bitcoins created in the genesis block, dispersed in transactions, and the proof-of-work accomplished?
Well, the first version of the software was launched by Satoshi Nakamoto in January 3rd, 2009. On that day, presumably Satoshi Nakamoto fired up the Bitcoin software and ran it on their own computer.
It started calculating a candidate block, and that candidate block was empty. In fact, I believe the first transaction didn’t happen until Block 75 or so. The first seventy or so blocks only had a coinbase transaction in them.
Of course it only had a coinbase transaction — there was no bitcoin to spend. Every transaction refers to the previous output, and at that point there were no previous outputs. The first block necessarily could only have a coinbase transaction. Soon after, in the first year or so I believe, a limitation was placed so you couldn’t spend the coinbase transaction until at least several blocks elapsed. The current standard is 100 blocks. I’m not quite sure when that rule was added.
But even the coinbase from the first block was not immediately spendable, so the second block was also empty and it only had a coinbase transaction. The third block was also empty and only had a coinbase transaction, etc.
All of these coinbase transactions paid the bitcoin address of presumably Satoshi Nakamoto. By the way, none of those have ever been spent. In fact, it would be quite a historic event and a big news item if any of those coins were spent because that would indicate that Satoshi Nakamoto was spending their initial coins.
Of course we don’t know that Satoshi Nakamoto mined the first blocks; maybe they gave the software to a friend and a friend was running it. Maybe Satoshi Nakamoto was more than one person. Maybe lots of different people were collaborating in running that early network.
None of that is known. We do know that others were invited to participate and several other individuals did participate, in both mining and transactions, in the first hundred blocks or so.
Michael asks: “How does the miner integrate the coinbase transaction within the block?”
That’s a great question. This is often confusing. After all, the coinbase transaction includes a payment to the miner themselves. Essentially, they write a check to themselves in the block that they produce.
How do they get that coinbase transaction in there?
The trick here is to realise that every miner constructs a candidate block; every miner’s candidate block has a coinbase transaction. They put it in there and that coinbase transaction pays their bitcoin address. Or, if it’s being produced by a mining pool, then the mining pool has put a coinbase transaction inside the candidate block and that coinbase transaction pays the mining pool address. Then they distribute that candidate block out to all of the miners that are participating in the mining pool.
Who creates the candidate block? The miners create the candidate block. Who puts the coinbase transaction in there? Every miner puts a coinbase transaction in their own candidate block; that coinbase transaction pays them.
If everybody puts a coinbase transaction in their own candidate block, how do we choose between them? That’s where mining comes in.
All of these candidate blocks: they’re useless, they’re worthless, they’re not valid. The reason they’re not valid is because they do not contain valid proof-of-work. They do not have a nonce, such that the block header hash produces a fingerprint that is within the difficulty target of the network. In order to become valid blocks, they need to have that nonce. In order to find that nonce, you have to do septillions of calculations and hashes. Once you find that nonce, and you publish that block because it is valid, the rest of the network accepts it because it is valid. As a result, the coinbase transaction that you wrote as a miner and put into the candidate block, becomes reality. One hundred blocks later, it becomes spendable so you can pay for your electricity bill and (maybe) make some profit.
Miners write a check. They put it in a candidate block and that candidate block is not valid until they find the proof-of-work that makes it valid.

Genesis block and coinbase transactions обновлено: September 9, 2018 автором: SchBit