Which of the next rpc strategies is used to mine bitcoin and obtain its reward?
None, actually.
The first manner of interfacing with Bitcoin Core for mining is thru the getblocktemplate
(GBT) RPC, which offers all data mining software program wants in regards to the present greatest block to construct upon, and what transactions to incorporate. The remainder is as much as the consumer.
Bitcoin Core isn’t concerned in “receiving” a reward for a block; moderately, the miner constructs a block that pays themselves. If that block is legitimate and will get accepted by the community, then they receives a commission; if it would not, they do not.
That is vital: Bitcoin mining rewards aren’t determined after mining by submitting it someplace; they’re determined forward of time, earlier than mining is tried. A miner (or its software program stack, or pool) will name GBT, construct a candidate block that makes use of the GBT outcome’s transactions + a coinbase transaction that pays the miner/pool, and then hand it to the mining {hardware} to resolve. Altering the payout after discovering a block would invalidate it.
- generateblock
It is a test-only RPC, which does truly mine a block, however with a user-specified set of transactions to incorporate. It additionally makes use of mining logic in Bitcoin Core itself, which is gradual and unoptimized, and can’t use ASICs or different specialised mining {hardware}. For something however check networks, it’s unusably gradual.
- submitblock
This RPC can be utilized to offer a block out of band to Bitcoin Core. It’s used when mining {hardware} has discovered a block, to get it to propagate throughout the community.
As famous above nevertheless, it’s not concerned in getting a payout from mining; the block itself already comprises its payout data, and may be submitted wherever on the community.
- submitheader
That is to tell Bitcoin Core a couple of block header out of band. It is unrelated to mining.