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

> プライバシー状態ツリー内のコミットメントに対する Merkle 包含証明を取得します。

## 包含証明

同じ状態ツリーから 1～1,000 個のコミットメントを指定します。各リーフは、BN254 スカラー体要素としてエンコードする必要があります。暗号化された出力とともに返されたツリーとコミットメントを使用します。証明は、リクエストしたリーフの順序に従います。

各証明には、兄弟 `path`、`leafIndex`、`root`、`rootSeq`、および `rootIndex` が含まれます。状態ツリーの場合、`rootSeq` は証明の鮮度を確保するために使用される確定済みの Solana スロットです。`rootIndex` は Solana アカウントのルート履歴内におけるルートの位置であり、スロットから計算することはできません。

インデックス化されたルートがルート履歴から期限切れになっている場合は、インデクサーが追いついてから再試行してください。[SDK](https://www.helius.dev/docs/ja/privacy/sdk.md) はウォレット操作のための証明の組み立てを処理します。

## リクエストパラメータ

**leaves** `array` *required*

base58 形式の 32 バイト BN254 スカラー体要素としてエンコードされた状態ツリーのコミットメントです。

**treeAccount** `string` *required*

コミットメントを含む状態ツリーアカウントです。


## OpenAPI

````yaml ja/openapi/privacy/getMerkleProofs.yaml POST /v1/spr/getMerkleProofs
openapi: 3.0.3
info:
  title: Solana プライバシーリング API
  version: 0.51.2
  description: 暗号化された状態、履歴、証明、公開レジストリレコードに対応するプライバシーインデクサー JSON-RPC API です。
servers:
  - url: https://devnet.helius-rpc.com
    description: Devnet Solana プライバシーリング API
security: []
paths:
  /v1/spr/getMerkleProofs:
    post:
      summary: getMerkleProofs
      description: プライバシー状態ツリー内のコミットメントに対する Merkle 包含証明を取得します。
      operationId: getMerkleProofs
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                id:
                  type: string
                  description: リクエストを識別するための ID です。
                  default: '1'
                jsonrpc:
                  type: string
                  description: JSON-RPC プロトコルのバージョンです。
                  enum:
                    - '2.0'
                  default: '2.0'
                method:
                  type: string
                  description: 呼び出すメソッドです。URL パスの最後のセグメントと一致する必要があります。
                  enum:
                    - getMerkleProofs
                  default: getMerkleProofs
                params:
                  type: object
                  required:
                    - treeAccount
                    - leaves
                  properties:
                    leaves:
                      type: array
                      items:
                        $ref: '#/components/schemas/Hash'
                      minItems: 1
                      maxItems: 1000
                      description: >-
                        base58 でエンコードされた 32 バイトの BN254
                        スカラー体要素として表される状態ツリーのコミットメントです。
                    treeAccount:
                      allOf:
                        - $ref: '#/components/schemas/SerializablePubkey'
                      description: コミットメントを含む状態ツリーアカウントです。
                  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 レスポンスです。result を読み取る前に error を確認してください。
          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 です。
                  jsonrpc:
                    type: string
                    description: 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: >-
            実行前に拒否されました。メソッドとパスの不一致、メソッドフィールドの重複、またはバッチリクエストの場合は -32601
            が返されます。読み取れない、またはサイズが上限を超えた本文の場合は -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 です。本文が単一の JSON-RPC 呼び出しでない場合は null です。
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
        '429':
          description: レート制限を超過しました。
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: リクエスト ID です。本文が単一の JSON-RPC 呼び出しでない場合は null です。
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
        '500':
          description: サーバー内部エラーです。
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: リクエスト ID です。本文が単一の JSON-RPC 呼び出しでない場合は null です。
                  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: base58 でエンコードされた 32 バイトのハッシュです。
    SerializablePubkey:
      type: string
      description: base58 でエンコードされた Solana 公開鍵です。
    Context:
      type: object
      required:
        - blockTime
        - slot
      properties:
        blockTime:
          type: integer
          format: int64
        slot:
          type: integer
          format: uint64
          description: スロットに基づく鮮度チェックのために、インデクサーが永続化した最上位のスロットです。
          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: |-
            `root` の実際のオンチェーン履歴位置です。状態ルートの位置は
            `root_seq` から導出できません。更新のないスロットではエントリが消費されないためです。
          minimum: 0
        rootSeq:
          type: integer
          format: uint64
          description: |-
            ルートの順序付けキーです。状態ツリー証明の鮮度には完了済みの Solana スロットを使用し、
            インデックス付きツリー証明にはオンチェーンの更新シーケンスを使用します。
          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: Helius API キーです。

````

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