Rerandomize the NYM mixnet client id on each connect - #737
Open
j0ntz wants to merge 1 commit into
Open
Conversation
Contributor
Author
clientId names the mixnet client's persistent key storage, so the fixed id made every setup adopt the previous registration. A registration that went bad therefore stayed bad for every later connect and across app launches, which surfaces as a wallet that never syncs and never recovers. Also drop the third argument at both fetch call sites: initMixFetch has already created the instance, and the instance-bound mixFetch takes only (url, args), so the options object was silently discarded.
j0ntz
marked this pull request as ready for review
August 17, 2026 20:36
j0ntz
force-pushed
the
jon/nym-mixfetch-v2-remeasure
branch
from
August 17, 2026 20:36
ef22402 to
87dffc6
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Asana task
clientIdnames the mixnet client's persistent key storage, andsrc/util/nym.tspassed the same hardcoded'edge-core-js-2026-03-10'on every setup. A client whose registration went bad therefore reloaded that same bad storage on every later connect, and across app restarts, so a wallet that got stuck stayed stuck until the app was reinstalled. This mints a fresh 16-byte random id per connect instead, which is what the Nym team recommends for exactly this failure mode.The change also drops the third argument at both
fetchcall sites.initMixFetchhas already created the instance, and the instance-boundmixFetchtakes only(url, args), so the options object was being silently discarded. That removes the last consumer of the exported options object, which is now private tonym.ts.Verified on the iOS sim (Nym mixnet ON for Ethereum, Avalanche, Coreum and Monero on a throwaway account):
edge-core-js-a260f91f…andedge-core-js-33ca108a…; across the whole session 11 distinct random ids were written. Every file still containing the old constant has an mtime from July, so it survives only as residue from earlier builds.com.apple.WebKit.Networking(the core WebView's network process) held an established WSS connection tonym-exit.tha1.craftdome.app:9001, a Nym entry/exit gateway, throughout.This PR carries the code change only. The task it belongs to is an evaluation of re-upgrading to
@nymproject/mix-fetchv2; that verdict is do not upgrade yet, and the measurements behind it are attached to the Asana task rather than repeated here. The short version: 2.0.1 cannot connect at all (its WASM panics innym_http_api_clientcallingstd::time::Instant::now, which is unsupported onwasm32-unknown-unknown), and 2.0.0 was 4-in-10 clean against v1's 9-in-10 over ten paired harness runs, with the same in-app send hanging attunnel error: IPR connect timed outwhere v1 succeeded.Note
Medium Risk
Changes NYM mixnet client identity and registration on each setup (extra ~10s handshake tradeoff), but scope is limited to privacy fetch initialization and call wiring.
Overview
Fixes NYM mixnet wallets that never recover after a bad gateway registration by minting a fresh
clientIdon eachinitMixFetchsetup instead of reusing the hardcodededge-core-js-2026-03-10. BecauseclientIdkeys persistent registration storage, a poisoned registration was reused on every connect and across app launches until reinstall.makeClientId()innym.tsgenerates a 16-byte randomedge-core-js-…id (withcrypto.getRandomValueswhen available). Static mixnet options stay the same butmixFetchOptionsis no longer exported;clientIdis injected only when callingcreateMixFetch.Browser and React Native
privacy: 'nym'fetch paths now call the instancenymFetchwith only URL and request options, dropping a third argument that was ignored after init anyway.Reviewed by Cursor Bugbot for commit 87dffc6. Bugbot is set up for automated code reviews on this repo. Configure here.