Blocks

Operations for retrieving block and microblock data.

Get Nakamoto block by ID

get
/v3/blocks/{block_id}

Get a specific Nakamoto block (Stacks 3.x+) by its index block hash. This endpoint streams the block data from the Nakamoto staging blocks database where Nakamoto blocks are stored with additional metadata including tenure information.

Compatibility: Works with Nakamoto blocks only. For Stacks 2.x blocks, use /v2/blocks/{block_id}.

Path parameters
block_idstringRequired

The block"s ID hash

Responses
200

The raw SIP-003-encoded block will be returned.

application/octet-stream
Responsestring · binary
get
/v3/blocks/{block_id}

Fetch a Nakamoto block by its height and optional tip

get
/v3/blocks/height/{block_height}

Fetch a Nakamoto block by its height and optional tip.

Path parameters
block_heightintegerRequired

The block's height

Query parameters
tipstring · max: 64Optional

Stacks chain tip to query from. Options:

  • (empty/omitted): Use latest anchored tip (canonical confirmed state)
  • latest: Use latest known tip including unconfirmed microblocks
  • {block_id}: Use specific block ID (64 hex characters)
Example: latestPattern: ^(latest|[0-9a-f]{64})?$
Responses
200

The raw SIP-003-encoded block will be returned.

application/octet-stream
Responsestring · binary
get
/v3/blocks/height/{block_height}

Fetch metadata about the ongoing Nakamoto tenure

get
/v3/tenures/info

Fetch metadata about the ongoing Nakamoto tenure. This information is sufficient to obtain and authenticate the highest complete tenure, as well as obtain new tenure blocks.

Responses
200

Metadata about the ongoing tenure

application/json
get
/v3/tenures/info
200

Metadata about the ongoing tenure

Fetch a sequence of Nakamoto blocks in a tenure

get
/v3/tenures/{block_id}

Fetch a sequence of Nakamoto blocks in a tenure. The blocks will be served in order from highest to lowest. The blocks will be encoded in their SIP-003 wire format, and concatenated together.

Path parameters
block_idstringRequired

The tenure-start block ID of the tenure to query

Query parameters
stopstringOptional

The block ID hash of the highest block in this tenure that is already known to the caller. Neither the corresponding block nor any of its ancestors will be served. This is used to fetch tenure blocks that the caller does not have.

Responses
200

SIP-003-encoded Nakamoto blocks, concatenated together

application/octet-stream
Responsestring · binary
get
/v3/tenures/{block_id}
200

SIP-003-encoded Nakamoto blocks, concatenated together

Get the list of Stacks blocks in a tenure

get
/v3/tenures/blocks/{consensus_hash}

Get the list of blocks in a tenure. The blocks will be shown in order from highest to lowest.

Path parameters
consensus_hashstringRequired

The hex-encoded consensus hash of the tenure to query (40 hexadecimal characters, without 0x prefix)

Pattern: ^[0-9a-f]{40}$
Responses
200

List of Stacks blocks in the tenure

application/json
get
/v3/tenures/blocks/{consensus_hash}

Get the list of Nakamoto Stacks blocks in a tenure given Bitcoin block hash

get
/v3/tenures/blocks/hash/{burnchain_block_hash}

Get the list of Nakamoto blocks in a tenure given the Bitcoin block hash. The blocks will be shown in order from highest to lowest. This is only for Nakamoto blocks, Epoch2 ones will not be shown.

Path parameters
burnchain_block_hashstringRequired

The hex-encoded Bitcoin block hash of the tenure to query (64 hexadecimal characters, without 0x prefix)

Pattern: ^[0-9a-f]{64}$
Responses
200

List of Stacks blocks in the tenure

application/json
get
/v3/tenures/blocks/hash/{burnchain_block_hash}

Get the list of Nakamoto Stacks blocks in a tenure given Bitcoin block height

get
/v3/tenures/blocks/height/{burnchain_block_height}

Get the list of Nakamoto blocks in a tenure given the Bitcoin block height. The blocks will be shown in order from highest to lowest. This is only for Nakamoto blocks, Epoch2 ones will not be shown.

Path parameters
burnchain_block_heightintegerRequired

The Bitcoin block height of the tenure to query

Responses
200

List of Stacks blocks in the tenure

application/json
get
/v3/tenures/blocks/height/{burnchain_block_height}

Get latest sortition information

get
/v3/sortitions

