Docs / Architecture
Inside Ordeo
The parts of Ordeo and how they work together
Ordeo is a public ERC-20, a handful of fixed contracts that hold it behind encrypted notes, and a few off-chain helpers that anyone can replace. This page lists each part and walks through the main flows.
On this page
Components
Five contracts and four libraries make up the on-chain side. None of them is deployed yet; the descriptions below are of the code in contracts/src. No contract has an owner, an admin key, a pause switch or an upgrade path. Every parameter is set once in a constructor.
| Part | Kind | Run by | Capabilities |
|---|---|---|---|
OrdeoShroud | Contract | Nobody (no owner) | Holds ORDEO and ETH behind notes. Accepts shields and spends that carry a valid proof. Keeps the vault that makes ORDEO notes earn. |
OrdeoAttestor | Contract + 2 libraries | Nobody | Says yes or no to a proof for the ten public inputs the pool hands it. Generated from the circuit; cannot be swapped. |
OrdeoSponge2 | Library (with OrdeoSponge3) | Nobody | Poseidon hashing for the tree and for note commitments. |
OrdeoKeyLedger | Contract | Nobody; each address edits only its own entry | Maps an ordinary 0x address to the note keys it published, so others can pay it privately. |
OrdeoYieldSplit | Contract | Nobody; two fixed payout addresses | Receives the Pons creator fee and the pool's ETH fees, splits them 50/50 between the team and the holders' harvester. |
OrdeoTradeDesk | Contract | Nobody | Buys ORDEO on its Pons market straight into a note or into the vault, and lands private sales. |
| Browser app | Off-chain, on your device | You | Derives your note keys, finds your notes, builds and proves spends. Your keys stay inside the page. |
| Leaf index | Off-chain, site server | The site operator | Serves the public list of commitments and encrypted notes. Cannot forge one, because the app compares the root it rebuilds with the pool's. |
| Bundler | Off-chain service | Anyone; the site lists the ones it knows | Submits a proof that names it, for a flat fee taken from your notes. Can submit or refuse, nothing else. |
| Harvester | Off-chain service | The holder of the splitter's holders key | Sweeps fees, spends the holders' half on ORDEO as a donation to the vault, tops up bundler gas. |
| Pons curve, v4 pool, meme hook | Third-party contracts | Pons | The market for ORDEO. Takes a fee on each trade and records the creator share in the splitter's favour. |
Flow: buying in the app
Buying in the app takes one transaction and leaves you with a fresh private note.
- 01
Prepare the note
The app picks a random blinding, computes
ownerHash = Poseidon(pk, blinding)for your key, and encrypts the blinding to your viewing key. - 02
Call the router
Your wallet calls
buy(ownerHash, minTokensOut, encryptedNote)onOrdeoTradeDeskwith the ETH you are spending. The minimum output is required; a buy without one reverts. - 03
Trade on Pons
Until graduation the router buys from the curve on Pons; afterwards it buys in the Pons-hooked Uniswap v4 pool. Any ETH the curve could not use comes back to you within that transaction.
- 04
Shield
The router passes everything it bought to
OrdeoShroud.shield. The pool takes the shield fee, mints vault shares and computes the commitment itself from the amount it received. - 05
Find the note
The ciphertext carries value 0, because only the pool knows the share count. Your app reads the value from the
Shieldedevent that the same transaction emits.
Visible on chain: your wallet, the ETH paid, the ORDEO bought, and that it went into a new note. See Buy for the user side.
Flow: a private send through a bundler
- 01
Ask for a quote
The app reads
GET /infofrom a bundler: its address and the flat fee it charges right now. - 02
Build the spend
The app picks one or two of your notes and builds exactly two outputs: the payment to the recipient’s key and the change back to you. A missing input or output is a zero-value filler. The bundler’s fee is the exit value; the recipient field is empty.
- 03
Prove
A web worker proves the spend in your browser. The proof binds the bundler’s address, its fee and both ciphertexts.
- 04
Relay
The app posts the calldata to
POST /relay. The bundler checks it, dry-runs it and sendstransactfrom its own wallet. - 05
Settle
The pool verifies the proof, marks two nullifiers spent, appends two commitments and pays the exit value to the bundler. Only the bundler named in the proof may send it.
Flow: a private sale through the router
- 01
Write the terms
The app encodes the payout address, the minimum ETH, a deadline, the bundler that may submit it and the bundler’s ORDEO fee. These terms take the place of the second encrypted output.
- 02
Prove an unshield to the router
The proof is an ordinary unshield whose recipient and relayer are both the router, so the pool accepts it only through
OrdeoTradeDesk.sell. - 03
Submit
The bundler calls
sell. The router unshields to itself, pays the bundler its fee, sells the rest on the live Pons venue and pays the resulting ETH to the payout address. - 04
Or revert
If the price moved and the ETH out is below the minimum, the whole transaction reverts and the notes stay unspent.
Flow: the harvest
About every four hours, at a time shifted at random by up to 40%, the harvester runs one round:
sweepEthFees()on the pool when ETH fees are waiting, which sends them to the splitter.distribute()on the splitter: claim the Pons creator fees held in escrow by Pons, split 50/50, pay both sides.- Top up the bundler’s wallet to 0.02 ETH when it is below 0.005 ETH.
- Buy ORDEO with the rest through
buyAndDonate, in batches of at most 0.02 ETH, which donates every token to the vault.
The details, and why this is an operated service and not an open function, are on The vault and Threat model.
No bundler required
The bundler is a convenience for privacy, never a requirement for your funds. Each of these works from your own wallet:
- Shielding public ORDEO or ETH, and buying through the router. Neither needs a proof.
- Registering your note keys in the key registry.
- Any spend with no relayer fee. A
transactwith zero exit value, or anunshieldwith zero relayer fee, can be sent by any address. Your wallet pays gas in ETH and shows up as the sender. - A sale whose terms name no submitter (anyone may land it) or name your own address.
- Every fee step:
sweepEthFees,collect,split,release,distributeandsweepPonsare open to any caller, and anyone may callbuyAndDonatewith their own ETH.