wintergate

Docs · Safety

INTERNAL REVIEW. NOT AN INDEPENDENT AUDIT. Written by AI reviewers working for Wintergate's developers (Claude Opus, the independent internal code review of rc6), 11 October 2026, on the frozen tag wintergate-personal-rc6. Published as written, except that internal file paths, task names, ticket numbers and hosting details were removed, the "Files" section (a list of paths on the team's machines) was dropped, two internal commercial notes were replaced by a neutral line, one table row about the team's deployment wallet was removed, and the status of finding F-1 was updated to fixed. Paths that remain are mapped to this repository: contracts/ (was mainnet/), client/ (was service/), exit-page/, app/. "Cross-model review" means review rounds run with a second, different AI model. No independent firm has reviewed this code. See SECURITY.md for the audit status.

Wintergate rc6: separate Opus review (independent of the code's authors, still internal) (11 Oct 2026)

The one separate Opus review (independent of the code's authors, still internal) the plan calls for, run before the Fable final. Scope: the whole rc4 to rc6 contract change, the SDK and app side, the private preview plumbing, the documented residuals, and the "always a way out" invariant. Inputs read: the rc5 adoption review, the recovery design note, the AI adversarial review, and the nine cross-model review rounds (v2 to v9). Nothing was broadcast to mainnet and nothing public changed.

1. Verdict in plain words

  • Contracts: no new finding. I found no High, Medium or Low defect in the rc6 contracts. The recovery fix does what it says: one recovery signature lets nobody sign anything else, the owner's veto cannot be blocked, and junk commits can never freeze a vault for good. The contracts did not change, so there is no re-freeze: the Fable final reviews the same tag.
  • App side: two Medium findings and two Low ones, all fixed. All four are about using the one-time recovery key safely in real life (a dropped transaction, a reload, a second device, a typo in a custom integration). None needed a contract change.
  • Documented residuals: accepted as documented, now with contract tests that show how far they reach.
  • Cross-model round v9 G-11 (rotation deadlines): closed on every path. The app already did it; one direct SDK path did not, and now does (O-3).

2. Final state for the Fable final

Item Value
Freeze tag wintergate-personal-rc6 (unchanged), commit 3f0a0e0a23d2863effc5943bd2ab82cedbb1758b
Source-set SHA-256 0c92a485d6abc395910425a80633402f93cd749c110a0912d5ef0f59cc813455 (re-checked: every file in contracts/FREEZE.json matches the working tree, and contracts/src + contracts/test match the tag byte for byte, apart from the one new test file below)
HybridWallet runtime 16,704 bytes, keccak 0x271660593c5976f1e729479cc2af03b0e3d0253a91affccd86dcc288debcdee5 (unchanged)
Contracts, forge test 216 / 216 pass (25 suites; the fork rehearsal test is skipped as before). Was 212; +4 new
Deep profile (FOUNDRY_PROFILE=deep, fuzz 10,000, invariants 2,000 x 128) 216 / 216 pass
App suite (cd client && npm test) 96 / 96 pass (was 89; +7 new in test/app-audit-rc6-opus.test.mjs), incl. the end-to-end run of the SDK against the real rc6 contracts on anvil and the fresh-bundle check

3. Findings

id severity where what, in plain words status
O-1 MEDIUM SDK initiateRecovery The SDK signed a recovery the vault would never start (the new hash key already used on this vault, no new owner, or a spent new recovery key). The vault then spends the one-time key, starts no recovery and arms the escape, and the transaction succeeds, so the "simulate first" step cannot catch it. The SDK then reported "recovery started". For a user who lost the owner keys that is the end of the vault, shown as a success. The shipped exit page always makes fresh random keys, so it could reach this only through the state-race case; a custom integration could reach it with one wrong argument. FIXED
O-2 MEDIUM exit page + SDK A recovery that was signed but did not land (relay dropped it, the page was closed, a reload, a network error) could not be sent again. The exit page only knew how to make new keys. On the same device the SDK then refused to sign (correct), leaving the user stuck. On another device or browser it would sign a second, different request with the one-time key, and two signatures of one WOTS key can be combined into a forged third. That needs no quantum computer, only a large hash search by anyone who sees both. The page also said "Nothing was sent" after the key had signed, which pushes the user towards exactly that retry. FIXED
O-3 LOW SDK send() Cross-model round v9 G-11 on every path: rotate() signed rotations with no deadline, but a rotation passed straight to send() still got the 2-hour default deadline. That is the stranded last-leaf case G-11 describes. The shipped apps only use rotate(). FIXED
O-4 LOW exit page copy A signed recovery never expires (by design: a one-time key cannot sign a replacement). An owner who finds the keys again after signing one that did not start is not told that anyone holding that signed request can start it later. The owner could still cancel it within the 30 days. The fix: set a new recovery key, which kills the signed request for good (checked against the contract: _spendRecoveryKey only accepts the installed key). FIXED (copy)
I-1 INFO contract finalizeRecovery's "new key spent meanwhile" branch can no longer happen in rc6 (both ways to spend a key refuse while a recovery is pending). It is harmless defence in depth. no change
I-2 INFO contract (design, since rc4) An escaped vault pays no action fee and loses the commit protection until the owner cancels the escape. The rc6 recovery-key escape and the self-arming escape are new ways to get there. noted
I-3 INFO contract (Mode B only) The commit-free cancel in Mode B is ECDSA-only before the canary fires, like every Mode B action. The app creates Mode A only. no change
I-4 INFO contract A signed recovery-key escape never expires either (its digest is fixed per recovery round). A dropped one can be landed later while that key is installed. It only starts the 7-day escape and moves no funds; setting a new key kills it. no change

O-1: what changed and its tests

  • Vault._recoveryExecutable (before the key signs): refuses a zero new owner, an empty new root, a new root the vault used before (usedRoot), a new recovery key that is the signing key or spent here (spentRecoveryCommit). Message: "nothing was signed".
  • Vault._sendRecovery (after the block): reads the RecoveryStarted event; without it the SDK throws recovery-retired ("the vault ... retired the recovery key and started the 7-day escape. No recovery is pending"). readyAt now comes from the event, not the device clock.
  • Tests (client/test/app-audit-rc6-opus.test.mjs, each failed on rc6 first): "a recovery the vault would retire is refused BEFORE the one-time key signs" (used root, zero owner: nothing sent, key unspent, no escape); "a spent key as the new recovery key is refused before signing"; "a recovery the vault retired (state moved under it) is never reported as started". The mock chain gained the usedRoot read and the retire branch's events, matching the contract.

O-2: what changed and its tests

  • SDK: the device record of a recovery signature now keeps the whole request (public parts only: what goes on chain anyway). New signedRecovery(key) and resendRecovery({ recoveryKey }): the same request, digest and signature are sent again, and it is refused if the vault moved on (key spent or replaced, another recovery pending, a new round).
  • Exit page (app/exit/ and exit-page/, identical): Start the recovery first re-sends a request this device signed. If there is none, a kit file saved on an earlier try of this recovery (it must open with the passphrase and name this vault in recoveredFrom) is used for the same keys, so another device or a closed page signs the SAME request. Only with neither does it make new keys. There is still one call site, and the kit must be proven to open first (audit app r1 M-3). After the key has signed, a failed send no longer says "Nothing was sent"; it says "press Start the recovery again here ... Do not make a new kit for this recovery key". A new paragraph tells the user: one recovery key, one request.
  • Tests: SDK "a signed recovery that was dropped is sent again identical after a reload, with no new signature" (the re-sent calldata equals the dropped one); "re-sending refuses a request the vault can no longer start"; a static check of both exit-page copies (re-send and earlier-kit paths come before any new keys are made). A browser journey test covers the same case end to end.
  • What remains (documented): a user who loses the saved kit AND switches device can still make a second request. The page tells them not to. The contract cannot tell two honest requests apart.

O-3 and O-4

  • O-3: send() forces NO_DEADLINE for any rotateHashKey call and refuses a finite one before anything is signed. Test "a rotation sent through send() is signed with no deadline too" (recorded deadline = max uint256; a finite one is refused, nothing committed).
  • O-4: exit-page line "A signed recovery request never expires. Found your keys again after signing one that has not started? Set a new recovery key ...: the signed request can then never start." Design note updated.

4. Contract review (what I checked and why it holds)

Attacker models: (1) an ECDSA break with full mempool, relay and builder visibility (holds the owner's ECDSA key, not the hash key, not the recovery secret); (2) a classical thief of the recovery secret; (3) the owner's own multi-device mistakes.

  • One-time recovery key (_spendRecoveryKey, RECOVERY_LEAF, spent commitments). The WOTS checksum makes one signature useless for any other digest. The tweak index 2^32-1 keeps it apart from the hash-key tree. The seed is bound in the commitment, and the EIP-712 typehashes keep a Recovery signature from being read as a RecoveryEscape. The key is spent on first use, cannot be installed again, and cannot be both the signing and the new key. Under model 1 an attacker cannot make an honest recovery non-executable: every condition of the retire branch needs the owner's hash key, the recovery key, or a spend that needs the key. The honest reveal can only land the honest recovery, however late.
  • escapeWithRecoveryKey: commit-free, fee-free. Refused while an escape exists or a recovery is pending, so the pending recovery keeps the recoveryNonce the cancel names. It spends and clears the key, and bumps the round.
  • Commit-free owner cancel: the digest is CancelRecovery(recoveryNonce, leaf), the burned leaf stops replay, and the owner nonce is kept (v8 G-10). Two devices at the same leaf sign the same digest. Under model 1 a junk commit cannot block it. It needs the owner factors in Mode A; Mode B is I-3.
  • Retirement of unexecutable signed recoveries and the reserved pending-recovery root: consistent with each other. A rotation cannot take the reserved root, so an accepted recovery can always finish; finalize cannot fail on usedRoot.
  • Invariants: ownerless (no admin, pause or upgrade, and nothing new in rc6 adds one; the one-time fee-token setter is unchanged and outside the funds path). Exits stay fee-free (requestEscape, escapeWithRecoveryKey, cancelRecoveryByOwner, initiate/finalize recovery, evacuate, every escaped action, the exits-gone rotation). The 7-day escape and the owner cancel are unchanged. Nothing ownerless becomes owned. Reentrancy: every new external entry is nonReentrant; self-calls stay onlySelf. The rc5 parts (evacuate gas budget, atomic rotation, the G-1 free reserve rotation, the canary collect) were re-read and hold. The canary's bounded payout leaves room to finish recording the alarm, and collect() pays later.
  • "Always a usable recovery key, a running escape or a pending recovery", every transition: initialize (key required), setRecoveryCommit (replace, never remove, never spent), cancelEscape (refused without a usable key), initiateRecovery executable (pending; its commit-free cancel arms the escape), the retire branch (arms the escape), escapeWithRecoveryKey (escape), both cancels (clear the key, arm the escape), finalize (a usable new key, or the escape armed). New test test_opus_alwaysAWayOut_everyTransition walks them in order.

5. The documented residuals: accepted

  1. Two devices signing one leaf in an emergency (the commit-free cancel and the escaped path). New tests show how far this reaches. Outside an active escape, an attacker who can sign ANY digest with that leaf and forges the owner's ECDSA can land only the digest committed to it or a cancel of the pending recovery, which the owner wanted anyway. It cannot drain, escape or evacuate (test_opus_compromisedLeaf_outsideEscape_onlyCommittedOrCancel). Inside an active escape it can (test_opus_compromisedLeaf_insideEscape_isTheDocumentedResidual): that is the documented limit. It needs an ECDSA break, two devices racing at one leaf, the attacker seeing both signatures and winning the race. The SDK narrows it further. It simulates before sending, so a cancel that would fail (the other device's cancel landed first) is never broadcast. It sends cancels and escaped moves through the private relay, and refuses any leaf that has a commit or that this device signed. Fixing it in the contract would mean binding escaped moves to commits again, which reopens commit griefing. Accepted as documented.
  2. NEW-4, the sibling key in a Merkle path: committing leaf L shows L^1's public key, so a pledge forger can junk-commit L^1. That is griefing only (at most one extra leaf per action). The way out is always there: the recovery-key escape, the armed escape, the commit-free cancel (test_opus_recoverySecretThief_cannotTakeOrFreeze also shows junk on the cancel's leaf does not stop it). Accepted as documented.

6. SDK and app: also checked, no finding

  • One-time signing rule: _recoverySign records before signing and refuses a second digest. Recoveries use NO_DEADLINE and go through the private relay with a simulation first. The recovery-key escape is refused while an escape exists or a recovery is pending. The commit-free cancel picks a leaf with no commit that this device never signed. Evacuate is capped at 20 assets. The rotation estimate runs before any commit, and rotate-soon works.