I am writing a software to mine bitcoins (in golang) as part of a college project. I'd like to know how is it that I build a block (which would potentially get appended to the end of the block chain) so I can send the 25 newly generated bitcoins to myself. You may assume I already know how to build a basic block header.

An example would be greatly appreciated, any dummy data may be used.

Also, I'd like to know if I would need to insert in the merkle tree any information regarding the transaction that gives the 25 newly generated coins to the miner.

Thanks in advance!

  • I didn't know the key term to find such answer: coinbase transaction. Sorry for the duplicate question.
    – G Oliveira
    Jun 24, 2016 at 16:58


Browse other questions tagged or ask your own question.