dcr

Decred (DCR)

Method: POST getblockheader

dropdown
POST

getblockheader

Returns hex-encoded bytes of the serialized block header.

Parameters

block hash - string

the hash of the block.

verbose - boolean

Optional, default=true

specifies the block header is returned as a JSON object instead of a hex-encoded string.

Request

curl --location --request POST 'https://dcr.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0",
"method": "getblockheader",
"params": ["000000000000000015cf0d0da939e61d0cd7a37443a99c726ecc9cbbd61b047f", true],
"id": "getblock.io"}'


Response

{
    "error": null,
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "bits": "183e974b",
        "chainwork": "0000000000000000000000000000000000000000001c905e2bb5d609816e1bce",
        "confirmations": 294,
        "difficulty": 17566344339.600372,
        "extradata": "f2c800035c665b01000000000000000000000000000000000000000000000000",
        "finalstate": "ce7560f23e49",
        "freshstake": 1,
        "hash": "000000000000000015cf0d0da939e61d0cd7a37443a99c726ecc9cbbd61b047f",
        "height": 589761,
        "merkleroot": "56d04256d461f53b339f03b6cdee5f2d247012798fccdca8b5dcac686bdbb28d",
        "nextblockhash": "00000000000000003772a1ee24ff949121ea6b857c26bc9a48f9680394613486",
        "nonce": 176151922,
        "poolsize": 40926,
        "previousblockhash": "00000000000000001997f485505c14e33c2f6279e81bdbb27ffce3560800465c",
        "revocations": 0,
        "sbits": 193.4765256,
        "size": 57559,
        "stakeroot": "45d451ab4b38a383118e9f9530f9aa9febfd9bc5df2188425fbb45b17001f04f",
        "stakeversion": 8,
        "time": 1631705840,
        "version": 8,
        "votebits": 1,
        "voters": 5
    }
}
close

It’s Black Friday Sale!
Don’t Miss.