← LeafPayOpenAPI JSON
Developer interface · Solana devnet

LeafPay API

Read the shared pool, broadcast wallet-signed transactions, or submit a withdrawal proof to the relayer. Notes and private nullifiers stay with the client.

Endpoints

GET/api/v1/statusNetwork, program, pool, relayer, and rate-limit status.
GET/api/v1/poolCurrent Merkle batch, roots, leaves, and indexer addresses.
GET/api/v1/circuitsProving artifacts and verification keys for supported operations.
POST/api/v1/transactionsBroadcast a fully signed LeafPay v2 devnet transaction.
GET/api/v1/relayCheck whether the withdrawal relayer is available.
POST/api/v1/relaySubmit a recipient-bound withdrawal proof for relaying.

Get pool state

The pool endpoint includes the current 16-leaf buffer and the indexer addresses used for reconstructing older Merkle paths.

curl https://leafpay.xyz/api/v1/pool

Submit a transaction

Sign a legacy transaction with your own devnet wallet, encode its bytes as base64, and submit them. The API does not hold your wallet key or fund deposits.

POST /api/v1/transactions
Content-Type: application/json

{"signedTransaction":"<base64>"}

Relayed withdrawals

Generate a Groth16 proof locally with the circuit files published by this site. The proof binds the recipient address, so the relayer cannot redirect the payout. Submit the packed instruction bytes to /api/v1/relay:

{"identifier":"leafpayv2","instructionData":"<base64>"}

The relayer pays the transaction fee on devnet. The on-chain withdrawal still deducts its pool fee.

Limits and errors

Limits are per public IP across deployments: 60 reads, 12 signed submissions, and 6 relayed withdrawals per minute. Exceeding a limit returns HTTP 429 with a Retry-After header. When rate-limit storage is unavailable, the API returns 503 instead of accepting unlimited requests.

All transaction endpoints accept only the leafpayv2 devnet pool. Signed submissions permit LeafPay, Solana Compute Budget, and Memo instructions. The program validates proofs and state transitions on-chain.