Requests#

GET Block#

The GET block operation gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.

Request

GET /block/<hash>.<format>

Parameter #1—the header hash of the block to retrieve

Name

Type

Presence

Description

Header Hash

path (hex)

Required
(exactly 1)

The hash of the header of the block to get, encoded as hex in RPC byte order

Parameter #2—the output format

Name

Type

Presence

Description

Format

suffix

Required
(exactly 1)

Set to .json for decoded block contents in JSON, or .bin or .hex for a serialized block in binary or hex

Response as JSON

Name

Type

Presence

Description

Result

object

Required
(exactly 1)

An object containing the requested block

→
hash

string (hex)

Required
(exactly 1)

The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1

→
confirmations

number (int)

Required
(exactly 1)

The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain

→
height

number (int)

Required
(exactly 1)

The height of this block on its block chain

→
version

number (int)

Required
(exactly 1)

This block’s version number. See block version numbers

→
versionHex

string (hex)

Required
(exactly 1)

This block’s version number formatted in hexadecimal

→
merkleroot

string (hex)

Required
(exactly 1)

The merkle root for this block, encoded as hex in RPC byte order

→
time

number (int)

Required
(exactly 1)

The value of the time field in the block header, indicating approximately when the block was created

→
mediantime

number (int)

Required
(exactly 1)

Added in Bitcoin Core 0.12.0

The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113

→
nonce

number (int)

Required
(exactly 1)

The nonce which was successful at turning this particular block into one that could be added to the best block chain

→
bits

string (hex)

Required
(exactly 1)

The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass

→
difficulty

number (real)

Required
(exactly 1)

The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0

→
chainwork

string (hex)

Required
(exactly 1)

The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex

→
nTx

number (int)

Required
(exactly 1)

The number of transactions in the block

→
previousblockhash

string (hex)

Optional
(0 or 1)

The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block

→
nextblockhash

string (hex)

Optional
(0 or 1)

The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order

→
chainlock

bool

Required
(exactly 1)

If set to true, this block is locked by a ChainLock

→
size

number (int)

Required
(exactly 1)

The size of this block in serialized block format, counted in bytes

→
tx

array

Required
(exactly 1)

An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block

→ →
Transaction

object

Required
(1 or more)

An object describing a particular transaction within this block

→ → →
txid

string (hex)

Required
(exactly 1)

The transaction’s TXID encoded as hex in RPC byte order

→ → →
size

number (int)

Required
(exactly 1)

Added in Bitcoin Core 0.12.0

The serialized transaction size

→ → →
version

number (int)

Required
(exactly 1)

The transaction format version number

→ → →
type

number (int)

Required
(exactly 1)

Added in Dash Core 0.13.0.0

The transaction format type

→ → →
locktime

number (int)

Required
(exactly 1)

The transaction’s locktime: either a Unix epoch date or block height; see the locktime parsing rules

→ → →
vin

array

Required
(exactly 1)

An array of objects with each object being an input vector (vin) for this transaction. Input objects will have the same order within the array as they have in the transaction, so the first input listed will be input 0

→ → → →
Input

object

Required
(1 or more)

An object describing one of this transaction’s inputs. May be a regular input or a coinbase

→ → → → →
txid

string

Optional
(0 or 1)

The TXID of the outpoint being spent, encoded as hex in RPC byte order. Not present if this is a coinbase transaction

→ → → → →
vout

number (int)

Optional
(0 or 1)

The output index number (vout) of the outpoint being spent. The first output in a transaction has an index of 0. Not present if this is a coinbase transaction

→ → → → →
scriptSig

object

Optional
(0 or 1)

An object describing the signature script of this input. Not present if this is a coinbase transaction

→ → → → → →
asm

string

Required
(exactly 1)

The signature script in decoded form with non-data-pushing opcodes listed

→ → → → → →
hex

string (hex)

Required
(exactly 1)

The signature script encoded as hex

→ → → → →
coinbase

string (hex)

Optional
(0 or 1)

The coinbase (similar to the hex field of a scriptSig) encoded as hex. Only present if this is a coinbase transaction

→ → → → →
prevout

object

Optional
(0 or 1)

The output being spent. Only present if block undo data is available. Not present if this is a coinbase transaction

→ → → → → →
generated

bool

Required
(exactly 1)

Whether the output being spent is a coinbase output

→ → → → → →
height

number (int)

Required
(exactly 1)

The height of the block containing the output being spent

→ → → → → →
value

number (Dash)

Required
(exactly 1)

The value of the output being spent in DASH

→ → → → → →
scriptPubKey

object

Required
(exactly 1)

An object describing the pubkey script of the output being spent

→ → → → → → →
asm

string

Required
(exactly 1)

The pubkey script in decoded form with non-data-pushing opcodes listed

→ → → → → → →
desc

string

Required
(exactly 1)

Inferred descriptor for the output

→ → → → → → →
hex

string (hex)

Required
(exactly 1)

The pubkey script encoded as hex

→ → → → → → →
type

string

Required
(exactly 1)

The type of script. This will be one of the following:
• pubkey for a P2PK script
• pubkeyhash for a P2PKH script
• scripthash for a P2SH script
• multisig for a bare multisig script
• nulldata for nulldata scripts
• nonstandard for unknown scripts

→ → → → → → →
address

string

Optional
(0 or 1)

Dash address (only if a well-defined address exists)

→ → → → →
sequence

number (int)

Required
(exactly 1)

The input sequence number

→ → →
vout

array

Required
(exactly 1)

An array of objects each describing an output vector (vout) for this transaction. Output objects will have the same order within the array as they have in the transaction, so the first output listed will be output 0

→ → → →
Output

object

Required
(1 or more)

An object describing one of this transaction’s outputs

→ → → → →
value

number (Dash)

Required
(exactly 1)

The number of Dash paid to this output. May be 0

→ → → → →
valueSat

number (duffs)

Required
(exactly 1)

The number of duffs paid to this output. May be 0

→ → → → →
n

number (int)

Required
(exactly 1)

The output index number of this output within this transaction

→ → → → →
scriptPubKey

object

Required
(exactly 1)

An object describing the pubkey script

→ → → → → →
asm

string

Required
(exactly 1)

The pubkey script in decoded form with non-data-pushing opcodes listed

→ → → → → →
desc

string

Required
(exactly 1)

Inferred descriptor for the output

→ → → → → →
hex

string (hex)

Required
(exactly 1)

The pubkey script encoded as hex

→ → → → → →
type

string

Required
(exactly 1)

The type of script. This will be one of the following:
• pubkey for a P2PK script
• pubkeyhash for a P2PKH script
• scripthash for a P2SH script
• multisig for a bare multisig script
• nulldata for nulldata scripts
• nonstandard for unknown scripts

→ → → → → →
address

string

Optional
(0 or 1)

Dash address (only if a well-defined address exists)

→ → →
extraPayloadSize

number (int)

Optional
(0 or 1)

Added in Dash Core 0.13.0.0

Size of the DIP2 extra payload. Only present if it’s a DIP2 special transaction

→ → →
extraPayload

string (hex)

Optional
(0 or 1)

Added in Dash Core 0.13.0.0

Hex encoded DIP2 extra payload data. Only present if it’s a DIP2 special transaction

→ → →
cbTx

object

Optional
(0 or 1)

The decoded Coinbase special transaction (CbTx) payload, with the same fields as the block’s cbTx object. Only present if this is a coinbase special transaction. Other DIP2 special transaction types include their own decoded payload object instead (for example, proRegTx or qcTx)

→ → →
instanceHash

string (hex)

Optional
(0 or 1)

Added in Dash Core 24.0.0

Full-serialization hash distinguishing this re-signed instance of the withdrawal; the txid is shared by all instances. Only present for version 2 Asset Unlock special TXs

→ → →
fee

number (Dash)

Optional
(0 or 1)

The transaction fee in DASH. Not present for the coinbase transaction or if block undo data is not available

→ → →
hex

string (hex)

Required
(exactly 1)

The serialized, hex-encoded data for the transaction

→ → →
instantlock

bool

Required
(exactly 1)

If set to true, this transaction is either protected by an InstantSend lock or it is in a block that has received a ChainLock

→ → →
instantlock_internal

bool

Required
(exactly 1)

