wintergate

Docs · Safety

INTERNAL REVIEW. NOT AN INDEPENDENT AUDIT. Written by AI reviewers working for Wintergate's developers (Claude Fable, the final internal review before mainnet), 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: Fable final internal review before mainnet (11 Oct 2026)

Verdict: MAINNET-READY. Deploy tag wintergate-personal-rc6 (commit 3f0a0e0a23d2863effc5943bd2ab82cedbb1758b, source set 0c92a485d6abc395910425a80633402f93cd749c110a0912d5ef0f59cc813455). No contract finding, so no re-freeze: the tag the Opus review named is the tag to deploy. One Low on the SDK side is recorded, not fixed here (section 4), because it cannot touch funds or the way out, the shipped exit page is not affected, and the SDK ships with phase 3, not phase 2.

Reviewer: Fable. Nothing was broadcast, nothing public changed, no secret was printed. Inputs read: the rc5 adoption review, the rc6 Opus review, the internal recovery design note, the AI adversarial review, the rc4 final review, the nine cross-model review rounds (v2 to v9) and the review log.

1. What was verified, and how

Check Result
Freeze Every one of the 14 hashes in contracts/FREEZE.json matches the working tree and the set hash re-derives to 0c92a485...3455. The tag wintergate-personal-rc6 was extracted (git archive) and diffed file by file against the working tree: src, script, config, test, foundry.toml, launchkey.sh, FREEZE.json, gas, rehearse.sh, check-symbols.sh and launch/src are byte-identical, apart from the one added test file test/audit/RC6OpusReview.t.sol the Opus review declared. No .sol in src is missing from the freeze
Delta rc4 to rc6 Only HybridWallet.sol (238 changed lines) and QuantumCanary.sol differ from the rc4 sources (the rc5 fixes and the rc6 recovery fix). The deploy script changed one line: the recovery delay must now be at least 8 days (longer than the 7-day escape). Everything else (Factory, FeePolicy, Zap, CommitRegistry, WOTS, WGToken, vendor, interfaces, configs, launchkey.sh) is as in my rc4 final
forge test 216 / 216 pass, 1 skipped (the fork rehearsal, as before). Log the internal test log
Deep profile (FOUNDRY_PROFILE=deep: fuzz 10,000; invariants 2,000 runs x depth 128) 216 / 216 pass. The recovery one-time invariants ran 128,000 calls each with 0 reverts; the rc4 attacker and wallet invariants 256,000 calls each. Log kept internally
Mutation check (do the rc6 tests bite?) Four mutants of HybridWallet.sol in scratch copies, rc6 suites only (33 tests): (a) the recovery key is never marked spent: 8 fail; (b) the owner's cancel needs a commit again: 9 fail; (c) the retire branch arms no escape: 3 fail; (d) the recovery-key escape and a new recovery are allowed while a recovery is pending: 2 fail. Every mutant is caught
check-symbols.sh OK: no operator, quorum or cosigner symbol in sources or ABIs
App suite (cd client && npm test) 96 / 96 pass, including the end-to-end run of the SDK against the real rc6 contracts on a fresh anvil fork of Ethereum mainnet and the fresh-bundle check. Log kept internally

2. The change since my rc4 final, read end to end

