# Architecture

Redacted is built from a few pieces. Your keys stay in your browser and your funds stay on-chain, and the nodes in between carry sealed actions, approve deposits and release them after the wait. This page puts the whole system on one map, follows the money through it and then takes each piece in turn.

## The system map

*Diagram: The Redacted system map. Entry doors lead into the Reserve of private notes, and the Reserve, the Spending accounts and the Rujira products sit on THORChain. Independent nodes relay, approve and vote, each choosing its own checks, with Ozone as the reference screener, and governance sets the public rules, the upgrade timelock and the Bōheki brake (drawn on https://redacted.gg/docs/protocol/architecture/)*

Read the map from the middle out. The core lives on THORChain, where the Reserve holds the funds as private notes, your Spending accounts act from it and they reach all of Rujira. The entry doors are the ways money gets in, which are a direct deposit from your public wallet and coins from other chains through a pay-in account.

The nodes are independent, bonded operators. They carry your sealed actions to the chain, approve deposits, release them after the wait and vote on the brakes, and what a node checks is up to that node. Ozone is the reference screener. It signs answers about addresses tied to known hacks or sanctions lists and decides nothing. Governance sets the public rules through token holders (the DAO until the relaunch), the upgrade timelock and Bōheki, a capped brake. You hold the keys, and your browser proves every action and sends it, sealed, to a node picked at random.

## How money moves

*Diagram: How money moves. Money comes in three ways, new money settles for about two hours while nodes may check where it came from, inside the Reserve you can move it to Spending and Rujira, and you can always withdraw (drawn on https://redacted.gg/docs/protocol/architecture/)*

Money comes in three ways. A direct deposit comes from your public wallet, and a node may check the source before it approves. Money someone else sends to a Spending account can be traced before it enters the Reserve. Coins from other chains arrive through a pay-in account and never at a Spending account. All new money waits about two hours, which breaks the timing link between a deposit and what you do next and gives the nodes time to send back money they decide not to accept. Coins tied to known hacks or sanctions lists don't enter the Reserve, and a rejected deposit goes back only to the address it came from. See [New money waits briefly](https://redacted.gg/docs/node-network/node-network.md#new-money-waits-briefly).

Once your money is in the Reserve, you can move it to a Spending account and use any Rujira product, and your own money comes back from Spending at once (see [Returns from Spending](https://redacted.gg/docs/node-network/node-network.md#returns-from-spending)). A move into Spending rests on a proof, so like a withdrawal it pays at once when it fits its coin's instant lane and otherwise after a 12-hour queue. Withdrawals are always open. Every withdrawal that rests on a proof, to your home wallet or to any other address, passes the same lanes. The proof-free exit to your home or rescue address needs no lane at all, and no pause or alarm applies to it. Your home wallet signs a lock for it, and the app offers it as **Bring it home** when nodes don't carry a withdrawal, and in bunker mode as **Emergency exit** in the account menu, which needs no node and is open at any time. If every node refuses your exit home, you can submit it yourself a day later, and if no node is active for 7 days the emergency exit of the contract opens by itself (see [The emergency exit](https://redacted.gg/docs/node-network/node-network.md#the-emergency-exit)).

## The browser

Your keys come from one wallet signature, joined by a key on your devices when you use Face ID or a fingerprint, or from your 25 words in [bunker mode](https://redacted.gg/docs/using-redacted/bunker-mode.md), and they exist only in your browser, inside Redacted's vault, a worker that runs within the app. The vault finds your notes, rebuilds your balances from public chain data, generates the zero-knowledge proofs and signatures that authorize every action, and wipes each secret from its memory once it is done with it. No key ever leaves your browser. The one step that runs on the vault's own domain, redactedvault.com, is the passkey, so your device ties your passkey to that domain.

That is why there is no database. Your account state isn't stored with us. It is rebuilt each time from the chain plus your keys, and any browser can do that, including ours.

## The Reserve contract

The Reserve holds all users' assets and applies its rules through zero-knowledge verification.

- Each deposit becomes a note, a SHA-256 commitment in a Merkle tree that hides its owner and amount.
- Spending requires a zero-knowledge proof that you own an unspent note in the tree, without revealing which one.
- A nullifier retires each spent note forever, so a note can't be spent twice.
- Every payout that rests on a proof passes two lanes per coin. The instant lane pays at once, up to a set size and within a budget that all users of the coin share, and the queue pays everything else after 12 hours. Above a set size, your device also sends a second, stronger proof that every node checks during those 12 hours.
- The contract's own books always balance, because it continuously accounts for every asset it owes against every asset it holds.

There is no admin backdoor into these rules. The contract has no admin sweep, no owner override and no switch that can stop an exit home. Its message surface is the user actions you see in the app, a time-locked and hard-capped fee governance path and the rules for bonded relayer nodes, whose brakes never touch an exit to your home or rescue address or your own money coming back.

## The Spending account

Each Spending account is a minimal smart-contract account with a single master, the Reserve acting on your proofs and on your account's hash-based keys. It is created without any migration admin, so it is immutable from the moment it exists. It executes your call plans (trades, swaps, stakes and THORChain deposits) and nothing else, for no one else.

## The relayer

The relayer carries your sealed actions to the chain and pays the network fee. Every proof binds the action, the amounts, the destination, the fee, the specific relayer and an expiry, so changing a single bit makes the proof worthless. The relayer can therefore deliver your sealed action or decline to, and that is the full extent of its power. It never sees a key, a note or a choice.

The relayer is one of many independent, bonded nodes, picked at random for each action. If every node refuses your exit home, you can submit it yourself a day later, and if none is live for 7 days you can submit your own withdrawal. See [How the node network works](https://redacted.gg/docs/node-network/node-network.md).

## Governance and safety

The pieces above sit inside a layer of public, capped governance.

- Token holders (the DAO until the relaunch) decide the fees, the wait, bond sizes, screening policy and code upgrades. Fees, the wait and bond sizes change only after an on-chain notice.
- Staking lets holders back a node with the bond currency. Stake counts toward the node's bond, so where holders stake helps decide which nodes run. See [Staking behind a node](https://redacted.gg/docs/node-network/node-network.md#staking-behind-a-node).
- The upgrade timelock holds every code upgrade for at least 3 days, in public, so anyone who disagrees can withdraw first. Every upgrade also needs hash-based co-signatures from a majority of a published group of co-signers, and the emergency lane, which needs a larger share of them, can run a rescue upgrade the DAO already scheduled at once.
- Node votes control five switches, which are the deposit pause, the deposit cap per hour, pausing new private accounts, strict screening and incident mode. Two thirds of the active nodes, and at least three, decide.
- Bōheki is a capped brake, a 2-of-3 multisig that can pause deposits, start incident mode or raise an alarm once. Only the DAO can re-arm it.
- An alarm pauses new deposits, halves the instant lane and holds the queue, for at most about 3 days beyond a payout's 12 hours. Two thirds of the active nodes, and at least three, can raise one for a day, Bōheki can raise one once, and the DAO and the contract's own checks can raise one too. Exits to your home or rescue address and your own money coming back carry on as usual.
- After a break of the proofs or of elliptic-curve signatures, the contract switches into a safe mode for good, and governance can then hold back up to half of each exit, once per coin, and pay it out about 30 days later.

Every brake acts on everyone at once, and none of them touches an exit to your home or rescue address or your own money coming back. See [Security and upgrades](https://redacted.gg/docs/protocol/security.md), [How the node network works](https://redacted.gg/docs/node-network/node-network.md) and [How it all fits together](https://redacted.gg/docs/protocol/system-overview.md).

## The note tree

Every deposit and every private action mints a note, which is a SHA-256 commitment appended to a Merkle tree. To every observer, including us and the relayer, it is sealed notes stacking up in a tree 67 million slots deep.

*Diagram: The note tree (drawn on https://redacted.gg/docs/protocol/architecture/)*

Three properties of the tree are worth knowing. The cost is constant, because appending note sixty million costs exactly what note four cost, which is twenty-six hashes, and proofs are the same size on day one and on day ten thousand. The tree doesn't slow down or degrade as it fills.

Nothing is ever deleted. The tree is append-only and every note stays where it landed, which is part of how the privacy works, because every new deposit joins everyone who came before it and the crowd you blend into only grows.

Capacity is not a practical limit either. 67 million notes is a million private actions a year for more than sixty years, and a full tree is followed by a fresh one beside it with the same math, while a proof never shows which tree a note sits in.

Your keys are also why there is no database anywhere in the system. Every note's secrets come from your keys by fixed rules, so any browser holding your keys, and only your keys, can find your notes in public chain data and rebuild your entire account. The chain serves as the backup and the ledger, and your keys are the only index into it.

## The cryptography

| Purpose | Design |
| --- | --- |
| Ownership and authorization | STARK zero-knowledge proofs built from hashes alone, with no trusted setup, checked on-chain for every action |
| Note privacy | SHA-256 note commitments, one-time nullifiers |
| Signatures | SLH-DSA (NIST FIPS 205) for node approvals and Spending account actions |
| Backup and device encryption | AES-256-GCM-SIV, with Argon2id for passphrases and the passkey's PRF output for Face ID and fingerprints |
| Key derivation | Deterministic wallet signature, scoped to the vault, chain and deployment, plus a device key from your passkey, or 25 words in bunker mode |

The proofs, notes and signatures in the table are the same for every account. In [bunker mode](https://redacted.gg/docs/using-redacted/bunker-mode.md), your account is also kept as 25 words instead of coming from a wallet signature, so nothing in it depends on a wallet key, and that is what makes it quantum-safe.

## What can be replaced

Every component can be replaced except the one you control. If you lose the frontend, any client can rebuild your account from chain data. If you lose the relayer, another one can carry your proofs. If you lose your device, your wallet, your other devices or your 25 words bring everything back (see [Backup and recovery](https://redacted.gg/docs/using-redacted/backup-and-recovery.md)). The one irreplaceable piece is your keys, and those never leave your hands.

For more detail, see [Relayer](https://redacted.gg/docs/protocol/relayer.md), [Security and upgrades](https://redacted.gg/docs/protocol/security.md) and the [Integration guide](https://redacted.gg/docs/protocol/integration.md).

---

Page: https://redacted.gg/docs/protocol/architecture/
