Arcium and the trust model
How Hadal computes on sealed state with Arcium, who can read what, what privacy rests on and what the program enforces by itself.
Arcium is the network that computes on what Hadal holds sealed. An MPC network on Solana: a program queues a computation over encrypted state and receives the result in a callback. Hadal is such a program. Its sealed state lives in its own accounts on Solana as ciphertext. Each action that changes that state is a computation by an Arcium cluster, and the program writes back only what the cluster signed.
The cluster's nodes hold secret shares of the values they compute on. No node sees an order, a balance or the book in the clear.
A computation's life
Every action that touches sealed state runs the same four steps.
Seal
The wallet encrypts the action's private inputs (an order's side, size and limit, a deal's size, minimum size and limit, an answer, liquidity amounts, shares) with the reading key and the cluster's public key, together with the wallet's own address. A deposit, a withdrawal, a collect and a cancel have no private input.
Queue
The Hadal instruction checks the public rules, marks each account it will change as having this computation pending, and queues the computation with Arcium. It passes the sealed inputs, the public inputs (a deposit's amount, the fee rates) and the sealed state the circuit reads, by reference to the accounts that hold it: the trader's ledger, the market's book, the deal's escrow.
Compute
The cluster runs the circuit on secret shares and produces the new sealed state, with the few public values the circuit reveals.
Callback
Arcium verifies the result and invokes Hadal's callback instruction with the cluster's signed output. The callback verifies that output against the cluster and the computation, checks that the computation is the one pending on each account, writes the new ciphertext, acts on what was revealed (pays a withdrawal, sets a deal's status, records a sounding) and clears the pending mark.
Placing a sealed order queues no computation by itself. The order joins the market's queue, and its computation is queued when it reaches the head: see Sealed orders.
The time from queue to callback, the computation fee and the size of a callback are in Limits. The statuses a computation passes through as the HTTP API reports them are in GET /v1/computations/:id.
One computation at a time
A market's book, a sealed balance and a deal each take one computation at a time. An instruction that needs an account with a computation pending is refused with Busy.
A computation reads sealed state at the moment it runs and its callback replaces that state whole. Two computations on the same book or the same ledger would each start from the same ciphertext, and the second callback would erase the first. Taking them one at a time makes every computation start from the result of the one before it. For a market it also fixes the order of trading: orders are processed one by one, in the order they were placed.
Who can read what
Sealed state is encrypted in one of two ways.
| Sealed state | Sealed to | Who reads it |
|---|---|---|
The book | the cluster alone | No one. It holds the pool (reserves, total shares, protocol fees accrued, the interval's crossed and swept volume) and the resting orders (side, limit, what is left, what is locked, proceeds). |
A deal's escrow | the cluster alone | No one. It holds the maker's limit and minimum, what is left, what is locked, the proceeds, and the deal's fees and volume, beside the maker's side, which is public. |
A ledger | the trader's reading key | The trader. It holds the base balance, the quote balance, the liquidity shares and the receipt of the trader's last action. |
An order's terms | the trader's reading key | The trader. Side, size and limit. |
A maker's deal terms | the maker's reading key | The maker. Size, minimum size and limit. |
State sealed to the cluster alone can be computed on only by the cluster as a whole, and no party holds a key that opens it. Its contents reach the surface only through what a circuit reveals.
State sealed to a reading key is encrypted under a secret shared between that key and the cluster, so the trader decrypts it and the cluster computes on it. The cluster re-encrypts every result to the same key with a new nonce.
No single node can read either kind. Neither can the team, the program's authority or the HTTP API: the API stores and serves ciphertext and never receives a reading key. Anyone can fetch the ciphertext from the chain, and it opens only with the reading key of its owner.
What each action shows on the surface is listed in What is sealed and what is seen.
Sealed inputs are bound to their sender
Ciphertext on a public chain can be copied. Every sealed input a wallet sends therefore carries, inside the ciphertext, the address it was sealed for: an order's terms, a deal's terms, an answer, liquidity amounts and shares. The instruction passes the address of the account that is acting in the clear, and the circuit compares the two before anything moves.
When they differ, the action is void. Nothing moves, and what the chain shows is what any void action shows.
| A copy of | Sent by another wallet as its own |
|---|---|
| An order's terms | The order is void: its receipt reads not ok and nothing fills or rests. |
| A deal's terms | The deal comes out void and takes no escrow. |
| An answer | "No deal". |
| Liquidity amounts or shares | The pool and the balance are unchanged. |
So a wallet cannot replay someone else's sealed order against its own balance, or resend someone else's answer to a deal, to learn from the outcome what the ciphertext holds. Only the wallet that sealed an input can act with it.
The same holds for amounts: an action whose amounts would not fit the program's integer range is void, never wrapped. The ranges are in Limits.
What privacy rests on
Privacy holds while one node of the cluster is honest. The cluster runs Arcium's Cerberus protocol, which is built for a dishonest majority: values are secret-shared among the nodes and every share is authenticated. Nodes that collude learn nothing unless all of them do.
The same protocol detects a node that deviates. A detected fault aborts the computation instead of returning a wrong result, and an aborted computation writes nothing: Hadal's callback refuses an output that does not verify, with AbortedComputation, and the sealed state stays as it was.
Hadal computes on Arcium cluster 2026 on mainnet and cluster 456 on devnet. The cluster a market computes on is served as arciumClusterOffset by GET /v1/markets/:market/config.
What the program enforces by itself
These rules are plain Solana program logic. They hold whatever a computation returns.
- Tokens leave a vault in three ways only. A withdrawal whose computation revealed that the sealed balance covers it, paid by the callback for the amount asked, to the wallet's own token account. The refund of a deposit whose computation expired, to the depositor's token account. Protocol fees a sounding revealed, to the fee recipient's token accounts. No other instruction moves tokens out.
- A callback must answer the pending computation. A callback whose computation is not the one pending on the account is refused with
StaleComputation. A result cannot be applied twice, applied late after its accounts were released, or applied to another account. - A callback must carry the cluster's signature. The output is verified against the cluster's account and the computation's account before anything is written.
- Only the owner acts on a balance. A deposit, a withdrawal, an order, a liquidity change and a deal are signed by the wallet whose sealed balance they use, and each sealed input is bound to that wallet (see Sealed inputs are bound to their sender). The exceptions return value to its owner and nothing else: closing a deal that is filled or expired, cancelling a resting order after its expiry, and releasing an expired computation.
- Mints are checked. A market takes SPL Token mints, and Token-2022 mints that carry none of these extensions: transfer fee, transfer hook, permanent delegate, default account state, pausable. A mint with any of them is refused with
UnsupportedMintwhen the market is created, so no mint can charge the vaults, pull from them, freeze them or stop their payouts. A deposit or withdrawal must name the market's own vault and mint, or it is refused withWrongVault.
When a computation does not finish
A computation the cluster does not take up within 180 slots of being queued expires. Its callback never runs, so the sealed state is exactly what it was before. The accounts it marked stay pending until they are released.
Releasing is one instruction that any wallet may send once the release window has passed (the window is in Limits). Before that it is refused with ComputationStillLive, and on an account with nothing pending with NothingPending.
| Instruction | Releases | And |
|---|---|---|
reclaim | a sealed balance | Refunds a deposit that was waiting on the computation from the vault to the depositor's token account, and clears a withdrawal that was waiting. Emits DepositRefunded. |
release_market | a market's book | Emits ComputationReleased. |
release_deal | a deal | Makes a deal that was still opening void, since it took no escrow. Emits ComputationReleased. |
A computation that marked several accounts (an order marks the market's book and the trader's balance, an answer marks the deal and the taker's balance) has each of them released by its own instruction. After the release the action is void and can be sent again.
| The action was | After the release |
|---|---|
| A deposit | The tokens are back in the wallet. Deposit again. |
| A withdrawal | Nothing was paid and the sealed balance is unchanged. Withdraw again. |
| An order being processed | With the book and the owner's balance both released, the order is still pending at the head of the market's queue and is processed again. An order whose expiry has passed by then, or whose owner's balance is still pending, is closed without a computation and nothing of it moves: see Orders closed without a computation. |
| A collect, a cancel, a liquidity change | Nothing changed. Send it again. |
| Opening a deal | release_deal makes the deal void. It took no escrow. Open a new deal. |
| An answer to a deal | Nothing traded. The attempt is counted. Answer again. |
| Closing a deal | The deal keeps its status and its escrow. Close it again. |
| A sounding | The interval continues and the next sounding covers it. |
A callback that arrives after its accounts were released is refused, so an expired computation cannot land on top of a newer one.
The circuits
Hadal has eleven circuits, one per kind of computation. A circuit is a fixed program: its inputs, its outputs and what it reveals are set when it is compiled, and no input can make it reveal anything else.
The hash of each compiled circuit is built into the Hadal program. When a circuit is registered with the cluster, the program hands over that hash with the circuit's location, and the cluster checks the circuit it fetches against it. A computation is always one of these eleven, named by the instruction that queues it.
This is everything the circuits make public. A circuit that reveals nothing returns ciphertext only.
| Circuit | Reveals | Computes |
|---|---|---|
init_market | nothing | Opens a market's pool with the creator's public first amounts and credits the creator's sealed balance with shares. |
deposit | nothing | Adds a public deposit to a sealed balance. |
withdraw | whether the sealed balance covered the amount | Takes a public withdrawal out of a sealed balance if the balance covers it. |
process_order | whether a dark order rests in the book | Runs one sealed order against the whole book: crosses opposite resting orders at the pool's mid, then sweeps the pool's curve (a swap) or rests the remainder in a book slot (a dark order), and writes the receipt. |
settle_slot | nothing | Moves a resting order's proceeds to its owner's sealed balance. On a cancel it also returns what the order still has locked and empties the slot. |
add_liquidity | nothing | Moves sealed amounts of both tokens from a sealed balance to the pool, in the pool's ratio, and credits shares. |
remove_liquidity | nothing | Turns sealed shares back into both tokens in the sealed balance. |
open_deal | whether the maker's sealed balance covered the escrow | Moves a deal's escrow from the maker's sealed balance into the deal. |
take_deal | whether the answer traded, and whether the deal has nothing left | Compares an answer with a deal's sealed terms and, if the limits cross and the size meets the minimum, trades at the midpoint of the two limits. |
settle_deal | nothing | Returns a deal's remaining escrow and its proceeds to the maker's sealed balance, and adds the deal's fees and volume to the market's pool for the next sounding. |
sound | the pool's price, the interval's crossed volume and swept volume, and the protocol fees accrued in base and in quote | Takes a sounding: reveals the pool's figures for the interval and starts the next interval. |
Each circuit's inputs and outputs are in Circuits.