<!-- source: https://secondlayer.tools/docs/api-reference#get-bitcoin-tx-proof -->

## Bitcoin transaction proof

`GET /v1/proofs/bitcoin-tx/{txid}`

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

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `txid` | string, required | The Bitcoin txid, display order: 64 hex characters, `0x` optional. |

### Returns

One `BitcoinTxProof` object.

### Responses

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

### Example

```bash
curl https://api.secondlayer.tools/v1/proofs/bitcoin-tx/f80a188d012dbb733748db003b987cc98fc4a636cbd071734decb298c1bad80b \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```

```json
{
  "txid": "f80a188d012dbb733748db003b987cc98fc4a636cbd071734decb298c1bad80b",
  "block_hash": "0000000000000000000179d46b321695682e26183ee0b1257bb3ea17483be0f9",
  "block_height": 968461,
  "header": "0000003…",
  "raw_tx": "02000000000101…",
  "tx_index": 2156,
  "tx_count": 4371,
  "siblings": [
    "4c1a…"
  ]
}
```
