How to add coinbase transaction with libblkmaker

2

I currently trying to develop a simple Bitcoin miner in c++ for a project on my university. For parsing the 'getblocktemplate'-data I'm using libblkmaker. Now I have to build the coinbase transaction for the 'blktmpl', but I don't really know how.

Anyone knows how to add a coinbase transaction to the block-template with 'libblkmaker'?

And how do I add my bitcoin address to this?

Thanks for your help, Sebastian

Salabasti

Posted 2016-02-02T10:40:53.893

Reputation: 21

Answers

1

To set a generating address, use set_generate_addr. blkmk_init_generation3 may also be what you're looking for.

The author of that library also wrote a miner, BFGMiner, that uses his library. Look at how he calls these libblkmaker function to add a coinbase transaction to the block header in miner.c.

Geremia

Posted 2016-02-02T10:40:53.893

Reputation: 3 665

I also fund the function 'blkmk_init_generation' and it seems to work. Do I also have to call 'blkmk_append_coinbase_safe2'?Salabasti 2016-02-03T09:54:43.693