Recover your account,
reveal nothing.
Lose your passkey and your account is still yours. Friends you trust, a recovery kit only you hold, or both bring you back in, after a waiting period in which the real you can say no.
The lost-key problem, without a backdoor.
Passkeys are wonderful — until the device holding them is gone. The usual fixes are grim: hand a company your keys to babysit (now they can drain you), or give friends keys of their own. Nido does neither. Friends you name can only approve a recovery whose result is fixed on-chain before they look, and a recovery kit only you hold proves it is you without revealing anything. Either way a waiting period lets the real you veto an imposter, and only the lost passkey is replaced. No custodian. No backdoor, including for us.
A claim ticket you keep in your head.
Picture a coat check with millions of coats. When you drop yours off, the attendant seals it in a tamper-proof bag stamped with your name — you never touch the seal, so you can only ever reclaim your coat. Instead of a paper stub, you keep a secret number in a sealed envelope. To get your coat back you don't hand over the number; you step behind a screen and prove, mathematically, that you know a number matching one sealed bag on the racks, without saying which bag or what the number is. The attendant hangs a "claimed" marker so the same secret can't be used twice, waits a set time in case the real you shows up to object, then hands the coat to your new pocket. Nobody ever learned your number, saw your coat, or could point to your bag. That's zero-knowledge recovery.
Secret in, account back — end to end.
- 1 Choose your helpers Trusted friends, a recovery kit, or both, written into your account's policy.
- 2 Enrolled on-chain One policy update records the setup; a kit's fingerprint joins a public pool.
- 3 New passkey On a new device you create a fresh passkey for your Nido.
- 4 Open a recovery Anyone can open it. It changes nothing until it is approved.
- 5 Approval Your friends approve, or your kit proves it is you, or both.
- 6 Waiting period Days in which you, or your helpers, can stop it.
- 7 Completion Your policy, with only the lost passkey swapped for the new one.
- 8 Back in The old passkey is revoked for good.
The secret never leaves your device. Everything on-chain is a fingerprint, a proof, or a public tag.
Watch Alice recover her account.
Press play, or step through it yourself. The name and the hash values are illustrative — the calls, their order, and what lands on-chain are exactly what the contracts do.
Months ago, Alice set up recovery.
Two friends of three can help, and she keeps a recovery kit offline. One policy update recorded it all.
combined · 2 of 3 friends + kitToday, her phone is gone.
Her passkey went with it. On a new device she has no way in.
passkey: unreachableNew phone, fresh passkey.
Alice creates a new passkey for her Nido and opens a recovery that names it as the replacement.
attempt #0 · replace adminTwo friends check with her, then approve.
Each reads Alice the last characters of her new passkey on a call before approving from their own Nido.
2 of 2 approvalsHer recovery kit proves it is her.
Her browser proves she holds the kit for this exact recovery. The secret never leaves the page.
UltraHonk proof ✓A seven-day wait.
Under her profile Alice could still cancel with her old passkey if she found it. Policy changes are on hold.
timelock 120,960 ledgersHer policy, with the new passkey.
Anyone finishes it. Her Nido installs exactly the derived policy; the old passkey is revoked and her kit is replaced.
apply_doc via recovery rule ✓Alice is back in.
Same Nido, same friends, a new passkey and a fresh kit.
250 XLM · new passkey- recovery: combined · 2 of 3
- kit leaf appended to pool
- attempt #0 opened
- attempt #0 · approved
- target: admin → new passkey
How it actually works.
- You · Your Nido
Write recovery into your policy
Recovery is part of your Nido's policy document, like every other rule. You pick what it protects against (losing your passkey, or someone stealing it), who can help (friends, a recovery kit, or both), and how long a recovery must wait. Saving it is one update your passkey signs.
For developers
The document's recovery member names the profile (loss | protected), the mode (guardian-only | zk-only | combined), guardians and quorum, the ZK adapter, circuit id, pool, enrollment id and commitment, the controller, an optional baseline hash, the replaceable signer ids, and the timing in ledgers. apply_doc compiles it, the controller records it in rcv_sync, and the account installs a zero-signer recovery rule whose only policy is the controller.
- You · Browser
A recovery kit, if you want one
A recovery kit is a random secret your browser makes and you keep offline. Only its fingerprint goes on-chain, into a public pool shared by every Nido that uses one. The same policy update inserts it, so your kit is either fully enrolled or not at all.
For developers
The kit holds a 253-bit random secret and a 32-byte enrollment id. The document names commitment = Poseidon2(DOM_LEAF, secret); apply_doc calls the pool's rcv_insert, which stores leaf = Poseidon2(DOM_BIND, account, enrollment id, commitment) in a depth-32 tree that rolls over when full. Every root a tree ever had stays valid for proofs.
- You · New device
Lost your passkey? Make a new one and open a recovery
If your passkey synced to the new device, you don't need any of this: use it from Security. Otherwise you create a fresh passkey for your Nido on the new device and open a recovery that says which passkey it replaces. Anyone can open one, and opening it changes nothing: your Nido keeps working and nothing is frozen until a recovery is approved.
For developers
begin_lost_key(account, replacements) is permissionless. The controller derives the target on-chain with the account's own compiler: the applied document with exactly the declared credential swapped (same signer slot, same kind, same verifier). Nobody supplies a target hash. A ZK mode must also declare a fresh kit, because completing spends the old one.
- Friends · Your kit
Your helpers approve
Friends approve from their own Nidos, after checking with you that the new passkey is really yours. A recovery kit approves with a zero-knowledge proof made in your browser. In combined mode both are needed. Each approval covers this one recovery and nothing else.
For developers
Guardians authorize submit_guardian for the attempt's statement digest. A ZK proof's public inputs are root, nullifier, and statement_hash = H(DOM_AUTH, account, enrollment id, digest), where digest covers the network, account, controller, configuration epoch and hash, timing, action, attempt id, source and target hashes, and the replacement-set hash. The first approved attempt invalidates every other open one.
- You · Controller
A waiting period you control
An approved recovery waits before it can finish. Under the lose-my-passkey profile you keep using your Nido and can cancel it any time with your passkey. Under the stolen-passkey profile your Nido freezes, and only your helpers can cancel, because a thief holding your passkey must not be able to.
For developers
Loss: ordinary activity continues; the owner's cancel_recovery is never capped. Protected: the controller sets a freeze mirror in the account through rcv_gate, and __check_auth refuses everything but the completing apply_doc on every path, including execute and delegated auth. Both profiles refuse policy changes and upgrades while an attempt is authorized. Evidence cancellations are capped by max-cancels.
- Anyone · Your Nido
Your policy, with the new passkey
After the wait anyone can finish the recovery. Your Nido installs exactly the derived policy: everything as it was, with the lost passkey replaced. The old passkey is revoked forever, and a kit used for the recovery is spent and replaced by your new one.
For developers
Completion is the account's own apply_doc of the derived target, authorized by selecting the zero-signer recovery rule; the controller's enforce checks the exact bytes, the timelock, and the window. The account revokes every credential the target drops, the controller spends the nullifier and bumps the configuration epoch (killing older evidence and queued upgrades), and the new kit's leaf is inserted.
What the proof hides — and what it reveals.
A zero-knowledge proof lets you demonstrate you know a secret without disclosing it. Nido's circuit proves exactly three things about your hidden secret and nothing more — that its ticket is in the pool, tied to your account, for this specific request.
- Your recovery kit's secret: a private input to the proof. It never appears on-chain and Nido never stores it.
- Which leaf in the pool is yours: the proof shows a leaf is in the pool and bound to your account without pointing at it.
root— which snapshot of the pool the proof was built against.nullifier— a one-time public tag for your kit, spent only when a recovery completes.statement_hash— the fingerprint of exactly what is being approved, rebuilt by the controller.
Four guarantees, all checkable.
Approvals cover one exact recovery
Every approval and every proof is bound to one statement: this network, this Nido, this recovery service, this configuration, this recovery, and the exact replacement. An approval for one recovery cannot be reused for another, for a cancellation, or after the setup changes.
A waiting period with a veto
Nothing completes the moment it is approved. Under the lose-my-passkey profile you can always cancel; under the stolen-passkey profile your helpers can, and your Nido is frozen so a thief cannot move funds in the meantime.
Nobody picks the result
The new policy is derived on-chain from your current one (or your saved restore point) and the declared replacement. A recovery can swap the passkeys you marked replaceable, for passkeys of the same kind, and nothing else.
Revoked means revoked
Every passkey a recovery replaces or removes joins a permanent revoked list that every future policy update is checked against. A stolen passkey cannot come back, even if the thief can still sign.
The words, in plain terms.
- Profile
- What recovery protects against: losing your passkey (loss), or someone stealing it (protected).
- Guardian
- A friend's Nido or Stellar account that can approve a recovery of yours. A quorum of them is needed.
- Recovery kit
- A random secret you keep offline. Its fingerprint (commitment) is enrolled in a public pool; a zero-knowledge proof shows you hold it.
- Nullifier
- A public one-time tag per kit. Proofs need it unspent; only a completed recovery spends it, and nothing ever un-spends it.
- Statement
- The exact thing an approval covers: network, account, controller, configuration epoch and hash, timing, action, and its subject.
- UltraHonk
- The zero-knowledge proving system (Barretenberg, BN254). Perch verifies it on-chain with NethermindEth's audited verifier plus Perch's not-yet-audited zero-knowledge addition.
- Baseline
- An optional saved policy a stolen-passkey recovery can restore, published on-chain at setup.
Straight answers.
Does Nido store my recovery kit?
No. Your browser makes the kit and gives it to you as a file; Nido never stores it. Only a fingerprint goes on-chain. Keep the file offline: anyone holding it can open a recovery, which is why the waiting period and your veto exist.
Can my friends see my balance or move my money?
No. A guardian can only approve or cancel a recovery of your Nido. They never get a key to it, and the result of a recovery is fixed on-chain before they approve.
If anyone can open a recovery, can a stranger lock me out?
No. Opening a recovery changes nothing and freezes nothing. Only an approved recovery restricts your Nido, and approval takes your helpers or your kit.
What if my passkey is stolen, not lost?
Choose the stolen-passkey profile. Then changing recovery, upgrading, or cancelling needs your helpers too, and with a saved restore point a recovery can undo whatever the thief changed.
Do I need funds or a working key to recover?
No. Opening, approving with a kit, and completing are all permissionless, so a relayer can pay for them.
What proving system is this, and does it need a trusted setup?
UltraHonk over BN254 with a universal reference string, so there is no per-circuit ceremony. Verification costs about 87M of the network's 400M instruction limit per transaction.
For the engineers.
One state machine for every profile and mode
Perch's spec defines attempts (collecting, authorized, completed, cancelled), the per-account epoch that kills stale evidence, evidence freshness, cancellation rules, nullifier ownership, revocation, and the upgrade delay, for Loss and Protected under GuardianOnly, ZkOnly, and Combined. Nido's integration suites run all six combinations end to end with real proofs.
Targets are derived, not supplied
A lost-key target is the applied document with exactly the declared replacements; a compromise target is the published baseline's signers and rules with the current recovery member. Replacements keep the slot's kind and verifier. The completing apply_doc must submit exactly those bytes.
Completion is not reconfiguration
The controller's enforce leaves a marker for the same invocation's rcv_sync, bound to the attempt, the target hash, and the ledger. That is how the account tells a completion from an owner's policy change, so rotating a passkey never trips the reconfiguration rules.
The ZK backend
A Noir circuit proved with UltraHonk (bb 0.87.0, nargo 1.0.0-beta.9), an adapter with the audited verifier, Perch's not-yet-audited zero-knowledge addition, and the VK compiled in, and a constructorless depth-32 pool that accounts insert into through apply_doc. Artifacts reproduce byte for byte from source; zero-knowledge proofs are randomized, so they do not.
Reserved hook names
The account never signs or executes install, uninstall, enforce, or any rcv_* name, so the controller's and pool's hooks are reachable only from the account's own apply_doc, cancel_recovery, and upgrade calls.
Read the recovery controller at perch-recovery and the circuit at perch/circuits.
Never locked out,
never watched.
Set up recovery in your Nido: friends, a kit only you hold, or both.
Set up recovery