# ledger_getVerifiedBatchProofsBySlotHeight

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://citrea-mainnet.g.alchemy.com/v2/{apiKey}

Returns verified ZK batch proof(s) for the specified DA slot height.

Reference: https://www.alchemy.com/docs/chains/citrea/citrea-api-endpoints/ledger-get-verified-batch-proofs-by-slot-height

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| height | integer | Yes | DA slot height (L1). |

## Result

**Verified batch proofs** (object[]): Array of verified batch proofs for the given slot height.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "ledger_getVerifiedBatchProofsBySlotHeight",
  "params": [
    85890
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": [
    {
      "proof": "0x0300000000000000000000000000000081670c116a84c0351f18c3...",
      "proofOutput": {
        "stateRoots": [
          "0x5e2a5b8da99b65c5eba4b36f2368321dad95c08c641d698b09ca6756caac589e",
          "0x182a9543bf64a90e78f7d810dedebdf4da3322752db5ee5533fae564e31033f7"
        ],
        "finalL2BlockHash": "0x8fe769cdb2d34f60b5a625caa8697ae1d1f213b558c9dc9e681059f18732e608",
        "stateDiff": {
          "0x412f612f0201edff3b3ee593dbef54e2fbdd421070db55e2de2aebe75f398bd85ac97ed364": "0xf4fd64e249e658fdb748f83190e47f0b1cd5e87fe30d005c257d7a94cca458e7167e690000000000"
        },
        "lastL2Height": "0xae0e97",
        "sequencerCommitmentIndexRange": [
          "0x92c",
          "0x92e"
        ],
        "sequencerCommitmentHashes": [
          "0x8a9cd0b9fda255370073abff4176416665d14552d5f0d671998ca89523041b36"
        ],
        "lastL1HashOnBitcoinLightClientContract": "0xa1717b35aa14be01ce037d1a346c4c1714afcfa5e8a66a35af5ead0000000000",
        "previousCommitmentIndex": "0x92b",
        "previousCommitmentHash": "0xa37a45539d40448d22f6da7978ca58f5845b72a5043129941817099471198749"
      }
    }
  ],
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://citrea-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "ledger_getVerifiedBatchProofsBySlotHeight",
  "params": [
    85890
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'ledger_getVerifiedBatchProofsBySlotHeight',
    params: [85890]
  })
};

fetch('https://citrea-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://citrea-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "ledger_getVerifiedBatchProofsBySlotHeight",
    "params": [85890]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://citrea-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"ledger_getVerifiedBatchProofsBySlotHeight\",\n  \"params\": [\n    85890\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://citrea-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"ledger_getVerifiedBatchProofsBySlotHeight\",\n  \"params\": [\n    85890\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://citrea-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"ledger_getVerifiedBatchProofsBySlotHeight\",\n  \"params\": [\n    85890\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: ledger_getVerifiedBatchProofsBySlotHeight
description: Returns verified ZK batch proof(s) for the specified DA slot height.
params:
  - name: height
    required: true
    description: DA slot height (L1).
    schema:
      title: DASlotHeight
      type: integer
result:
  name: Verified batch proofs
  description: Array of verified batch proofs for the given slot height.
  schema:
    type: array
    items:
      type: object
      required:
        - proof
        - proofOutput
      additionalProperties: false
      properties:
        proof:
          title: hex encoded bytes
          type: string
          pattern: ^0x[0-9a-f]*$
          description: ZK proof data (~2MB, hex-encoded).
        proofOutput:
          type: object
          required:
            - stateRoots
            - finalL2BlockHash
            - stateDiff
            - lastL2Height
            - sequencerCommitmentIndexRange
            - sequencerCommitmentHashes
            - lastL1HashOnBitcoinLightClientContract
            - previousCommitmentIndex
            - previousCommitmentHash
          additionalProperties: false
          properties:
            stateRoots:
              description: Array of intermediate/final state roots proven by this batch.
              type: array
              minItems: 1
              items:
                title: 32 byte hex value
                type: string
                pattern: ^0x[0-9a-f]{64}$
            finalL2BlockHash:
              title: 32 byte hex value
              type: string
              pattern: ^0x[0-9a-f]{64}$
              description: Final L2 block hash covered by the batch.
            stateDiff:
              description: State changes as key-value pairs (hex → hex).
              type: object
              additionalProperties:
                title: hex encoded bytes
                type: string
                pattern: ^0x[0-9a-f]*$
            lastL2Height:
              title: hex encoded unsigned integer
              type: string
              pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
              description: Last L2 height included in the proof (hex quantity).
            sequencerCommitmentIndexRange:
              description: Inclusive range of sequencer commitment indices [start, end] covered by this batch.
              type: array
              minItems: 2
              maxItems: 2
              items:
                title: hex encoded unsigned integer
                type: string
                pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
            sequencerCommitmentHashes:
              description: Commitment hashes corresponding to the covered range.
              type: array
              minItems: 1
              items:
                title: 32 byte hex value
                type: string
                pattern: ^0x[0-9a-f]{64}$
            lastL1HashOnBitcoinLightClientContract:
              title: 32 byte hex value
              type: string
              pattern: ^0x[0-9a-f]{64}$
              description: Last L1 hash recorded on the Bitcoin light client contract.
            previousCommitmentIndex:
              title: hex encoded unsigned integer
              type: string
              pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
              description: Previous sequencer commitment index (hex quantity).
            previousCommitmentHash:
              title: 32 byte hex value
              type: string
              pattern: ^0x[0-9a-f]{64}$
              description: Previous sequencer commitment hash.
examples:
  - name: ledger_getVerifiedBatchProofsBySlotHeight example
    params:
      - name: height
        value: 85890
    result:
      name: Verified batch proofs
      value:
        - proof: 0x0300000000000000000000000000000081670c116a84c0351f18c3...
          proofOutput:
            stateRoots:
              - '0x5e2a5b8da99b65c5eba4b36f2368321dad95c08c641d698b09ca6756caac589e'
              - '0x182a9543bf64a90e78f7d810dedebdf4da3322752db5ee5533fae564e31033f7'
            finalL2BlockHash: '0x8fe769cdb2d34f60b5a625caa8697ae1d1f213b558c9dc9e681059f18732e608'
            stateDiff:
              '0x412f612f0201edff3b3ee593dbef54e2fbdd421070db55e2de2aebe75f398bd85ac97ed364': '0xf4fd64e249e658fdb748f83190e47f0b1cd5e87fe30d005c257d7a94cca458e7167e690000000000'
            lastL2Height: '0xae0e97'
            sequencerCommitmentIndexRange:
              - '0x92c'
              - '0x92e'
            sequencerCommitmentHashes:
              - '0x8a9cd0b9fda255370073abff4176416665d14552d5f0d671998ca89523041b36'
            lastL1HashOnBitcoinLightClientContract: '0xa1717b35aa14be01ce037d1a346c4c1714afcfa5e8a66a35af5ead0000000000'
            previousCommitmentIndex: '0x92b'
            previousCommitmentHash: '0xa37a45539d40448d22f6da7978ca58f5845b72a5043129941817099471198749'
```
