§ 02 — Custody
Offchain and custodial, by default.
In the default execution mode Sealed holds your deposits in a company wallet and tracks what you own in a double-entry ledger. This page explains exactly how money gets in, how it gets out, and what you are trusting.
§ 2.1The model in one paragraph
The backend runs auctions, clearing, the graduation pool, buyback drips, fee splits and holder rewards as postings in a Postgres double-entry ledger. Every posting debits one account and credits another, so the books always sum to zero. Real assets live in one place: the company wallet. Proof of reserves compares that wallet's on-chain balances with the sum of user liabilities in the ledger, live. The contract for all of this is packages/shared/src/custody.ts; the server code is being written in apps/api/src/offchain/.
$2,500
auto-approved withdrawal ceiling (USD-equivalent)
$25,000
daily withdrawal limit per wallet
1
company wallet holding every deposit
0
on-chain transactions needed to bid or trade
§ 2.2Sign in with Solana
There are no passwords. You prove you own a wallet by signing a message; the signature costs nothing and sends no transaction.
POST /api/auth/noncewith{ wallet }returns a nonce, the exact message to sign and an expiry.- Your wallet signs the message (ed25519). The statement reads: “Sign in to Sealed. This request will not trigger a transaction or cost any fees.”
POST /api/auth/verifywith the wallet, nonce and base58 signature returns a session token. Send it asAuthorization: Bearer <token>on every account and trade call.
§ 2.3Deposits
Each user has a stable deposit reference. A deposit is an ordinary on-chain transfer of SOL or an SPL token to the company wallet that carries the memo sealed:<depositRef>. The backend watches the wallet through Helius RPC, matches the memo, waits for the configured confirmations (DEPOSIT_CONFIRMATIONS, finalized commitment) and then credits your available balance.
You
Solana
Sealed API
Ledger
01GET /api/account/deposit/USDC — company wallet, memo, mint
02transfer to company wallet with memo sealed:<ref>
03Helius RPC: new signatures on the company wallet
04status detected → confirmed after finality
05credit available balance — status credited
| Deposit status | Meaning |
|---|---|
detected | Transfer seen with a valid memo; not yet final. |
confirmed | Reached the required confirmations. |
credited | Posted to your ledger balance; spendable. |
rejected | Unknown memo, unsupported asset or failed transfer. The reason field says which. |
§ 2.4Bidding and trading against your balance
Once credited, a balance moves only by ledger postings. Committing a bid locks the deposit from your available quote balance; the commitment is the same keccak preimage as the onchain mode, with the bidder fixed to your signed-in wallet. Swaps, claims, staking and reward claims are API calls. Balances show available and locked (open bids and pending withdrawals).
POST /api/trade/commit
Authorization: Bearer <token>
Content-Type: application/json
{
"launchId": "<launch id>",
"commitment": "<64 hex: keccak256(wallet || u64le(maxPrice) || u64le(bidAmount) || salt)>",
"deposit": 25,
"sealedReveal": { "...": "optional SealedRevealEnvelope for auto-reveal" }
}
→ { "bidId": "...", "bidCount": 58 }§ 2.5Withdrawals
POST /api/account/withdrawals with an asset, amount and destination (the client defaults it to your signed-in wallet). The amount is locked immediately. The payout worker then sends it from the company wallet.
- Auto-approved
- At or under $2,500 USD-equivalent and inside the $25,000 daily per-wallet limit.
- Manual approval
- Above either limit, or whenever payouts are disabled. An operator approves or rejects with
ADMIN_TOKENon/api/admin/withdrawals. - Payouts disabled
- Until the operator sets
COMPANY_WALLET_SECRET_KEY,payoutsEnabledis false and every withdrawal queues for manual processing. - USD valuation
- Limits use the reference prices in quoteAssets.ts, which are demo prices — a known simplification.
| Withdrawal status | Meaning |
|---|---|
queued | Accepted, waiting for the payout worker. |
pending_approval | Over a limit or payouts disabled; waiting for an operator. |
sending | Transaction built and submitted from the company wallet. |
sent | Confirmed on-chain; signature attached. |
failed | Submission failed; funds are unlocked back to available. |
rejected | Declined by an operator; reason attached. |
§ 2.6Proof of reserves
GET /api/custody/info (no auth) returns, per asset, the company wallet's on-chain balance, the ledger's total liabilities to users, their ratio and an as-of timestamp. A ratio ≥ 1 means every user balance is covered by assets you can verify yourself on a block explorer.
{
"companyWallet": "DDhVBh8HSwvYmCmXRowowUdDLcCc5vA9BM3GJMR3hm1j",
"network": "devnet",
"mode": "offchain",
"payoutsEnabled": false,
"proofOfReserves": [
{ "asset": "SOL", "onchain": 412.8, "liabilities": 398.1, "ratio": 1.037, "asOfTs": 1795692450 },
{ "asset": "USDC", "onchain": 50210, "liabilities": 49877, "ratio": 1.006, "asOfTs": 1795692450 }
]
}What proof of reserves does not prove
- That the ledger is complete. Liabilities are the operator's own figure; a hidden liability would not appear.
- That the assets will still be there tomorrow. It is a snapshot, not a lock.
- That the key is safe. Reserves can be moved by whoever holds
COMPANY_WALLET_SECRET_KEY.
§ 2.7Risks, plainly
| Risk | What could happen | Mitigation today |
|---|---|---|
| Operator key compromise | Company wallet drained | Key held only as a Railway secret; small hot balance recommended; no multisig yet |
| Operator insolvency or misconduct | Withdrawals refused | Live proof of reserves; double-entry ledger; no legal protection |
| Ledger bug | Wrong balances or fills | Same property-tested shared math as the program; ledger must sum to zero |
| Deposit mismatch | Funds not credited | Memo matching, signature nudge endpoint, manual review |
| Withdrawal delay | Funds held for manual approval | Published limits; status visible per withdrawal |
| Mode drift | Offchain rules differ from the program | Both use @sealed/shared math; anti-snipe uses a 2 s window instead of a slot |