# Blocks

Operations for retrieving block and microblock data.

## Get Nakamoto block by 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}\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/blocks/{block_id}":{"get":{"summary":"Get Nakamoto block by ID","tags":["Blocks"],"operationId":"getNakamotoBlockById","description":"Get a specific Nakamoto block (Stacks 3.x+) by its index block hash. This endpoint streams\nthe block data from the Nakamoto staging blocks database where Nakamoto blocks are stored\nwith additional metadata including tenure information.\n\n**Compatibility**: Works with Nakamoto blocks only. For Stacks 2.x blocks, use `/v2/blocks/{block_id}`.\n","parameters":[{"name":"block_id","in":"path","description":"The block's ID hash (64-character hex string)","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$","minLength":64,"maxLength":64}}],"responses":{"200":{"description":"The raw SIP-003-encoded block will be returned.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"405":{"description":"Method Not Allowed","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Fetch a Nakamoto block by its height and optional tip

> Fetch a Nakamoto block by its height and optional tip.

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/blocks/height/{block_height}":{"get":{"summary":"Fetch a Nakamoto block by its height and optional tip","tags":["Blocks"],"operationId":"getNakamotoBlockByHeight","description":"Fetch a Nakamoto block by its height and optional tip.","parameters":[{"name":"block_height","in":"path","description":"The block's height (max 4294967295)","required":true,"schema":{"type":"integer","minimum":0,"maximum":4294967295}},{"name":"tip","in":"query","schema":{"type":"string","pattern":"^(latest|[0-9a-f]{64})?$","maxLength":64},"description":"Stacks chain tip to query from. Options:\n- (empty/omitted): Use latest anchored tip (canonical confirmed state)\n- `latest`: Use latest known tip including unconfirmed microblocks\n- `{block_id}`: Use specific block ID (64 hex characters)\n"}],"responses":{"200":{"description":"The raw SIP-003-encoded block will be returned.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Fetch metadata about the ongoing Nakamoto tenure