If set to true, this transaction has an InstantSend lock

→
cbTx

object

Optional
(0 or 1)

Coinbase special transaction details. Only present if the block’s coinbase transaction is a Coinbase special transaction (CbTx)

→ →
version

number (int)

Required
(exactly 1)

The version of the Coinbase special transaction (CbTx)

→ →
height

number (int)

Required
(exactly 1)

The height of this block on its block chain

→ →
merkleRootMNList

string (hex)

Required
(exactly 1)

The merkle root for the masternode list

→ →
merkleRootQuorums

string (hex)

Optional
(0 or 1)

The merkle root for the quorum list

→ →
bestCLHeightDiff

number (int)

Optional
(0 or 1)

Blocks between the current block and the last known block with a ChainLock

→ →
bestCLSignature

string (hex)

Optional
(0 or 1)

Best ChainLock signature known by the miner

→ →
creditPoolBalance

number (real)

Optional
(0 or 1)

Balance in the Platform credit pool

→ →
merkleRootAssetUnlocks

string (hex)

Optional
(0 or 1)

Added in Dash Core 24.0.0

Merkle root of the instance hashes of the block’s version 2 asset unlock transactions

Examples from Dash Core 24.0.0

Request a block in hex-encoded serialized block format:

curl http://localhost:19898/rest/block/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.hex

Result (wrapped):

000000209845c5e39b8d98c7094801cbb0fa27ba6ddb110d00cbf20a1aef1e35\
44f9b255036f309b40326518781c29a054f83d68e3ca73b9c685edc19f849de3\
3dbdf3b77e1b5769ffff7f200000000002030005000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff016affffffff\
023fe8ec0f000000001976a91432ae99679ea84309f80373691cf2bb7b0da9ae\
1688ac374e3b0600000000016a00000000af03005e0200000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000010655c9d040000\
000200000001fdd454572780af673f0c39335cf2f6db997ca0d55c0606d765cf\
6303ad091709000000006a47304402206465db43706bd35b1ced14e27b89ecc2\
ad939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d9\
4ff75cbb4165508211914d41b3ea0e6122cc012102cde88a8b67f85aa08dfaf0\
c10714d5af431b8909ea5a2da4551584e3533b621bffffffff0200ca9a3b0000\
00001976a914db91347da1e3fc25608b441994027847f489191b88ac18a6a068\
0b0000001976a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac0000\
0000

Get the same block in JSON:

curl http://localhost:19898/rest/block/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.json

Result (whitespace added):

{
  "hash": "7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79",
  "confirmations": 5,
  "height": 606,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "b7f3bd3de39d849fc1ed85c6b973cae3683df854a0291c78186532409b306f03",
  "time": 1767316350,
  "mediantime": 1767315600,
  "nonce": 0,
  "bits": "207fffff",
  "difficulty": 4.656542373906925e-10,
  "chainwork": "00000000000000000000000000000000000000000000000000000000000004be",
  "nTx": 2,
  "previousblockhash": "55b2f944351eef1a0af2cb000d11db6dba27fab0cb014809c7988d9be3c54598",
  "nextblockhash": "54a630f248fa9cd8b7dd7ddddf5e74b7d91de5d168c6708656fd85b182b516e4",
  "chainlock": false,
  "size": 578,
  "tx": [
    {
      "txid": "d4a330e14742feb8f38947ffd9eea12a5bba3301513c94ef60a5b76a1bed0cc6",
      "version": 3,
      "type": 5,
      "size": 272,
      "locktime": 0,
      "vin": [
        {
          "coinbase": "6a",
          "sequence": 4294967295
        }
      ],
      "vout": [
        {
          "value": 2.67184191,
          "valueSat": 267184191,
          "n": 0,
          "scriptPubKey": {
            "asm": "OP_DUP OP_HASH160 32ae99679ea84309f80373691cf2bb7b0da9ae16 OP_EQUALVERIFY OP_CHECKSIG",
            "desc": "addr(yQwRoAN7nzz1rbjq5oyt3d5gpyqChMEn3x)#73ua6uzw",
            "hex": "76a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac",
            "address": "yQwRoAN7nzz1rbjq5oyt3d5gpyqChMEn3x",
            "type": "pubkeyhash"
          }
        },
        {
          "value": 1.04549943,
          "valueSat": 104549943,
          "n": 1,
          "scriptPubKey": {
            "asm": "OP_RETURN",
            "desc": "raw(6a)#4mhr9ur5",
            "hex": "6a",
            "type": "nulldata"
          }
        }
      ],
      "extraPayloadSize": 175,
      "extraPayload": "03005e020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010655c9d04000000",
      "cbTx": {
        "version": 3,
        "height": 606,
        "merkleRootMNList": "0000000000000000000000000000000000000000000000000000000000000000",
        "merkleRootQuorums": "0000000000000000000000000000000000000000000000000000000000000000",
        "bestCLHeightDiff": 0,
        "bestCLSignature": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "creditPoolBalance": 198.19947280
      },
      "hex": "03000500010000000000000000000000000000000000000000000000000000000000000000ffffffff016affffffff023fe8ec0f000000001976a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac374e3b0600000000016a00000000af03005e020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010655c9d04000000",
      "instantlock": false,
      "instantlock_internal": false
    },
    {
      "txid": "2d527d1ca1900100c40b41d1881afb6a07888373e03ff7be0420960005b6f648",
      "version": 2,
      "type": 0,
      "size": 225,
      "locktime": 0,
      "vin": [
        {
          "txid": "091709ad0363cf65d706065cd5a07c99dbf6f25c33390c3f67af80275754d4fd",
          "vout": 0,
          "scriptSig": {
            "asm": "304402206465db43706bd35b1ced14e27b89ecc2ad939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d94ff75cbb4165508211914d41b3ea0e6122cc[ALL] 02cde88a8b67f85aa08dfaf0c10714d5af431b8909ea5a2da4551584e3533b621b",
            "hex": "47304402206465db43706bd35b1ced14e27b89ecc2ad939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d94ff75cbb4165508211914d41b3ea0e6122cc012102cde88a8b67f85aa08dfaf0c10714d5af431b8909ea5a2da4551584e3533b621b"
          },
          "prevout": {
            "generated": true,
            "height": 1,
            "value": 500.00000000,
            "scriptPubKey": {
              "asm": "OP_DUP OP_HASH160 32ae99679ea84309f80373691cf2bb7b0da9ae16 OP_EQUALVERIFY OP_CHECKSIG",
              "desc": "addr(yQwRoAN7nzz1rbjq5oyt3d5gpyqChMEn3x)#73ua6uzw",
              "hex": "76a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac",
              "address": "yQwRoAN7nzz1rbjq5oyt3d5gpyqChMEn3x",
              "type": "pubkeyhash"
            }
          },
          "sequence": 4294967295
        }
      ],
      "vout": [
        {
          "value": 10.00000000,
          "valueSat": 1000000000,
          "n": 0,
          "scriptPubKey": {
            "asm": "OP_DUP OP_HASH160 db91347da1e3fc25608b441994027847f489191b OP_EQUALVERIFY OP_CHECKSIG",
            "desc": "addr(ygLQnEhtRv9LiQAfjzvURpUiEXLK9xei6f)#e0zk9xr6",
            "hex": "76a914db91347da1e3fc25608b441994027847f489191b88ac",
            "address": "ygLQnEhtRv9LiQAfjzvURpUiEXLK9xei6f",
            "type": "pubkeyhash"
          }
        },
        {
          "value": 489.99999000,
          "valueSat": 48999999000,
          "n": 1,
          "scriptPubKey": {
            "asm": "OP_DUP OP_HASH160 32ae99679ea84309f80373691cf2bb7b0da9ae16 OP_EQUALVERIFY OP_CHECKSIG",
            "desc": "addr(yQwRoAN7nzz1rbjq5oyt3d5gpyqChMEn3x)#73ua6uzw",
            "hex": "76a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac",
            "address": "yQwRoAN7nzz1rbjq5oyt3d5gpyqChMEn3x",
            "type": "pubkeyhash"
          }
        }
      ],
      "fee": 0.00001000,
      "hex": "0200000001fdd454572780af673f0c39335cf2f6db997ca0d55c0606d765cf6303ad091709000000006a47304402206465db43706bd35b1ced14e27b89ecc2ad939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d94ff75cbb4165508211914d41b3ea0e6122cc012102cde88a8b67f85aa08dfaf0c10714d5af431b8909ea5a2da4551584e3533b621bffffffff0200ca9a3b000000001976a914db91347da1e3fc25608b441994027847f489191b88ac18a6a0680b0000001976a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac00000000",
      "instantlock": false,
      "instantlock_internal": false
    }
  ],
  "cbTx": {
    "version": 3,
    "height": 606,
    "merkleRootMNList": "0000000000000000000000000000000000000000000000000000000000000000",
    "merkleRootQuorums": "0000000000000000000000000000000000000000000000000000000000000000",
    "bestCLHeightDiff": 0,
    "bestCLSignature": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "creditPoolBalance": 198.19947280
  }
}

