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

## Transaction inclusion proof

`GET /v1/index/transactions/{tx_id}/proof`

What you need to check, without trusting this API, that a transaction is in a signed Nakamoto block: the raw tx, the raw block header, and the tx merkle path. `consensus` adds the cycle's signer set when the node can resolve it. The SDK's `verifyTransactionProof` runs every check. The instance must reach its Stacks node. Immutable once served.

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `tx_id` | string, required | Transaction id, `0x`-prefixed hex. |

### Returns

One `TransactionProof` object.

### Responses

- `200` The inclusion proof
- `401` This bind requires the instance token, and it was missing or wrong
- `404` The transaction or its block is not indexed or not on the node (`PROOF_UNAVAILABLE`)
- `429` Rate limited; retry after `Retry-After` seconds
- `503` The Stacks node is unreachable (`PROOF_NODE_UNAVAILABLE`), or the stored transactions do not reproduce the block's merkle root (`PROOF_TX_SET_INCOMPLETE`)

### Example

```bash
curl https://api.secondlayer.tools/v1/index/transactions/{tx_id}/proof \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```

```json
{
  "txid": "198d642edb1104a1757a8c353ad61231d0422ecb6ba83aa1ce45d05df44157e0",
  "index_block_hash": "990152a894e12288960c8b68e5790ad7994f9d261e9ad8adc13c72e76f914339",
  "block_height": 9048502,
  "tx_index": 1,
  "raw_tx": "000000000104004ba0f04696ab911b7009e3421913e1f5768c222400000000000001090000000000000bb8000123767ba956a0545b2543f059d003500767330fad1f4e6cce3d734c8719bfca9226c07dc6e64edb83078cb34e83c6b430d4a260628af821041f51eb5f21e444390302000000010102164ba0f04696ab911b7009e3421913e1f5768c222414f6decc7cfff2a413bd7cd4f53c25ad7fd1899acc0a736274632d746f6b656e0a736274632d746f6b656e01000000000000012c0214f6decc7cfff2a413bd7cd4f53c25ad7fd1899acc0a736274632d746f6b656e087472616e7366657200000004010000000000000000000000000000012c05164ba0f04696ab911b7009e3421913e1f5768c222405161a3cb3edf945d27fa141d1de2deb9093ec74147f09",
  "raw_header": "0100000000008a11b60000006643539084f394038c2267d08e5e5c52b9da2d99f4360c91a5314c3cac40ac15f4397b92360ccaa5adaeda6ebc5587511f33b1495fe1d1f66d10b0bfc1ef83918390f25ad4f0b7f5ddf76fa79782e92da2315856590664d9c179ccc0143e35f99140069ea4517ab4ca79e39f0e54b406b1b68b5f8c29e25750000000006ab3d0c2012ae8acc3a85100ae9eecf07468c694fee3cb585c423a0df3054991c77f4fa3fb4fc7b300f1b332f02ec0488c4033c7eb72abec17999c01326d222225f430e56d000000130016f1a9fb8ef3c85b04bd863818f4b47680de8f33e375b2872fbdd5b94d1664624488458f13383478becec32e9ce8ac9b2d0292d2773b37bf1c5943e87cf35b31006dbcd0a22c1eaf81d34dd1c2f25a1e05b7d6e5fdd3c5d8c7e4b96aa4472088e14d8b7ece3427f77fbcfd4027e7bd27be1388ddb68efb8debf8dfe48da558987400e3df41a2cc852d41b6db8f67c8e6c7bf1c31d185c87b019d349a5d6713c951ca43837c05b62a9f0b58ac4403a98233f1e1573e031fae90306ccd618dff1ce8eb01f4bba3a39010779d4870906d1f7e66115b8146f6b70b4e4fee3a402fa484c1d40146832b8fb21ab3328d7588e3861d9c614522692bd14fb763c77a2203d0b86a010075c0105d54deac9a6388734e0519d7ba90024727f02d65b8fd2cd788eca9350c6f6c7ff52200e41cefbf19873bcb9c17068ca9b093fd032dd68683348e95550083c787948e7bd477341747c8769ce2e9c8a420cb137d3609b5e90163f0c56ac3747219c113b0b5018aefa1dc9bd415b21b48173cb9c42f96f19cf143a77261340092179e100c58cfc2b3ee3271eca056ad98c986a1b434296eb1bb00986f3c1a7e70d89fdcbb983f216b9b9d5b5bf21093f58bf2e022fb0010f6706010ebe8c09f01bf06697f3e93883ebf59f83a98bc032d7b3da70886b6e44309cd77855dc1bf8c099084b40609c0a4e3d04806a0fd23391ad79745ba52b122838e3edf6359aa2d006d529e1f590e58b3d1519b719d1149e1babfa1cf20b164167199da2804dec7004159c9f6cb90f265b0d7c3338905de677087bbf9e40a7f06159a4697014756c501726fe445f8a4c876138ff40581e34a659463f97d7b2d1cc843b82d5c8ec9cd2e326ab34b509f4c193f424ebd2ddd729f007687c88b66af59ddda1036b1c7da8700d9a1b7f528df90661c608fd1935d95abb0f638b780573101837863353daf50c529e02703891e885ffa2603ca19a8ab1724c07795e6ab458e93abdca27ac67c3600c4202f95645edb945c2659345fd1dc5043d9fd178c398ddb2ed55ffc5bb9c62f2a61ada05578631cd6523fadf4a47be96133216b5cd421222a1289914ec41d5600ae2119da699f9eea1a8c49b0cf63c2ed5191d141491f11893869e04f24ad14d20dabc52b11e4418cd46610709c7d6456ff0a235760dc39c7e4c057fc8802fa4101813c588a7730569283f517b53949f67aa46a214530dab382da6ec3afc7014ede023706361ec717f8487a88f9d8ae9f912b3033124fccf8c98e5bcf382208febf016ad6d2d6a0c77ae937dc663b7111ab145e4df0248bcb1da80dce6b5bf0061539705f37412cf59476a22ee6677c20c9b980f263f8c1d4c79acd8d7166ff1a7b4f00aecd8f47fee2d6819993aa0d2e3e4872e2a95550c7403491f9764ebfa832f38b61704739abda8cfb0e05d8020efa5e49a5704dbd82f79fd3638b61005c37867c00025ea0925e7583f2f43c9ad4ff6ceaa8ef6bb62cb15265ebf684ca9005f5bb9312009b7e7bc171291c4c2530b74b275e57fc53072cd381a1cb27dc63232c0835007a5b80bc0b5af6848568468cc2a10f74789e1a1e0bcf6f18bb45f8df4e7a19f55c26f593b23aa76c2b7171aff4b062a58f6611da097071298621735521c7ee110062254da4170c6e66963e8a74c9a4fb5797e4247f5ccd8784c82d70ae96f5f01644e6b7733ca93f0e065fc165e152b4abd602687f2f081ab39c8f0943d3b51ea90001000000010100000000",
  "tx_merkle_path": [
    {
      "position": "left",
      "hash": "ea5ecd867b9945b06aecdf77117de46ae9fd055b137be1fecc1dee38f56b19af"
    },
    {
      "position": "right",
      "hash": "398e676d798b758c66c50e21a83b4c6c8c20a5ffc8552b61d1df160f36a0c23c"
    },
    {
      "position": "right",
      "hash": "d1315b8f5f61861868657a0ab2c8c62332bb77a74a833567427a9f95ab86c1eb"
    }
  ],
  "consensus": {
    "reward_cycle": 143,
    "reward_set": {
      "signers": [
        {
          "signing_key": "0209130bec93e83b23d3366adfcbe0a1641057b9c48102572d892fe8f78de2bee7",
          "weight": 646
        },
        {
          "signing_key": "0216436e7785e1dc55cf4350ac1f90e45daf0ec5b57bce13a32551a513446e71d1",
          "weight": 9
        }
      ],
      "total_weight": 4000
    }
  }
}
```
