§ 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.

In development

§ 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.

  1. POST /api/auth/nonce with { wallet } returns a nonce, the exact message to sign and an expiry.
  2. Your wallet signs the message (ed25519). The statement reads: “Sign in to Sealed. This request will not trigger a transaction or cost any fees.”
  3. POST /api/auth/verify with the wallet, nonce and base58 signature returns a session token. Send it as Authorization: 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

  1. 01GET /api/account/deposit/USDC — company wallet, memo, mint

  2. 02transfer to company wallet with memo sealed:<ref>

  3. 03Helius RPC: new signatures on the company wallet

  4. 04status detected → confirmed after finality

  5. 05credit available balance — status credited

Deposit flow. If detection is slow you can nudge it by posting the transaction signature to /api/account/deposits.
Deposit statusMeaning
detectedTransfer seen with a valid memo; not yet final.
confirmedReached the required confirmations.
creditedPosted to your ledger balance; spendable.
rejectedUnknown 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).

Commit a sealed bid (offchain)
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_TOKEN on /api/admin/withdrawals.
Payouts disabled
Until the operator sets COMPANY_WALLET_SECRET_KEY, payoutsEnabled is 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 statusMeaning
queuedAccepted, waiting for the payout worker.
pending_approvalOver a limit or payouts disabled; waiting for an operator.
sendingTransaction built and submitted from the company wallet.
sentConfirmed on-chain; signature attached.
failedSubmission failed; funds are unlocked back to available.
rejectedDeclined 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.

GET /api/custody/info
{
  "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

RiskWhat could happenMitigation today
Operator key compromiseCompany wallet drainedKey held only as a Railway secret; small hot balance recommended; no multisig yet
Operator insolvency or misconductWithdrawals refusedLive proof of reserves; double-entry ledger; no legal protection
Ledger bugWrong balances or fillsSame property-tested shared math as the program; ledger must sum to zero
Deposit mismatchFunds not creditedMemo matching, signature nudge endpoint, manual review
Withdrawal delayFunds held for manual approvalPublished limits; status visible per withdrawal
Mode driftOffchain rules differ from the programBoth use @sealed/shared math; anti-snipe uses a 2 s window instead of a slot