Repository navigation
✨ (signer-btc-legacy) [DSDK-1617]: Add get extended public key - #2000
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🟡 Changes recommended
Short-path validation runs after app opening, allowing invalid requests to trigger device communication before returning an error.
1 open issue
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
Adds extended public key retrieval to the legacy Bitcoin signer, building on its existing address API and Litecoin profile.
Changes:
- Adds
getExtendedPublicKeyand constructs BIP32 keys from parent and account public keys. - Introduces coin-specific xpub versions and hashing/Base58 dependencies.
- Adds unit coverage, three Litecoin end-to-end cases, documentation, and a sample-app action.
| File | Description |
|---|---|
pnpm-lock.yaml |
Locks hashing and Base58 dependencies. |
packages/signer/signer-btc-legacy/src/internal/use-cases/address/GetExtendedPublicKeyUseCase.ts |
Forwards xpub requests and options. |
packages/signer/signer-btc-legacy/src/internal/use-cases/address/GetExtendedPublicKeyUseCase.test.ts |
Tests option forwarding and defaults. |
packages/signer/signer-btc-legacy/src/internal/DefaultSignerBtcLegacy.ts |
Implements the signer method. |
packages/signer/signer-btc-legacy/src/internal/DefaultSignerBtcLegacy.test.ts |
Tests signer action wiring. |
packages/signer/signer-btc-legacy/src/internal/btcLegacyTypes.ts |
Adds the dependency-injection identifier. |
packages/signer/signer-btc-legacy/src/internal/btcLegacyModule.ts |
Registers the new use case. |
packages/signer/signer-btc-legacy/src/internal/btcLegacyModule.test.ts |
Tests use-case registration. |
packages/signer/signer-btc-legacy/src/internal/app-binder/task/utils/legacyTransactionUtils.ts |
Adds public-key compression and hashing. |
packages/signer/signer-btc-legacy/src/internal/app-binder/task/GetExtendedPublicKeyTask.ts |
Retrieves keys and serializes the xpub. |
packages/signer/signer-btc-legacy/src/internal/app-binder/task/GetExtendedPublicKeyTask.test.ts |
Tests serialization and error handling. |
packages/signer/signer-btc-legacy/src/internal/app-binder/BtcLegacyAppBinder.ts |
Runs the task in the selected app. |
packages/signer/signer-btc-legacy/src/internal/app-binder/BtcLegacyAppBinder.test.ts |
Tests task-action configuration. |
packages/signer/signer-btc-legacy/src/api/SignerBtcLegacy.ts |
Declares the public method. |
packages/signer/signer-btc-legacy/src/api/profiles/litecoinProfile.ts |
Sets Litecoin’s Ltub version. |
packages/signer/signer-btc-legacy/src/api/model/LegacyCoinProfile.ts |
Requires a coin-specific xpub version. |
packages/signer/signer-btc-legacy/src/api/model/ExtendedPublicKeyOptions.ts |
Defines the app-opening option. |
packages/signer/signer-btc-legacy/src/api/index.ts |
Exports the new public types. |
packages/signer/signer-btc-legacy/src/api/app-binder/GetExtendedPublicKeyDeviceActionTypes.ts |
Defines action output, errors, and interaction types. |
packages/signer/signer-btc-legacy/README.md |
Documents xpub usage and options. |
packages/signer/signer-btc-legacy/package.json |
Adds hashing and Base58 dependencies. |
apps/sample/src/components/SignerLitecoinView/index.tsx |
Adds the xpub action form. |
apps/sample/playwright/utils/drivers/LtcSignerDriver.ts |
Adds xpub form automation. |
apps/sample/playwright/cases/signers/litecoin/get-extended-public-key.spec.ts |
Checks three Litecoin account xpubs. |
.changeset/bitcoin-legacy-xpub.md |
Records the minor package update. |
Review effort: Balanced
70664f0 to
c864e50
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Address the critical compressed-key handling defect, correct the pre-APDU validation error type, and resolve the LegacyCoinProfile compatibility or release-versioning issue.
2 open issues
1 file not reviewed
pnpm-lock.yaml: Generated file
Review effort: Lite
c864e50 to
bb8ae5d
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Invalid or empty derivation paths can throw synchronously instead of returning the documented observable error; path validation should handle these inputs and include a regression test.
1 resolved since last review
1 file not reviewed
pnpm-lock.yaml: Generated file
Review effort: Lite
bb8ae5d to
ed9df7f
Compare
ed9df7f to
3c3018d
Compare
Replaced by a newer auto-merge request
|





📝 Description
Get extended public key for
signer-btc-legacy(ticket 1.3 of Plan: Bitcoin family on DMK). Stacked on #1994.getExtendedPublicKey(path, { skipOpenApp })returns{ extendedPublicKey }, named like signer-btc's method.BtcOld.getWalletXpubdoes: two get address calls (the parent's key for the fingerprint, the account's key and chain code), then the BIP32 serialization with the coin's version, base58check encoded. A path with fewer than two levels returns an error before any APDU.LegacyCoinProfilegetsxpubVersion;LITECOIN_PROFILEuses0x019da462("Ltub"), the value Ledger Wallet reads from coin-bitcoin'snetworks.ts.@noble/hashes(as in signer-zcash) andbs58(workspace catalog).One deliberate difference with hw-app-btc: it always sets the hardened bit of the child index; the kit writes the real index. Both are identical for account paths, the only ones Ledger Wallet uses.
Compared with Ledger Wallet. For the 44', 49' and 84' Litecoin accounts of the Speculos seed, the same three xpubs come from:
BtcOld.getWalletXpub, Ledger Wallet's LitecoinxpubVersion), run live against a real Speculos Litecoin app through the mock server;Sample app: a "Get extended public key" action on the Litecoin screen, and 3 Playwright specs against the real Litecoin app 2.4.13 on Flex 1.7.0, through the mock server and Speculos.
❓ Context
✅ Checklist
Pull Requests must pass CI checks and undergo code review. Set the PR as Draft if it is not yet ready for review.
signer-btc-legacy: new get extended public key API;xpubVersionis a new required field ofLegacyCoinProfilesigners/litecoin(3 new specs, all on real Speculos)🧐 Checklist for the PR Reviewers
🤖 Generated with Claude Code