See also

  • GET Block/NoTxDetails gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. The JSON object includes TXIDs for transactions within the block rather than the complete transactions GET block returns.

  • GetBestBlockHash RPC: returns the header hash of the most recent block on the best block chain.

  • GetBlock RPC: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.

  • GetBlockHash RPC: returns the header hash of a block at the given height in the local best block chain.

GET Block/NoTxDetails#

The GET block/notxdetails operation gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. The JSON object includes TXIDs for transactions within the block rather than the complete transactions GET block returns.

Request

GET /block/notxdetails/<hash>.<format>

Parameter #1—the header hash of the block to retrieve

Name

Type

Presence

Description

Header Hash

path (hex)

Required
(exactly 1)

The hash of the header of the block to get, encoded as hex in RPC byte order

Parameter #2—the output format

Name

Type

Presence

Description

Format

suffix

Required
(exactly 1)

Set to .json for decoded block contents in JSON, or .bin or .hex for a serialized block in binary or hex

Response as JSON

Name

Type

Presence

Description

Result

object

Required
(exactly 1)

An object containing the requested block

→
hash

string (hex)

Required
(exactly 1)

The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1

→
confirmations

number (int)

Required
(exactly 1)

The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain

→
height

number (int)

Required
(exactly 1)

The height of this block on its block chain

→
version

number (int)

Required
(exactly 1)

This block’s version number. See block version numbers

→
versionHex

string (hex)

Required
(exactly 1)

Added in Bitcoin Core 0.13.0

This block’s version number formatted in hexadecimal. See [BIP9 assignments]

→
merkleroot

string (hex)

Required
(exactly 1)

The merkle root for this block, encoded as hex in RPC byte order

→
time

number (int)

Required
(exactly 1)

The value of the time field in the block header, indicating approximately when the block was created

→
mediantime

number (int)

Required
(exactly 1)

Added in Bitcoin Core 0.12.0

The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113

→
nonce

number (int)

Required
(exactly 1)

The nonce which was successful at turning this particular block into one that could be added to the best block chain

→
bits

string (hex)

Required
(exactly 1)

The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass

→
difficulty

number (real)

Required
(exactly 1)

The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0

→
chainwork

string (hex)

Required
(exactly 1)

The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex

→
nTx

number (int)

Required
(exactly 1)

The number of transactions in the block

→
previousblockhash

string (hex)

Optional
(0 or 1)

The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block

→
nextblockhash

string (hex)

Optional
(0 or 1)

The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order

→
chainlock

bool

Required
(exactly 1)

If set to true, this block is locked by a ChainLock

→
size

number (int)

Required
(exactly 1)

The size of this block in serialized block format, counted in bytes

→
tx

array

Required
(exactly 1)

An array containing the TXIDs of all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block

→ →
TXID

string (hex)

Required
(1 or more)

The TXID of a transaction in this block, encoded as hex in RPC byte order

→
cbTx

object

Optional
(0 or 1)

Coinbase special transaction details. Only present if the block’s coinbase transaction is a Coinbase special transaction (CbTx)

→ →
version

number (int)

Required
(exactly 1)

The version of the Coinbase special transaction (CbTx)

→ →
height

number (int)

Required
(exactly 1)

The height of this block on its block chain

→ →
merkleRootMNList

string (hex)

Required
(exactly 1)

The merkle root for the masternode list

→ →
merkleRootQuorums

string (hex)

Optional
(0 or 1)

The merkle root for the quorum list

→ →
bestCLHeightDiff

number (int)

Optional
(0 or 1)

Blocks between the current block and the last known block with a ChainLock

→ →
bestCLSignature

string (hex)

Optional
(0 or 1)

Best ChainLock signature known by the miner

→ →
creditPoolBalance

number (real)

Optional
(0 or 1)

Balance in the Platform credit pool

→ →
merkleRootAssetUnlocks

string (hex)

Optional
(0 or 1)

Added in Dash Core 24.0.0

Merkle root of the instance hashes of the block’s version 2 asset unlock transactions

Examples from Dash Core 24.0.0

Request a block in hex-encoded serialized block format:

curl http://localhost:19898/rest/block/notxdetails/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.hex

Result (wrapped):

000000209845c5e39b8d98c7094801cbb0fa27ba6ddb110d00cbf20a1aef1e35\
44f9b255036f309b40326518781c29a054f83d68e3ca73b9c685edc19f849de3\
3dbdf3b77e1b5769ffff7f200000000002030005000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff016affffffff\
023fe8ec0f000000001976a91432ae99679ea84309f80373691cf2bb7b0da9ae\
1688ac374e3b0600000000016a00000000af03005e0200000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000010655c9d040000\
000200000001fdd454572780af673f0c39335cf2f6db997ca0d55c0606d765cf\
6303ad091709000000006a47304402206465db43706bd35b1ced14e27b89ecc2\
ad939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d9\
4ff75cbb4165508211914d41b3ea0e6122cc012102cde88a8b67f85aa08dfaf0\
c10714d5af431b8909ea5a2da4551584e3533b621bffffffff0200ca9a3b0000\
00001976a914db91347da1e3fc25608b441994027847f489191b88ac18a6a068\
0b0000001976a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac0000\
0000

Get the same block in JSON:

curl http://localhost:19898/rest/block/notxdetails/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.json

Result (whitespace added):

{
  "hash": "7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79",
  "confirmations": 5,
  "height": 606,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "b7f3bd3de39d849fc1ed85c6b973cae3683df854a0291c78186532409b306f03",
  "time": 1767316350,
  "mediantime": 1767315600,
  "nonce": 0,
  "bits": "207fffff",
  "difficulty": 4.656542373906925e-10,
  "chainwork": "00000000000000000000000000000000000000000000000000000000000004be",
  "nTx": 2,
  "previousblockhash": "55b2f944351eef1a0af2cb000d11db6dba27fab0cb014809c7988d9be3c54598",
  "nextblockhash": "54a630f248fa9cd8b7dd7ddddf5e74b7d91de5d168c6708656fd85b182b516e4",
  "chainlock": false,
  "size": 578,
  "tx": [
    "d4a330e14742feb8f38947ffd9eea12a5bba3301513c94ef60a5b76a1bed0cc6",
    "2d527d1ca1900100c40b41d1881afb6a07888373e03ff7be0420960005b6f648"
  ],
  "cbTx": {
    "version": 3,
    "height": 606,
    "merkleRootMNList": "0000000000000000000000000000000000000000000000000000000000000000",
    "merkleRootQuorums": "0000000000000000000000000000000000000000000000000000000000000000",
    "bestCLHeightDiff": 0,
    "bestCLSignature": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "creditPoolBalance": 198.19947280
  }
}

See also

  • GET Block: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.

  • GetBlock RPC: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.

  • GetBlockHash RPC: returns the header hash of a block at the given height in the local best block chain.

  • GetBestBlockHash RPC: returns the header hash of the most recent block on the best block chain.

GET BlockFilter#

The GET blockfilter operation gets the BIP157 compact block filter for a block either as a JSON object or as a serialized filter. Requires the -blockfilterindex Dash Core command-line/configuration-file parameter to be enabled (masternodes enable it automatically).

Request

GET /blockfilter/<filtertype>/<hash>.<format>

Parameter #1—the filter type

Name

Type

Presence

Description

Filter Type

path (string)

Required
(exactly 1)

The type of filter to get. Only basic is supported. An unknown type returns HTTP 400 with Unknown filtertype <type>, and a type whose index is not enabled returns HTTP 400 with Index is not enabled for filtertype <type>

