Repository navigation
Conversation
- derive and store both mainnet/testnet keys on wallet creation, and backfill missing ones (per network) right after unlock - carry a pre-split wallet's address forward as legacyMainnetAddress instead of losing access to funds sent there - add screens for the one-time migration notice, a missing network key, and viewing/sending from the legacy mainnet address - reuse SendModal for both normal and legacy-address sends
Contributor
Author
Yamaguchi
force-pushed
the
fix/derive_separate_keys_per_network
branch
from
October 7, 2026 06:03
77283dc to
ee9c7be
Compare
Yamaguchi
marked this pull request as ready for review
October 7, 2026 07:57
This branch has not been deployed
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.




Summary
Switching between mainnet and testnet in the extension only changed which explorer it talked to — the wallet's address and private key stayed exactly the same on both networks. Traced to
@tapylet/corealways deriving the key with the testnet coin type, whichever network was selected.Details
Mainnet and testnet now derive genuinely separate keys (see the companion
@tapylet/corechange). Addresses stay in the prod format on both networks; only the derivation path's coin type differs. A wallet created from now on gets both keys up front. An existing wallet gets its missing keys derived right after unlock; its previous single address is carried forward untouched as a "legacy mainnet address" — real funds may be sitting there — rather than recomputed, and a one-time notice tells the user their mainnet address has changed and where the old one went.Changes
PasswordSetupScreen: derive and store both mainnet/testnet keys on creation.UnlockScreen+storage/migrations.ts#ensureWalletNetworkKeys: backfill missing per-network keys after unlock; each network is derived independently so one failing doesn't block the other.LegacyMigrationNoticeScreen(one-time notice),MissingNetworkKeyScreen(retry when a key failed to derive),LegacyAddressScreen(view balance / send from the legacy mainnet address, reachable from Settings).SendModaltakes an explicitnetworkIdand an optionalfromLegacyMainnetWalletflag, reused by both normal sends and legacy-address sends.WalletDatamoved from a singleaddress/publicKeytonetworks: Record<networkId, {address, publicKey}>pluslegacyMainnetAddress.@tapylet/coreto^0.0.8.Impact
Verification Steps
npm test— 128 testsnpx tsc --noEmitpnpm buildRelated Issues
chaintope/tapylet-core#8
Notes
@tapylet/core0.0.8.tapylet-for-mobilehas the same fix in chaintope/tapylet-for-mobile#28.