btc

Bitcoin (BTC)

Method: POST getblocktemplate

dropdown

POST getblocktemplate

If the request parameters include a ‘mode’ key, that is used to explicitly select between the default ‘template’ request or a ‘proposal’.

It returns data needed to construct a block to work on.

Parameters

template_request - json object, optional, default={}

Format of the template

Request

curl --location --request POST 'https://btc.getblock.io' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "getblocktemplate",
"params": [{"rules": ["segwit"]}],
"id": "getblock.io"}'


Response

{
    "capabilities": [
        "proposal"
    ],
    "version": 536870912,
    "rules": [
        "csv",
        "!segwit"
    ],
    "vbavailable": {},
    "vbrequired": 0,
    "previousblockhash": "00000000000000000004bc17f44b685da13277444f78c08e42c2fb407695868c",
    "transactions": [
        {
            "data": "0100000001eb31b1e3c5124b0def383405a71e8f2272d65cef5aac8a04a76cc1250fa3f7990a0000008b4830450221008fc8a9b6c6c249210d0c8de1b1146b7469c5fb1e703d92d8937346d231ee637a022024e06be73b73dc274d88ad7c8aa892c8b5403db24a9edf8fa4cef9ec84651697014104c4b7a7f7bb2c899f4aeab75b41567c040ae79506d43ee72f650c95b6319e47402f0ba88d1c5a294d075885442679dc24882ea37c31e0dbc82cfd51ed185d7e94ffffffff0b1eac0800000000001976a91434c18c693dcde7ed2262e94aadaf7ad9a9a4dc8488ac40ff2e000000000017a914e83b218cd37bf55e252b63b9225404021387160f8740a902000000000017a9142fd1e6e2ba505d05d407022ca92e640b9adeabf387179001000000000017a9143724a9f9acb91de594ac509f14aa72c1bac856dc874d751800000000001976a9147bef2143712cc8bde93fd191c18f53a1a44ff5c488ac306303000000000017a914839f67638ddb5e0dd5f79b9738d251e575047c3687c8ae0900000000001976a914a4e4308f3aee900eafdd4e76c4f436ab5f22caa388ac616303000000000017a914b97d613bc8923ce55c212a4133aec524a148bcf58787977d00000000001976a9145300d976f51ee34ff6d667ba801724524cba0c5f88ac79c70300000000001976a91465e46f53e93221d334a3c538d84b38b72738c68288ac206e020f000000001976a9147ddb236e7877d5040e2a59e4be544c65934e573a88ac00000000",
            "txid": "36620fc5b6a2987d6378cac6a370338a4a1d3d1632df6bd95971629ec98c7e78",
            "hash": "36620fc5b6a2987d6378cac6a370338a4a1d3d1632df6bd95971629ec98c7e78",
            "depends": [],
            "fee": 2000000,
            "sigops": 24,
            "weight": 2216
        }
    ]
}
GetBlock.io

Get access to 40+ blockchain nodes right now! GetBlock provides a fast and reliable connection for the most popular cryptocurrencies` nodes.

Subscribe

Email is invalid

Products
For developers
Contact

Technical support:

support@getblock.io

General inquiries:

marketing@getblock.io

To contact Us:

Schedule a Сall

2019 - 2021 GetBlock