Parameter #2—the header hash of the block

Name

Type

Presence

Description

Header Hash

path (hex)

Required
(exactly 1)

The hash of the header of the block whose filter to get, encoded as hex in RPC byte order. A hash not found in the local block index returns HTTP 404 with <hash> not found

Parameter #3—the output format

Name

Type

Presence

Description

Format

suffix

Required
(exactly 1)

Set to .json for the filter in JSON, or .bin or .hex for a serialized filter in binary or hex. The serialized filter is the filter type (1 byte), the block hash (32 bytes, internal byte order), and the encoded filter (compactSize length followed by the filter data)

Response as JSON

Name

Type

Presence

Description

result

object

Required
(exactly 1)

An object containing the block filter

→
filter

string (hex)

Required
(exactly 1)

The hex-encoded filter data

Examples from Dash Core 24.0.2

Request the basic filter for a block in hex-encoded serialized format:

curl http://localhost:19898/rest/blockfilter/basic/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.hex

Result (wrapped):

00798b062ea8524b1b17c52d9ce38da7819f78c6f62b452c263292038e7069b8\
7e0702c777e41ff9c0

Get the same filter in JSON:

curl http://localhost:19898/rest/blockfilter/basic/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.json

Result (whitespace added):

{
  "filter": "02c777e41ff9c0"
}

See also

GET BlockFilterHeaders#

The GET blockfilterheaders operation returns the BIP157 compact block filter headers for a specified amount of blocks in upward direction, either as a JSON array or serialized. Requires the -blockfilterindex Dash Core command-line/configuration-file parameter to be enabled (masternodes enable it automatically).

Request

GET /blockfilterheaders/<filtertype>/<hash>.<format>?count=<count>

The older GET /blockfilterheaders/<filtertype>/<count>/<hash>.<format> form is deprecated but still supported.

Parameter #1—the filter type

Name

Type

Presence

Description

Filter Type

path (string)

Required
(exactly 1)

The type of filter to use. Only basic is supported. An unknown type returns HTTP 400 with Unknown filtertype <type>, and a type whose index is not enabled returns HTTP 400 with Index is not enabled for filtertype <type>

Parameter #2—the header hash of the first block

Name

Type

Presence

Description

Header Hash

path (hex)

Required
(exactly 1)

The hash of the header of the first block whose filter header to get, encoded as hex in RPC byte order

Parameter #3—the output format

Name

Type

Presence

Description

Format

suffix

Required
(exactly 1)

Set to .json for filter headers in JSON, or .bin or .hex for serialized filter headers (32 bytes each, internal byte order) in binary or hex

Parameter #4—the amount of filter headers to retrieve

Name

Type

Presence

Description

count

query (int)

Optional
(0 or 1)

The amount of filter headers in upward direction to return, starting with the filter header of the requested block. Default: 5. Must be between 1 and 2000; other values return HTTP 400 with Header count is invalid or out of acceptable range (1-2000): <count>

Response as JSON

Name

Type

Presence

Description

result

array

Required
(exactly 1)

An array containing the requested filter headers

→
Filter Header

string (hex)

Optional
(0 or more)

A filter header, encoded as hex in RPC byte order. The array contains the amount of filter headers requested with count, or fewer if the chain tip is reached first. It is empty if the block hash is not in the active chain

Examples from Dash Core 24.0.2

Request 2 filter headers in hex-encoded serialized format:

curl "http://localhost:19898/rest/blockfilterheaders/basic/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.hex?count=2"

Result (wrapped):

d42e01b64f76ecb51cd354098d21d3ff483c219e1bf1b148f397db0bde48afa7\
4f3a98c5abab7b241bb0ecbee79be7c6e18ebd11c1f1c6fc1de97b11d0369ace

Get the same filter headers in JSON:

curl "http://localhost:19898/rest/blockfilterheaders/basic/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.json?count=2"

Result (whitespace added):

[
  "a7af48de0bdb97f348b1f11b9e213c48ffd3218d0954d31cb5ec764fb6012ed4",
  "ce9a36d0117be91dfcc6f1c111bd8ee1c6e79be7beecb01b247bababc5983a4f"
]

See also

GET BlockHashByHeight#

The GET blockhashbyheight operation returns the hash of a block in best-block-chain at the height provided. The hash can be returned as a JSON object or serialized as binary or hex.

Request

GET /blockhashbyheight/<height>.<format>

Parameter #1—the header hash of the block to retrieve

Name

Type

Presence

Description

Block Height

number (int)

Required
(exactly 1)

The height of the block hash to get

Parameter #2—the output format

Name

Type

Presence

Description

Format

suffix

Required
(exactly 1)

Set to .json for decoded block hash contents in JSON, or .bin or .hex for a serialized block hash in binary or hex

Response as JSON

Name

Type

Presence

Description

result

object

Required
(exactly 1)

An object containing the block hash for the requested height

→
blockhash

string

Required
(exactly 1)

Block hash for the requested height

Examples from Dash Core 24.0.0

Request a block hash in hex-encoded serialized block hash format:

curl http://localhost:19898/rest/blockhashbyheight/606.hex

Result:

7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79

Get the same block hash in JSON:

curl http://localhost:19898/rest/blockhashbyheight/606.json

Result:

{
  "blockhash": "7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79"
}

See also

  • GetBlockHash RPC: returns the header hash of a block at the given height in the local best block chain.

GET ChainInfo#

The GET chaininfo operation returns information about the current state of the block chain. Supports only json as output format.

Request

GET /chaininfo.json

Parameters: none

Response as JSON

Name

Type

Presence

Description

result

object

Required
(exactly 1)

Information about the current state of the local block chain

→
chain

string

Required
(exactly 1)

The name of the block chain. One of main for mainnet, test for testnet, regtest for regtest, or devnet-<name> for a devnet started with -devnet=<name> (devnet if started with -devnet and no name)

→
blocks

number (int)

Required
(exactly 1)

The number of validated blocks in the local best block chain. For a new node with just the hardcoded genesis block, this will be 0

→
headers

number (int)

Required
(exactly 1)

The number of validated headers in the local best headers chain. For a new node with just the hardcoded genesis block, this will be zero. This number may be higher than the number of blocks

→
bestblockhash

string (hex)

Required
(exactly 1)

The hash of the header of the highest validated block in the best block chain, encoded as hex in RPC byte order. This is identical to the string returned by the getbestblockhash RPC

→
difficulty

number (real)

Required
(exactly 1)

The difficulty of the highest-height block in the best block chain

→
time

number (int)

Required
(exactly 1)

The block time of the highest-height block in the best block chain, expressed in Unix epoch time

→
mediantime

number (int)

Required
(exactly 1)

Added in Bitcoin Core 0.12.0

The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113

→
verificationprogress

number (real)

Required (exactly 1)

Estimate of what percentage of the block chain transactions have been verified so far, starting at 0.0 and increasing to 1.0 for fully verified. May slightly exceed 1.0 when fully synced to account for transactions in the memory pool which have been verified before being included in a block

→
initialblockdownload

bool

Required
(exactly 1)

An estimate of whether this node is in Initial Block Download mode (debug information)

→
chainwork

string (hex)

Required
(exactly 1)

The estimated number of block header hashes checked from the genesis block to this block, encoded as big-endian hex

→
size_on_disk

number (int)

Required
(exactly 1)

The estimated size of the block and undo files on disk, in bytes

→
pruned

bool

Required
(exactly 1)

Indicates if the blocks are subject to pruning

→
pruneheight

number (int)

Optional
(0 or 1)

The lowest-height complete block stored if pruning is activated

→
automatic_pruning

bool

Optional
(0 or 1)

Whether automatic pruning is enabled (false if started with -prune=1 for manual pruning). Only present if pruning is enabled

→
prune_target_size

number (int)

Optional
(0 or 1)

The target size used by pruning, in bytes. Only present if automatic pruning is enabled

→
softforks

object

Optional
(0 or 1)

Deprecated in Dash Core 24.0.0

Status of softforks, keyed by name. Only returned if config option -deprecatedrpc=softforks is passed. Use GET DeploymentInfo instead, which returns the same per-deployment objects in its deployments field

→
warnings

string

