Phase 1: descriptor-backed standard wallet address derivation (wpkh)#700
Draft
Phase 1: descriptor-backed standard wallet address derivation (wpkh)#700
Conversation
Co-authored-by: dangershony <7487930+dangershony@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate standard wallet to descriptor-based wallets
Phase 1: descriptor-backed standard wallet address derivation (wpkh)
Mar 14, 2026
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.
Migrates standard wallet receive/change address derivation to use BIP-84
wpkhdescriptors internally, while keeping all existing interfaces, signing paths, and Angor custom scripts unchanged. Old wallets auto-migrate on first scan without any user action.Model changes (
AccountInfo)Three new nullable fields alongside existing
ExtPubKey/Path(additive – no breaking storage change):ReceiveDescriptor–wpkh([fp/84h/coinTypeh/0h]xpub/0/*)ChangeDescriptor–wpkh([fp/84h/coinTypeh/0h]xpub/1/*)MasterFingerprint– first 4 bytes of HASH160(root pubkey), lowercase hexNew helper:
StandardWalletDescriptorsStatic class in
Angor.Shared:Build(xpub, fingerprint, coinType)→(ReceiveDescriptor, ChangeDescriptor)ExtractXPub(descriptor)→ account-level xpub stringIsChangeBranch(descriptor)→ boolTryMigrate(accountInfo, coinType)→ generates descriptors from legacyExtPubKeywhen absentWalletOperationschangesBuildAccountInfoForWalletWordsnow computes the master fingerprint and populates all three descriptor fields on creation.UpdateAccountInfoWithNewAddressesAsynccallsTryMigrateat entry (no-op if already migrated), then sources the scanning xpub from the descriptor rather than rawExtPubKey:Migration behaviour
Descriptor derivation uses the same account xpub at
m/84'/coinType'/0'as the legacy path, so all addresses are identical. Old wallets transparently gain descriptors in-memory on firstUpdateAccountInfoWithNewAddressesAsynccall; no manual migration or data loss.Tests (
WalletDescriptorTests– 23 cases)ExtractXPubround-tripBuildAccountInfoForWalletWordsintegrationTryMigratelifecycle: generates, is idempotent, skips when xpub absentNot changed
Angor custom scripts, founder/investor derivation, Nostr paths, signing, all public service interfaces.
Recommended follow-up
tr(…)) descriptor support💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.