Get sortition information about the latest burnchain block processed by this node. Returns a single-element array with the latest sortition.

Responses
200

Latest sortition information

application/json
get
/v3/sortitions

Get latest and last winning sortitions

get
/v3/sortitions/latest_and_last

Get sortition information about the latest burn block with a winning miner AND the previous such burn block. Returns an array with two sortition objects.

Responses
200

Latest and last sortition information

application/json
get
/v3/sortitions/latest_and_last

Get sortition by consensus hash

get
/v3/sortitions/consensus/{consensus_hash}

Get sortition information for a specific consensus hash. Returns a single-element array with the matching sortition.

Path parameters
consensus_hashstringRequired

Hex-encoded consensus hash (40 characters)

Pattern: ^(0x)?[0-9a-f]{40}$
Responses
200

Sortition information for the consensus hash

application/json
get
/v3/sortitions/consensus/{consensus_hash}

Get sortition by burn header hash

get
/v3/sortitions/burn/{burn_header_hash}

Get sortition information for a specific burn header hash. Returns a single-element array with the matching sortition.

Path parameters
burn_header_hashstringRequired

Hex-encoded burn header hash (64 characters)

Pattern: ^(0x)?[0-9a-f]{64}$
Responses
200

Sortition information for the burn header hash

application/json
get
/v3/sortitions/burn/{burn_header_hash}

Get sortition by burn block height

get
/v3/sortitions/burn_height/{height}

Get sortition information for a specific burn block height. Returns a single-element array with the matching sortition.

Path parameters
heightintegerRequired

Burn block height (integer)

Responses
200

Sortition information for the burn block height

application/json
get
/v3/sortitions/burn_height/{height}

Get number of blocks signed by signer during a given reward cycle

get
/v3/signer/{signer_pubkey}/{cycle_number}

Get number of blocks signed by signer during a given reward cycle

Path parameters
signer_pubkeystringRequired

Hex-encoded compressed Secp256k1 public key of signer

Pattern: ^0[23][0-9a-f]{64}$
cycle_numberintegerRequired

Reward cycle number

Query parameters
tipstring · max: 64Optional

Stacks chain tip to query from. Options:

  • (empty/omitted): Use latest anchored tip (canonical confirmed state)
  • latest: Use latest known tip including unconfirmed microblocks
  • {block_id}: Use specific block ID (64 hex characters)
Example: latestPattern: ^(latest|[0-9a-f]{64})?$
Responses
200

Number of blocks signed

application/json
get
/v3/signer/{signer_pubkey}/{cycle_number}
200

Number of blocks signed

Get stream of confirmed microblocks (Epoch 2.x)

get
/v2/microblocks/confirmed/{block_id}

Get microblocks that were confirmed by the given anchored block. The microblocks are returned as a binary stream of concatenated microblock data.

Path parameters
block_idstringRequired

Hex-encoded Stacks block ID (64 characters)

Pattern: ^[0-9a-f]{64}$
Query parameters
tipstring · max: 64Optional

Stacks chain tip to query from. Options:

  • (empty/omitted): Use latest anchored tip (canonical confirmed state)
  • latest: Use latest known tip including unconfirmed microblocks
  • {block_id}: Use specific block ID (64 hex characters)
Example: latestPattern: ^(latest|[0-9a-f]{64})?$
Responses
200

Stream of confirmed microblocks

application/octet-stream
Responsestring · binary
get
/v2/microblocks/confirmed/{block_id}

Get a stream of microblocks beginning with the given microblock (Epoch 2.x).

get
/v2/microblocks/{microblock_id}
Path parameters
microblock_idstringRequired

Hex-encoded microblock hash (64 characters)

Pattern: ^[0-9a-f]{64}$
Responses
200

The microblock data

application/octet-stream
Responsestring · binary
get
/v2/microblocks/{microblock_id}

Get stream of unconfirmed microblocks (Epoch 2.x)

get
/v2/microblocks/unconfirmed/{block_id}/{seq}

Get unconfirmed microblocks starting from a specific sequence number. The microblocks are returned as a binary stream.

Path parameters
block_idstringRequired

Hex-encoded parent block ID (64 characters)

Pattern: ^[0-9a-f]{64}$
seqinteger · max: 65535Required

Starting sequence number (0-65535)

Responses
200

Stream of unconfirmed microblocks

application/octet-stream
Responsestring · binary
get
/v2/microblocks/unconfirmed/{block_id}/{seq}

