> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getMerkleProofs

> Rufe Merkle-Inklusionsbeweise für commitments in einem privaten Zustandsbaum ab.

## Inklusionsbeweise

Übermittle zwischen 1 und 1.000 commitments aus demselben Zustandsbaum. Jedes Blatt muss ein skalares BN254-Körperelement codieren. Verwende den Baum und das commitment, die mit einer verschlüsselten Ausgabe zurückgegeben wurden. Die Reihenfolge der Beweise entspricht der Reihenfolge der angeforderten Blätter.

Jeder Beweis enthält das Geschwisterelement `path`, `leafIndex`, `root`, `rootSeq` und `rootIndex`. Bei Zustandsbäumen ist `rootSeq` der abgeschlossene Solana-slot, der die Aktualität des Beweises bestimmt. `rootIndex` ist die Position der Wurzel im Wurzelverlauf des Solana-Kontos. Sie kann nicht aus dem slot berechnet werden.

Wenn die indizierte Wurzel nicht mehr im Wurzelverlauf enthalten ist, versuche es erneut, nachdem der Indexer aufgeholt hat. Das [SDK](https://www.helius.dev/docs/de/privacy/sdk.md) setzt Beweise für Wallet-Vorgänge zusammen.

## Request-Parameter

**leaves** `array` *required*

commitments des Zustandsbaums, codiert als 32 Byte große skalare BN254-Körperelemente in Base58.

**treeAccount** `string` *required*

Konto des Zustandsbaums, das die commitments enthält.


## OpenAPI

````yaml de/openapi/privacy/getMerkleProofs.yaml POST /v1/spr/getMerkleProofs
openapi: 3.0.3
info:
  title: Solana Privacy Rings API
  version: 0.51.2
  description: >-
    JSON-RPC API des Privacy-Indexers für verschlüsselte Zustände, Verläufe,
    Beweise und öffentliche Registereinträge.
servers:
  - url: https://devnet.helius-rpc.com
    description: Solana Privacy Rings API im Devnet
security: []
paths:
  /v1/spr/getMerkleProofs:
    post:
      summary: getMerkleProofs
      description: >-
        Rufe Merkle-Inklusionsbeweise für commitment in einem privaten State
        Tree ab.
      operationId: getMerkleProofs
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                id:
                  type: string
                  description: Eine ID zur Identifizierung des request.
                  default: '1'
                jsonrpc:
                  type: string
                  description: Die Version des JSON-RPC-Protokolls.
                  enum:
                    - '2.0'
                  default: '2.0'
                method:
                  type: string
                  description: >-
                    Die aufzurufende Methode. Sie muss mit dem letzten Segment
                    des URL-Pfads übereinstimmen.
                  enum:
                    - getMerkleProofs
                  default: getMerkleProofs
                params:
                  type: object
                  required:
                    - treeAccount
                    - leaves
                  properties:
                    leaves:
                      type: array
                      items:
                        $ref: '#/components/schemas/Hash'
                      minItems: 1
                      maxItems: 1000
                      description: >-
                        commitment des State Tree, als
                        32-Byte-Skalarfeldelemente von BN254 in Base58 codiert.
                    treeAccount:
                      allOf:
                        - $ref: '#/components/schemas/SerializablePubkey'
                      description: State-Tree-Konto, das die commitment enthält.
                  additionalProperties: false
                  example:
                    treeAccount: 33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN
                    leaves:
                      - '11111111111111111111111111111112'
            example:
              jsonrpc: '2.0'
              id: '1'
              method: getMerkleProofs
              params:
                treeAccount: 33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN
                leaves:
                  - '11111111111111111111111111111112'
        required: true
      responses:
        '200':
          description: JSON-RPC response. Prüfe `error`, bevor du `result` liest.
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
                  id:
                    type: string
                    description: Die ID des request.
                  jsonrpc:
                    type: string
                    description: Die Version des JSON-RPC-Protokolls.
                    enum:
                      - '2.0'
                  result:
                    type: object
                    required:
                      - context
                      - proofs
                    properties:
                      context:
                        $ref: '#/components/schemas/Context'
                      proofs:
                        type: array
                        items:
                          $ref: '#/components/schemas/MerkleProof'
                    additionalProperties: false
        '400':
          description: >-
            Vor der Ausführung abgelehnt. Wenn Methode und Pfad nicht
            übereinstimmen, Methodenfelder doppelt vorhanden sind oder es sich
            um einen Batch-request handelt, wird -32601 zurückgegeben. Wenn der
            Body nicht lesbar oder zu groß ist, wird -32600 zurückgegeben.
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: >-
                      Die ID des request oder `null`, wenn der Body keinen
                      einzelnen JSON-RPC-Aufruf enthält.
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
        '429':
          description: rate limit überschritten.
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: >-
                      Die ID des request oder `null`, wenn der Body keinen
                      einzelnen JSON-RPC-Aufruf enthält.
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
        '500':
          description: Interner Serverfehler.
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: >-
                      Die ID des request oder `null`, wenn der Body keinen
                      einzelnen JSON-RPC-Aufruf enthält.
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
      security:
        - ApiKeyQuery: []
components:
  schemas:
    Hash:
      type: string
      description: Ein in Base58 codierter 32-Byte-Hash.
    SerializablePubkey:
      type: string
      description: Ein in Base58 codierter öffentlicher Solana-Schlüssel.
    Context:
      type: object
      required:
        - blockTime
        - slot
      properties:
        blockTime:
          type: integer
          format: int64
        slot:
          type: integer
          format: uint64
          description: >-
            Der höchste vom Indexer gespeicherte slot für Aktualitätsprüfungen
            auf slot-Basis.
          minimum: 0
    MerkleProof:
      type: object
      required:
        - leaf
        - merkleContext
        - path
        - leafIndex
        - root
        - rootSeq
        - rootIndex
      properties:
        leaf:
          $ref: '#/components/schemas/Hash'
        leafIndex:
          type: integer
          format: uint64
          minimum: 0
        merkleContext:
          $ref: '#/components/schemas/MerkleContext'
        path:
          type: array
          items:
            $ref: '#/components/schemas/Hash'
        root:
          $ref: '#/components/schemas/Hash'
        rootIndex:
          type: integer
          format: uint16
          description: >-
            Tatsächliche Position von `root` im On-Chain-Verlauf. Die Position
            einer State Root lässt sich

            nicht aus `root_seq` ableiten: slots ohne Aktualisierungen belegen
            keinen Eintrag.
          minimum: 0
        rootSeq:
          type: integer
          format: uint64
          description: >-
            Sortierschlüssel der Root: der abgeschlossene Solana-slot für die
            Aktualität eines State-Tree-Beweises

            oder die On-Chain-Aktualisierungssequenz für einen
            Indexed-Tree-Beweis.
          minimum: 0
      additionalProperties: false
    MerkleContext:
      type: object
      required:
        - treeType
        - tree
      properties:
        tree:
          $ref: '#/components/schemas/SerializablePubkey'
        treeType:
          type: integer
          format: uint16
          minimum: 0
      additionalProperties: false
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: Dein Helius API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.