A node can publish any block at any time. How? How to publish?

0

0

Can anyone tell me what to do to publish if I mined a block

Shilps

Posted 2019-01-06T13:16:36.740

Reputation: 11

Answers

1

Let's assume that you are solo-mining.
If you are a miner you need to run a Bitcoin Full-Node for example Bitcoin Core. If you do this you are a full part of the Bitcoin network.
If you mine a block, you do the following steps:

  • Putting transaction together and verify them
  • Doing the Proof-of-Work (Calculating the nounce until the first characters are zeros).
  • Adding stuff like coinbase and timestamps
  • Profit from the reward and transaction fees

If this is done you broadcast the block to all nodes in the network the same way as broadcast a transaction. This means that all nodes are receiving this block. They are also checking it like if your block matches the difficulty and if the transaction are valid. Then they are adding it to their own local copy of the blockchain.

The nodes are broadcasting the blocks and transactions under each other. That's how peer to peer work. You should take a look at this

Emil

Posted 2019-01-06T13:16:36.740

Reputation: 63

0

To actually publish the block onto the Bitcoin network, you can use the bitcoin-cli command submitblock. You would have to serialize all the data in the block into hex format first.

torkel

Posted 2019-01-06T13:16:36.740

Reputation: 122