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

> Returns a single ZK Proof used by the compression program to verify that the given accounts are valid and that the new addresses can be created.

## Request Parameters

<ParamField body="hashes" type="array">
  Array of cryptographic hashes for Solana compressed accounts to verify
</ParamField>

<ParamField body="newAddressesWithTrees" type="array">
  Array of Solana account addresses with their associated merkle trees for verification
</ParamField>


## OpenAPI

````yaml openapi/zk-compression/getValidityProof.yaml POST /
openapi: 3.0.3
info:
  title: Solana Zero-Knowledge Proof Validation API
  description: >
    Advanced Solana indexer for state compression validation using
    zero-knowledge cryptography.

    This specialized API enables verification of compressed NFTs and token
    accounts on the Solana blockchain

    through cryptographic validity proofs, providing mathematical certainty of
    data integrity for compressed 

    assets while maintaining the security guarantees of the Solana consensus
    model.
  license:
    name: Apache-2.0
  version: 0.50.0
servers:
  - url: https://mainnet.helius-rpc.com
    description: Mainnet RPC endpoint
  - url: https://devnet.helius-rpc.com
    description: Devnet RPC endpoint
security: []
paths:
  /:
    summary: getValidityProof
    post:
      description: >
        Retrieve cryptographic zero-knowledge validity proofs for Solana
        compressed accounts.

        This advanced verification endpoint returns the mathematical proof
        components needed to

        validate compressed NFTs and token accounts without requiring full
        on-chain data.

        Essential for applications that need cryptographic verification of
        compressed asset state

        while benefiting from Solana's state compression technology for reduced
        storage costs

        and improved scalability.
      operationId: getValidityProof
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: The version of the JSON-RPC protocol.
                  enum:
                    - '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: An ID to identify the request.
                  default: '1'
                method:
                  type: string
                  description: The name of the method to invoke.
                  enum:
                    - getValidityProof
                  default: getValidityProof
                params:
                  type: object
                  properties:
                    hashes:
                      type: array
                      items:
                        $ref: '#/components/schemas/Hash'
                      description: >-
                        Array of cryptographic hashes for Solana compressed
                        accounts to verify
                    newAddressesWithTrees:
                      type: array
                      items:
                        $ref: '#/components/schemas/AddressWithTree'
                      description: >-
                        Array of Solana account addresses with their associated
                        merkle trees for verification
                  additionalProperties: false
        required: true
      responses:
        '200':
          description: Successfully retrieved validity proof for Solana compressed accounts
          content:
            application/json:
              schema:
                type: object
                required:
                  - value
                  - context
                properties:
                  context:
                    $ref: '#/components/schemas/Context'
                  value:
                    $ref: '#/components/schemas/CompressedProofWithContext'
                additionalProperties: false
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                id: '1'
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Unauthorized
                id: '1'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Too many requests
                id: '1'
        '500':
          description: Internal Server Error - An error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal error
                id: '1'
        '503':
          description: Service Unavailable - The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Service unavailable
                id: '1'
        '504':
          description: Gateway Timeout - The request timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Gateway timeout
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    Hash:
      type: string
      description: >-
        A 32-byte cryptographic hash represented as a base58 string, used for
        Solana compressed account verification.
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    AddressWithTree:
      type: object
      required:
        - address
        - tree
      properties:
        address:
          $ref: '#/components/schemas/SerializablePubkey'
          description: Solana account address to verify through zero-knowledge proof
        tree:
          $ref: '#/components/schemas/SerializablePubkey'
          description: Merkle tree address where the compressed Solana account is stored
      additionalProperties: false
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
          description: Current Solana blockchain slot for this validity proof request
    CompressedProofWithContext:
      type: object
      required:
        - compressedProof
        - roots
        - rootIndices
        - leafIndices
        - leaves
        - merkleTrees
      properties:
        compressedProof:
          $ref: '#/components/schemas/CompressedProof'
          description: >-
            The zero-knowledge cryptographic proof for validating Solana
            compressed accounts
        leafIndices:
          type: array
          items:
            type: integer
            format: int32
            minimum: 0
          description: >-
            Indices of the leaves in the Solana merkle trees for the compressed
            accounts
        leaves:
          type: array
          items:
            type: string
          description: Leaf node data for the Solana compressed accounts being verified
        merkleTrees:
          type: array
          items:
            type: string
          description: >-
            Addresses of the Solana merkle trees containing the compressed
            accounts
        rootIndices:
          type: array
          items:
            type: integer
            format: int64
            minimum: 0
          description: >-
            Indices of the roots in the Solana merkle trees for the compressed
            accounts
        roots:
          type: array
          items:
            type: string
          description: Root hashes of the Solana merkle trees for the compressed accounts
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: The JSON-RPC protocol version.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: The error code.
              example: -32602
            message:
              type: string
              description: The error message.
            data:
              type: object
              description: Additional data about the error.
        id:
          type: string
          description: Identifier matching the request.
          example: '1'
    SerializablePubkey:
      type: string
      description: >-
        A Solana public key represented as a base58 string, used to identify
        accounts, trees, and programs.
      default: 11111118eRTi4fUVRoeYEeeTyL4DPAwxatvWT5q1Z
      example: 11111118eRTi4fUVRoeYEeeTyL4DPAwxatvWT5q1Z
    CompressedProof:
      type: object
      required:
        - a
        - b
        - c
      properties:
        a:
          type: string
          format: binary
          description: First component of the Solana zero-knowledge validity proof
        b:
          type: string
          format: binary
          description: Second component of the Solana zero-knowledge validity proof
        c:
          type: string
          format: binary
          description: Third component of the Solana zero-knowledge validity proof
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Your Helius API key. You can get one for free in the
        [dashboard](https://dashboard.helius.dev/api-keys).

````