Overview
CloakOTC is a private OTC desk for Solana. Two parties agree on a block trade (any pair of SOL, SPL or Token-2022 assets) and settle it through Solana Privacy Rings, a shielded pool that runs directly on Solana. Neither the size, the price nor the counterparty appears on-chain.
The connection between confidential balances and an actual swap is a per-deal escrow private wallet that pays both legs crosswise once both are in.
Lifecycle of a deal
- Private wallet. Each trader opens a CloakOTC private wallet in Vault (one plain-text signature) and deposits the asset they plan to trade into the Ring.
- Post. The maker sets both legs, an expiry, an optional Pyth SOL/USD band, and visibility: a private link, a single wallet, or the board, in one of two modes: public price (amounts and price visible, first come first served, the taker has 15 minutes to fund or the deal reopens) or on request (pair and size range only, the maker approves who sees the terms). The server registers a fresh escrow private wallet on the Rings registry.
- Fund. Create & fund sends the maker's leg to the escrow in the same flow. Until it lands, the deal is a hidden draft nobody can take; unfunded drafts close after 30 minutes.
- Partial fills (optional). Public-price deals can accept partial fills above a minimum. Each fill is a child deal with its own escrow; at settlement the listing escrow pays the taker and the fill escrow pays the maker. Write-once slot claims stop concurrent fills from overselling.
- Match. The taker opens the link, is the reserved wallet, is first to take a public-price board deal, or is the requester the maker approved on an on-request deal. A write-once claim makes sure only one wallet can ever become the taker. Their private wallet becomes the destination of their payout.
- Fund. Each side sends its leg to the escrow with one private transfer (
buildMultiTransferTransaction). Order doesn't matter. - Settle. On every check the escrow syncs and decrypts its own balance. With both legs in, a taker, no expiry and the price condition met, it sends the maker's asset to the taker and the taker's asset to the maker, minus the desk fee, in one private transfer per asset. Overpayments go back to whoever sent them.
- Refund. Cancelled by the maker (before settlement) or expired: 90 seconds after expiry, each leg goes back privately to the side that funded it.
The escrow
- Key.
HMAC-SHA256(ESCROW_MASTER_KEY, deal id)seeds an Ed25519 keypair. It signs the Rings derivation message itself, so its Rings keys can be rebuilt at any time and there is no per-deal secret to store. - Funding attribution. A deal's two legs are different assets, so the escrow's balance per asset is enough to know who funded. It never needs to know who sent a note.
- Fees and rent. An operator wallet pays registry rent and every escrow transaction fee (
payer/feePayer). The escrow never holds public SOL and never receives a public transfer, so nothing ties it to the maker or the taker. - Crash safety. Each payout is signed, recorded as pending with its signature, then sent. A later check confirms it or retries. A settlement that started always finishes, even past expiry; refunds never pay a mint twice.
- Storage. Deal records are AES-256-GCM encrypted at rest with a key derived from the master key.
What's private
| Data | On-chain visibility |
|---|---|
| Your deposit into the Ring | Public |
| That your private wallet sent a private transfer | Public |
| That it went to a deal escrow | Encrypted |
| Amounts of both legs | Encrypted |
| Which assets moved inside the Ring | Encrypted |
| Who your counterparty is | Encrypted |
| The escrow's registry record (paid by the operator) | Public |
| Your withdrawal back to a public wallet | Public |
Privacy grows with the crowd. Depositing exactly your leg right before a deal, or withdrawing exactly your payout right after, makes the link easy to guess. Deposit ahead in round amounts and leave proceeds in the Ring for a while.
Trust & security
- What you trust. During a deal the escrow key lives on the CloakOTC server. You trust the operator to run the published settlement rules (
lib/deal.ts) and not to move escrow funds otherwise. That is the same trust as any OTC desk, with on-chain payouts you can check. A program-enforced escrow inside the Ring is not possible with the current Rings SDK. - What the server can see. Deal terms and escrow balances (it needs them to settle). It never sees your private wallet key or your Rings keys: those are derived in your tab.
- Your keys. Your wallet signs a fixed plain-text message, hashed into your CloakOTC private wallet key. Only sign it on cloakotc.fun.
- Sign-in. A second plain-text signature gets a 24 h session token. It can't move funds.
- Proving. Proofs are generated by Helius' prover inside an attested enclave; requests are HPKE-encrypted to it. Our proxies only relay ciphertext and keep the API key server-side.
- Programs. Rings
ring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW, registryregy3WAeRXMYuMYxr5iK3Bf9Arr3PcxGxyzAddbiqDQ, both deployed by Helius. - Maturity. The Rings SDK is alpha. Start with small deals.
Disclosures
Either party can export a JSON receipt after a deal: network, deal id, both wallets, both legs, fee, status and every settlement or refund transaction. It is signed with the operator key over canonical JSON (sorted keys). Anyone can check it on /verify; changing any field breaks the signature. Nothing is disclosed unless a party exports it.
Fees & limits
- Desk fee: 0.2% of each leg, at settlement only. Refunds and cancels are free.
- The operator pays the escrow's registry rent and Rings transaction fees.
- You pay normal Solana fees and the Rings tree fee on your own deposit, transfer and withdrawal.
- Expiry from 15 minutes to 14 days. Five open deals per maker wallet.
- The two legs must be different assets.
Self-hosting
CloakOTC is a Next.js app. Server variables:
HELIUS_API_KEY=… # RPC, Rings indexer + prover
OPERATOR_SECRET=… # base58 64-byte keypair: pays escrow fees, collects desk fees
ESCROW_MASTER_KEY=… # 32 bytes hex: derives escrow keys, encrypts deal records
BLOB_READ_WRITE_TOKEN=… # Vercel Blob (optional locally: .data/ is used)
NEXT_PUBLIC_NETWORK=mainnet # or devnetLosing ESCROW_MASTER_KEY means losing access to every live escrow. Back it up offline.
FAQ
What exactly is hidden?
Inside a Privacy Ring, the amount and recipient of each private transfer are encrypted. When you fund a deal, the chain sees your private wallet touching the Ring, not that you paid an escrow or how much. Payouts look the same. Deposits into the Ring and withdrawals out of it are ordinary public transactions, so deposit early and in round amounts.
Who holds the funds during a deal?
A per-deal escrow private wallet whose key is derived on the CloakOTC server from the deal id and a server secret. The server decrypts the escrow balance, pays out when both legs are in (and the price condition holds), and refunds at expiry or on cancel. You trust the desk to run that code, like any OTC desk. The rules are open source and every payout is an on-chain transaction you can check.
How does the escrow know who paid?
Each deal is a two-asset swap, so the escrow's private balance per asset tells it everything: the maker's asset means the maker funded, the taker's asset means the taker did. It never needs to know who sent what, and nobody else can read the balance.
How does the board work?
Makers pick one of two modes. Public price: amounts and price are visible to everyone, the first wallet to take the deal gets it (a write-once claim settles ties), and it has 15 minutes to send its leg or the deal goes back on the board. On request: only the pair and a size range are listed; wallets ask for the terms and the maker approves one. In both modes the wallets and the transactions stay private.
Do I have to fund when I create a deal?
Yes. Create & fund opens the deal's escrow and sends your leg to it privately in one flow (depositing into your private balance first if needed). A deal only appears and can only be taken once your leg is in escrow, so takers never wait on a maker. Unfunded drafts disappear after 30 minutes.
How do partial fills work?
On a public-price board deal, the maker can allow partial fills with a minimum size. Each fill is its own small deal with its own escrow: the taker sends their part privately within 15 minutes, then the listing escrow pays them and their fill escrow pays the maker. Fills are reserved with write-once claims, so two takers can never fill more than what's left. Unfilled size returns to the maker at expiry or on cancel.
What is conditional settlement?
An optional band on Pyth's SOL/USD price. Both legs can be funded, but the escrow only settles while the price is inside the band. If it never is before expiry, both sides are refunded.
What is an optional disclosure?
After a deal, either party can download a receipt signed by the desk's operator key: the terms, both wallets and the settlement transaction ids. Give it to an auditor, a fund admin or an accountant; they check it on /verify. Nothing is disclosed unless you export it.
Why a separate private wallet?
Rings keys come from a signature that wallets like Phantom refuse to give websites, because it is secret key material. CloakOTC asks your wallet for a plain-text signature instead and turns it into a dedicated private wallet, rebuilt in your tab each time. Only sign it on cloakotc.fun.
What does it cost?
0.20% of each leg, taken only when a deal settles. Refunds are free. The desk pays the escrow's registry rent and transaction fees. You pay normal Solana fees on your own deposits, transfers and withdrawals.
Is this affiliated with Helius?
No. CloakOTC is an independent interface built on the public Solana Privacy Rings protocol and SDK. Rings is new, alpha-stage software, so start small.