Title: What is a good reference for a getblocktemplate based solo miner? Post by: mrpotato98 on October 31, 2022, 01:04:44 PM 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. Title: Re: What is a good reference for a getblocktemplate based solo miner? Post by: mrpotato98 on November 26, 2022, 02:07:36 PM 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 (https://github.com/luke-jr/bfgminer) [2] https://bitcointalk.org/index.php?topic=5415861.0 (https://bitcointalk.org/index.php?topic=5415861.0) 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 |