bitcoind.app
CommandsGuidesContact ↗
Home/Mining/getblocktemplate
Mining

getblocktemplate

Returns data needed to construct a block to work on. Used by mining software.

Parameters

template_requestobjectREQUIRED
Template request object with rules array

Returns

objectBlock template

Code Examples

curl --user myuser --data-binary '{"jsonrpc":"1.0","id":"1","method":"getblocktemplate","params":[{"rules":["segwit"]}]}' -H 'content-type:text/plain;' http://127.0.0.1:8332/

Example Response

{
  "version": 536870912,
  "previousblockhash": "00000000000000...",
  "transactions": [...],
  "coinbasevalue": 625000000,
  "target": "00000000000000000004...",
  "curtime": 1713571767,
  "bits": "17034219",
  "height": 840001
}
← Previous
generatetodescriptor
Next →
getmininginfo

More Mining Commands

getmininginfogetnetworkhashpsprioritisetransactionsubmitblocksubmitheader

bitcoind.app — Bitcoin Core RPC Reference

GuidesContact ↗