ochk.app · In-Browser Operator Flow
Operator-held keys, browser-resident.
The portal at ochk.app/me/operator (opens in a new tab) lets operators apply, ratify charters, publish incidents, and request hosted hardware without ever installing the kit. The architectural invariant — signatures must be produced on operator-held key material the portal cannot reach — is preserved by holding the key in the browser's IndexedDB and signing client-side; the portal only sees signed envelopes, never the private half.
The operator program is not open. The portal's operator pages open only to accounts the program lets in, and while the system is in testing orangecheck holds every role (ochk.app/custody (opens in a new tab)).
This page is the technical reference for that path. It covers what the browser stores, how envelopes round-trip with the Rust kit, what happens on key loss, and why federations cannot distinguish a browser-signed guardian from a kit-signed one.
Storage modelLink to this section
| Element | Location | Persistence |
|---|---|---|
| Ed25519 private key (32 bytes, hex) | IndexedDB (oc- DB) | Survives reload, tab close, browser restart. Cleared by browser data wipe / "delete site data". |
| Ed25519 public key (32 bytes, hex) | IndexedDB · derivable from private | Same. |
operator_ (op-) | IndexedDB · derivable | Same. Identical derivation in the kit (Rust): the portal and kit always agree on the operator_id for a given key. |
| 24-word BIP-39 mnemonic | Shown once at generate time, then dropped from memory. Operator records it externally. | Recovery requires re-entering the mnemonic. We do not store it. |
Generate, restore, importLink to this section
Three entry points on the portal:
- Generate new — fresh Ed25519 keypair from
crypto.getRandomValues, wrapped in a 24-word BIP-39 mnemonic. The mnemonic is shown once; you confirm you've recorded it before the panel closes. - Restore from mnemonic — re-derive the same key on a different browser /
device by pasting the 24-word phrase. Same words → same key → same
operator_id→ same federation memberships. - Import from kit — paste the 64-hex private key that
oc-guardian init --key-filewrites. A key the kit keeps in the OS keychain cannot be exported. Useful if you provisioned via the kit on a server first and want to drive the portal from the same identity.
Refusing to overwrite is intentional. If a key already exists in this browser, generate / restore / import all error rather than clobbering it. You delete the existing key first if you really want a fresh start (losing any federation memberships bound to the old key in the process).
Envelope round-tripLink to this section
The portal signs the same ActionEnvelope shape the Rust kit produces.
Canonicalization is field-declaration order over the payload struct:
const ordered = {
action, // "program-apply" | "charter-sign" | "alert-publish" | …
params, // action-specific record
nonce, // 48-bit random
expires_at, // unix seconds
federation, // slug | null
};
const message = new TextEncoder().encode(JSON.stringify(ordered));
const sig = ed25519.sign(message, privkey);
The Rust kit's serde_json::to_vec(&ActionPayload) produces byte-identical
output; its encoder and round-trip tests are public in
oc-guardian-kit/crates/oc-guardian-core/src/actions.rs (opens in a new tab).
The server-side validator re-encodes the payload and verifies the Ed25519
signature against the embedded pubkey — same code path for portal-signed and
kit-signed envelopes.
The portal's round-trip tests cover each envelope type:
program-apply(apply to the operator program)charter-sign(ratify a federation charter)alert-publish(publish an operator-signed incident)
A future drift between the kit's Rust impl, the portal's TS validator, and the portal's TS signer would fail these tests immediately.
Key loss + recoveryLink to this section
| Scenario | Recovery path |
|---|---|
| Cleared site data on this browser | Restore from mnemonic on the same or different browser. |
| Browser uninstalled | Same — restore from mnemonic. |
| Mnemonic lost, kit-imported key never written down | Reveal the raw private key from the portal (Show private key) and back it up to a password manager. Do this before you lose the device. |
| Both mnemonic and raw key lost | The operator_id is permanently stranded. Generate a new identity (loses any federation memberships) and re-apply. The kit cannot recover this either — there's no escrow. |
The mnemonic is the only durable backup we provide; treat it like seed words for a Bitcoin wallet. We deliberately do not offer "server-stored mnemonic" or "OC can recover" — that would defeat the operator-held-keys invariant.
Why federations cannot distinguishLink to this section
A guardian's fedimintd takes part in DKG and threshold signing with its own
key share, which fedimintd holds. Your operator key does not sign there: it
signs the program's envelopes (application, charter ratification, incidents,
payout claims, exits), in your browser tab or in the kit. On those envelopes,
the only observable property is that each verifies under your pubkey. The kit's
portal bridge (oc-guardian bridge) is a stub: nothing relays portal requests
to the kit.
Practically: you can apply via the portal, run the binary on a server, sign incidents from your phone via a different browser, and the federation just sees one operator. The constraint is that any browser / kit instance holding the private key is fully empowered as that operator — same as running multiple Bitcoin nodes with the same xpriv.
Bypass parityLink to this section
The kit-only flow in BYPASS.md (opens in a new tab) covers every action without using the portal:
| Action | Kit command | Portal equivalent |
|---|---|---|
| generate identity | oc- | "generate new" on /me/operator |
| sign application | oc- | application form on /me/operator/apply |
| ratify charter | oc- | /me/operator/ceremonies, or the federation's page |
| publish incident | oc- | compose form on /me/operator/incidents |
| run guardian | oc- | docker recipe in runbook + hosted-hardware option |
Both paths produce byte-identical envelopes, indexed in the same KV store, visible on the same public timelines. Pick whichever fits your trust posture; mix them freely.