POST
/
788f110831fe13808302bd79796d55e8
curl --request POST \
  --url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "1.0",
  "method": "getblocktemplate",
  "params": [
    {
      "mode": "template",
      "capabilities": [
        "coinbasetxn",
        "workid",
        "coinbase/append"
      ],
      "rules": [
        "segwit"
      ]
    }
  ],
  "id": 1
}'
{
  "result": {},
  "error": {},
  "id": 123
}

The getblocktemplate method is used by miners to request a block template for mining new blocks. It can be customized with various parameters to specify the desired mining capabilities and rules.

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account

Parameters

  • mode (optional): Specifies the mode of operation. Can be ‘template’ for a block template or ‘proposal’ for submitting a block proposal. This field is required if parameters are specified.
  • capabilities (optional): A list of strings specifying the capabilities the miner supports. This can include ‘coinbasetxn’, ‘workid’, ‘coinbase/append’, etc.
  • rules (optional): A list of strings specifying the rules the miner will support. For example, ‘segwit’ indicates support for Segregated Witness.

Response

  • result — an object containing the block template or proposal for mining.
  • error — an object containing an error message if an error occurred, otherwise null.
  • id — an integer representing the ID of the request.

Use case

The getblocktemplate method is crucial for miners who need to get information about the current state of the network to mine new blocks. It allows miners to get a template for creating a new block to be added to the blockchain.

Body

application/json
jsonrpc
string
default:1.0
method
string
default:getblocktemplate
params
object[]
Example:
[
  {
    "mode": "template",
    "capabilities": ["coinbasetxn", "workid", "coinbase/append"],
    "rules": ["segwit"]
  }
]
id
integer
default:1

Response

200 - application/json
A block template or proposal for mining.
result
object

The block template or proposal.

error
object
id
integer