# How privacy works

> Who can read what, how sealing works, what goes on chain, and what is not protected.

Privacy in Enclaus means a short, checkable list of who can read each thing. It does not mean nobody: the worker you approve and the arbiter read the task, because they have to.

## Who can read what

| What | Who can read it | Where it lives |
|---|---|---|
| Your contract and condition | You, the worker you approve, the arbiter | Sealed boxes on our servers |
| The exploit | The arbiter | A sealed box on our servers |
| What happened in each run | You | A sealed box on our servers |
| Task summary, bounty, attempts, deadline | Anyone | Our database |
| Wallets, amount, a hash committing to the terms | Anyone | The escrow agreement on Robinhood Chain |

> **Enclave** The arbiter runs in an Intel TDX enclave. Its keys are made inside the enclave and never leave it. Before anything is sealed, Enclaus checks the enclave's attestation: Intel's signature on the quote, that it names these keys, and that it runs a published build. You can [check it yourself](https://the public repo            /blob/main/scripts/verify-arbiter.ts).

## Sealed boxes

Everything private travels as a **sealed box**: data encrypted so that one key can open it.

- A new throwaway X25519 key pair is made for each box.
- Its shared secret with the recipient's public key goes through HKDF-SHA256 to an AES-256-GCM key.
- The box records which key it is for, but not who you are.
- Each box is bound to a **context** that names what it is for: `task-terms:<task id>`, `exploit:<task id>:<attempt>` or `verdict:<task id>:<attempt>`. A box cannot be passed off as a different one: opening it under another context fails.

Sealing uses only the browser's built in WebCrypto, so the same code runs in your browser, in the arbiter and in worker agents.

## Your sealing key

Your private sealing key is never stored. Your browser derives it from one wallet signature over this exact message:

```text
Unlock your Enclaus sealing key (v1)

This creates the private key that opens your sealed tasks. It is not a transaction and costs nothing.
Only sign this on enclaus.dev: anyone with this signature can read what was sealed to you.

Wallet: <your address in lower case>
```

The signature is hashed, with a fixed label, into a 32 byte seed, and the seed becomes an X25519 key. Ordinary wallets sign the same message the same way every time, so you get the same key on any device. Smart contract wallets (ERC-1271) can sign in; for sealing, the app asks them to sign twice and uses them only if both signatures match. Wallets that sign differently each time (many passkey wallets) and smart accounts that are not deployed yet (ERC-6492) are refused for sealing, because the key would change and what was sealed to it could not be opened again.

The tradeoff: anyone who obtains this exact signature can open what was sealed to you. Only sign it on enclaus.dev.

## What goes on chain

The escrow agreement on Robinhood Chain holds the payer, the payee, the amount, the deadline, and one hash:

```text
terms hash  = keccak256("enclaus:" + commitment)
commitment  = keccak256("enclaus-terms:v1:" + canonical JSON of the terms + 32 byte random salt)
```

The salt sits inside the sealed terms, so nobody can confirm a guess about your terms by hashing it. The arbiter recomputes the commitment from the terms it opened and signs it into its verdict. It only releases money from an agreement whose hash matches the terms it actually checked.

## What this does not protect

- **The summary is public.** Do not name the project or paste code into it.
- **Wallets are public.** The escrow shows who paid whom and how much.
- **The approved worker sees everything in the task.** Approve workers you are willing to show the code to.
- **A paid exploit is the worker's work.** Today it is sealed to the arbiter only; you see the verdict and the run details.
- **Upgrades.** The arbiter's keys belong to its enclave app, not to one build: a new build we deploy gets the same keys. Each build's hash is in the attestation and only published builds are accepted, but this is not yet enforced on chain.
- **Hardware and host trust.** You trust Intel TDX and the cloud host's key service and OS image.
- **The scan API is not in an enclave.** It receives code in readable form on our server.
