json rpc – Which rpc technique is used to mine bitcoin?

0
80


Which of the next rpc strategies is used to mine bitcoin and obtain its reward?

None, actually.

The first means of interfacing with Bitcoin Core for mining is thru the getblocktemplate (GBT) RPC, which offers all info mining software program wants concerning the present greatest block to construct upon, and what transactions to incorporate. The remainder is as much as the person.

Bitcoin Core is just not concerned in “receiving” a reward for a block; relatively, 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 does not, they do not.

That is essential: 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 unravel. Altering the payout after discovering a block would invalidate it.

  1. generateblock

It is a test-only RPC, which does really 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 sluggish and unoptimized, and can’t use ASICs or different specialised mining {hardware}. For something however take a look at networks, it’s unusably sluggish.

  1. submitblock

This RPC can be utilized to supply 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 nonetheless, it’s not concerned in getting a payout from mining; the block itself already comprises its payout info, and will be submitted wherever on the community.

  1. submitheader

That is to tell Bitcoin Core a few block header out of band. It is unrelated to mining.

LEAVE A REPLY

Please enter your comment!
Please enter your name here