Submit a microblock (Epoch 2.x)

post
/v2/microblocks

Submit a microblock to the node for validation and relay. The body must be the SIP-003 binary serialization of a Microblock and sent with Content-Type: application/octet-stream.

Body
string · binaryOptional
Responses
200

Index-block hash of the accepted microblock

application/json
Responsestring

32-byte block-header hash (hex)

Pattern: ^[0-9a-f]{64}$
post
/v2/microblocks

Get recent 2.x block headers

get
/v2/headers/{quantity}

Deprecated: This endpoint is deprecated since Nakamoto.** Stream (as a JSON array) up to quantity most recent anchored Stacks block headers. The result is ordered from the current tip backwards.

Path parameters
quantityinteger · min: 1 · max: 256Required

Number of headers to return (max 256)

Query parameters
tipstring · max: 64Optional

Stacks chain tip to query from. Options:

  • (empty/omitted): Use latest anchored tip (canonical confirmed state)
  • latest: Use latest known tip including unconfirmed microblocks
  • {block_id}: Use specific block ID (64 hex characters)
Example: latestPattern: ^(latest|[0-9a-f]{64})?$
Responses
200

Array of block headers

application/json
get
/v2/headers/{quantity}

Get Stacks 2.x block by ID

get
/v2/blocks/{block_id}

Get a specific Stacks 2.x era block by its block ID. This endpoint streams the block data from the filesystem storage where traditional Stacks blocks are stored as individual files.

Compatibility: Works with all Stacks 2.x blocks. For Nakamoto blocks (Stacks 3.x+), use /v3/blocks/{block_id}.

Path parameters
block_idstringRequired

Hex-encoded block ID (64 characters)

Pattern: ^[0-9a-f]{64}$
Responses
200

The block data

application/octet-stream
Responsestring · binary
get
/v2/blocks/{block_id}

Get tenure fork information

get
/v3/tenures/fork_info/{start}/{stop}

Get information about tenure forking between two consensus hashes. This is used to identify conflicting tenures in the Nakamoto consensus.

Path parameters
startstringRequired

Starting consensus hash (40 hexadecimal characters, without 0x prefix)

Pattern: ^[0-9a-f]{40}$
stopstringRequired

Stopping consensus hash (40 hexadecimal characters, without 0x prefix)

Pattern: ^[0-9a-f]{40}$
Responses
200

Ordered list of tenure fork events from stop back to (and including) start

application/json
get
/v3/tenures/fork_info/{start}/{stop}

Get tenure tip

get
/v3/tenures/tip/{consensus_hash}

Get the tip block of a tenure identified by consensus hash.

Path parameters
consensus_hashstringRequired

Consensus hash (40 characters)

Pattern: ^[0-9a-f]{40}$
Responses
200

Tenure tip block information

application/json
Responseone of

JSON encoding of StacksBlockHeaderTypes returned by /v3/tenures/tip. Exactly one variant property will be present: either Epoch2 or Nakamoto.

or
get
/v3/tenures/tip/{consensus_hash}

Upload a Nakamoto block

post
/v3/blocks/upload

Upload a Nakamoto block to the node for processing.

  • Body - must be the binary (SIP-003) serialization of a NakamotoBlock.

  • Authentication - only required when the query parameter broadcast=1 is supplied. In that case the caller must include an Authorization header.

Authorizations
authorizationstringOptional

Plain-text secret value that must exactly equal the node's configured password, which is set as connection_options.auth_token in the node's configuration file.

Query parameters
broadcaststring · enumOptional

If set to "1" the node will broadcast the uploaded block to peers. When present the request must include a valid Authorization header.

Possible values:
Body
string · binaryOptional

Binary SIP-003 encoding of a NakamotoBlock

Responses
200

Block upload result.

application/json
post
/v3/blocks/upload

Replay mining of a block and returns its content

get
/v3/blocks/replay/{block_id}

Replay the mining of a block (no data is written in the MARF) and returns its content.

Authorizations
authorizationstringRequired

Plain-text secret value that must exactly equal the node's configured password, which is set as connection_options.auth_token in the node's configuration file.

Path parameters
block_idstringRequired

The block ID hash

Pattern: ^[0-9a-f]{64}$
Responses
200

Content of the replayed block

application/json
get
/v3/blocks/replay/{block_id}

Last updated

Was this helpful?