Attacker models used: (1) an ECDSA break with full mempool, relay and builder visibility (the attacker can forge the owner's pledge signatures and sees every transaction before it lands; it never holds the hash key or the recovery secret); (2) a classical thief of the recovery secret; (3) the owner's own multi-device mistakes.

2.1 The one-time hash-based recovery key (_spendRecoveryKey, initiateRecovery, escapeWithRecoveryKey)

  • The key is one WOTS leaf (n 32, w 16, l 67) under the tweak index 2^32 - 1, so no chain value is ever shared with the hash-key tree (leaves 0 to 1023), even if an app reused the public seed. The commitment binds the seed and the public key (keccak256(abi.encode(seed, pk))); the seed arrives in calldata and is checked against the commitment, so nobody can pick another tweak seed. The JS derivation (wgcrypto.mjs) matches the contract (the app suite checks the three implementations agree).
  • One signature cannot be stretched to another digest: a forgery needs every one of the 67 base-16 digits of the new digest to be at or above the signed one's, and the 3-digit checksum (960 at most, so it fits) decreases whenever a message digit increases, so some digit is always below. Under model 1, seeing the honest recovery for any length of time, in the mempool, a relay or a builder, gives no way to start a different recovery or an escape: the AI audit's G-2 race is gone. The deep invariant suite models exactly this attacker (forge, mutate, copy, junk-commit, replay, warp, from the first broadcast on) and never wins.
  • The EIP-712 domain binds the vault address and chain id; the Recovery and RecoveryEscape typehashes differ, so a recovery signature cannot be read as an escape or the other way round; the recovery digest carries RECOVERY_DELAY.
  • A spent commitment is spent for good: setRecoveryCommit and a recovery's new commitment refuse it; a key cannot be both the signing key and the new key (newRecoveryCommit != recoveryCommit); finalizeRecovery installs none if the new key was spent meanwhile (dead code in rc6, since both spend paths refuse while a recovery is pending: harmless).

2.2 The retire branch and the reserved root

  • A signed recovery that can never execute (expired, zero owner, empty or used root, a spent new key or the signing key) still verifies and spends the key, clears it, bumps recoveryNonce and arms the escape; nothing else moves. A recovery that can execute always starts exactly as signed. Under model 1 the attacker cannot make an honest recovery non-executable: every retire condition needs the owner's hash key, the recovery key, or a spend that needs the key.
  • A pending recovery's target root is reserved against rotation, and usedRoot is written only by initialize, a successful rotation and finalizeRecovery, so finalizeRecovery can never fail on "root used". Commits live under the current root only, so a recovery lands on a root with no commits.

2.3 The commit-free owner cancel and the self-arming escape

  • The digest is CancelRecovery(recoveryNonce, leaf). initiateRecovery bumps recoveryNonce before storing the pending recovery, and nothing else moves it while a recovery is pending (the recovery-key escape and a second recovery are refused then), so two devices cancelling the same recovery at the same leaf sign the same digest. A cancel does not bump recoveryNonce or the owner nonce; replay is stopped by the burned leaf, and a cancel signed under an old root fails the WOTS check under the new one. Moves the owner already signed stay valid (cross-model round G-10).
  • The leaf may be any free leaf up to 1022 (1023 stays for rotation). The pledge is still required (Mode A: ECDSA and the hash key), so under model 1 the attacker cannot cancel, and under model 2 the thief cannot block the cancel.
  • Every cancel, the retire branch, the recovery-key escape, an evacuate on the last exit leaf (requestEscape there sets the timer anyway) and a finalize without a usable new key arm the 7-day escape. cancelEscape is refused while there is no usable key; setRecoveryCommit replaces and never removes; a vault cannot be created without a key. Walked by hand and by test_opus_alwaysAWayOut_everyTransition: at every state there is a usable recovery key, a running escape or a pending recovery (whose commit-free cancel arms the escape). Junk commits can therefore never freeze a vault for good.
  • Once the escape is active nothing needs a commit, so a vault whose reserve rotations went stale rotates from the reserve on the escaped path; the reserve rotation is fee-free when no exit leaf is left (rc5 G-1), a failed rotation reverts whole (rc5 NEW-3).

2.4 The rc5 fixes, re-read

  • evacuate: every asset call gets exactly 300,000 gas (minus the 2,300 stipend on a value send), one word of return data is copied, the escape is armed before the asset loop, and the function is nonReentrant. A hostile asset burns at most 300k and never blocks the rest; an asset that needs more stays in the vault (documented).
  • QuantumCanary.claim sets fired before a bounded self-call payout it can catch (everything except 60k, none below 100k); collect() pays later; fund refuses once fired. Re-entrancy through the token into claim, collect or fund is blocked by fired and the guards; payClaimer only accepts the canary itself.

2.5 Invariants, confirmed

  • Ownerless: no admin, pause or upgrade anywhere; rc6 adds no privileged role. The one-time fee-token setter is unchanged and outside the funds path (my rc4 final, section 3).
  • Exits are always fee-free: requestEscape, escapeWithRecoveryKey, cancelRecoveryByOwner, initiateRecovery, finalizeRecovery, evacuate, every action once escaped, and the exits-gone rotation never read the fee policy (invariant_exitsAreNeverCharged, 256,000 calls).
  • The 7-day escape and the owner's veto on a recovery are unchanged in meaning; the veto no longer needs a commit.
  • The recovery delay (30 days in every config; the script now refuses below 8 days) is longer than the escape, so an escape armed when the exits run out is active before any recovery can finish.
  • Clones: OZ 5.1 ReentrancyGuard checks _status == ENTERED, so a clone's zero initial slot is "not entered"; EIP712 rebuilds the domain for a clone's own address from immutables. Both unchanged since rc3 and exercised by the fork e2e.

2.6 The documented known limit, judged

  • Two devices at one leaf in an emergency. Outside an active escape a leaf that could sign anything can land only the digest committed to it or a cancel of the pending recovery (test_opus_compromisedLeaf_outsideEscape_...). Inside an active escape the commit rule is lifted, so two signatures on one leaf (two devices racing) seen by an ECDSA-breaking attacker could be ground into a third move. It needs the break, the owner's own race, the attacker seeing both (the app sends escaped moves and cancels through the private relay and refuses a leaf this device signed or that carries a commit) and winning the race. Binding escaped moves to commits again would reopen commit griefing, a liveness attack that needs less. Judgment: the right trade; accepted as documented, with the "one device at a time" wording in both apps.
  • The recovery key as the lost-keys backup. A classical thief of the recovery secret can start a recovery or the recovery-key escape, but moves nothing: the owner with keys cancels (commit-free) or just keeps acting. Only an owner who has lost every key AND whose recovery secret is stolen loses the vault after 30 days. The kit holds both secrets, so this is the inherent limit of any backup, not a Wintergate one. Accepted.
  • One recovery key, one request. A user who loses the saved kit AND switches device can still sign a second request with the one-time key (the contract cannot tell two honest requests apart). The page says not to; the device re-sends the identical request first (Opus O-2). Accepted.
  • NEW-4 (sibling leaf shown by a Merkle path). Griefing only; every way out above stays. Accepted.

2.7 SDK, apps and preview

  • _recoverySign records the digest before the key signs and refuses a second, different digest; signedRecovery and resendRecovery re-send the identical request; _recoveryExecutable refuses, before signing, what the vault would retire (O-1); initiateRecovery reads the RecoveryStarted event and never reports a retired recovery as started; the recovery key escape is refused while an escape or a recovery exists; the commit-free cancel picks the lowest free leaf with no commit that this device never signed, records the digest first, signs through the A3 guard and sends through the relay; every rotation path signs with no deadline (O-3). The exit page's recovery start re-sends a signed request first, then reuses a kit saved on an earlier try (it must open and name this vault), and only then makes new keys; its copy says a signed request never expires and how to kill it (O-4).

3. Findings

Severity scale as in every round: HIGH loss of funds or of the vault reachable by an outsider or on a likely user path; MEDIUM loss possible on a plausible path, or a hard invariant weaker than stated; LOW wasted gas, a burned one-time key, a stuck flow the user can recover from, or a guard weaker than it should be; INFO a design note.

No High. No Medium. No contract finding.

id severity where what status
F-1 LOW (SDK, custom integrations only) Vault.initiateRecovery newRecoveryCommit defaults to zero. The vault accepts a zero new key (it is neither spent nor the signing key), so the recovery starts; finalizeRecovery then installs no key and arms the escape, and 7 days later the recovered vault sits in escape mode (fee-free, commit rule lifted, "one device at a time") until the new owner sets a key and cancels. The shipped exit page, the only call site, always passes a fresh key, and the SDK comment already says the field must be a fresh key, but the default contradicts it and _recoveryExecutable does not refuse it, unlike the other O-1 cases. FIXED 18 October 2026: the SDK signing core (rounds r2 and r3) now refuses a zero new recovery key before the one-time key signs; a regression test passes on the fixed client and fails on the rc6 client
I-1 INFO contract A signed recovery that later becomes unexecutable (the owner rotated to its root, or its new key was spent here) can be landed by anyone holding it to retire the current recovery key and arm the escape. Same family as Opus I-4; the app's requests never expire, and the owner's remedy is the same: set a new recovery key, which kills the signed request. no change
I-2 INFO SDK resume() A dropped commit-free cancel is completed by resume the way a committed exit is: it commits the cancel digest first and sends the cancel through the public RPC rather than re-sending the relay bytes. Correct (the vault accepts a committed cancel, the leaf carries one signature, the same digest), but one extra commit transaction, in the public mempool; and if the other device cancelled meanwhile the commit leaves a dead digest on that leaf. no change; fold into the F-1 follow-on if cheap
I-3 INFO design After a cancelled hostile recovery the vault arms its own escape; the owner who does nothing is in escape mode after 7 days (no action fee, no commit protection, one device at a time) until a new key is set and the escape cancelled. The exit page says so at the cancel. This is the price of "never frozen" (Opus I-2). noted

4. Why F-1 was not fixed at this gate (fixed since: see the F-1 row)

A fix is one guard in the SDK plus a dozen test call sites that use the default, both browser bundles rebuilt and the preview site copy refreshed, and a re-run of the app suite and the journey. The contracts do not change, no funds and no way out are at risk (the invariant "a usable key or a running escape" holds in that state by design), and the artefact concerned ships at phase 3. Changing a dozen tests at the final gate is more risk than the finding carries; it goes to a coder follow-on with its own test, to land before the app opens.

5. The verdict, reasoned

  • The contracts are 1,341 lines; only HybridWallet and QuantumCanary changed since my rc4 final, and that delta has been read by the AI-adversarial pass, nine cross-model review passes (the last three "pass with fixes", each fix applied), the separate Opus review (independent of the code's authors, still internal) and this final, with 216 tests, 29 invariants at depth 128, and a mutation check showing the rc6 tests catch the four changes that would matter most.
  • The property the design targets holds: with the one-time hash-based recovery key, a watcher with an ECDSA break and full mempool, relay and builder visibility can neither take over a recovery nor stop one, and every path that could once freeze a vault (junk commits, a cancel that cleared the key, stale reserve rotations, an exit on the last leaf) now ends in a commit-free way out.
  • What this review cannot supply is an independent external audit.