Docs/Reference
API
Every route of the Liora API, with its request, its response and the types they are made of.
The API serves the public record (configuration, directory, whitelist, ledger), takes registrations, and relays proved transfers. It holds no keys of any holder and learns no recipient or amount. The SDK and the CLI call it for you. Contract 0.2.1.
#Conventions
- Every path is under
/v1, on the API's origin. The examples write that origin as$LIORA_API. - Responses are JSON. A
POSTsendsContent-Type: application/json, and a body with a field the route does not know is rejected. - A successful response carries the header
X-Contract-Version. - A failed request answers with an error envelope and the code's HTTP status.
- New values can appear in
status,kindand error codes. Show one you do not know as it is. - Before the program is configured, data routes answer
{"status": "waiting"}with HTTP 200. Read/v1/healthto tell that apart from an empty ledger.
#Routes
| Route | What it does |
|---|---|
GET /health | The same as GET /v1/health.Returns HealthResponse. |
GET /v1/health | Whether the service is ready, its mode, and the relayer's balance. Returns HealthResponse. |
GET /v1/figures | The measured figures. Returns FiguresResponse. |
GET /v1/config | The program address, the roles, the auditor's public key and both fees. Returns ProgramConfig. |
GET /v1/directory | Every registration, the whitelist state and every active leaf. Returns DirectoryResponse. |
GET /v1/whitelist | The current root, the revision, the size and the accepted roots. Returns WhitelistState. |
GET /v1/requests | Registrations waiting for the issuer, oldest first. Returns RequestsResponse. |
POST /v1/requests | Files a registration signed by the wallet. Takes RegistrationRequest. Returns DirectoryEntry. |
POST /v1/issuer/decisions | Records a refusal signed by the issuer. Takes IssuerDecisionRequest. Returns IssuerDecisionResponse. |
GET /v1/ledger | Every payment's announcement, newest first. Returns LedgerResponse. |
GET /v1/announcements | The same list, for a device's scan. Returns LedgerResponse. |
GET /v1/ledger/:signature | One payment. Takes eventIndex query, optional. Returns PublicPayment. |
POST /v1/relay | Hands a proved payment or withdrawal to the relayer. Takes RelayRequest. Returns RelayStatus. |
GET /v1/relay/:signature | Follows a relayed transaction. Returns RelayStatus. |
POST /v1/rpc | A short list of Solana reads, and sending a wallet-signed deposit, admission or removal. Takes JSON-RPC. Returns JSON-RPC. |
POST /v1/indexer | The program's public timeline for a scan, or a read from the Rings indexer. Takes IndexerRequest, or JSON-RPC. Returns IndexerResponse, or JSON-RPC. |
POST /v1/indexer/:method | A read from the Rings indexer, with the method in the path. Takes JSON-RPC. Returns JSON-RPC. |
POST /v1/prover | Carries an encrypted Rings proving request to the attested prover. Takes ProverRequest. Returns ProverResponse. |
GET /v1/artifacts/:version/:name | A proving file of one contract version. Returns A file. |
GET /v1/artifacts/:name | The current proving file of that name. Returns A file. |
GET /v1/prover/* | The attested prover's own routes: attestation and job status. Returns As the prover answers. |
POST /v1/prover/* | The attested prover's own routes: proof submission. Takes Encrypted bytes. Returns Encrypted bytes. |
#Reading the public record
#GET /v1/config
curl "$LIORA_API/v1/config"The roles and the fees are whatever the program's configuration holds at that moment, so read them from here before showing a total.
programIdWalletAddress- The Liora program.
issuerWalletAddress- The wallet that admits and removes recipients.
relayerWalletAddress- The wallet that submits payments and withdrawals.
auditorPublicKeyHex32- The auditor's public key
A, packed. feeRecipientWalletAddress- The wallet that receives the protocol fee.
protocolFeeLamportsLamports- The flat protocol fee per payment or withdrawal.
relayerFeeLamportsLamports- The flat amount paid back to the relayer per payment or withdrawal.
#GET /v1/whitelist
curl "$LIORA_API/v1/whitelist"{
"root": "0f111b8122f8be992dc3ed9bccee188cf73db3fb43d833ba58d61d7fcd070d17",
"revision": 7,
"size": 1,
"depth": 24,
"acceptedRoots": ["0f111b8122f8be992dc3ed9bccee188cf73db3fb43d833ba58d61d7fcd070d17"]
}rootFieldHex- The current root.
revisioninteger- Rises by one with every admission and removal.
sizeinteger- The number of active entries.
depthinteger- The depth of the tree.
acceptedRootsFieldHex[]- The roots a payment's proof may use, newest first.
#GET /v1/directory
Everything a device needs to look a recipient up and build their path, in one snapshot.
entriesDirectoryEntry[]- Every registration, whatever its status.
whitelistWhitelistState- The whitelist as of this snapshot.
treeLeaves{ leafIndex, leaf }[]- Every active leaf on chain, including any admitted without a registration on file.
A DirectoryEntry:
idstring- The registration's id, 1 to 64 characters.
walletWalletAddress- The wallet that asked.
handleHandle- The name it asked for.
metaAddressMetaAddressText- The meta-address.
statusstringrequested,whitelisted,refusedorremoved.leafIndexinteger or null- The position in the tree, once admitted. Kept after removal.
leafFieldHex or null- The leaf, once admitted. Kept after removal.
updatedAtTimestamp- When the status last changed.
The device does the lookup itself, on the whole snapshot. The API is never asked about one recipient.
#GET /v1/ledger
curl "$LIORA_API/v1/ledger"{
"payments": [
{
"signature": "Hub4XHEnP8jF9H5QvcJRCWmY2NzM3izsQ7TjMQWmntvEbWGFwZwzEZZPziD4967XsJtfCQ4mayj81pZmCxUftEo",
"eventIndex": 0,
"slot": "550",
"blockTime": "2026-11-25T14:29:01.000Z",
"proofVerified": true,
"stealthAddress": "936cd345f0e5b7ff585e0f613d5e27c4d8369d02d36b2897aca48f830326c383",
"ephemeralKey": "f636c2874cdf59f01c7a7bbff11ef901df8cf2e62e2387317bffdf5adf779f94",
"viewTag": 194,
"auditCiphertext": {
"c1": "7ab39a9094b649c62d352ce9ce5e32b071b7796d345d2c30bb154510746ba19a",
"c2": "bfc3e88a5aa4cd050da36dd8d8b6ae9d37f4675b91e8e23ee5fd53956349a924"
},
"whitelistRoot": "1b30ee114667671ee5d003c12be52c30a82ae3e83f85498fb12392a18c94f357"
}
]
}Each entry is a PublicPayment. Its fields are described on Announcements. GET /v1/announcements returns the same list.
#GET /v1/ledger/:signature
One payment. A payment is identified by its transaction signature and its eventIndex. Without the query, the first announcement of that transaction is returned.
curl "$LIORA_API/v1/ledger/$SIGNATURE?eventIndex=0"A signature that is not on the ledger answers 404:
{ "error": { "code": "NOT_FOUND", "message": "This payment has not been indexed.", "retryable": false, "stage": "read" } }#GET /v1/health
statusstringready, orwaitingbefore the program is configured.modestringchainfor the real service,fixturefor a fixture server.crankstring- The state of the fee worker.
relayerobject, optional- The relayer's
address, itsbalanceLamports, thenetworkFeesLamportsit has paid, therepaymentsLamportsit has received, andnetFeesLamports, the first less the second.
#GET /v1/figures
The measured figures, as Measured figures shows them: provingTimeMs, proofBytes, computeUnits and transactionBytes for a payment, with the full measurements under transactions and browser.
#Registering
#POST /v1/requests
Files a registration. The wallet signs the message that registrationMessage builds: the line Liora registration v1, then the wallet, the handle and the meta-address, each on its own line, joined by single line feeds with none at the end.
walletWalletAddressrequired- The registering wallet.
handleHandlerequired- A lowercase letter, then 1 to 31 lowercase letters, digits,
_or-. metaAddressMetaAddressTextrequired- The meta-address to whitelist.
signatureTransactionSignaturerequired- The wallet's Ed25519 signature over that message, base58.
Returns the DirectoryEntry, with status requested. A wallet has one registration. Sending the identical request again returns the entry on file. A handle or spend key that a pending, whitelisted or removed entry holds answers CONFLICT.
#GET /v1/requests
The registrations with status requested, oldest first, as { "requests": DirectoryEntry[] }.
#POST /v1/issuer/decisions
Records a refusal. The issuer signs the message that issuerDecisionMessage builds: Liora issuer decision v1, then the issuer, the request id, the action and the revision.
issuerWalletAddressrequired- The configured issuer.
requestIdstringrequired- The registration's id.
actionstringrequiredrefuse. Admissions and removals are transactions the issuer's wallet signs, sent through/v1/rpc.revisionintegerrequired- The whitelist revision the issuer read.
signatureTransactionSignaturerequired- The issuer's signature over that message.
Returns { entry, whitelist }. A refusal changes the entry's status and leaves the tree, the root and the revision as they were.
#Sending transfers
#POST /v1/relay
Takes one unsigned version 1 transaction holding one Liora pay or withdraw, already proved, with the relayer as fee payer and only signer.
transactionBase64Base64required- The serialized transaction.
The relayer checks that the transaction calls the Liora program and nothing else, simulates it, signs as fee payer and sends it.
signatureTransactionSignature- The transaction's signature. Follow it.
kindstringpayorwithdraw.statusstringsent,confirmedorfailed.errorFailure, optional- Why it failed.
Sending the same bytes twice returns the first submission. A different transaction that spends the same note while the first is pending answers INPUT_SPENT, until the first confirms, fails or expires.
#GET /v1/relay/:signature
The current RelayStatus of a submission. A transaction that failed on chain answers HTTP 200 with status failed and the reason in error.
#POST /v1/rpc
A JSON-RPC endpoint limited to getAccountInfo, getLatestBlockhash, getSignatureStatuses, getSlot, getBlockHeight and sendTransaction. sendTransaction accepts transactions a wallet has signed itself: a deposit, an admission or a removal.
#POST /v1/indexer
With the body { "method": "getNotes" } it returns the program's confirmed public timeline: deposits with their wallet, balance key and amount, each payment and withdrawal with its announcements, and the nullifiers spent. A device scans this list locally.
With a JSON-RPC body it passes getEncryptedUtxosByTags and getShieldedTransactionsBySignature to the Rings indexer. POST /v1/indexer/:method does the same with the method in the path.
#The prover routes
The Liora proof is made on the device and is never sent to a prover. The Rings proof for the same transfer is made by a Rings prover: one on the device's own machine, or the attested prover reached through /v1/prover. In the second case the SDK checks the prover's attestation and encrypts the request to it, so the API passes on bytes it cannot read.
#The proving files
GET /v1/artifacts/:version/:name serves pay.wasm, pay.zkey, pay.vkey.json and the same three for withdraw, for one contract version. A versioned file never changes and is cached for a year. GET /v1/artifacts/:name serves the current one.
#Types
| Type | Form |
|---|---|
WalletAddress | 32 bytes in base58 |
TransactionSignature | 64 bytes in base58 |
Hex32 | 64 lowercase hex digits |
FieldHex | 64 lowercase hex digits, a number below the BN254 field modulus |
MetaAddressText | liora:1: and 128 lowercase hex digits |
Handle | A lowercase letter, then 1 to 31 of a-z, 0-9, _, - |
Lamports | A decimal string of an unsigned 64-bit integer, with no leading zeros |
Base64 | Padded base64 |
Timestamp | ISO 8601, UTC |
slot uses the Lamports form. viewTag is an integer from 0 to 255.
#Limits
| Calls | Per client, per minute |
|---|---|
| Registrations, refusals, relayed and wallet-signed transactions | 30 in all |
Solana reads through /v1/rpc | 360 |
| Rings indexer reads | 360 |
| Prover calls | 60 |
Over a limit the API answers RATE_LIMITED with a Retry-After header.