<!-- source: https://secondlayer.tools/docs/api-reference#get-block-state-writes -->

## State writes of a block

`GET /v1/proofs/writes/{height}`

Every MARF write the canonical block at `height` committed, in the node's write order, from this instance's indexed `state_writes`: the names a verifier needs to label each written leaf of the block's witness. A write the witness does not hold, or a leaf no write names, fails that check, so the rows are checked, not trusted. 404 when the instance has no writes for the block (its node did not subscribe to `state_writes` at that height); verifiers then report the diff unnamed. Near the tip the block at a height can change, so this is short-cached. 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 |
| --- | --- | --- |
| `height` | integer, required | Stacks block height. |

### Returns

One `BlockStateWrites` object.

### Responses

- `200` The block's writes
- `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 `state_writes` for a canonical block at that height
- `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`)

### Example

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

```json
{
  "block_height": 9137005,
  "state_writes": [
    {
      "ordinal": 0,
      "tx_index": 0,
      "key": "vm::SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.amm-vault-v2-01::1::paused",
      "value_hex": "3033"
    }
  ]
}
```
