Private rooms
Open a new private loan in private_room_v2 and a new sealed sale in sale_room_v2. A v1 private_room settle writes every losing rate on chain. Do not open one. The finish that publishes every sale bid is the classic sale_room. v2 finish and settle carry a proof and leave losing values sealed. The walkthrough is Hand this to your agent. The relayer bodies are on Private flows & credentials.
Essey's private rooms keep both sides of every flow shielded: the price is sealed, and the money moves through a shielded pool instead of a wallet anyone can follow. There are two: the private loan room and the gated sale room. Both run in Sui Dollar (USDsui), USDC and SUI, and both are proven end to end on Sui testnet.
Text version
OFF CHAIN Your agent (SDK · MCP · API) -> Fresh wallet (or the relayer) -> Sui full node
Relayer (submits the proof) -> Sui full node (gRPC / GraphQL)
Issuance API (signs a dregg credential) · Seal key servers (threshold decryption)
ON SUI Sui full node -- transactions --> Access switch (CLOSED -> INVITE -> PUBLIC)
Access switch -> Private loan room -> ShieldedPool<C>
Access switch -> Gated sale room -> ShieldedPool<C>
ShieldedPool<C>: one per coin (Sui Dollar (USDsui), USDC, SUI), Groth16 proof + dregg check, bound to n0The building blocks#
From Sui and Mysten#
- Move objects. Every room, pool and loan is a Move object with its own rules, checked by Sui validators on every transaction.
- Seal. Mysten's threshold encryption. A bid or an offer is encrypted to a policy written in Move; the key servers release the key only when that policy says yes, for example after bidding closes and only to the borrower.
- Groth16 and Poseidon on Sui. Sui verifies BN254 Groth16 proofs and Poseidon hashes natively, so a zero-knowledge proof is checked on chain in the same transaction that moves the money.
From Essey#
- ShieldedPool<C>. One shielded pool per coin:
ShieldedPool<USDSUI>,ShieldedPool<USDC>andShieldedPool<SUI>. A member deposits once and later spends from a private note. Each spend publishes a nullifiern0, so a note is spent exactly once, and the spend names the relayer address, so a relayer can never redirect funds. - The dregg credential. A zero-knowledge membership credential. The Essey issuer signs
Poseidon(commitment, expiry, epoch)with a Baby Jubjub key; the member proves inside the Groth16 proof that it holds a signed credential, without revealing which one. The credential is bound to the spend'sn0, which gives three properties:- One bid per member per room. The room records the member's room tag; a second bid from the same member is refused.
- Unlinkable across rooms. The tag is derived per room, so in PUBLIC two rooms cannot tell they saw the same member. In CLOSED and INVITE the gate pass identifies the invited member to the gate by design.
- Revocable by epoch. Bumping the gate epoch retires every credential of the old epoch at once. The issuer signs one commitment per account per epoch and never learns the member's secret.
- The relayer. Submits the proof and pays the gas, so the member's address never appears on chain. It is coin-aware: fees are set in each coin's own decimals.
- The access switch. One admin switch stages launch: CLOSED (operators only) → INVITE (invited members, with per-member loan caps) → PUBLIC (any member with a credential).
The private loan room#
Text version
1 BORROWER OPENS SUI collateral into the room; terms public 2 LENDER OFFERS from the pool: rate sealed with Seal, relayed, dregg-checked 3 BORROWER SETTLES the loan lands in a private note 4 REPAY shielded from a note, or public 5 OR LIQUIDATE or claim a default; collateral covers the lender, surplus goes back
- Open. The borrower opens a
PrivateLoanRoomwith SUI collateral. The terms are public. - Offer. A lender offers a rate, sealed with Seal, funded from its note in the shielded pool and submitted by the relayer. The pool proof and the dregg credential are both bound to the spend's
n0. - Settle. After the close, Seal releases the offers to the borrower only. The borrower settles the one it picks, and the principal lands in the borrower's private note. A relayed settle is bound to an action hash over the room, a nonce and every argument, so it cannot be replayed or re-bound.
- Repay. A v2 loan repays a public coin (
repay_coin). The relayer has norepay_v2kind. A v1 room can repay from a note (kind=repay). The caller of repay, liquidate or claim-default supplieslenderEnc. An empty ciphertext leaves the lender's note unscannable; the lender rebuilds it withShieldedWallet.recoverRoomNote(MCPessey_shielded_recover). The winning lender's repay note reuses the room's publiclender_pubkeyandlender_blinding, so that repayment is linkable to the winning offer. Losing v2 offers stay sealed. - Liquidation and default. An undercollateralized loan is liquidated; at maturity the lender claims the default, and any surplus collateral goes back to the borrower.
The gated sale room#
Text version
1 DEPOSIT member puts coins into ShieldedPool<C> 2 PROVE MEMBERSHIP dregg credential, bound to the spend's n0 3 SEAL THE BID price encrypted with Seal in the browser 4 RELAYER SUBMITS pool_bid, not from the member's address 5 CLOSE AND OPEN Seal releases keys after close; the contract picks the highest 6 CLAIM OR REFUND winner claims the item; others get their deposit back
- Deposit into the pool for the room's coin.
- Prove membership with a dregg credential bound to the spend's
n0. - Seal the price in the browser.
- Bid through the relayer with
pool_bid. The bid locks the room's ceiling, so the amount on chain says nothing about the price. - Finish. After the close, Seal releases the sale-room bid keys to the seller (
room::seal_approvechecks the key id, the clock, and that the sender is the seller). The seller callsroom::finish. Every bid's price is readable from then on. The contract stores the winning price. Loan-room offer keys stay with the borrower. - Claim or refund. The winner claims the item; every other bidder gets its deposit back into the pool and can withdraw. If the seller never finishes, anyone can expire the room after its finish window. That returns every deposit, shielded ones when anyone collects, and does not open the prices.
Access stages#
Text version
CLOSED -> INVITE -> PUBLIC CLOSED operators only: team agents INVITE invited members, with loan caps PUBLIC open to members with a credential One admin switch (`AdminCap`) sets the stage; a gate epoch bump revokes every invite
| Stage | Who may act |
|---|---|
| CLOSED | Operators the admin names, for round trips with small amounts |
| INVITE | Invited members, each with a loan cap and a lifetime cap |
| PUBLIC | Any member holding a dregg credential |
A pause stops new risk only: repay, liquidation and default claims keep working.
Three coins#
Text version
Sui Dollar (USDsui) headline loan and bid coin -> ShieldedPool 0x304df63ce2bc69ecae878b366813a5d21a3d5be3f85704a688621bffb0bba11c USDC loans and bids -> ShieldedPool 0xe9fa57e6030e630302f63b45c2e7f19629b06fb99c72ee600c0f1351f1a1075c SUI collateral and bids -> ShieldedPool 0x96db81b0f3cc2c804bb26fb835eaa7e41f73070e2153ed3e70ea1645d1707436 One ShieldedPool<C> per coin. Testnet has all three.
| Coin | Role |
|---|---|
| Sui Dollar (USDsui) | The headline coin for loans and bids. On testnet it is the test coin tUSDsui (mock_usdsui::MOCK_USDSUI), minted by the hosted faucet. |
| USDC | Loans and bids |
| SUI | Collateral |
On Sui testnet#
- Sale room package
0x48db0307be9b6aadbf9f29c28561e1b450348ab2786ea4853a8d7249c22979a1. It hasroom::attest_seller. Shielded pools: SUI0x96db81b0f3cc2c804bb26fb835eaa7e41f73070e2153ed3e70ea1645d1707436, USDC0xe9fa57e6030e630302f63b45c2e7f19629b06fb99c72ee600c0f1351f1a1075c, USDsui0x304df63ce2bc69ecae878b366813a5d21a3d5be3f85704a688621bffb0bba11c. Access is PUBLIC. - Access switch: CLOSED → INVITE → PUBLIC, 37 of 37 passes and refusals as expected.
- Loan room: a pool-funded lender offer, settle into a private note, then a public repay and a shielded repay, each in Sui Dollar (test) and USDC. Seal releases the rate to the borrower after close and refuses the lender. Each coin pair has its own market object, and a room settles against the market for its own pair:
Market<SUI, USDC>(0x618b3e2946ff34462bf8af9ff2cafe444d7bb19b367e882ca67c9af59f1aad33),Market<SUI, USDSUI>(0x441827e6df0b201c85c2df88a4c43d3729d55a93d6b9618e167ea5d3110fbca6) andMarket<USDSUI, SUI>(0x71a134124c544d1e79bd619c3cfc27f0a1a3b2f9e7ea4a077a7c4638da9023f9, read throughpyth_oracle::read_inverseon the SUI/USD price).GET /v1/private/configlists all three underloanMarkets, each openable. - Liquidation, default claim with surplus returned, relayed settle and relayed cancel.
- Proved settlement: sale room
0xeeacf6d88596fedfdcd66cc6510c3c84e08d249bdb1d2b956f3c931a33feb714and private loan room0x5e2dbc14e6687bb550e2f69fcdd328c21b252fdcf9c9dddce0f8aa33f37e9050. Each settles with a Groth16 proof over up to 16 sealed bids or offers, so only the winner and the winning price or rate reach the chain. See Sealed rooms.
Those runs are on chain. A hosted-relayer private loan settled and repaid in digest Bwu2Bsw61FcDgs2xiY4xvm4DWsDcxT1W5FGaM6mHEevd / Er5GRmgaYiyxAQn8ozpHnmKES66Jt26PV8AzqPc1xXV5 (room 0xba214e557a70e933fffb6b5fa04252e3e2124c416c2005b9d5b1e961048c56bd). Fresh private sales on USDC, SUI and USDsui finished in FVz8D82frWQNz8mYzYx3JWoE4Vx1A3zUjyL8QnoE9VMb, GZSKAM9sfvZaZrMZjpdJJmu44PhX3nfSCiZoN9gQsers and BKSPRMQ6MVq1QdtXKJW2rhxdyEfp5zgnHi9M91VocgZs. Public lending on the cutover pool borrowed and repaid in 29e1vjf8FisQ5BTQGMMZx5MZWmygLuMnbkuHpjuLmJ57 / 2CnR89iw8mrT92Jisn2AzxARuoFYY1aeb7u6xQxRz4ow. The same ids are in Network and GET /v1/private/config.