# Bitcoin JSON-RPC

This endpoint offers a unified RPC interface for Bitcoin Core node functionality:

* Blockchain data: `getbestblockhash`, `getblock`, `getblockchaininfo`, `getblockcount`, `getblockfilter`, `getblockhash`, `getblockheader`, `getblockstats`, `getchaintips`, `getchaintxstats`, `getdifficulty`
* Mempool data: `getmempoolancestors`, `getmempooldescendants`, `getmempoolentry`, `getmempoolinfo`, `getrawmempool`, `testmempoolaccept`
* Transactions: `getrawtransaction`, `sendrawtransaction`, `gettxout`, `gettxoutproof`
* Raw tx/script utils: `createrawtransaction`, `decoderawtransaction`, `decodescript`
* Wallet & addresses: `createmultisig`, `validateaddress`, `verifymessage`
* Fees: `estimatesmartfee`

## POST /v2/rpc/bitcoin

> JSON RPC

```json
{"openapi":"3.0.3","info":{"title":"SecretKeyLabs API","version":"1.0.0"},"tags":[],"servers":[{"url":"https://api.secretkeylabs.io"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"x-api-key","in":"header"}}},"paths":{"/v2/rpc/bitcoin":{"post":{"tags":["Bitcoin RPC"],"description":"JSON RPC","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"enum":["getbestblockhash","getblock","getblockchaininfo","getblockcount","getblockfilter","getblockhash","getblockheader","getblockstats","getchaintips","getchaintxstats","getdifficulty","getmempoolancestors","getmempooldescendants","getmempoolentry","getmempoolinfo","getrawmempool","gettxout","gettxoutproof","createrawtransaction","decoderawtransaction","decodescript","getrawtransaction","sendrawtransaction","testmempoolaccept","createmultisig","estimatesmartfee","validateaddress","verifymessage"],"type":"string"},"params":{"type":"array","items":{}}},"required":["method"]}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"result":{},"error":{},"id":{}}}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xverse.app/api/bitcoin/bitcoin-json-rpc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
