Skip to main content

getblocktemplate

Generates a block template for mining, intended for both PoW and PoS types of blocks based on the provided parameters.

URL: http:://127.0.0.1:11211/json_rpc

Request:

{
"id": 0,
"jsonrpc": "2.0",
"method": "getblocktemplate",
"params": {
"explicit_transaction": "",
"extra_text": "",
"pe": {
"amount": 0,
"block_timestamp": 0,
"g_index": 0,
"keyimage": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
"stake_unlock_time": 0,
"tx_id": "0000000000000000000000000000000000000000000000000000000000000000",
"tx_out_index": 0
},
"pos_block": false,
"stakeholder_address": "",
"wallet_address": ""
}
}

Request description:

    "explicit_transaction": A transaction blob that must be explicitly included in the block.
"extra_text": Arbitrary data added to the extra field of the miner transaction.
"pe": PoS entry details, relevant only for PoS block generation.
"pos_block": Flag indicating whether the block is a PoS block.
"stakeholder_address": Address where the stake is returned for PoS blocks (usually the same as 'wallet_address').
"wallet_address": Address where mining rewards will be deposited.

Response:

{
"id": 0,
"jsonrpc": "2.0",
"result": {
"block_reward": 0,
"block_reward_without_fee": 0,
"blocktemplate_blob": "",
"difficulty": "",
"height": 0,
"miner_tx_tgc": {
"amount_blinding_masks_sum": "0000000000000000000000000000000000000000000000000000000000000000",
"amount_commitments_sum": "00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"ao_amount_blinding_mask": "0000000000000000000000000000000000000000000000000000000000000000",
"ao_amount_commitment": "00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"ao_asset_id": "0000000000000000000000000000000000000000000000000000000000000000",
"ao_asset_id_pt": "00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"ao_commitment_in_outputs": "00",
"asset_id_blinding_mask_x_amount_sum": "0000000000000000000000000000000000000000000000000000000000000000",
"pseudo_out_amount_blinding_masks_sum": "0000000000000000000000000000000000000000000000000000000000000000",
"pseudo_out_amount_commitments_sum": "00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"real_in_asset_id_blinding_mask_x_amount_sum": "0000000000000000000000000000000000000000000000000000000000000000",
"tx_key": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"tx_pub_key_p": "00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
"prev_hash": "",
"seed": "",
"status": "OK",
"txs_fee": 0
}
}

Response description:

    "block_reward": Total block reward, including transaction fees if they are given to the miner (legacy), or the base reward if fees are burnt (current state).
"block_reward_without_fee": Base block reward excluding any transaction fees.
"blocktemplate_blob": Serialized block template blob.
"difficulty": The mining difficulty targeted by the block template.
"height": The height of the block template in the blockchain.
"miner_tx_tgc": Miner transaction generation context. Intended for PoS blocks and Zarcanum.
"prev_hash": Hash of the previous block in the chain.
"seed": Seed value for the ProgPoWZ mining algorithm's epoch.
"status": Status of the call.
"txs_fee": Total fees from transactions included in the block.