I know that the miner after success he spreads to the network the message that is the concatenation of: Version, Previous Block, Merkle Root, Time, Bits, and Nonce. But how do the validators know his address to confirm his reward transaction? Does this mean that spreading the message is not enough and the miner should spread the list of transactions too? If yes then what is the first thing he has to announce; the message or the list of transactions?
1 Answer
When a miner succeeds in finding a valid block, the miner needs to attach the block to its own chain of its own node. Knowledge of this chain is then communicated and accepted by other nodes on the network, as long the block is valid.
But how do the validators know his address to confirm his reward transaction?
Finding a valid block is already sufficient for the miner to generate themselves the coinbase(/"reward") transaction to an address specified by the miner. Other nodes(/"validators") don't need to know the address or confirm the coinbase transaction first. However, other nodes do need to accept that the block is valid and then update their chain with the new block. You could say that validation/confirmation of the coinbase transaction is implicit when other nodes accept the block.
Does this mean that spreading the message is not enough and the miner should spread the list of transactions too? If yes then what is the first thing he has to announce; the message or the list of transactions?>
How it works is that once the miner has attached the new block to its chain, the miner will first send a message called inv
to its 10-15 peers that its aware of. Then its peers will send a message getdata
back to the miner, and the miner will then send the message block
with the actual block to the peer who will update their chain. The peers of the peers will do the same with its list of 10-15 peers and so on, and that is how the whole P2P network is 'flooded' and updated with the new block.
-
Moderators, please do correct answer if I made a mistake somewhere. Feb 17, 2022 at 9:17