> ## 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

> Ambil bukti inklusi Merkle untuk komitmen dalam pohon status privasi.

## Bukti Inklusi

Berikan antara 1 hingga 1.000 komitmen dari pohon status yang sama. Setiap daun harus mengodekan elemen medan skalar BN254. Gunakan pohon dan komitmen yang dikembalikan bersama output terenkripsi. Urutan bukti mengikuti urutan daun yang diminta.

Setiap bukti menyertakan sibling `path`, `leafIndex`, `root`, `rootSeq`, dan `rootIndex`. Untuk pohon status, `rootSeq` adalah slot Solana yang telah diselesaikan dan digunakan untuk memastikan bukti tetap terbaru. `rootIndex` adalah posisi root dalam riwayat root akun Solana; nilai ini tidak dapat dihitung dari slot.

Jika root terindeks telah kedaluwarsa dari riwayat root, coba lagi setelah pengindeks menyusul. [SDK](https://www.helius.dev/docs/id/privacy/sdk.md) menangani penyusunan bukti untuk operasi dompet.

## Parameter Permintaan

**leaves** `array` *required*

Komitmen pohon status yang dikodekan sebagai elemen medan skalar BN254 32 byte dalam base58.

**treeAccount** `string` *required*

Akun pohon status yang berisi komitmen.


## OpenAPI

````yaml id/openapi/privacy/getMerkleProofs.yaml POST /v1/spr/getMerkleProofs
openapi: 3.0.3
info:
  title: API Solana Privacy Rings
  version: 0.51.2
  description: >-
    API JSON-RPC pengindeks privasi untuk status terenkripsi, riwayat, bukti,
    dan catatan registri publik.
servers:
  - url: https://devnet.helius-rpc.com
    description: API Solana Privacy Rings Devnet
security: []
paths:
  /v1/spr/getMerkleProofs:
    post:
      summary: getMerkleProofs
      description: Ambil bukti inklusi Merkle untuk komitmen dalam pohon status privasi.
      operationId: getMerkleProofs
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                id:
                  type: string
                  description: ID untuk mengidentifikasi permintaan.
                  default: '1'
                jsonrpc:
                  type: string
                  description: Versi protokol JSON-RPC.
                  enum:
                    - '2.0'
                  default: '2.0'
                method:
                  type: string
                  description: >-
                    Metode yang akan dipanggil. Harus cocok dengan segmen jalur
                    URL terakhir.
                  enum:
                    - getMerkleProofs
                  default: getMerkleProofs
                params:
                  type: object
                  required:
                    - treeAccount
                    - leaves
                  properties:
                    leaves:
                      type: array
                      items:
                        $ref: '#/components/schemas/Hash'
                      minItems: 1
                      maxItems: 1000
                      description: >-
                        Komitmen pohon status yang dikodekan dengan base58
                        sebagai elemen bidang skalar BN254 berukuran 32 byte.
                    treeAccount:
                      allOf:
                        - $ref: '#/components/schemas/SerializablePubkey'
                      description: Akun pohon status yang berisi komitmen.
                  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: Respons JSON-RPC. Periksa error sebelum membaca result.
          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: ID permintaan.
                  jsonrpc:
                    type: string
                    description: Versi protokol JSON-RPC.
                    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: >-
            Ditolak sebelum eksekusi. Ketidakcocokan metode/jalur, kolom metode
            duplikat, atau permintaan batch akan mengembalikan -32601. Isi yang
            tidak dapat dibaca atau terlalu besar akan mengembalikan -32600.
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: >-
                      ID permintaan, atau null jika isi bukan satu panggilan
                      JSON-RPC.
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
        '429':
          description: Batas laju terlampaui.
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: >-
                      ID permintaan, atau null jika isi bukan satu panggilan
                      JSON-RPC.
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
        '500':
          description: Kesalahan server internal.
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: >-
                      ID permintaan, atau null jika isi bukan satu panggilan
                      JSON-RPC.
                  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: Hash 32 byte yang dikodekan dengan base58.
    SerializablePubkey:
      type: string
      description: Kunci publik Solana yang dikodekan dengan base58.
    Context:
      type: object
      required:
        - blockTime
        - slot
      properties:
        blockTime:
          type: integer
          format: int64
        slot:
          type: integer
          format: uint64
          description: >-
            Slot tertinggi yang telah disimpan oleh pengindeks, untuk
            pemeriksaan keterkinian berbasis slot.
          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: >-
            Posisi riwayat on-chain aktual untuk `root`. Posisi root status

            tidak dapat diperoleh dari `root_seq`: slot tanpa pembaruan tidak
            menggunakan entri.
          minimum: 0
        rootSeq:
          type: integer
          format: uint64
          description: >-
            Kunci pengurutan root: slot Solana yang telah selesai untuk
            keterkinian bukti

            pohon status, atau urutan pembaruan on-chain untuk bukti pohon
            terindeks.
          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: Kunci API Helius Anda.

````

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