The Verity Prover is a proxy server that enables you to generate cryptographic proofs for API interactions. It acts as a middleware between your application and target APIs, allowing you to prove specific aspects of the request/response cycle while selectively redacting sensitive information.

Key Concepts

Request ID

Every proof generation requires a unique Request ID (UUID) to track and retrieve the proof. You can generate one using:

uuidgen

Proof Subscription

Proofs are delivered asynchronously via Server-Sent Events (SSE). You’ll need to establish a connection to receive proofs as they’re generated.

Core Endpoints

Proxy Endpoint (/proxy)

This endpoint forwards your requests to target APIs while generating proofs. You can use any HTTP method to call this endpoint, such as GET, POST, PUT, DELETE, etc.

Required Headers:

  • T-PROXY-URL: The target API URL you want to call
  • T-REQUEST-ID: Your generated UUID for tracking the proof
  • T-REDACTED (optional): Comma-separated list of fields to redact
  • T-PROVE-FAILED-REQ (optional): If set to true, the proof will be generated even if the request fails

Redaction Syntax:

Fields in the T-REDACTED header follow this pattern:

  • req:body:fieldName: Redact request body field
  • req:header:headerName: Redact request header
  • res:body:fieldName: Redact response body field
  • res:header:headerName: Redact response header

Proof Subscription (/proof/{requestId})

Subscribe to receive proofs for a specific request ID via SSE.

Basic POST Request

curl http://localhost:8080/proxy -X POST \
-H "T-PROXY-URL: https://jsonplaceholder.typicode.com/posts" \
-H "T-REDACTED: res:body:id,req:body:userId" \
-H "T-REQUEST-ID: <your-uuid>" \
-H "Content-Type: application/json" \
-d '{"title": "Example", "userId": 1}'

Simple GET Request

curl http://localhost:8080/proxy -X GET \
-H "T-PROXY-URL: https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd" \
-H "T-REQUEST-ID: <your-uuid>" \
-H "Content-Type: application/json"

Subscribing to Proofs

curl -N http://localhost:8080/proof/<your-uuid>

Best Practices

  1. Always Generate Fresh UUIDs: Use a new UUID for each proof request to avoid collisions.
  2. Subscribe First: Set up your SSE connection before making the proxy request.
  3. Handle Timeouts: Implement appropriate timeout handling for both proxy requests and SSE connections.
  4. Redact Sensitive Data: Use the T-REDACTED header to protect sensitive information from TLS proofs while maintaining proof validity.
  5. Error Handling: The API uses standard HTTP status codes:
    • 200: Successful request
    • 400: Bad request (invalid headers or body)
    • 404: Target API not found
    • 500: Server error