Required
(exactly 1)

Any network and blockchain warnings

Examples from Dash Core 24.0.0

Get blockchain info in JSON:

curl http://localhost:19898/rest/chaininfo.json

Result (whitespace added):

{
  "chain": "regtest",
  "blocks": 610,
  "headers": 610,
  "bestblockhash": "3990ef757c54a2866029c56f693797e78c426e7c47afbc102902a2d12c54efe9",
  "difficulty": 4.656542373906925e-10,
  "time": 1767316950,
  "mediantime": 1767316200,
  "verificationprogress": 1,
  "initialblockdownload": false,
  "chainwork": "00000000000000000000000000000000000000000000000000000000000004c6",
  "size_on_disk": 272279,
  "pruned": false,
  "warnings": ""
}

See also

  • GET DeploymentInfo: returns state info regarding deployments of consensus changes at the chain tip or at a specified block.

  • GetBlockChainInfo RPC: provides information about the current state of the block chain.

GET DeploymentInfo#

Added in version 24.0.0.

The GET deploymentinfo operation returns an object containing various state info regarding deployments of consensus changes, either at the current chain tip or at a specified block. The output is the same as the getdeploymentinfo RPC. Supports only json as output format.

Request

GET /deploymentinfo.json
GET /deploymentinfo/<blockhash>.json

Parameter #1—the header hash of the block to query

Name

Type

Presence

Description

Block Hash

path (hex)

Optional
(0 or 1)

The hash of the header of the block at which to query deployment state, encoded as hex in RPC byte order. If omitted, the current chain tip is used. An invalid hash returns HTTP 400 with Invalid hash: <hash>, and a hash not found in the local block index returns HTTP 400 with Block not found

Response as JSON

Name

Type

Presence

Description

result

object

Required
(exactly 1)

Deployment information for the requested block (or tip). See the getdeploymentinfo RPC for a full description of each deployment object

→
hash

string (hex)

Required
(exactly 1)

The requested block hash (or tip)

→
height

number (int)

Required
(exactly 1)

The requested block height (or tip)

→
deployments

object

Required
(exactly 1)

Deployments, keyed by name

Examples from Dash Core 24.0.0

Get deployment info at the current chain tip in JSON:

curl http://localhost:19898/rest/deploymentinfo.json

Get deployment info at a specific block in JSON:

curl http://localhost:19898/rest/deploymentinfo/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.json

Result for the specific block (whitespace added, truncated):

{
  "hash": "7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79",
  "height": 606,
  "deployments": {
    "bip34": {
      "type": "buried",
      "active": true,
      "height": 1
    },
    "dip0003": {
      "type": "buried",
      "active": true,
      "height": 432
    },
    "withdrawals": {
      "type": "buried",
      "active": true,
      "height": 600
    },
    "v24": {
      "type": "bip9",
      "active": false,
      "bip9": {
        "start_time": 0,
        "timeout": 9223372036854775807,
        "ehf": true,
        "min_activation_height": 0,
        "status": "defined",
        "since": 0,
        "status_next": "defined"
      }
    }
  }
}

See also

  • GET ChainInfo: returns information about the current state of the block chain.

  • GetDeploymentInfo RPC: returns state info regarding deployments of consensus changes at any block.

GET GetUtxos#

The GET getutxos operation returns an UTXO set given a set of outpoints.

Request

GET /getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<txid>-<n>.<bin|hex|json>

Parameter #1—Include memory pool transactions

Name

Type

Presence

Description

Check mempool

string

Optional
(0 or 1)

Set to checkmempool to include transactions that are currently in the memory pool to the calculation

Parameter #2—List of Outpoints

Name

Type

Presence

Description

Outpoint

vector

Required
(1 or more)

The list of outpoints to be queried. Each outpoint is the TXID of the transaction, encoded as hex in RPC byte order with an additional -n parameter for the output index (vout) number, with the index starting from 0

Parameter #3—the output format

Name

Type

Presence

Description

Format

suffix

Required
(exactly 1)

Set to .json for decoded block contents in JSON, or .bin or .hex for a serialized block in binary or hex

Response as JSON

Name

Type

Presence

Description

result

object

Required
(exactly 1)

The requested UTXO set

→
chainHeight

number (int)

Required
(exactly 1)

The height of the chain at the moment the result was calculated

→
chaintipHash

string (hex)

Required
(exactly 1)

The block hash of the top of the chain at the moment the result was calculated, encoded as hex in RPC byte order

→
bitmap

string

Required
(exactly 1)

Whether each requested output was found in the UTXO set or not. A 1 is returned for those that were found and a 0 is returned for those that were not found. Results are returned in the same order as outpoints were requested in the input parameters

→
utxos

array

Required
(exactly 1)

An array of objects each describing an outpoint that is unspent

→ →
Unspent Outpoint

object

Optional
(0 or more)

A UTXO match based on the query

→ → →
height

number (int)

Required
(exactly 1)

The height of the block containing the defining transaction, or 2147483647 (0x7FFFFFFF) if the transaction is in the memory pool

→ → →
value

number (Dash)

Required
(exactly 1)

The value of the output in DASH

→ → →
scriptPubKey

object

Required
(exactly 1)

An object describing the pubkey script

→ → → →
asm

string

Required
(exactly 1)

The pubkey script in decoded form with non-data-pushing opcodes listed

→ → → →
desc

string

Required
(exactly 1)

Inferred descriptor for the output

→ → → →
hex

string (hex)

Required
(exactly 1)

The pubkey script encoded as hex

→ → → →
type

string

Required
(exactly 1)

The type of script. This will be one of the following:
• pubkey for a P2PK script
• pubkeyhash for a P2PKH script
• scripthash for a P2SH script
• multisig for a bare multisig script
• nulldata for nulldata scripts
• nonstandard for unknown scripts

→ → → →
address

string

Optional
(0 or 1)

Dash address (only if a well-defined address exists)

Examples from Dash Core 24.0.0

Request the UTXO set for a confirmed output and an unconfirmed (memory pool) output:

curl http://localhost:19898/rest/getutxos/checkmempool/2d527d1ca1900100c40b41d1881afb6a07888373e03ff7be0420960005b6f648-0/5c4551c47487217a228ca7d10d39dea9bdb25d8ce327740be94e1dc596613939-0.hex

Result (wrapped):

62020000e9ef542cd1a2022910bcaf477c6e428ce79737696fc5296086a2547c\
75ef9039010302000000005e02000000ca9a3b000000001976a914db91347da1\
e3fc25608b441994027847f489191b88ac00000000ffffff7f0065cd1d000000\
001976a914db91347da1e3fc25608b441994027847f489191b88ac

Same request in JSON:

curl http://localhost:19898/rest/getutxos/checkmempool/2d527d1ca1900100c40b41d1881afb6a07888373e03ff7be0420960005b6f648-0/5c4551c47487217a228ca7d10d39dea9bdb25d8ce327740be94e1dc596613939-0.json

Result (whitespace added):

{
  "chainHeight": 610,
  "chaintipHash": "3990ef757c54a2866029c56f693797e78c426e7c47afbc102902a2d12c54efe9",
  "bitmap": "11",
  "utxos": [
    {
      "height": 606,
      "value": 10.00000000,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 db91347da1e3fc25608b441994027847f489191b OP_EQUALVERIFY OP_CHECKSIG",
        "desc": "addr(ygLQnEhtRv9LiQAfjzvURpUiEXLK9xei6f)#e0zk9xr6",
        "hex": "76a914db91347da1e3fc25608b441994027847f489191b88ac",
        "address": "ygLQnEhtRv9LiQAfjzvURpUiEXLK9xei6f",
        "type": "pubkeyhash"
      }
    },
    {
      "height": 2147483647,
      "value": 5.00000000,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 db91347da1e3fc25608b441994027847f489191b OP_EQUALVERIFY OP_CHECKSIG",
        "desc": "addr(ygLQnEhtRv9LiQAfjzvURpUiEXLK9xei6f)#e0zk9xr6",
        "hex": "76a914db91347da1e3fc25608b441994027847f489191b88ac",
        "address": "ygLQnEhtRv9LiQAfjzvURpUiEXLK9xei6f",
        "type": "pubkeyhash"
      }
    }
  ]
}

