.md

Proofs API

Signed blocks, Bitcoin anchoring and state proofs, so you can check an answer instead of trusting it. How to run the checks is on Verify; envelope and cursors are in REST conventions.

Signed block by id

GET/v1/proofs/block/{index_block_hash}
Open .md

The consensus-serialized Nakamoto block from the Stacks node (/v3/blocks/{id}): header with signer signatures, then transactions. Recompute the block id from the header and check the signatures against the cycle's signer set. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Path parameters

index_block_hashstringrequired#

The block's index_block_hash: 64 hex characters, 0x optional.

Returns

application/octet-stream

  • 200The block bytes. Immutable.
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404The node has no block with that index_block_hash
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)

Signed block by height

GET/v1/proofs/block/height/{height}
Open .md

The node's block at a Stacks height (/v3/blocks/height/{height}), same bytes as the by-id route. Near the tip the block at a height can change, so this is short-cached; prefer the by-id route once you know the id. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Path parameters

heightintegerrequired#

Stacks block height.

Returns

application/octet-stream

  • 200The block bytes.
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404The node has no block at that height
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)

Epoch 2.x block header by id

GET/v1/proofs/epoch2-header/{index_block_hash}
Open .md

A pre-Nakamoto block's header from the Stacks node (/v2/headers/1?tip={id}), as the node's one-element array: header (consensus-serialized StacksBlockHeader, hex), consensus_hash and parent_block_id. The id is sha512/256(sha512/256(header) || consensus_hash): recompute it, then check state against the header's state_index_root. Nakamoto blocks are a 404 here; use the block route. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Path parameters

index_block_hashstringrequired#

The block's index_block_hash: 64 hex characters, 0x optional.

Returns

  • 200The block's header and consensus hash
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404The node has no epoch 2.x block with that index_block_hash
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)

Burn block behind a consensus hash

GET/v1/proofs/burn/{consensus_hash}
Open .md

The sortition preimage that hashes to a block header's consensus_hash (RIPEMD160(SHA256(preimage))). Bytes 4..36 of the preimage are the Bitcoin block hash, which pins the header's burn height against Bitcoin proof of work. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Path parameters

consensus_hashstringrequired#

The header's consensus_hash: 40 hex characters, 0x optional.

Returns

The Burn block proof object.

  • 200The preimage and the burn block it names
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404No sortition with that consensus hash
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)
  • 503PROOFS_UNAVAILABLE: this instance has no proof sidecar (PROOF_SIDECAR_URL unset). PROOF_SOURCE_BUSY: the sidecar is busy; retry after Retry-After seconds

Bitcoin block headers

GET/v1/proofs/bitcoin-headers
Open .md

Raw 80-byte Bitcoin headers from from, at most 2016 (one difficulty period) per call. Check proof of work and linkage yourself from a checkpoint you trust. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Query parameters

fromintegerrequired#

First Bitcoin height to return.

countinteger · 1 to 2016required#

Number of headers, 1 to 2016.

Returns

The Bitcoin headers object.

  • 200Consecutive headers starting at from
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404The sidecar has no header at from
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)
  • 503PROOFS_UNAVAILABLE: this instance has no proof sidecar (PROOF_SIDECAR_URL unset). PROOF_SOURCE_BUSY: the sidecar is busy; retry after Retry-After seconds

Bitcoin transaction proof

GET/v1/proofs/bitcoin-tx/{txid}
Open .md

A confirmed Bitcoin transaction with its merkle branch (internal byte order) and block header, from the instance's own Bitcoin node. Recompute the txid from raw_tx, fold the branch to the header's merkle root, and check the header against a Bitcoin chain you trust, such as a checkpoint plus proof of work. Short-cached: a shallow block can reorg. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Path parameters

txidstringrequired#

The Bitcoin txid, display order: 64 hex characters, 0x optional.

Returns

The Bitcoin transaction proof object.

  • 200The raw transaction, merkle branch and block header
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404No confirmed transaction with that txid
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)
  • 503PROOFS_UNAVAILABLE: this instance has no Bitcoin node (BITCOIN_RPC_URL unset)

State witness for a block

GET/v1/proofs/witness/{index_block_hash}
Open .md

The block's MARF state witness (wire v3) from the proof sidecar: the trie nodes the block wrote, ancestor roots, and the names of every write. Recompute the root and compare it with the header's state_index_root; every changed leaf is a named write, a carried value, or an internal key, so a hidden write fails. Extracted on demand, so it has its own lower rate limit. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Path parameters

