Start
Post-quantum lock
A vault with the post-quantum lock takes two signatures for every owner command: the wallet's, as usual, and one from a hash-based key made from a 24-word phrase. A quantum computer that could forge ECDSA signatures still cannot forge the second one, so it cannot sign for the vault.
What it protects
The lock, 0x5fB0b325d51849ddDA549f4FE893581a30ce1664, is the vault's root validator. It accepts a root operation only with both signatures: the wallet's ECDSA signature and an HSS signature (LMS with SHA-256, two levels of height 10, Winternitz parameter 4), the stateful hash-based scheme NIST approved in SP 800-208 and RFC 8554 specifies. It verifies the HSS signature on chain with the SHA-256 precompile.
| Covered | Not covered by the lock |
|---|---|
| Every owner command: withdrawals, settings, agents, modules, guardians, key changes | Agents' own keys: an agent can use a post-quantum key of its own, see Post-quantum agents |
| The vault's root, guardians and signed messages (the lock's signer answers only digests the vault approved) | Guardians that are ordinary wallets: see Guardians and recovery |
| Removing the lock: refused by the SDK and the app, and it marks the vault for good | Robinhood Chain's own accounts and the tokens a vault holds, which their issuers run |
Build a locked vault
In the app, choose Wallet + post-quantum key. The browser makes a new phrase and shows it; you type back three of its words before you can go on. Then you name guardians, or confirm that you want none, and pick the first agent. Your wallet then sends three things: the transaction that creates the vault on the post-quantum factory, a little ETH for its first operation, and the signature of that operation, which names your wallet as pauser, sets the guardians, creates and fills the gas tank and plugs in the agent. The browser adds the post-quantum signature to it. Later operations are paid by the tank.
The backup phrase
The phrase is 24 words from the BIP-39 English list. Each key is derived from it with HKDF-SHA256 and a key number, so one phrase holds many keys: number 0 first, the next ones for key changes. It is never a wallet's phrase, and a wallet's phrase must never be used here.
The app keeps the phrase only in the memory of the tab that signs, inside a web worker, until the tab closes or you press Forget. It never writes it to the browser's storage and never sends it anywhere: the signature is made on your computer. The copy you write down is the only lasting one.
Signatures and new keys
One key signs 1,048,576 times; each signature uses a number once, and the lock only accepts numbers above the last one used. Every owner command uses one. The last 1,024 numbers are kept for a key change, so 1,047,552 are for ordinary commands. Before they run out, Move to a new key on the vault screen switches the vault to the phrase's next unused key in one operation; the phrase stays the same.
A locked operation is sent with a verification limit of 1.2 million gas and uses about 0.82 million of it. In the live runs on mainnet one cost about 0.00003 ETH.
One record per browser
A number signed twice would let someone forge a signature, so each browser keeps a record of the numbers it handed out, in its own storage, and writes it before it signs. Two tabs take turns through the browser's lock on that storage. The record is never copied, synced or restored from a backup.
A browser with no record, another computer, or one whose site data was cleared, sets itself up first. The phrase's restore counter, an address made from the phrase, sends one empty transaction; its number gives that browser a range starting 64 times that number plus 64 above the vault's last used signature, which no other browser can reach. Your wallet sends the counter the gas for it. Each setup skips 64 numbers more than the one before it. Only the browser set up last signs: every browser or machine that recorded the key before it stops, and has to be set up again, so two of them never reach the same number.
Guardians and recovery
Guardians can replace both keys: the new owner connects a new wallet, writes down a new phrase and sends the link the app makes to the guardians. When enough of them approve, the new keys apply after the delay, 7 to 90 days; anyone may apply them then. The owner can cancel during the delay from the vault screen, and the gas tank stops paying anything but the way back while a recovery is pending.
A guardian can be an ordinary wallet or another vault with the lock. A wallet guardian signs with ECDSA, which a quantum computer could forge: recovery stays simple, but you would have to notice a false recovery and cancel it within the delay, and the chain does not report the vault as locked. A guardian that is itself a locked vault approves through its own root operation, with both of its keys, and keeps the lock whole.
Checked on chain
0x92d006B925556335FfF36A5169B254E8E8692941 answers isLocked(vault) for anyone. It returns true when the vault is a genuine Safe with Safe7579, the sealed owner and only the Gate and the sub-vault manager as executors, was born with the lock from the post-quantum factory, was never marked, has no recovery pending, has only the lock and its signer as validators, and every guardian is itself a locked vault. The app shows its answer as Locked, and otherwise Protected with the reason.
Add the key to an existing vault
On the vault screen of a vault with an ordinary root, Add a post-quantum key installs the lock with a new phrase and removes the old root in one signature of the wallet. The vault keeps its address, funds, agents and settings. A timelock or the old message signer answers to the old root, so remove them first. From then on every owner command needs both keys, but the check only calls vaults born locked fully locked: an older root could have left changes no check can see. For the strongest case, empty such a vault into a new one born locked.
With the SDK
The SDK signs the same operations from Node, with the index record in a file. createLockedVault, migrateToLock, lock.* and lockStatus cover the rest; see the SDK quickstart.
import { buildLockedRootOp, ecdsaRootSigner, gate, HssSigner, hssKeyFromPhrase, tankPaymaster } from "@mortiseagentvault/sdk";
import { fileIndexStore } from "@mortiseagentvault/sdk/node";
const signer = new HssSigner(hssKeyFromPhrase(PHRASE, 0));
const store = fileIndexStore("/home/you/.mortise/vault-hss", signer.publicKey().quantumId);
// The wallet signs first, then the post-quantum key, after every check that could refuse the operation.
const op = await buildLockedRootOp(client, VAULT, { kind: "execute", calls: [gate.setAgent(AGENT, UNTIL)] }, {
root,
signers: [ecdsaRootSigner(0, owner)],
hss: { signer, store },
paymaster: tankPaymaster(client, VAULT),
bundlerUrl: BUNDLER_URL,
});