See also

  • GetTxOutSetInfo RPC: returns statistics about the confirmed unspent transaction output (UTXO) set. Note that this call may take some time and that it only counts outputs from confirmed transactions—it does not count outputs from the memory pool.

GET Headers#

The GET headers operation returns a specified amount of block headers in upward direction.

Request

GET /headers/<hash>.<format>?count=<count>

The older GET /headers/<count>/<hash>.<format> form is deprecated but still supported.

Parameter #1—the header hash of the block to retrieve

Name

Type

Presence

Description

Header Hash

path (hex)

Required
(exactly 1)

The hash of the header of the block to get, encoded as hex in RPC byte order

Parameter #2—the output format

Name

Type

Presence

Description

Format

suffix

Required
(exactly 1)

Set to .json for decoded block headers in JSON, or .bin or .hex for serialized block headers in binary or hex

Parameter #3—the amount of block headers to retrieve

Name

Type

Presence

Description

count

query (int)

Optional
(0 or 1)

The amount of block headers in upward direction to return (including the start header hash). Default: 5. Must be between 1 and 2000; other values return HTTP 400 with Header count is invalid or out of acceptable range (1-2000): <count>

Response as JSON

Name

Type

Presence

Description

Result

array

Required
(exactly 1)

An array containing the requested block headers

→
Block Header

object

Optional
(0 or more)

An object containing a block header. The array contains the amount of headers requested with count, or fewer if the chain tip is reached first. It is empty if the block hash is not in the active chain

→ →
hash

string (hex)

Required
(exactly 1)

The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1

→ →
confirmations

number (int)

Required
(exactly 1)

The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain

→ →
height

number (int)

Required
(exactly 1)

The height of this block on its block chain

→ →
version

number (int)

Required
(exactly 1)

This block’s version number. See block version numbers

→ →
versionHex

string (hex)

Required
(exactly 1)

This block’s version number formatted in hexadecimal

→ →
merkleroot

string (hex)

Required
(exactly 1)

The merkle root for this block, encoded as hex in RPC byte order

→ →
time

number (int)

Required
(exactly 1)

The value of the time field in the block header, indicating approximately when the block was created

→ →
mediantime

number (int)

Required
(exactly 1)

Added in Bitcoin Core 0.12.0

The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113

→ →
nonce

number (int)

Required
(exactly 1)

The nonce which was successful at turning this particular block into one that could be added to the best block chain

→ →
bits

string (hex)

Required
(exactly 1)

The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass

→ →
difficulty

number (real)

Required
(exactly 1)

The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0

→ →
chainwork

string (hex)

Required
(exactly 1)

The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex

→ →
nTx

number (int)

Required
(exactly 1)

The number of transactions in the block

→ →
previousblockhash

string (hex)

Optional
(0 or 1)

The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block

→ →
nextblockhash

string (hex)

Optional
(0 or 1)

The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order

→ →
chainlock

bool

Required
(exactly 1)

If set to true, this block is locked by a ChainLock

Examples from Dash Core 24.0.2

Request 2 block headers in hex-encoded serialized block format:

curl "http://localhost:19898/rest/headers/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.hex?count=2"

Result (wrapped):

000000209845c5e39b8d98c7094801cbb0fa27ba6ddb110d00cbf20a1aef1e35\
44f9b255036f309b40326518781c29a054f83d68e3ca73b9c685edc19f849de3\
3dbdf3b77e1b5769ffff7f200000000000000020798b062ea8524b1b17c52d9c\
e38da7819f78c6f62b452c263292038e7069b87ec8997f386905bafad4ff3e6a\
a14244e881eb7c2ed29d6d39d9f406dbd431a28c141c5769ffff7f2001000000

Get the same block headers in JSON:

curl "http://localhost:19898/rest/headers/7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79.json?count=2"

Result (whitespace added):

[
  {
    "hash": "7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79",
    "confirmations": 5,
    "height": 606,
    "version": 536870912,
    "versionHex": "20000000",
    "merkleroot": "b7f3bd3de39d849fc1ed85c6b973cae3683df854a0291c78186532409b306f03",
    "time": 1767316350,
    "mediantime": 1767315600,
    "nonce": 0,
    "bits": "207fffff",
    "difficulty": 4.656542373906925e-10,
    "chainwork": "00000000000000000000000000000000000000000000000000000000000004be",
    "nTx": 2,
    "previousblockhash": "55b2f944351eef1a0af2cb000d11db6dba27fab0cb014809c7988d9be3c54598",
    "nextblockhash": "54a630f248fa9cd8b7dd7ddddf5e74b7d91de5d168c6708656fd85b182b516e4",
    "chainlock": false
  },
  {
    "hash": "54a630f248fa9cd8b7dd7ddddf5e74b7d91de5d168c6708656fd85b182b516e4",
    "confirmations": 4,
    "height": 607,
    "version": 536870912,
    "versionHex": "20000000",
    "merkleroot": "8ca231d4db06f4d9396d9dd22e7ceb81e84442a16a3effd4faba0569387f99c8",
    "time": 1767316500,
    "mediantime": 1767315750,
    "nonce": 1,
    "bits": "207fffff",
    "difficulty": 4.656542373906925e-10,
    "chainwork": "00000000000000000000000000000000000000000000000000000000000004c0",
    "nTx": 1,
    "previousblockhash": "7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79",
    "nextblockhash": "702d26b15179aa51cffba4bc6ab7f3b18fc2ef68886c5cc9db1c232ad387ae95",
    "chainlock": false
  }
]

See also

  • GET Block/NoTxDetails gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. The JSON object includes TXIDs for transactions within the block rather than the complete transactions GET block returns.

  • GetBlockHash RPC: returns the header hash of a block at the given height in the local best block chain.

  • GetBlockHeader RPC: gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header.

GET MemPool/Contents#

The GET mempool/contents operation returns all transaction in the memory pool with detailed information, or only their TXIDs (verbose=false). Supports only json as output format.

Request

GET /mempool/contents.json
GET /mempool/contents.json?verbose=<true|false>&mempool_sequence=<true|false>

Parameter #1—verbose output

Name

Type

Presence

Description

verbose

query (bool)

Optional
(0 or 1)

Added in Dash Core 24.0.0

Set to true (the default) to return a JSON object describing each transaction, or false to return an array of TXIDs. Any value other than true or false returns HTTP 400 with The "verbose" query parameter must be either "true" or "false".

Parameter #2—include mempool sequence

Name

Type

Presence

Description

mempool_sequence

query (bool)

Optional
(0 or 1)

Added in Dash Core 24.0.0

Set to true to return the TXIDs together with the mempool sequence number. Default: false. Only valid with verbose=false; combining it with verbose output returns HTTP 400 with Verbose results cannot contain mempool sequence values. (hint: set "verbose=false"). Any value other than true or false returns HTTP 400 with The "mempool_sequence" query parameter must be either "true" or "false".

Result (verbose=true, the default)—a JSON object describing each transaction

Name

Type

Presence

Description

result

object

Required
(exactly 1)

A object containing transactions currently in the memory pool. May be empty

→
TXID

string : object

Optional
(0 or more)

The TXID of a transaction in the memory pool, encoded as hex in RPC byte order

→ →
vsize

number (int)

Required
(exactly 1)

Transaction size

→ →
time

number (int)

Required
(exactly 1)

The time the transaction entered the memory pool, Unix epoch time format

→ →
height

number (int)

Required
(exactly 1)

The block height when the transaction entered the memory pool

→ →
descendantcount

number (int)

Required
(exactly 1)

The number of in-mempool descendant transactions (including this one)

→ →
descendantsize

number (int)

Required
(exactly 1)

The size of in-mempool descendants (including this one)

→ →
ancestorcount

number (int)

Required
(exactly 1)

The number of in-mempool ancestor transactions (including this one)

→ →
ancestorsize

number (int)

Required
(exactly 1)

The size of in-mempool ancestors (including this one)

→ →
fees

object

Required
(exactly 1)

Object containing fee information

→ → →
base

number (Dash)

Required
(exactly 1)

Transaction fee in DASH

→ → →
modified

number (Dash)

Required
(exactly 1)

Transaction fee with fee deltas used for mining priority in DASH

→ → →
ancestor

number (Dash)

Required
(exactly 1)

