Author

Topic: What is a good reference for a getblocktemplate based solo miner? (Read 148 times)

newbie
Activity: 4
Merit: 0
Quote


If all BIP mentioned on bitcoin.org isn't detailed enough for you, i guess your other option is only by reading the source code.

[1] https://github.com/luke-jr/bfgminer
[2] https://bitcointalksearch.org/topic/guide-solo-mine-testnet-bitcoins-with-bfgminer-bitcoin-core-and-a-cpugpu-5415861

Explaining all the details was a bad choice of words. The BIPS are of course detailed but it's harder to get an overview by of the full protocol by diving into each BIP. In that sense I find it easier to follow some sample source code.

I was looking for a plain cpuminer for this purpose. bfgminer is of course a good reference but it contains a lot of driver code for different miners as well as scrypt support.

Thank you for the pointer to the guide. I had some problems reproducing it. I will add a message in the thread describing my issues.

I've found some references to https://en.bitcoin.it/wiki/Getblocktemplate which does not appear to be up to date since it does not include the segwit rules.

If I try to include it:
Code:
bitcoin-cli -rpcuser=MYUSER -rpcpassword=MYPASS  -rpcport=5000 -rpcconnect=MY.NODE.IP.NR getblocktemplate '{"rules": ["segwit"], "capabilities": ["coinbasetxn", "workid", "coinbase/append"]}'|grep coinbase
  "coinbaseaux": {
  "coinbasevalue": 3041246,

The returned value does not look like the one in the wiki, e.g. there is no coinbasetxn. Of course it's not unlikely that I've got the json dictionary order/levels wrong in the above query. Also it might be that despite the coinbasetxn capabilities parameter it's allowed to return a coinbasevalue value instead. Where can I find a similar example using the coinbasevalue if the latter is the case?
newbie
Activity: 4
Merit: 0
I'm looking for a working CPU miner which supports GBT including segwit rules which can do solo mining with bitcoin core, presumably v23.0 and beyond.
The purpose is not to make profit, but to learn more about the protocol.


https://developer.bitcoin.org/devguide/mining.html describes the procedure, but the "getblocktemplate RPC" does not describe the details how the getblocktemplate data structure is used to form a header used in the mining process.

Many blog sites describes the process on how to calculate the sha256 using the variable nonce, but most are old and are using the getwork protocol.
I would like to learn how the GBT is processed and what parts of the data is used for nonce hashing as well as generating the correct response back to bitcoin core.

Will https://github.com/pooler/cpuminer.git serve this purpose or are there any better candidates? Any working implementation in a high level programming language will do.
Jump to: