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

# getCompressedAccountProof

> 返回压缩程序用于验证账户有效性的证明。

## 请求参数

<ParamField body="hash" type="string" required>
  一个以 base58 字符串表示的32字节密码学哈希，唯一标识一个 Solana 压缩账户。
</ParamField>


## OpenAPI

````yaml zh/openapi/zk-compression/getCompressedAccountProof.yaml POST /
openapi: 3.0.3
info:
  title: Solana 压缩账户验证 API
  description: |
    高级 Solana 索引器，用于使用默克尔证明验证压缩账户。
    此专用验证 API 使应用程序能够通过高效的默克尔证明验证，
    加密验证 Solana 区块链上压缩 NFT 和代币账户的存在性和数据完整性，
    支持安全使用状态压缩技术，与传统账户相比，
    将链上存储成本降低多达 1000 倍。
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.50.0
servers:
  - url: https://mainnet.helius-rpc.com
    description: 主网 RPC 端点
  - url: https://devnet.helius-rpc.com
    description: 开发网 RPC 端点
security: []
paths:
  /:
    summary: getCompressedAccountProof
    post:
      description: |
        检索特定压缩 Solana 账户的加密默克尔证明。
        此验证端点返回验证压缩 NFT 或代币账户在 Solana 区块链上存在性和数据完整性所需的完整证明路径，
        无需将完整账户数据存储在链上。对于需要验证压缩资产所有权和真实性的钱包应用程序、市场和 DeFi 协议至关重要，
        同时受益于 Solana 突破性的状态压缩技术，实现显著的成本降低。
      operationId: getCompressedAccountProof
      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: 用于检索 Solana 压缩账户证明数据的方法名称。
                  enum:
                    - getCompressedAccountProof
                  default: getCompressedAccountProof
                params:
                  type: object
                  required:
                    - hash
                  properties:
                    hash:
                      $ref: '#/components/schemas/Hash'
                      description: 要检索其证明的 Solana 压缩账户的哈希值
        required: true
      responses:
        '200':
          description: 成功检索到请求的 Solana 压缩账户的默克尔证明
          content:
            application/json:
              schema:
                type: object
                required:
                  - context
                  - value
                properties:
                  context:
                    $ref: '#/components/schemas/Context'
                  value:
                    $ref: '#/components/schemas/MerkleProofWithContext'
                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: 一个 32 字节的加密哈希，以 base58 字符串表示，唯一标识一个 Solana 压缩账户。
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
          description: 此压缩账户证明请求的当前 Solana 区块链槽位
    MerkleProofWithContext:
      type: object
      required:
        - proof
        - root
        - leafIndex
        - hash
        - merkleTree
        - rootSeq
      properties:
        hash:
          $ref: '#/components/schemas/Hash'
          description: 正在验证的 Solana 压缩账户的唯一哈希标识符
        leafIndex:
          type: integer
          format: int32
          minimum: 0
          description: 此压缩账户在 Solana Merkle 树结构中的位置索引
        merkleTree:
          $ref: '#/components/schemas/SerializablePubkey'
          description: 存储此压缩账户的 Solana Merkle 树的地址
        proof:
          type: array
          items:
            $ref: '#/components/schemas/Hash'
          description: 形成 Merkle 证明路径的哈希数组，用于验证此 Solana 压缩账户
        root:
          $ref: '#/components/schemas/Hash'
          description: 包含此压缩账户的Solana默克尔树的根哈希
        rootSeq:
          type: integer
          format: int64
          minimum: 0
          description: Solana默克尔树中根的序列号，用于版本跟踪
      additionalProperties: false
    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: 以base58字符串表示的Solana公钥，用于标识默克尔树和账户。
      default: 11111117353mdUKehx9GW6JNHznGt5oSZs9fWkVkB
      example: 11111117353mdUKehx9GW6JNHznGt5oSZs9fWkVkB
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        您的 Helius API
        密钥。您可以在[仪表板](https://dashboard.helius.dev/api-keys)中免费获取一个。

````