Modified fees (see above) of in-mempool ancestors (including this one) in DASH

→ → →
descendant

number (Dash)

Required
(exactly 1)

Modified fees (see above) of in-mempool descendants (including this one) in DASH

→ →
depends

array

Required
(exactly 1)

An array holding TXIDs of unconfirmed transactions this transaction depends upon (parent transactions). Those transactions must be part of a block before this transaction can be added to a block, although all transactions may be included in the same block. The array may be empty

→ → →
Depends TXID

string

Optional (0 or more)

The TXIDs of any unconfirmed transactions this transaction depends upon, encoded as hex in RPC byte order

→ →
spentby

array

Required
(exactly 1)

An array of unconfirmed transactions spending outputs from this transaction

→ → →
TXID

string

Optional (0 or more)

The TXIDs of any unconfirmed transactions spending from this transaction

→ →
instantlock

string

Required
(exactly 1)

"true" if this transaction was locked via InstantSend, "false" if it was not, or "unknown" if InstantSend is unavailable

→ →
unbroadcast

bool

Required
(exactly 1)

Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)

Result (verbose=false)—an array of TXIDs

Name

Type

Presence

Description

result

array

Required
(exactly 1)

An array of TXIDs belonging to transactions in the memory pool. The array may be empty if there are no transactions in the memory pool

→
TXID

string

Optional
(0 or more)

The TXID of a transaction in the memory pool, encoded as hex in RPC byte order

Result (verbose=false&mempool_sequence=true)—TXIDs with the mempool sequence

Name

Type

Presence

Description

result

object

Required
(exactly 1)

An object containing the TXIDs and the mempool sequence number

→
txids

array

Required
(exactly 1)

An array of TXIDs belonging to transactions in the memory pool. The array may be empty if there are no transactions in the memory pool

→ →
TXID

string

Optional
(0 or more)

The TXID of a transaction in the memory pool, encoded as hex in RPC byte order

→
mempool_sequence

number (int)

Required
(exactly 1)

The mempool sequence value

Examples from Dash Core 24.0.0

Get all transactions in the memory pool in JSON:

curl http://localhost:19898/rest/mempool/contents.json

Result (whitespace added):

{
  "5c4551c47487217a228ca7d10d39dea9bdb25d8ce327740be94e1dc596613939": {
    "vsize": 225,
    "time": 1767317100,
    "height": 610,
    "descendantcount": 2,
    "descendantsize": 450,
    "ancestorcount": 1,
    "ancestorsize": 225,
    "fees": {
      "base": 0.00001000,
      "modified": 0.00001000,
      "ancestor": 0.00001000,
      "descendant": 0.00002000
    },
    "depends": [],
    "spentby": [
      "7713aaad561955af9c0cf461e3823d3413f3de370b9420a2c6f3f666c4cb02a5"
    ],
    "instantlock": "false",
    "unbroadcast": true
  },
  "7713aaad561955af9c0cf461e3823d3413f3de370b9420a2c6f3f666c4cb02a5": {
    "vsize": 225,
    "time": 1767317100,
    "height": 610,
    "descendantcount": 1,
    "descendantsize": 225,
    "ancestorcount": 2,
    "ancestorsize": 450,
    "fees": {
      "base": 0.00001000,
      "modified": 0.00001000,
      "ancestor": 0.00002000,
      "descendant": 0.00001000
    },
    "depends": [
      "5c4551c47487217a228ca7d10d39dea9bdb25d8ce327740be94e1dc596613939"
    ],
    "spentby": [],
    "instantlock": "false",
    "unbroadcast": true
  }
}

Get only the TXIDs:

curl "http://localhost:19898/rest/mempool/contents.json?verbose=false"

Result (whitespace added):

[
  "5c4551c47487217a228ca7d10d39dea9bdb25d8ce327740be94e1dc596613939",
  "7713aaad561955af9c0cf461e3823d3413f3de370b9420a2c6f3f666c4cb02a5"
]

Get the TXIDs with the mempool sequence number:

curl "http://localhost:19898/rest/mempool/contents.json?verbose=false&mempool_sequence=true"

Result (whitespace added):

{
  "txids": [
    "5c4551c47487217a228ca7d10d39dea9bdb25d8ce327740be94e1dc596613939",
    "7713aaad561955af9c0cf461e3823d3413f3de370b9420a2c6f3f666c4cb02a5"
  ],
  "mempool_sequence": 5
}

See also

  • GET MemPool/Info: returns information about the node’s current transaction memory pool.

  • GetMemPoolInfo RPC: returns information about the node’s current transaction memory pool.

  • GetRawMemPool RPC: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.

GET MemPool/Info#

The GET mempool/info operation returns information about the node’s current transaction memory pool. Supports only json as output format.

Request

GET /mempool/info.json

Parameters: none

Result as JSON

Name

Type

Presence

Description

result

object

Required
(exactly 1)

A object containing information about the memory pool

→
loaded

bool

Required
(exactly 1)

True if the mempool is fully loaded

→
size

number (int)

Required
(exactly 1)

The number of transactions currently in the memory pool

→
bytes

number (int)

Required
(exactly 1)

The total number of bytes in the transactions in the memory pool

→
usage

number (int)

Required
(exactly 1)

Added in Bitcoin Core 0.11.0

Total memory usage for the mempool in bytes

→
total_fee

number (Dash)

Required
(exactly 1)

Total fees for the mempool in DASH, ignoring fees modified through the prioritisetransaction RPC

→
maxmempool

number (int)

Required
(exactly 1)

Added in Bitcoin Core 0.12.0

Maximum memory usage for the mempool in bytes

→
mempoolminfee

number (Dash)

Required
(exactly 1)

Added in Bitcoin Core 0.12.0

Minimum fee rate in DASH/kB for a transaction to be accepted. This is the maximum of minrelaytxfee and the minimum mempool fee

→
minrelaytxfee

number (Dash)

Required
(exactly 1)

Current minimum relay fee rate for transactions, in DASH/kB

→
instantsendlocks

number (int)

Required
(exactly 1)

Number of unconfirmed InstantSend locks

→
unbroadcastcount

number (int)

Required
(exactly 1)

Current number of transactions that haven’t passed initial broadcast yet

→
pendingassetunlocks

number (Dash)

Required
(exactly 1)

Added in Dash Core 24.0.0

Sum of the withdrawal amounts (outputs plus fee) of the Asset Unlock transactions in the mempool in DASH

Examples from Dash Core 24.0.0

Get memory pool info in JSON:

curl http://localhost:19898/rest/mempool/info.json

Result (whitespace added):

{
  "loaded": true,
  "size": 2,
  "bytes": 450,
  "usage": 2176,
  "total_fee": 0.00002000,
  "maxmempool": 300000000,
  "mempoolminfee": 0.00001000,
  "minrelaytxfee": 0.00001000,
  "instantsendlocks": 0,
  "unbroadcastcount": 2,
  "pendingassetunlocks": 0.00000000
}

See also

  • GET MemPool/Contents: returns all transaction in the memory pool with detailed information, or only their TXIDs.

  • GetMemPoolInfo RPC: returns information about the node’s current transaction memory pool.

GET Tx#

The GET tx operation gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Dash Core only stores complete transaction data for UTXOs and your own transactions, so this method may fail on historic transactions unless you use the non-default txindex=1 in your Dash Core startup settings.

Note

If you begin using txindex=1 after downloading the block chain, you must rebuild your indexes by starting Dash Core with the option -reindex. This may take several hours to complete, during which time your node will not process new blocks or transactions. This reindex only needs to be done once.

Request

GET /tx/<txid>.<format>

Parameter #1—the TXID of the transaction to retrieve

Name

Type

Presence

Description

TXID

path (hex)

Required
(exactly 1)

The TXID of the transaction to get, encoded as hex in RPC byte order

Parameter #2—the output format

Name

Type

Presence

Description

Format

suffix

Required
(exactly 1)

Set to .json for decoded transaction contents in JSON, or .bin or .hex for a serialized transaction in binary or hex

Response as JSON

Name

Type

Presence

Description

Result

object

Required
(exactly 1)

An object describing the request transaction

→
txid

string (hex)

Required
(exactly 1)

The transaction’s TXID encoded as hex in RPC byte order

→
size

number (int)

Required
(exactly 1)

