getblocktemplate

Returns data needed to construct a block to mine. This 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.

Path Parameters

apiKeystringRequiredDefaults to docs-demo

Request

This endpoint expects an object.
template_requestobjectOptional
A JSON object containing the template request parameters.

Response

A block template object containing all necessary data for mining.
versioninteger or null
The block version.
previousblockhashstring or nullformat: "^[a-fA-F0-9]{64}$"

A 64-character hex string representing the block hash.

transactionslist of objects or null

Contents of non-coinbase transactions that should be included in the next block.

coinbaseauxobject or null
Data that should be included in the coinbase's scriptSig content.
coinbasevalueinteger or null

Maximum allowable input to coinbase transaction, including the mining reward and transaction fees (in satoshis).

targetstring or null
The hash target for the block.
mintimeinteger or null
The minimum timestamp appropriate for the next block time in seconds since epoch.
mutablelist of strings or null
List of ways the block template may be changed.
noncerangestring or null
Range of valid nonces.
sigoplimitinteger or null
Limit of signature operations in blocks.
sizelimitinteger or null
Limit of block size.
curtimeinteger or null
Current timestamp in seconds since epoch.
bitsstring or null
Compressed target of the next block.
heightinteger or null
The height of the next block.