index_block_hashstringrequired#

The block's index_block_hash: 64 hex characters, 0x optional.

Returns

application/octet-stream

  • 200The witness bytes. Immutable.
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404The sidecar has no block with that index_block_hash
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)
  • 503PROOFS_UNAVAILABLE: this instance has no proof sidecar (PROOF_SIDECAR_URL unset). PROOF_SOURCE_BUSY: the sidecar is busy; retry after Retry-After seconds

State writes of a block

GET/v1/proofs/writes/{height}
Open .md

Every MARF write the canonical block at height committed, in the node's write order, from this instance's indexed state_writes: the names a verifier needs to label each written leaf of the block's witness. A write the witness does not hold, or a leaf no write names, fails that check, so the rows are checked, not trusted. 404 when the instance has no writes for the block (its node did not subscribe to state_writes at that height); verifiers then report the diff unnamed. Near the tip the block at a height can change, so this is short-cached. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Path parameters

heightintegerrequired#

Stacks block height.

Returns

The Block state writes object.

  • 200The block's writes
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404No state_writes for a canonical block at that height
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)

MARF inclusion proof

GET/v1/proofs/marf/{path}
Open .md

A value and its MARF inclusion proof as of block tip, from the node (/v2/clarity/marf/{path}?proof=1). Keys the node cannot serve because they hold no stored value string, such as the MARF's own __MARF_BLOCK_HEIGHT_TO_HASH::<height>, are proven by the proof sidecar from the MARF itself: same proof bytes, and data is the raw 40-byte leaf value. Fold the proof to a root and compare it with tip's state_index_root. Inclusion only: a missing key is a 404, not a proof of absence. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

Path parameters

pathstringrequired#

The MARF key hash: 64 hex characters, 0x optional.

Query parameters

tipstringrequired#

index_block_hash of the block to prove against, 64 hex characters, 0x optional. Pinned, so the answer is immutable.

Returns

The MARF proof object.

  • 200The value and its proof
  • 400A path or query parameter is malformed (VALIDATION_ERROR): hashes must be exact-length hex, heights non-negative integers
  • 401This bind requires the instance token, and it was missing or wrong
  • 404No value at that path as of tip
  • 429Rate limited; retry after Retry-After seconds
  • 502The node or proof sidecar could not be reached, or answered with an unexpected status (PROOF_SOURCE_ERROR)
Open .md

A sortition's consensus-hash preimage and the Bitcoin block it commits to.

Returned by Burn block behind a consensus hash

Attributes

consensus_hashstring#

The consensus hash asked about, hex.

burn_heightinteger#

Bitcoin height of the sortition.

bitcoin_block_hashstring#

Bitcoin block hash, display order. Equals preimage bytes 4..36.

preimagestring#

Hex bytes whose RIPEMD160(SHA256(·)) is consensus_hash.

Open .md

Consecutive raw Bitcoin block headers.

Returned by Bitcoin block headers

Attributes

frominteger#

Bitcoin height of the first header.

headersarray of string#

80-byte headers, hex, in height order.

Open .md

A Bitcoin transaction, the merkle branch to its block's root, and that block's header.

Returned by Bitcoin transaction proof

Attributes

txidstringrequired#

The txid, display order, hex.

block_hashstringrequired#

Hash of header, display order, hex.

block_heightintegerrequired#

Bitcoin height of the confirming block.

headerstringrequired#

The block's 80-byte header, hex.

raw_txstringrequired#

The serialized transaction, witness included, hex.

tx_indexintegerrequired#

Position of the transaction in the block.

tx_countintegerrequired#

Number of transactions in the block.

siblingsarray of stringrequired#

Merkle branch from the leaf up, internal byte order, hex: ceil(log2(tx_count)) hashes.

Open .md

One block's MARF writes, whole, in write order.

Returned by State writes of a block

Attributes

block_heightintegerrequired#

Stacks block height.

state_writesarray of objectrequired#

Every write of the block, ordinal 0 first.

Open .md

A MARF value and its inclusion proof, as the node returns them.

Returned by MARF inclusion proof

Attributes

datastring#

The stored value, hex (0x-prefixed). For keys with no stored value (__MARF_*), the raw 40-byte leaf value instead.

proofstring#

Serialized MARF proof, hex (0x-prefixed). Proof bytes are malleable: hash the parsed content, never use them as an id.

Edit on GitHub