Added in Bitcoin Core 0.12.0

The serialized transaction size

→
version

number (int)

Required
(exactly 1)

The transaction format version number

→
type

number (int)

Required
(exactly 1)

Added in Dash Core 0.13.0.0

The transaction format type

→
locktime

number (int)

Required
(exactly 1)

The transaction’s locktime: either a Unix epoch date or block height; see the locktime parsing rules

→
vin

array

Required
(exactly 1)

An array of objects with each object being an input vector (vin) for this transaction. Input objects will have the same order within the array as they have in the transaction, so the first input listed will be input 0

→ →
Input

object

Required
(1 or more)

An object describing one of this transaction’s inputs. May be a regular input or a coinbase

→ → →
txid

string

Optional
(0 or 1)

The TXID of the outpoint being spent, encoded as hex in RPC byte order. Not present if this is a coinbase transaction

→ → →
vout

number (int)

Optional
(0 or 1)

The output index number (vout) of the outpoint being spent. The first output in a transaction has an index of 0. Not present if this is a coinbase transaction

→ → →
scriptSig

object

Optional
(0 or 1)

An object describing the signature script of this input. Not present if this is a coinbase transaction

→ → → →
asm

string

Required
(exactly 1)

The signature script in decoded form with non-data-pushing opcodes listed

→ → → →
hex

string (hex)

Required
(exactly 1)

The signature script encoded as hex

→ → →
coinbase

string (hex)

Optional
(0 or 1)

The coinbase (similar to the hex field of a scriptSig) encoded as hex. Only present if this is a coinbase transaction

→ → →
sequence

number (int)

Required
(exactly 1)

The input sequence number

→
vout

array

Required
(exactly 1)

An array of objects each describing an output vector (vout) for this transaction. Output objects will have the same order within the array as they have in the transaction, so the first output listed will be output 0

→ →
Output

object

Required
(1 or more)

An object describing one of this transaction’s outputs

→ → →
value

number (Dash)

Required
(exactly 1)

The number of Dash paid to this output. May be 0

→ → →
valueSat

number (duffs)

Required
(exactly 1)

The number of duffs paid to this output. May be 0

→ → →
n

number (int)

Required
(exactly 1)

The output index number of this output within this transaction

→ → →
scriptPubKey

object

Required
(exactly 1)

An object describing the pubkey script

→ → → →
asm

string

Required
(exactly 1)

The pubkey script in decoded form with non-data-pushing opcodes listed

→ → → →
desc

string

Required
(exactly 1)

Inferred descriptor for the output

→ → → →
hex

string (hex)

Required
(exactly 1)

The pubkey script encoded as hex

→ → → →
type

string

Required
(exactly 1)

The type of script. This will be one of the following:
• pubkey for a P2PK script
• pubkeyhash for a P2PKH script
• scripthash for a P2SH script
• multisig for a bare multisig script
• nulldata for nulldata scripts
• nonstandard for unknown scripts

→ → → →
address

string

Optional
(0 or 1)

Dash address (only if a well-defined address exists)

→
extraPayloadSize

number (int)

Optional
(0 or 1)

Added in Dash Core 0.13.0.0

Size of the DIP2 extra payload. Only present if it’s a DIP2 special transaction

→
extraPayload

string (hex)

Optional
(0 or 1)

Added in Dash Core 0.13.0.0

Hex encoded DIP2 extra payload data. Only present if it’s a DIP2 special transaction

→
cbTx

object

Optional
(0 or 1)

The decoded Coinbase special transaction (CbTx) payload, with the same fields as the block-level cbTx object in GET Block. Only present if this is a coinbase special transaction. Other DIP2 special transaction types include their own decoded payload object instead (for example, proRegTx or qcTx)

→
instanceHash

string (hex)

Optional
(0 or 1)

Added in Dash Core 24.0.0

Full-serialization hash distinguishing this re-signed instance of the withdrawal; the txid is shared by all instances. Only present for version 2 Asset Unlock special TXs

→
blockhash

string (hex)

Optional
(0 or 1)

If the transaction has been included in a block on the local best block chain, this is the hash of that block encoded as hex in RPC byte order. Not present for memory pool transactions

→
hex

string (hex)

Required
(exactly 1)

The serialized, hex-encoded data for the transaction

Examples from Dash Core 24.0.0

Request a transaction in hex-encoded serialized transaction format:

curl http://localhost:19898/rest/tx/2d527d1ca1900100c40b41d1881afb6a07888373e03ff7be0420960005b6f648.hex

Result (wrapped):

0200000001fdd454572780af673f0c39335cf2f6db997ca0d55c0606d765cf63\
03ad091709000000006a47304402206465db43706bd35b1ced14e27b89ecc2ad\
939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d94f\
f75cbb4165508211914d41b3ea0e6122cc012102cde88a8b67f85aa08dfaf0c1\
0714d5af431b8909ea5a2da4551584e3533b621bffffffff0200ca9a3b000000\
001976a914db91347da1e3fc25608b441994027847f489191b88ac18a6a0680b\
0000001976a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac000000\
00

Get the same transaction in JSON:

curl http://localhost:19898/rest/tx/2d527d1ca1900100c40b41d1881afb6a07888373e03ff7be0420960005b6f648.json

Result (whitespace added):

{
  "txid": "2d527d1ca1900100c40b41d1881afb6a07888373e03ff7be0420960005b6f648",
  "version": 2,
  "type": 0,
  "size": 225,
  "locktime": 0,
  "vin": [
    {
      "txid": "091709ad0363cf65d706065cd5a07c99dbf6f25c33390c3f67af80275754d4fd",
      "vout": 0,
      "scriptSig": {
        "asm": "304402206465db43706bd35b1ced14e27b89ecc2ad939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d94ff75cbb4165508211914d41b3ea0e6122cc[ALL] 02cde88a8b67f85aa08dfaf0c10714d5af431b8909ea5a2da4551584e3533b621b",
        "hex": "47304402206465db43706bd35b1ced14e27b89ecc2ad939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d94ff75cbb4165508211914d41b3ea0e6122cc012102cde88a8b67f85aa08dfaf0c10714d5af431b8909ea5a2da4551584e3533b621b"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 10.00000000,
      "valueSat": 1000000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 db91347da1e3fc25608b441994027847f489191b OP_EQUALVERIFY OP_CHECKSIG",
        "desc": "addr(ygLQnEhtRv9LiQAfjzvURpUiEXLK9xei6f)#e0zk9xr6",
        "hex": "76a914db91347da1e3fc25608b441994027847f489191b88ac",
        "address": "ygLQnEhtRv9LiQAfjzvURpUiEXLK9xei6f",
        "type": "pubkeyhash"
      }
    },
    {
      "value": 489.99999000,
      "valueSat": 48999999000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 32ae99679ea84309f80373691cf2bb7b0da9ae16 OP_EQUALVERIFY OP_CHECKSIG",
        "desc": "addr(yQwRoAN7nzz1rbjq5oyt3d5gpyqChMEn3x)#73ua6uzw",
        "hex": "76a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac",
        "address": "yQwRoAN7nzz1rbjq5oyt3d5gpyqChMEn3x",
        "type": "pubkeyhash"
      }
    }
  ],
  "blockhash": "7eb869708e039232262c452bf6c6789f81a78de39c2dc5171b4b52a82e068b79",
  "hex": "0200000001fdd454572780af673f0c39335cf2f6db997ca0d55c0606d765cf6303ad091709000000006a47304402206465db43706bd35b1ced14e27b89ecc2ad939bb04fd7f644e74d322ef5c553b7022022069e76134796df3a006d6c18d94ff75cbb4165508211914d41b3ea0e6122cc012102cde88a8b67f85aa08dfaf0c10714d5af431b8909ea5a2da4551584e3533b621bffffffff0200ca9a3b000000001976a914db91347da1e3fc25608b441994027847f489191b88ac18a6a0680b0000001976a91432ae99679ea84309f80373691cf2bb7b0da9ae1688ac00000000"
}

See also

  • GetRawTransaction RPC: gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Dash Core only stores complete transaction data for UTXOs and your own transactions, so the RPC may fail on historic transactions unless you use the non-default txindex=1 in your Dash Core startup settings.

  • GetTransaction RPC: gets detailed information about an in-wallet transaction.