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

> Trả về một bằng chứng ZK duy nhất được chương trình nén sử dụng để xác minh rằng các tài khoản đã cho là hợp lệ và có thể tạo các địa chỉ mới.

## Tham số yêu cầu

<ParamField body="hashes" type="array">
  Mảng các hàm băm mật mã cho tài khoản nén Solana cần xác minh
</ParamField>

<ParamField body="newAddressesWithTrees" type="array">
  Mảng các địa chỉ tài khoản Solana cùng với các cây Merkle liên kết để xác minh
</ParamField>


## OpenAPI

````yaml vi/openapi/zk-compression/getValidityProof.yaml POST /
openapi: 3.0.3
info:
  title: API xác thực bằng chứng không kiến thức Solana
  description: >
    Bộ lập chỉ mục Solana nâng cao để xác thực nén trạng thái bằng mật mã không
    kiến thức.

    API chuyên biệt này cho phép xác minh NFT nén và tài khoản token trên
    blockchain Solana

    thông qua các bằng chứng hợp lệ bằng mật mã, cung cấp sự chắc chắn về mặt
    toán học đối với tính toàn vẹn dữ liệu của

    tài sản nén trong khi vẫn duy trì các đảm bảo bảo mật của mô hình đồng thuận
    Solana.
  license:
    name: Apache-2.0
  version: 0.50.0
servers:
  - url: https://mainnet.helius-rpc.com
    description: Điểm cuối RPC Mainnet
  - url: https://devnet.helius-rpc.com
    description: Điểm cuối RPC Devnet
security: []
paths:
  /:
    summary: getValidityProof
    post:
      description: >
        Truy xuất các bằng chứng hợp lệ không kiến thức bằng mật mã cho tài
        khoản nén Solana.

        Điểm cuối xác minh nâng cao này trả về các thành phần bằng chứng toán
        học cần thiết để

        xác thực NFT nén và tài khoản token mà không yêu cầu toàn bộ dữ liệu
        trên chuỗi.

        Đây là chức năng thiết yếu cho các ứng dụng cần xác minh bằng mật mã
        trạng thái tài sản nén,

        đồng thời tận dụng công nghệ nén trạng thái của Solana để giảm chi phí
        lưu trữ

        và cải thiện khả năng mở rộng.
      operationId: getValidityProof
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: Phiên bản của giao thức JSON-RPC.
                  enum:
                    - '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: ID dùng để nhận dạng yêu cầu.
                  default: '1'
                method:
                  type: string
                  description: Tên của phương thức cần gọi.
                  enum:
                    - getValidityProof
                  default: getValidityProof
                params:
                  type: object
                  default:
                    hashes:
                      - gEF8v1TLb2T9vTaJarFj6kQoSfWNkskMSCJpPJSxZzT
                  properties:
                    hashes:
                      type: array
                      items:
                        $ref: '#/components/schemas/Hash'
                      description: >-
                        Mảng các hàm băm mật mã của tài khoản nén Solana cần xác
                        minh
                    newAddressesWithTrees:
                      type: array
                      items:
                        $ref: '#/components/schemas/AddressWithTree'
                      description: >-
                        Mảng các địa chỉ tài khoản Solana cùng với cây Merkle
                        tương ứng để xác minh
                  additionalProperties: false
        required: true
      responses:
        '200':
          description: >-
            Đã truy xuất thành công bằng chứng hợp lệ cho các tài khoản nén
            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: >-
            Yêu cầu không hợp lệ - Tham số yêu cầu không hợp lệ hoặc yêu cầu có
            định dạng sai.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                id: '1'
        '401':
          description: Không được ủy quyền - Khóa API không hợp lệ hoặc bị thiếu.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Unauthorized
                id: '1'
        '429':
          description: Quá nhiều yêu cầu - Đã vượt quá giới hạn tốc độ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Too many requests
                id: '1'
        '500':
          description: Lỗi máy chủ nội bộ - Đã xảy ra lỗi trên máy chủ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal error
                id: '1'
        '503':
          description: Dịch vụ không khả dụng - Dịch vụ tạm thời không khả dụng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Service unavailable
                id: '1'
        '504':
          description: Hết thời gian chờ cổng kết nối - Yêu cầu đã hết thời gian chờ.
          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: >-
        Hàm băm mật mã 32 byte được biểu diễn dưới dạng chuỗi base58, dùng để
        xác minh tài khoản nén Solana.
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    AddressWithTree:
      type: object
      required:
        - address
        - tree
      properties:
        address:
          $ref: '#/components/schemas/SerializablePubkey'
          description: >-
            Địa chỉ tài khoản Solana cần xác minh thông qua bằng chứng không
            kiến thức
        tree:
          $ref: '#/components/schemas/SerializablePubkey'
          description: Địa chỉ cây Merkle lưu trữ tài khoản nén Solana
      additionalProperties: false
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
          description: Slot blockchain Solana hiện tại cho yêu cầu bằng chứng hợp lệ này
    CompressedProofWithContext:
      type: object
      required:
        - compressedProof
        - roots
        - rootIndices
        - leafIndices
        - leaves
        - merkleTrees
      properties:
        compressedProof:
          $ref: '#/components/schemas/CompressedProof'
          description: >-
            Bằng chứng mật mã không kiến thức để xác thực các tài khoản nén
            Solana
        leafIndices:
          type: array
          items:
            type: integer
            format: int32
            minimum: 0
          description: >-
            Chỉ số của các nút lá trong cây Merkle Solana dành cho các tài khoản
            nén
        leaves:
          type: array
          items:
            type: string
          description: Dữ liệu nút lá của các tài khoản nén Solana đang được xác minh
        merkleTrees:
          type: array
          items:
            type: string
          description: Địa chỉ của các cây Merkle Solana chứa tài khoản nén
        rootIndices:
          type: array
          items:
            type: integer
            format: int64
            minimum: 0
          description: >-
            Chỉ số của các nút gốc trong cây Merkle Solana dành cho các tài
            khoản nén
        roots:
          type: array
          items:
            type: string
          description: Các hàm băm gốc của cây Merkle Solana dành cho các tài khoản nén
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: Phiên bản giao thức JSON-RPC.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Mã lỗi.
              example: -32602
            message:
              type: string
              description: Thông báo lỗi.
            data:
              type: object
              description: Dữ liệu bổ sung về lỗi.
        id:
          type: string
          description: Mã định danh khớp với yêu cầu.
          example: '1'
    SerializablePubkey:
      type: string
      description: >-
        Khóa công khai Solana được biểu diễn dưới dạng chuỗi base58, dùng để
        nhận dạng tài khoản, cây và chương trình.
      default: 11111118eRTi4fUVRoeYEeeTyL4DPAwxatvWT5q1Z
      example: 11111118eRTi4fUVRoeYEeeTyL4DPAwxatvWT5q1Z
    CompressedProof:
      type: object
      required:
        - a
        - b
        - c
      properties:
        a:
          type: string
          format: binary
          description: Thành phần thứ nhất của bằng chứng hợp lệ không kiến thức Solana
        b:
          type: string
          format: binary
          description: Thành phần thứ hai của bằng chứng hợp lệ không kiến thức Solana
        c:
          type: string
          format: binary
          description: Thành phần thứ ba của bằng chứng hợp lệ không kiến thức Solana
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Khóa API Helius của bạn. Bạn có thể nhận khóa miễn phí trong [bảng điều
        khiển](https://dashboard.helius.dev/api-keys).

````