> ## Documentation Index
> Fetch the complete documentation index at: https://developer.usewarp.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify a proof

> Verifies a Groth16 proof off-chain against the proof's stored verification key. With `onchain: true`, also calls `verifyProof` on the proof's deployed verifier contract (allow-listed chains only). Enforces the proof's policies: value rules, a nonce signal (`kind: "nonce"`) that must equal the supplied nonce, and a nullifier signal (`kind: "nullifier"`) that can only be accepted once per proof. Attestation circuits also declare `kind: "project_ref"` (must equal the stored value) and `kind: "registry_nonce"` (enforced by the on-chain registry). A malformed policy fails closed (`policy: "invalid_policy"`, `valid: false`). Returns a signed receipt (compact JWS, EdDSA) that you can verify with the keys from the JWKS endpoint. Only the owning project's secret key can verify its proofs.



## OpenAPI

````yaml /openapi.json post /v1/zk/proofs/{proofId}/verify
openapi: 3.0.3
info:
  title: Warp API
  version: 1.0.0
  description: >-
    Public Warp API: hosted checkout sessions for Pay with Warp, hosted ZK proof
    verification, and Warp Verify attestation checks.
  contact:
    name: Warp Support
    email: support@usewarp.net
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.usewarp.net
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Checkout sessions
    description: Create and track hosted checkout sessions.
  - name: ZK verification
    description: Verify Groth16 proofs against circuits deployed from the Warp Platform.
  - name: Attestations
    description: Public Warp Verify attestation checks.
  - name: Health
    description: Service status.
paths:
  /v1/zk/proofs/{proofId}/verify:
    post:
      tags:
        - ZK verification
      summary: Verify a proof
      description: >-
        Verifies a Groth16 proof off-chain against the proof's stored
        verification key. With `onchain: true`, also calls `verifyProof` on the
        proof's deployed verifier contract (allow-listed chains only). Enforces
        the proof's policies: value rules, a nonce signal (`kind: "nonce"`) that
        must equal the supplied nonce, and a nullifier signal (`kind:
        "nullifier"`) that can only be accepted once per proof. Attestation
        circuits also declare `kind: "project_ref"` (must equal the stored
        value) and `kind: "registry_nonce"` (enforced by the on-chain registry).
        A malformed policy fails closed (`policy: "invalid_policy"`, `valid:
        false`). Returns a signed receipt (compact JWS, EdDSA) that you can
        verify with the keys from the JWKS endpoint. Only the owning project's
        secret key can verify its proofs.
      operationId: verifyZkProof
      parameters:
        - name: proofId
          in: path
          required: true
          description: ZK proof ID from the Warp Platform.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ZkVerifyRequest'
      responses:
        '200':
          description: Verification result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ZkVerifyResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: invalid_request
                  message: 'amount_usd: Number must be greater than 0'
        '401':
          description: Missing or invalid secret key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Invalid API key
        '404':
          description: Not found (or owned by another project)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: Resource not found
        '409':
          description: The proof has no verification key yet (`proof_not_ready`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Too many requests. Retry after the window resets.
        '502':
          description: >-
            On-chain verification was requested but the chain RPC did not
            respond (`onchain_unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ZkVerifyRequest:
      type: object
      required:
        - proof
        - public_signals
      properties:
        proof:
          $ref: '#/components/schemas/Groth16Proof'
        public_signals:
          type: array
          items:
            type: string
          description: >-
            Public signals as decimal strings. The count must match the circuit
            and each value must be below the BN254 scalar field modulus.
        nonce:
          type: string
          pattern: ^[0-9]{1,78}$
          description: >-
            Decimal nonce from the create-nonce endpoint. Required when the
            proof declares a nonce signal; it must equal that public signal.
            Otherwise optional: it is consumed but reported as `unbound`,
            because the proof itself does not commit to it.
        onchain:
          type: boolean
          default: false
          description: Also call `verifyProof` on the deployed verifier contract.
    ZkVerifyResponse:
      type: object
      properties:
        valid:
          type: boolean
        proof_id:
          type: string
        checks:
          type: object
          properties:
            offchain:
              type: boolean
            onchain:
              type: object
              properties:
                chain_id:
                  type: integer
                contract_address:
                  type: string
                result:
                  type: boolean
            nonce:
              type: string
              enum:
                - ok
                - missing
                - used
                - expired
                - mismatch
                - unbound
              description: >-
                `ok`: the nonce is the proof's nonce signal and was consumed.
                `unbound`: consumed, but the circuit has no nonce signal (replay
                protection is advisory only). `mismatch`: the nonce does not
                equal the nonce signal. `missing`: unknown nonce, or none
                supplied when the circuit requires one. Omitted when no nonce
                was supplied and none is required. Anything other than `ok` or
                `unbound` makes `valid` false.
            policy:
              type: string
              enum:
                - ok
                - mismatch
                - n/a
                - invalid_policy
              description: >-
                `n/a` when the proof has no value rules. `invalid_policy` when a
                stored policy entry is malformed; the result is then never
                valid.
            nullifier:
              type: string
              enum:
                - ok
                - reused
              description: >-
                Present when the proof declares a nullifier signal and every
                other check passed. `reused` means the nullifier was already
                accepted for this proof, and `valid` is false.
        verified_at:
          type: string
          format: date-time
        receipt:
          type: string
          description: >-
            Compact JWS (EdDSA, Ed25519, `typ: warp-verify-receipt+jws`) over a
            `ZkReceiptClaims` payload. Verify the signature with the JWKS
            endpoint, then check `aud`, `exp`, `nonce` and `nonce_bound`, and
            remember `jti` if you need single-use receipts.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: >-
                Machine-readable error code: `invalid_request`, `unauthorized`,
                `not_found`, `proof_not_ready`, `onchain_unavailable`,
                `rate_limited` or `internal_error`.
              example: invalid_request
            message:
              type: string
              description: Human-readable description.
    Groth16Proof:
      type: object
      required:
        - pi_a
        - pi_b
        - pi_c
      description: Proof object as produced by snarkjs `groth16.fullProve`.
      properties:
        pi_a:
          type: array
          items:
            type: string
        pi_b:
          type: array
          items:
            type: array
            items:
              type: string
        pi_c:
          type: array
          items:
            type: string
        protocol:
          type: string
          enum:
            - groth16
        curve:
          type: string
          enum:
            - bn128
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your project secret key: `sk_test_...` (testnet) or `sk_live_...`
        (mainnet). Use it only on your server.

````

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