Proof Relayer
Generates Groth16 ZK proofs server-side. CPU-intensive — limited to 2 concurrent proof generations.
Endpoint
POST /api/proof/generate
Port: 3003
Public URL: https://relayer.specterchain.com/api/proof/generate
Request
{
"secret": "123456789",
"nullifierSecret": "987654321",
"amount": "1000000000000000000",
"blinding": "111222333",
"tokenIdHash": "0",
"recipient": "0xRecipientAddress",
"withdrawAmount": "1000000000000000000",
"newBlinding": "0"
}
| Field | Type | Required | Description |
|---|---|---|---|
secret | string | Yes | Commitment secret |
nullifierSecret | string | Yes | Nullifier secret |
amount | string | Yes | Full committed amount |
blinding | string | Yes | Commitment blinding factor |
tokenIdHash | string | Yes | Token ID hash |
recipient | string | Yes | Recipient Ethereum address |
withdrawAmount | string | Yes | Amount to withdraw |
newBlinding | string | Yes | Blinding for change commitment ("0" for full reveal) |
Response
{
"proof": [
"0x...", "0x...", "0x...", "0x...",
"0x...", "0x...", "0x...", "0x..."
],
"publicInputs": [
"0x...", "0x...", "0x...", "0x...",
"0x...", "0x...", "0x...", "0x..."
]
}
The proof array contains 8 uint256 values (3 EC points) ready for the reveal() function.
Limits
| Parameter | Value |
|---|---|
| Rate limit | 5 requests/minute/IP |
| Max concurrent proofs | 2 |
| Commitment cache TTL | 5 minutes |
Authentication
Requires HMAC signature:
X-HMAC-Signature: <computed-hmac>
Status endpoint
GET /status
Returns service status including current load and queue depth.
Security note
warning
Like the commitment relayer, this service receives your secret values in plaintext. For maximum privacy, generate proofs client-side using snarkjs. See Generating Proofs.
Internal architecture
The proof relayer:
- Maintains an in-memory copy of the Merkle tree (rebuilt from
CommitmentAddedevents) - Computes the Merkle proof path for the requested commitment
- Generates the Groth16 proof using snarkjs with the circuit WASM and proving key
- Returns the formatted proof and public inputs