SDK-facing route map
POST /transactUTXO submitPOST /transact_swapUTXO swap submitGET /status/:idasync job statusPOST /viewing-key/registerviewing-key registrationGET /commitmentscommitment list for Merkle rebuildGET /merkle-rootlatest on-chain root
POST /transact (UTXO)
public_inputs byte layout (264 bytes):
root[32]publicAmount[8](i64, LE)extDataHash[32]mintAddress[32]nullifiers[64]commitments[64]chainNoteHash[32]
proof_bytesmust decode to exactly256bytes.public_inputsmust decode to exactly264bytes.recipientis required whenpublicAmount < 0.encrypted_notessupports max 2 entries and bounded total bytes.
POST /transact_swap (UTXO swap)
- Requires withdrawal semantics (
publicAmount < 0). - Submits
TransactSwap, then queues swap execution job. - Response includes
swap_state_pdaandnullifierwhen available.
POST /viewing-key/register
Registers a 32-byte viewing key (hex) after wallet signature verification.
- Signature must be over the fixed Cloak sign-in message.
- If
identifieris omitted, relay computessha256(user_pubkey || viewing_key_hex). - Relay stores identifier + viewing key; no raw wallet column is required.
GET /commitments
Returns DB-backed commitments for Merkle rebuild:
- Use this endpoint when rebuilding Merkle state for proof generation.
GET /merkle-root
Returns latest chain root and tree address:
503 with pool-init guidance.