> For the complete documentation index, see [llms.txt](https://docs.stacks.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacks.co/reference/api/stacks-node-rpc/mining.md).

# Mining

Endpoints related to Stacks block production and mining.

## Validate a proposed Stacks block

> Used by stackers to validate a proposed Stacks block from a miner.\
> \*\*This API endpoint requires a basic Authorization header.\*\*<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Mining","description":"Endpoints related to Stacks block production and mining."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"}],"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"}},"schemas":{"BlockProposalResponse":{"description":"Get Response for Block Proposal","type":"object","additionalProperties":false,"required":["result","message"],"properties":{"result":{"type":"string","enum":["Error","Accepted"]},"message":{"type":"string","description":"A message describing the result or error message."}}}},"responses":{"Unauthorized":{"description":"Unauthorized. Invalid or missing authentication token.","content":{"text/plain":{"schema":{"type":"string"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}},"paths":{"/v3/block_proposal":{"post":{"summary":"Validate a proposed Stacks block","tags":["Mining"],"operationId":"postBlockProposal","description":"Used by stackers to validate a proposed Stacks block from a miner.\n**This API endpoint requires a basic Authorization header.**\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["block","chain_id"],"properties":{"block":{"type":"string","minLength":400,"pattern":"^([0-9a-fA-F]{2})+$","description":"Hex-encoded block data (must be valid SIP-003 serialized block, typically 200+ bytes)"},"chain_id":{"type":"integer","minimum":0,"description":"Chain ID for the block"}}}}}},"responses":{"202":{"description":"Block proposal has been accepted for processing.\nThe result will be returned via the event observer.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockProposalResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockProposalResponse"}},"text/plain":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"description":"There is an ongoing proposal validation being processed, the new\nrequest cannot be accepted until the prior request has been processed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockProposalResponse"}}}},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```

## Upload a Stacks block

> Upload a Stacks block to the node for processing.\
> The block must be in binary format and associated with the given consensus hash.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Mining","description":"Endpoints related to Stacks block production and mining."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"}],"security":[],"paths":{"/v2/blocks/upload/{consensus_hash}":{"post":{"summary":"Upload a Stacks block","tags":["Mining"],"operationId":"uploadLegacyBlock","description":"Upload a Stacks block to the node for processing.\nThe block must be in binary format and associated with the given consensus hash.\n","parameters":[{"name":"consensus_hash","in":"path","required":true,"description":"Consensus hash (40 hex characters)","schema":{"type":"string","pattern":"^[0-9a-f]{40}$"}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","minLength":1,"description":"Binary-encoded Stacks block"}}}},"responses":{"200":{"description":"Block upload result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockUploadResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"schemas":{"BlockUploadResponse":{"type":"object","properties":{"stacks_block_id":{"type":"string","description":"The ID of the uploaded block"},"accepted":{"type":"boolean","description":"Whether the block was accepted"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"NotFound":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stacks.co/reference/api/stacks-node-rpc/mining.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
