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

# getValidityProof

> 圧縮プログラムが指定されたアカウントが有効であり、新しいアドレスが作成可能であることを検証するために使用する単一のZK Proofを返します。

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

<ParamField body="hashes" type="array">
  Solana圧縮アカウントを検証するための暗号ハッシュの配列
</ParamField>

<ParamField body="newAddressesWithTrees" type="array">
  検証用の関連メルクリーツリーを持つSolanaアカウントアドレスの配列
</ParamField>


## OpenAPI

````yaml ja/openapi/zk-compression/getValidityProof.yaml POST /
openapi: 3.0.3
info:
  title: Solana Zero-Knowledge Proof Validation API
  description: |
    零知識暗号を使用した状態圧縮検証のための高度なSolanaインデクサー。
    この専門的なAPIは、暗号的正当性証明を通じてSolanaブロックチェーン上の圧縮NFTおよびトークンアカウントの検証を可能にし、
    Solanaのコンセンサスモデルのセキュリティ保証を維持しながら、圧縮資産のデータ整合性を数学的に確実にします。
  license:
    name: Apache-2.0
  version: 0.50.0
servers:
  - url: https://mainnet.helius-rpc.com
    description: Mainnet RPC エンドポイント
  - url: https://devnet.helius-rpc.com
    description: Devnet RPC エンドポイント
security: []
paths:
  /:
    summary: getValidityProof
    post:
      description: |
        Solana圧縮アカウントの暗号的零知識正当性証明を取得します。
        この高度な検証エンドポイントは、圧縮されたNFTおよびトークンアカウントを検証するために必要な数学的証明コンポーネントを返します。
        完全なオンチェーンデータを必要とせずに、圧縮資産状態の暗号的検証が必要なアプリケーションに不可欠です。
        Solanaの状態圧縮技術から、ストレージコストの削減とスケーラビリティの向上の恩恵を受けることができます。
      operationId: getValidityProof
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: JSON-RPCプロトコルのバージョン。
                  enum:
                    - '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: リクエストを識別するためのID。
                  default: '1'
                method:
                  type: string
                  description: 呼び出すメソッドの名前。
                  enum:
                    - getValidityProof
                  default: getValidityProof
                params:
                  type: object
                  default:
                    hashes:
                      - gEF8v1TLb2T9vTaJarFj6kQoSfWNkskMSCJpPJSxZzT
                  properties:
                    hashes:
                      type: array
                      items:
                        $ref: '#/components/schemas/Hash'
                      description: Solana圧縮アカウントを検証するための暗号ハッシュの配列
                    newAddressesWithTrees:
                      type: array
                      items:
                        $ref: '#/components/schemas/AddressWithTree'
                      description: 検証のために関連するマークルツリーを持つSolanaアカウントアドレスの配列
                  additionalProperties: false
        required: true
      responses:
        '200':
          description: Solana圧縮アカウントの正当性証明の取得に成功しました
          content:
            application/json:
              schema:
                type: object
                required:
                  - value
                  - context
                properties:
                  context:
                    $ref: '#/components/schemas/Context'
                  value:
                    $ref: '#/components/schemas/CompressedProofWithContext'
                additionalProperties: false
        '400':
          description: 不正なリクエスト - 無効なリクエストパラメータまたは不正なリクエスト。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: 無効なパラメータ
                id: '1'
        '401':
          description: 認証エラー - 無効なまたは欠落しているAPIキー。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: 認証エラー
                id: '1'
        '429':
          description: リクエストが多すぎます - レート制限を超えました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: リクエストが多すぎます
                id: '1'
        '500':
          description: 内部サーバーエラー - サーバーでエラーが発生しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: 内部エラー
                id: '1'
        '503':
          description: サービス利用不可 - サービスは一時的に利用不可です。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: サービス利用不可
                id: '1'
        '504':
          description: ゲートウェイタイムアウト - リクエストがタイムアウトしました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: ゲートウェイタイムアウト
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    Hash:
      type: string
      description: Solana圧縮アカウントの検証に使用される32バイトの暗号ハッシュで、base58文字列で表されます。
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    AddressWithTree:
      type: object
      required:
        - address
        - tree
      properties:
        address:
          $ref: '#/components/schemas/SerializablePubkey'
          description: 零知識証明を通じて検証されるSolanaアカウントアドレス
        tree:
          $ref: '#/components/schemas/SerializablePubkey'
          description: 圧縮されたSolanaアカウントが保存されているマークルツリーアドレス
      additionalProperties: false
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
          description: この正当性証明リクエストのための現在のSolanaブロックチェーンスロット
    CompressedProofWithContext:
      type: object
      required:
        - compressedProof
        - roots
        - rootIndices
        - leafIndices
        - leaves
        - merkleTrees
      properties:
        compressedProof:
          $ref: '#/components/schemas/CompressedProof'
          description: Solana圧縮アカウントを検証するための零知識暗号証明
        leafIndices:
          type: array
          items:
            type: integer
            format: int32
            minimum: 0
          description: 圧縮アカウント用のSolanaマークルツリー内のリーフのインデックス
        leaves:
          type: array
          items:
            type: string
          description: 検証されるSolana圧縮アカウントのリーフノードデータ
        merkleTrees:
          type: array
          items:
            type: string
          description: 圧縮アカウントを含むSolanaマークルツリーのアドレス
        rootIndices:
          type: array
          items:
            type: integer
            format: int64
            minimum: 0
          description: 圧縮アカウント用のSolanaマークルツリー内のルートのインデックス
        roots:
          type: array
          items:
            type: string
          description: 圧縮アカウント用のSolanaマークルツリーのルートハッシュ
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: JSON-RPCプロトコルのバージョン。
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: エラーコード。
              example: -32602
            message:
              type: string
              description: エラーメッセージ。
            data:
              type: object
              description: エラーに関する追加データ。
        id:
          type: string
          description: リクエストと一致する識別子。
          example: '1'
    SerializablePubkey:
      type: string
      description: Solanaの公開鍵で、base58文字列で表され、アカウント、ツリー、およびプログラムを識別するために使用されます。
      default: 11111118eRTi4fUVRoeYEeeTyL4DPAwxatvWT5q1Z
      example: 11111118eRTi4fUVRoeYEeeTyL4DPAwxatvWT5q1Z
    CompressedProof:
      type: object
      required:
        - a
        - b
        - c
      properties:
        a:
          type: string
          format: binary
          description: Solanaの零知識正当性証明の最初のコンポーネント
        b:
          type: string
          format: binary
          description: Solanaの零知識正当性証明の2番目のコンポーネント
        c:
          type: string
          format: binary
          description: Solanaの零知識正当性証明の3番目のコンポーネント
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        HeliusのAPIキー。無料で[ダッシュボード](https://dashboard.helius.dev/api-keys)から取得できます。

````