> 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.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/tenures/info":{"get":{"summary":"Fetch metadata about the ongoing Nakamoto tenure","tags":["Blocks"],"operationId":"getTenureInfo","description":"Fetch metadata about the ongoing Nakamoto tenure. This information is\nsufficient to obtain and authenticate the highest complete tenure, as\nwell as obtain new tenure blocks.\n","responses":{"200":{"description":"Metadata about the ongoing tenure","content":{"application/json":{"schema":{"type":"object","properties":{"consensus_hash":{"type":"string","description":"Consensus hash of the tenure","pattern":"^[0-9a-f]{40}$"},"tenure_start_block_id":{"type":"string","description":"Block ID where the tenure started","pattern":"^[0-9a-f]{64}$"},"parent_consensus_hash":{"type":"string","description":"Parent consensus hash","pattern":"^[0-9a-f]{40}$"},"parent_tenure_start_block_id":{"type":"string","description":"Parent tenure start block ID","pattern":"^[0-9a-f]{64}$"},"tip_block_id":{"type":"string","description":"Current tip block ID","pattern":"^[0-9a-f]{64}$"},"tip_height":{"type":"integer","minimum":0,"description":"Current tip height"},"reward_cycle":{"type":"integer","minimum":0,"description":"Current reward cycle"}}}}}}}}}}}
```

## Fetch a sequence of Nakamoto blocks in a tenure

> 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.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/tenures/{block_id}":{"get":{"summary":"Fetch a sequence of Nakamoto blocks in a tenure","tags":["Blocks"],"operationId":"getTenures","description":"Fetch a sequence of Nakamoto blocks in a tenure. The blocks will be\nserved in order from highest to lowest. The blocks will be encoded in\ntheir SIP-003 wire format, and concatenated together.\n","parameters":[{"name":"block_id","in":"path","description":"The tenure-start block ID of the tenure to query (64-character hex string)","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$","minLength":64,"maxLength":64}},{"name":"stop","in":"query","description":"The block ID hash of the highest block in this tenure that is already\nknown to the caller. Neither the corresponding block nor any of its\nancestors will be served. This is used to fetch tenure blocks that the\ncaller does not have.\n","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$","minLength":64,"maxLength":64}}],"responses":{"200":{"description":"SIP-003-encoded Nakamoto blocks, concatenated together","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"405":{"description":"Method Not Allowed","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get the list of Stacks blocks in a tenure

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/tenures/blocks/{consensus_hash}":{"get":{"summary":"Get the list of Stacks blocks in a tenure","tags":["Blocks"],"operationId":"getTenureBlocks","description":"Get the list of blocks in a tenure. The blocks will be\nshown in order from highest to lowest.\n","parameters":[{"name":"consensus_hash","in":"path","description":"The hex-encoded consensus hash of the tenure to query (40 hexadecimal characters, without 0x prefix)","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{40}$"}}],"responses":{"200":{"description":"List of Stacks blocks in the tenure","content":{"application/json":{"schema":{"type":"object","properties":{"consensus_hash":{"type":"string","description":"Consensus hash of the tenure","pattern":"^[0-9a-f]{40}$"},"burn_block_height":{"type":"integer","description":"Height of the Bitcoin block","format":"uint64"},"burn_block_hash":{"type":"string","description":"Hash of the Bitcoin block","pattern":"^[0-9a-f]{64}$"},"stacks_blocks":{"type":"array","items":{"type":"object","properties":{"block_id":{"type":"string","description":"Block ID (index block hash)","pattern":"^[0-9a-f]{64}$"},"block_hash":{"type":"string","description":"Hash of the block","pattern":"^[0-9a-f]{64}$"},"header_type":{"type":"string","description":"Type of block (currently \"epoch2\" or \"nakamoto\")"},"height":{"type":"integer","description":"Height of the block","format":"uint64"},"parent_block_id":{"type":"string","description":"Block ID (index block hash) of the parent","pattern":"^[0-9a-f]{64}$"}}}}}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get the list of Nakamoto Stacks blocks in a tenure given Bitcoin 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.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/tenures/blocks/hash/{burnchain_block_hash}":{"get":{"summary":"Get the list of Nakamoto Stacks blocks in a tenure given Bitcoin block hash","tags":["Blocks"],"operationId":"getTenureBlocksByHash","description":"Get the list of Nakamoto blocks in a tenure given the Bitcoin block hash. The blocks will be\nshown in order from highest to lowest. This is only for Nakamoto blocks, Epoch2 ones will not be shown.\n","parameters":[{"name":"burnchain_block_hash","in":"path","description":"The hex-encoded Bitcoin block hash of the tenure to query (64 hexadecimal characters, without 0x prefix)","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"List of Stacks blocks in the tenure","content":{"application/json":{"schema":{"type":"object","properties":{"consensus_hash":{"type":"string","description":"Consensus hash of the tenure","pattern":"^[0-9a-f]{40}$"},"burn_block_height":{"type":"integer","description":"Height of the Bitcoin block","format":"uint64"},"burn_block_hash":{"type":"string","description":"Hash of the Bitcoin block","pattern":"^[0-9a-f]{64}$"},"stacks_blocks":{"type":"array","items":{"type":"object","properties":{"block_id":{"type":"string","description":"Block ID (index block hash)","pattern":"^[0-9a-f]{64}$"},"block_hash":{"type":"string","description":"Hash of the block","pattern":"^[0-9a-f]{64}$"},"header_type":{"type":"string","description":"Type of block (currently \"epoch2\" or \"nakamoto\")"},"height":{"type":"integer","description":"Height of the block","format":"uint64"},"parent_block_id":{"type":"string","description":"Block ID (index block hash) of the parent","pattern":"^[0-9a-f]{64}$"}}}}}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get the list of Nakamoto Stacks blocks in a tenure given Bitcoin 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.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/tenures/blocks/height/{burnchain_block_height}":{"get":{"summary":"Get the list of Nakamoto Stacks blocks in a tenure given Bitcoin block height","tags":["Blocks"],"operationId":"getTenureBlocksByHeight","description":"Get the list of Nakamoto blocks in a tenure given the Bitcoin block height. The blocks will be\nshown in order from highest to lowest. This is only for Nakamoto blocks, Epoch2 ones will not be shown.\n","parameters":[{"name":"burnchain_block_height","in":"path","description":"The Bitcoin block height of the tenure to query","required":true,"schema":{"type":"integer","minimum":0,"maximum":4294967295}}],"responses":{"200":{"description":"List of Stacks blocks in the tenure","content":{"application/json":{"schema":{"type":"object","properties":{"consensus_hash":{"type":"string","description":"Consensus hash of the tenure","pattern":"^[0-9a-f]{40}$"},"burn_block_height":{"type":"integer","description":"Height of the Bitcoin block","format":"uint64"},"burn_block_hash":{"type":"string","description":"Hash of the Bitcoin block","pattern":"^[0-9a-f]{64}$"},"stacks_blocks":{"type":"array","items":{"type":"object","properties":{"block_id":{"type":"string","description":"Block ID (index block hash)","pattern":"^[0-9a-f]{64}$"},"block_hash":{"type":"string","description":"Hash of the block","pattern":"^[0-9a-f]{64}$"},"header_type":{"type":"string","description":"Type of block (currently \"epoch2\" or \"nakamoto\")"},"height":{"type":"integer","description":"Height of the block","format":"uint64"},"parent_block_id":{"type":"string","description":"Block ID (index block hash) of the parent","pattern":"^[0-9a-f]{64}$"}}}}}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get latest sortition information

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/sortitions":{"get":{"summary":"Get latest sortition information","tags":["Blocks"],"operationId":"getLatestSortitions","description":"Get sortition information about the latest burnchain block processed by this node.\nReturns a single-element array with the latest sortition.\n","responses":{"200":{"description":"Latest sortition information","content":{"application/json":{"schema":{"description":"Array of sortition information objects from the burnchain","type":"array","$defs":{"Sortition":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}},"items":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get latest and last winning sortitions

> 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.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/sortitions/latest_and_last":{"get":{"summary":"Get latest and last winning sortitions","tags":["Blocks"],"operationId":"getLatestAndLastWinningSortitions","description":"Get sortition information about the latest burn block with a winning miner\nAND the previous such burn block. Returns an array with two sortition objects.\n","responses":{"200":{"description":"Latest and last sortition information","content":{"application/json":{"schema":{"description":"Array of sortition information objects from the burnchain","type":"array","$defs":{"Sortition":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}},"items":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get sortition by consensus hash

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/sortitions/consensus/{consensus_hash}":{"get":{"summary":"Get sortition by consensus hash","tags":["Blocks"],"operationId":"getSortitionByConsensusHash","description":"Get sortition information for a specific consensus hash.\nReturns a single-element array with the matching sortition.\n","parameters":[{"name":"consensus_hash","in":"path","required":true,"description":"Hex-encoded consensus hash (40 characters)","schema":{"type":"string","pattern":"^[0-9a-f]{40}$"}}],"responses":{"200":{"description":"Sortition information for the consensus hash","content":{"application/json":{"schema":{"description":"Array of sortition information objects from the burnchain","type":"array","$defs":{"Sortition":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}},"items":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get sortition by burn header hash

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/sortitions/burn/{burn_header_hash}":{"get":{"summary":"Get sortition by burn header hash","tags":["Blocks"],"operationId":"getSortitionByBurnHeaderHash","description":"Get sortition information for a specific burn header hash.\nReturns a single-element array with the matching sortition.\n","parameters":[{"name":"burn_header_hash","in":"path","required":true,"description":"Hex-encoded burn header hash (64 characters)","schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"Sortition information for the burn header hash","content":{"application/json":{"schema":{"description":"Array of sortition information objects from the burnchain","type":"array","$defs":{"Sortition":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}},"items":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get sortition by burn block height

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/sortitions/burn_height/{height}":{"get":{"summary":"Get sortition by burn block height","tags":["Blocks"],"operationId":"getSortitionByBurnBlockHeight","description":"Get sortition information for a specific burn block height.\nReturns a single-element array with the matching sortition.\n","parameters":[{"name":"height","in":"path","required":true,"description":"Burn block height (integer, max 4294967295)","schema":{"type":"integer","minimum":0,"maximum":4294967295}}],"responses":{"200":{"description":"Sortition information for the burn block height","content":{"application/json":{"schema":{"description":"Array of sortition information objects from the burnchain","type":"array","$defs":{"Sortition":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}},"items":{"type":"object","description":"Information about a burnchain sortition event","properties":{"burn_block_hash":{"type":"string","description":"The burnchain header hash of the block that triggered this event","pattern":"^0x[0-9a-f]{64}$"},"burn_block_height":{"type":"integer","description":"The burn height of the block that triggered this event","minimum":0},"burn_header_timestamp":{"type":"integer","description":"The burn block time of the sortition (Unix timestamp)","minimum":0},"sortition_id":{"type":"string","description":"This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{64}$"},"parent_sortition_id":{"type":"string","description":"The parent of this burn block's Sortition ID","pattern":"^0x[0-9a-f]{64}$"},"consensus_hash":{"type":"string","description":"The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.","pattern":"^0x[0-9a-f]{40}$"},"was_sortition":{"type":"boolean","description":"Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."},"miner_pk_hash160":{"type":["string","null"],"description":"If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.","pattern":"^0x[0-9a-f]{40}$"},"stacks_parent_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.","pattern":"^0x[0-9a-f]{40}$"},"last_sortition_ch":{"type":["string","null"],"description":"If sortition occurred, this will be the consensus hash of the most recent sortition before this one.","pattern":"^0x[0-9a-f]{40}$"},"committed_block_hash":{"type":["string","null"],"description":"In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.","pattern":"^0x[0-9a-f]{64}$"},"vrf_seed":{"type":["string","null"],"description":"This is the VRF seed generated by this sortition","pattern":"^0x[0-9a-f]{64}$"}},"required":["burn_block_hash","burn_block_height","burn_header_timestamp","sortition_id","parent_sortition_id","consensus_hash","was_sortition"]}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

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

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."},{"name":"Signers","description":"Endpoints for retrieving signer information."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/signer/{signer_pubkey}/{cycle_number}":{"get":{"summary":"Get number of blocks signed by signer during a given reward cycle","tags":["Blocks","Signers"],"operationId":"getSignerBlocksSigned","description":"Get number of blocks signed by signer during a given reward cycle","parameters":[{"name":"signer_pubkey","in":"path","required":true,"description":"Hex-encoded compressed Secp256k1 public key of signer","schema":{"type":"string","pattern":"^0[23][0-9a-f]{64}$"}},{"name":"cycle_number","in":"path","required":true,"description":"Reward cycle number","schema":{"type":"integer","minimum":0}},{"name":"tip","in":"query","schema":{"type":"string","pattern":"^(latest|[0-9a-f]{64})?$","maxLength":64},"description":"Stacks chain tip to query from. Options:\n- (empty/omitted): Use latest anchored tip (canonical confirmed state)\n- `latest`: Use latest known tip including unconfirmed microblocks\n- `{block_id}`: Use specific block ID (64 hex characters)\n"}],"responses":{"200":{"description":"Number of blocks signed","content":{"application/json":{"schema":{"type":"object","properties":{"blocks_signed":{"type":"integer","description":"Number of blocks signed by this signer"}},"required":["blocks_signed"]}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get stream of confirmed microblocks (Epoch 2.x)

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."},{"name":"Microblocks","description":"Operations for retrieving and submitting microblocks."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v2/microblocks/confirmed/{block_id}":{"get":{"summary":"Get stream of confirmed microblocks (Epoch 2.x)","tags":["Blocks","Microblocks"],"operationId":"getConfirmedMicroblocks","description":"Get microblocks that were confirmed by the given anchored block.\nThe microblocks are returned as a binary stream of concatenated microblock data.\n","parameters":[{"name":"block_id","in":"path","required":true,"description":"Hex-encoded Stacks block ID (64 characters)","schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},{"name":"tip","in":"query","schema":{"type":"string","pattern":"^(latest|[0-9a-f]{64})?$","maxLength":64},"description":"Stacks chain tip to query from. Options:\n- (empty/omitted): Use latest anchored tip (canonical confirmed state)\n- `latest`: Use latest known tip including unconfirmed microblocks\n- `{block_id}`: Use specific block ID (64 hex characters)\n"}],"responses":{"200":{"description":"Stream of confirmed microblocks","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## GET /v2/microblocks/{microblock\_id}

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."},{"name":"Microblocks","description":"Operations for retrieving and submitting microblocks."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v2/microblocks/{microblock_id}":{"get":{"summary":"Get a stream of microblocks beginning\nwith the given microblock (Epoch 2.x).\n","tags":["Blocks","Microblocks"],"operationId":"getMicroblockById","parameters":[{"name":"microblock_id","in":"path","required":true,"description":"Hex-encoded microblock hash (64 characters)","schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"The microblock data","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get stream of unconfirmed microblocks (Epoch 2.x)

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."},{"name":"Microblocks","description":"Operations for retrieving and submitting microblocks."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v2/microblocks/unconfirmed/{block_id}/{seq}":{"get":{"summary":"Get stream of unconfirmed microblocks (Epoch 2.x)","tags":["Blocks","Microblocks"],"operationId":"getUnconfirmedMicroblocks","description":"Get unconfirmed microblocks starting from a specific sequence number.\nThe microblocks are returned as a binary stream.\n","parameters":[{"name":"block_id","in":"path","required":true,"description":"Hex-encoded parent block ID (64 characters)","schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},{"name":"seq","in":"path","required":true,"description":"Starting sequence number (0-65535)","schema":{"type":"integer","minimum":0,"maximum":65535}}],"responses":{"200":{"description":"Stream of unconfirmed microblocks","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Submit a microblock (Epoch 2.x)

> 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\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."},{"name":"Microblocks","description":"Operations for retrieving and submitting microblocks."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v2/microblocks":{"post":{"summary":"Submit a microblock (Epoch 2.x)","tags":["Blocks","Microblocks"],"operationId":"postMicroblock","description":"Submit a microblock to the node for validation and relay.\nThe body **must** be the SIP-003 binary serialization of a `Microblock`\nand sent with `Content-Type: application/octet-stream`.\n","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","minLength":1}}}},"responses":{"200":{"description":"Index-block hash of the accepted microblock","content":{"application/json":{"schema":{"type":"string","description":"32-byte block-header hash (hex)","pattern":"^[0-9a-f]{64}$"}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get recent 2.x block headers

> \*\*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.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v2/headers/{quantity}":{"get":{"summary":"Get recent 2.x block headers","tags":["Blocks"],"operationId":"getBlockHeaders","description":"**Deprecated**: This endpoint is deprecated since Nakamoto.**\nStream (as a JSON array) up to `quantity` most recent anchored Stacks block headers.\nThe result is ordered from the current tip backwards.\n","parameters":[{"name":"quantity","in":"path","required":true,"description":"Number of headers to return (max 256)","schema":{"type":"integer","minimum":1,"maximum":256}},{"name":"tip","in":"query","schema":{"type":"string","pattern":"^(latest|[0-9a-f]{64})?$","maxLength":64},"description":"Stacks chain tip to query from. Options:\n- (empty/omitted): Use latest anchored tip (canonical confirmed state)\n- `latest`: Use latest known tip including unconfirmed microblocks\n- `{block_id}`: Use specific block ID (64 hex characters)\n"}],"responses":{"200":{"description":"Array of block headers","content":{"application/json":{"schema":{"type":"array","description":"JSON array returned by /v2/headers/{quantity}. Each entry is an ExtendedStacksHeader.","items":{"type":"object","required":["consensus_hash","header","parent_block_id"],"properties":{"consensus_hash":{"type":"string","description":"20-byte burn-chain consensus hash (hex, no 0x prefix)","pattern":"^[0-9a-f]{40}$"},"header":{"type":"string","description":"Hex-encoded SIP-003 serialization of the Stacks block header","pattern":"^[0-9a-f]+$"},"parent_block_id":{"type":"string","description":"32-byte index-block ID of the parent Stacks block (hex)","pattern":"^[0-9a-f]{64}$"}},"additionalProperties":false}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get Stacks 2.x block by 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}\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v2/blocks/{block_id}":{"get":{"summary":"Get Stacks 2.x block by ID","tags":["Blocks"],"operationId":"getLegacyBlockById","description":"Get a specific Stacks 2.x era block by its block ID. This endpoint streams the block data\nfrom the filesystem storage where traditional Stacks blocks are stored as individual files.\n\n**Compatibility**: Works with all Stacks 2.x blocks. For Nakamoto blocks (Stacks 3.x+), use `/v3/blocks/{block_id}`.\n","parameters":[{"name":"block_id","in":"path","required":true,"description":"Hex-encoded block ID (64 characters)","schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"The block data","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get tenure fork information

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/tenures/fork_info/{start}/{stop}":{"get":{"summary":"Get tenure fork information","tags":["Blocks"],"operationId":"getTenureForkInfo","description":"Get information about tenure forking between two consensus hashes.\nThis is used to identify conflicting tenures in the Nakamoto consensus.\n","parameters":[{"name":"start","in":"path","required":true,"description":"Starting consensus hash (40 hexadecimal characters, without 0x prefix)","schema":{"type":"string","pattern":"^[0-9a-f]{40}$"}},{"name":"stop","in":"path","required":true,"description":"Stopping consensus hash (40 hexadecimal characters, without 0x prefix)","schema":{"type":"string","pattern":"^[0-9a-f]{40}$"}}],"responses":{"200":{"description":"Ordered list of tenure fork events from `stop` back to (and including) `start`","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"Information about a tenure used for fork-detection.","required":["burn_block_hash","burn_block_height","sortition_id","parent_sortition_id","consensus_hash","was_sortition"],"properties":{"burn_block_hash":{"type":"string","description":"0x-prefixed 32-byte Bitcoin block hash that triggered the tenure event","pattern":"^0x[0-9a-fA-F]{64}$"},"burn_block_height":{"type":"integer","format":"uint64"},"sortition_id":{"type":"string","description":"0x-prefixed 32-byte sortition ID (unique across PoX and Bitcoin forks)","pattern":"^0x[0-9a-fA-F]{64}$"},"parent_sortition_id":{"type":"string","description":"0x-prefixed sortition ID of the parent burn block","pattern":"^0x[0-9a-fA-F]{64}$"},"consensus_hash":{"type":"string","description":"0x-prefixed 20-byte consensus hash identifying the tenure","pattern":"^0x[0-9a-fA-F]{40}$"},"was_sortition":{"type":"boolean","description":"Whether a winning sortition occurred at this burn block"},"first_block_mined":{"type":["string","null"],"description":"0x-prefixed index-block ID of the first Stacks block in the tenure (if any)","pattern":"^0x[0-9a-fA-F]{64}$"},"nakamoto_blocks":{"type":["string","null"],"description":"0x-prefixed SIP-003 binary encoding of all Nakamoto blocks mined in this tenure"}},"additionalProperties":false}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get tenure tip

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/tenures/tip/{consensus_hash}":{"get":{"summary":"Get tenure tip","tags":["Blocks"],"operationId":"getTenureTip","description":"Get the tip block of a tenure identified by consensus hash.\n","parameters":[{"name":"consensus_hash","in":"path","required":true,"description":"Consensus hash (40 characters)","schema":{"type":"string","pattern":"^[0-9a-f]{40}$"}}],"responses":{"200":{"description":"Tenure tip block information","content":{"application/json":{"schema":{"description":"JSON encoding of `StacksBlockHeaderTypes` returned by /v3/tenures/tip.\nExactly one variant property will be present: either `Epoch2` or `Nakamoto`.\n","oneOf":[{"title":"Epoch2HeaderVariant","type":"object","required":["Epoch2"],"additionalProperties":false,"properties":{"Epoch2":{"type":"object","description":"Header structure for a Stacks 2.x anchored block.","required":["version","total_work","proof","parent_block","parent_microblock","parent_microblock_sequence","tx_merkle_root","state_index_root","microblock_pubkey_hash"],"properties":{"version":{"type":"integer","minimum":0},"total_work":{"type":"object","required":["burn","work"],"properties":{"burn":{"type":"integer","format":"uint64"},"work":{"type":"integer","format":"uint64"}}},"proof":{"type":"string","description":"Hex-encoded VRF proof"},"parent_block":{"type":"string","description":"32-byte hex of the parent block header hash"},"parent_microblock":{"type":"string","description":"32-byte hex of the parent microblock header hash"},"parent_microblock_sequence":{"type":"integer"},"tx_merkle_root":{"type":"string","description":"Hex-encoded merkle root of the transactions in the block"},"state_index_root":{"type":"string","description":"Hex-encoded MARF trie root after this block"},"microblock_pubkey_hash":{"type":"string","description":"Hash160 (20-byte hex) of the microblock public key"}},"additionalProperties":false}}},{"title":"NakamotoHeaderVariant","type":"object","required":["Nakamoto"],"additionalProperties":false,"properties":{"Nakamoto":{"type":"object","description":"Header structure for a Nakamoto-epoch Stacks block.","required":["version","chain_length","burn_spent","consensus_hash","parent_block_id","tx_merkle_root","state_index_root","timestamp","miner_signature","signer_signature","pox_treatment"],"properties":{"version":{"type":"integer","minimum":0},"chain_length":{"type":"integer","format":"uint64","description":"Number of ancestor blocks including Stacks 2.x blocks"},"burn_spent":{"type":"integer","format":"uint64","description":"Total BTC spent by the sortition that elected this block"},"consensus_hash":{"type":"string","description":"20-byte hex consensus hash that identifies the tenure"},"parent_block_id":{"type":"string","description":"32-byte hex identifier of the parent block (hash+consensus)"},"tx_merkle_root":{"type":"string","description":"Hex-encoded merkle root of all transactions in the block"},"state_index_root":{"type":"string","description":"Hex-encoded MARF trie root after this block"},"timestamp":{"type":"integer","description":"Unix timestamp (seconds)"},"miner_signature":{"type":"string","description":"Recoverable ECDSA signature from the miner"},"signer_signature":{"type":"array","description":"Signer-set signatures over the block header","items":{"type":"string"}},"pox_treatment":{"type":"string","description":"Bit-vector, hex-encoded, indicating PoX reward treatment"}},"additionalProperties":false}}}]}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Get tenure tip with metadata

> Get the tip block and associated metadata of a tenure identified by consensus hash.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v3/tenures/tip_metadata/{consensus_hash}":{"get":{"summary":"Get tenure tip with metadata","tags":["Blocks"],"operationId":"getTenureTipMetadata","description":"Get the tip block and associated metadata of a tenure identified by consensus hash.\n","parameters":[{"name":"consensus_hash","in":"path","required":true,"description":"Consensus hash (40 characters)","schema":{"type":"string","pattern":"^[0-9a-f]{40}$"}}],"responses":{"200":{"description":"Tenure tip block information","content":{"application/json":{"schema":{"description":"JSON encoding of `BlockHeaderWithMetadata` returned by /v3/tenures/tip_metadata.\nExactly one variant property will be present: either `Epoch2` or `Nakamoto`.\n","type":"object","required":["anchored_header"],"properties":{"burn_view":{"type":"string","description":"Hex-encoded bitcoin block hash"},"anchored_header":{"oneOf":[{"title":"Epoch2HeaderVariant","type":"object","required":["Epoch2"],"additionalProperties":false,"properties":{"Epoch2":{"type":"object","description":"Header structure for a Stacks 2.x anchored block.","required":["version","total_work","proof","parent_block","parent_microblock","parent_microblock_sequence","tx_merkle_root","state_index_root","microblock_pubkey_hash"],"properties":{"version":{"type":"integer","minimum":0},"total_work":{"type":"object","required":["burn","work"],"properties":{"burn":{"type":"integer","format":"uint64"},"work":{"type":"integer","format":"uint64"}}},"proof":{"type":"string","description":"Hex-encoded VRF proof"},"parent_block":{"type":"string","description":"32-byte hex of the parent block header hash"},"parent_microblock":{"type":"string","description":"32-byte hex of the parent microblock header hash"},"parent_microblock_sequence":{"type":"integer"},"tx_merkle_root":{"type":"string","description":"Hex-encoded merkle root of the transactions in the block"},"state_index_root":{"type":"string","description":"Hex-encoded MARF trie root after this block"},"microblock_pubkey_hash":{"type":"string","description":"Hash160 (20-byte hex) of the microblock public key"}},"additionalProperties":false}}},{"title":"NakamotoHeaderVariant","type":"object","required":["Nakamoto"],"additionalProperties":false,"properties":{"Nakamoto":{"type":"object","description":"Header structure for a Nakamoto-epoch Stacks block.","required":["version","chain_length","burn_spent","consensus_hash","parent_block_id","tx_merkle_root","state_index_root","timestamp","miner_signature","signer_signature","pox_treatment"],"properties":{"version":{"type":"integer","minimum":0},"chain_length":{"type":"integer","format":"uint64","description":"Number of ancestor blocks including Stacks 2.x blocks"},"burn_spent":{"type":"integer","format":"uint64","description":"Total BTC spent by the sortition that elected this block"},"consensus_hash":{"type":"string","description":"20-byte hex consensus hash that identifies the tenure"},"parent_block_id":{"type":"string","description":"32-byte hex identifier of the parent block (hash+consensus)"},"tx_merkle_root":{"type":"string","description":"Hex-encoded merkle root of all transactions in the block"},"state_index_root":{"type":"string","description":"Hex-encoded MARF trie root after this block"},"timestamp":{"type":"integer","description":"Unix timestamp (seconds)"},"miner_signature":{"type":"string","description":"Recoverable ECDSA signature from the miner"},"signer_signature":{"type":"array","description":"Signer-set signatures over the block header","items":{"type":"string"}},"pox_treatment":{"type":"string","description":"Bit-vector, hex-encoded, indicating PoX reward treatment"}},"additionalProperties":false}}}]}}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Upload a Nakamoto block

> 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.\
> &#x20; In that case the caller \*\*must\*\* include an \`Authorization\` header.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[{"rpcAuth":[]},{}],"components":{"securitySchemes":{"rpcAuth":{"type":"apiKey","in":"header","name":"authorization","description":"Plain-text secret value that must exactly equal the node's\nconfigured password, which is set as `connection_options.auth_token`\nin the node's configuration file.\n"}}},"paths":{"/v3/blocks/upload":{"post":{"summary":"Upload a Nakamoto block","tags":["Blocks"],"operationId":"uploadNakamotoBlock","description":"Upload a Nakamoto block to the node for processing.\n\n- **Body** - must be the binary (SIP-003) serialization of a `NakamotoBlock`.\n- **Authentication** - only required when the query parameter `broadcast=1` is supplied.\n  In that case the caller **must** include an `Authorization` header.\n","parameters":[{"name":"broadcast","in":"query","description":"If set to `\"1\"` the node will broadcast the uploaded block to peers.\nWhen present the request must include a valid `Authorization` header.\n","schema":{"type":"string","enum":["1"]},"required":false}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","minLength":1,"description":"Binary SIP-003 encoding of a `NakamotoBlock`"}}}},"responses":{"200":{"description":"Block upload result.","content":{"application/json":{"schema":{"type":"object","properties":{"stacks_block_id":{"type":"string","description":"The ID of the uploaded block"},"accepted":{"type":"boolean","description":"Whether the block was accepted"}}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized. Invalid or missing authentication token.","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Replay mining of a block and returns its content

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

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[{"rpcAuth":[]}],"components":{"securitySchemes":{"rpcAuth":{"type":"apiKey","in":"header","name":"authorization","description":"Plain-text secret value that must exactly equal the node's\nconfigured password, which is set as `connection_options.auth_token`\nin the node's configuration file.\n"}}},"paths":{"/v3/blocks/replay/{block_id}":{"get":{"summary":"Replay mining of a block and returns its content","tags":["Blocks"],"operationId":"blockReplay","description":"Replay the mining of a block (no data is written in the MARF) and returns its content.\n","parameters":[{"name":"block_id","in":"path","description":"The block ID hash","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"Content of the replayed block","content":{"application/json":{"schema":{"type":"object","properties":{"block_hash":{"type":"string","description":"Hash of the block","pattern":"^[0-9a-f]{64}$"},"block_id":{"type":"string","description":"Block ID (index block hash)","pattern":"^[0-9a-f]{64}$"},"block_height":{"type":"integer","description":"Height of the Stacks block","format":"uint64"},"consensus_hash":{"type":"string","description":"Consensus hash of the tenure","pattern":"^[0-9a-f]{40}$"},"fees":{"type":"integer","description":"total fees for the block"},"miner_signature":{"type":"string","description":"Uncompressed signature of the miner","pattern":"^[0-9a-f]{130}$"},"parent_block_id":{"type":"string","description":"Parent Block ID (index block hash)","pattern":"^[0-9a-f]{64}$"},"signer_signature":{"type":"array","items":{"type":"string","description":"Uncompressed signature of the signer","pattern":"^[0-9a-f]{130}$"}},"state_index_root":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"block state index root computed from the MARF (got from the original block)"},"timestamp":{"type":"integer"},"tx_merkle_root":{"type":"string","description":"merkle_root of the included transactions"},"valid_merkle_root":{"type":"boolean","description":"does the merkle_root matches the chain block and the simulated one?"},"transactions":{"type":"array","items":{"type":"object","properties":{"data":{"type":"object","description":"JSON representation of the transaction payload"},"events":{"type":"array","items":{"type":"object","description":"JSON representation of the transaction events"}},"execution_cost":{"type":"object","description":"costs accounting for the transaction"},"hex":{"type":"string","description":"hexadecimal representation of the transaction body"},"result":{"type":"object","description":"Clarity value representing the transaction result"},"result_hex":{"type":"string","description":"The transaction's result, encoded as a Clarity hex string"},"post_condition_aborted":{"type":"boolean","description":"Whether the transaction was aborted by a post-condition"},"stx_burned":{"type":"integer","description":"number of burned stx"},"tx_index":{"type":"integer","description":"index of the transaction in the array of transactions"},"txid":{"type":"string","description":"transaction id"},"vm_error":{"type":["string","null"],"description":"optional vm error (for runtime failures)"}}}}}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized. Invalid or missing authentication token.","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Simulate mining of a block with the specified transactions and returns its content

> Simulate the mining of a block (no data is written in the MARF) with specified transactions and returns its content.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Blocks","description":"Operations for retrieving block and microblock data."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[{"rpcAuth":[]}],"components":{"securitySchemes":{"rpcAuth":{"type":"apiKey","in":"header","name":"authorization","description":"Plain-text secret value that must exactly equal the node's\nconfigured password, which is set as `connection_options.auth_token`\nin the node's configuration file.\n"}}},"paths":{"/v3/blocks/simulate/{block_id}":{"get":{"summary":"Simulate mining of a block with the specified transactions and returns its content","tags":["Blocks"],"operationId":"blockSimulate","description":"Simulate the mining of a block (no data is written in the MARF) with specified transactions and returns its content.\n","parameters":[{"name":"block_id","in":"path","description":"The block ID hash","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"transactions_hex":{"type":"array","items":{"type":"string","description":"SIP-003-encoded Transaction in hex format"}},"mint":{"type":"array","items":{"type":"object","properties":{"principal":{"type":"string","description":"Principal address receiving STX"},"amount":{"type":"integer","description":"amount of microSTX to mint for the block simulation"}}}}}}}}},"responses":{"200":{"description":"Content of the simulated block","content":{"application/json":{"schema":{"type":"object","properties":{"block_hash":{"type":"string","description":"Hash of the block","pattern":"^[0-9a-f]{64}$"},"block_id":{"type":"string","description":"Block ID (index block hash)","pattern":"^[0-9a-f]{64}$"},"block_height":{"type":"integer","description":"Height of the Stacks block","format":"uint64"},"consensus_hash":{"type":"string","description":"Consensus hash of the tenure","pattern":"^[0-9a-f]{40}$"},"fees":{"type":"integer","description":"total fees for the block"},"miner_signature":{"type":"string","description":"Uncompressed signature of the miner","pattern":"^[0-9a-f]{130}$"},"parent_block_id":{"type":"string","description":"Parent Block ID (index block hash)","pattern":"^[0-9a-f]{64}$"},"signer_signature":{"type":"array","items":{"type":"string","description":"Uncompressed signature of the signer","pattern":"^[0-9a-f]{130}$"}},"state_index_root":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"block state index root computed from the MARF (got from the original block)"},"timestamp":{"type":"integer"},"tx_merkle_root":{"type":"string","description":"merkle_root of the included transactions"},"valid_merkle_root":{"type":"boolean","description":"does the merkle_root matches the chain block and the simulated one?"},"transactions":{"type":"array","items":{"type":"object","properties":{"data":{"type":"object","description":"JSON representation of the transaction payload"},"events":{"type":"array","items":{"type":"object","description":"JSON representation of the transaction events"}},"execution_cost":{"type":"object","description":"costs accounting for the transaction"},"hex":{"type":"string","description":"hexadecimal representation of the transaction body"},"result":{"type":"object","description":"Clarity value representing the transaction result"},"result_hex":{"type":"string","description":"The transaction's result, encoded as a Clarity hex string"},"post_condition_aborted":{"type":"boolean","description":"Whether the transaction was aborted by a post-condition"},"stx_burned":{"type":"integer","description":"number of burned stx"},"tx_index":{"type":"integer","description":"index of the transaction in the array of transactions"},"txid":{"type":"string","description":"transaction id"},"vm_error":{"type":["string","null"],"description":"optional vm error (for runtime failures)"}}}}}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized. Invalid or missing authentication token.","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```
