Repository navigation
✨ (signer-btc-legacy) [DSDK-1618]: Add basic transaction signing - #2029
Merged
aussedatlo merged 6 commits intoOct 23, 2026
Merged
aussedatlo merged 6 commits into
aussedatlo merged 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
aussedatlo
force-pushed
the
feat/dsdk-1618-btc-legacy-basic-signing
branch
from
October 22, 2026 10:22
eba12c4 to
80dce52
Compare
aussedatlo
added this pull request to stack #2027
October 22, 2026 10:42
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved validation, unlocking-script construction, and command-payload sizing issues can produce invalid transactions or prevent signing.
3 open issues
What changed in this PR
Adds basic non-SegWit transaction signing to signer-btc-legacy, building on the extended-public-key support in #2000 and extending the sample app to Dogecoin.
Changes:
- Adds the signing API, device commands, trusted-input processing, and replaceable transaction serializers.
- Introduces a Dogecoin profile and transaction-signing forms for Litecoin and Dogecoin.
- Adds recorded-command replay tests, end-to-end signing and rejection tests, documentation, and a minor-version changeset.
| File | Description |
|---|---|
| packages/signer/signer-btc-legacy/src/internal/use-cases/transaction/SignTransactionUseCase.ts | Forwards signing requests and options. |
| packages/signer/signer-btc-legacy/src/internal/use-cases/transaction/SignTransactionUseCase.test.ts | Tests forwarding and default options. |
| packages/signer/signer-btc-legacy/src/internal/DefaultSignerBtcLegacy.ts | Exposes transaction signing. |
| packages/signer/signer-btc-legacy/src/internal/DefaultSignerBtcLegacy.test.ts | Tests profile-specific signing dispatch. |
| packages/signer/signer-btc-legacy/src/internal/btcLegacyTypes.ts | Adds signing and serializer injection tokens. |
| packages/signer/signer-btc-legacy/src/internal/btcLegacyModule.ts | Registers signing services and serializers. |
| packages/signer/signer-btc-legacy/src/internal/btcLegacyModule.test.ts | Tests service bindings and serializer replacement. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/utils/legacyTransactionUtils.ts | Adds integer encoding and script chunking. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/SignTransactionTask.ts | Coordinates validation, hashing, and signing. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/SignTransactionTask.test.ts | Tests reference transactions and errors. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/GetTrustedInputTask.ts | Streams previous transactions to the device. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/GetTrustedInputTask.test.ts | Tests streaming and error propagation. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/format/TrustedInputSerializer.ts | Defines the trusted-input serialization hook. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/format/TransactionSerializer.ts | Defines signing serialization hooks. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/format/StandardTrustedInputSerializer.ts | Serializes standard previous transactions. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/format/StandardTransactionSerializer.ts | Serializes headers and signed transactions. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/task/__fixtures__/referenceTransactions.ts | Stores reference exchanges and signed bytes. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/utils/apduHeaderUtils.ts | Adds command-header constants. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/StartUntrustedHashTransactionInputCommand.ts | Implements input-hashing commands. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/StartUntrustedHashTransactionInputCommand.test.ts | Tests hashing headers and errors. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/SignTransactionCommand.ts | Implements signature requests and response parsing. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/SignTransactionCommand.test.ts | Tests signature encoding and rejection handling. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/ProvideOutputFullChangePathCommand.ts | Sends the change derivation path. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/ProvideOutputFullChangePathCommand.test.ts | Tests change-path encoding and errors. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/HashOutputFullCommand.ts | Streams output-hashing payloads. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/HashOutputFullCommand.test.ts | Tests output chunk flags and rejection. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/GetTrustedInputCommand.ts | Implements trusted-input commands. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/command/GetTrustedInputCommand.test.ts | Tests trusted-input encoding and responses. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/BtcLegacyAppBinder.ts | Runs signing in the profile’s app. |
| packages/signer/signer-btc-legacy/src/internal/app-binder/BtcLegacyAppBinder.test.ts | Tests signing dispatch and preflight rejection. |
| packages/signer/signer-btc-legacy/src/api/SignerBtcLegacy.ts | Adds the public signing method. |
| packages/signer/signer-btc-legacy/src/api/profiles/dogecoinProfile.ts | Defines the Dogecoin profile. |
| packages/signer/signer-btc-legacy/src/api/model/TransactionOptions.ts | Defines signing options. |
| packages/signer/signer-btc-legacy/src/api/model/CreateTransactionArg.ts | Defines transaction input models. |
| packages/signer/signer-btc-legacy/src/api/index.ts | Exports signing APIs and extension hooks. |
| packages/signer/signer-btc-legacy/src/api/app-binder/SignTransactionDeviceActionTypes.ts | Defines signing results and interaction types. |
| packages/signer/signer-btc-legacy/README.md | Documents signing usage and format hooks. |
| apps/sample/src/utils/btcLegacyTransaction.ts | Parses raw transactions and form values. |
| apps/sample/src/components/SignerView/index.tsx | Adds Dogecoin navigation. |
| apps/sample/src/components/SignerLitecoinView/index.tsx | Adds the Litecoin signing form. |
| apps/sample/src/components/SignerDogecoinView/index.tsx | Adds the Dogecoin signing view. |
| apps/sample/src/app/signers/dogecoin/page.tsx | Adds the Dogecoin route. |
| apps/sample/playwright/utils/drivers/BtcLegacySignerDriver.ts | Generalizes the driver and adds signing interactions. |
| apps/sample/playwright/fixtures.ts | Provides Litecoin and Dogecoin drivers. |
| apps/sample/playwright/cases/signers/litecoin/sign-transaction.spec.ts | Adds Litecoin signing and rejection scenarios. |
| apps/sample/playwright/cases/signers/litecoin/get-address.spec.ts | Updates the renamed driver import. |
| apps/sample/playwright/cases/signers/dogecoin/sign-transaction.spec.ts | Adds Dogecoin signing and rejection scenarios. |
| .changeset/bitcoin-legacy-sign-transaction.md | Records the minor-version feature addition. |
Review effort: Balanced
aussedatlo
force-pushed
the
feat/dsdk-1618-btc-legacy-basic-signing
branch
from
October 22, 2026 12:10
80dce52 to
79523b9
Compare
aussedatlo
force-pushed
the
feat/dsdk-1618-btc-legacy-basic-signing
branch
from
October 22, 2026 12:58
79523b9 to
a9f1566
Compare
aussedatlo
force-pushed
the
feat/dsdk-1618-btc-legacy-basic-signing
branch
from
October 23, 2026 08:23
a9f1566 to
cab8ce9
Compare
Comment on lines
36
to
+38
| private readonly profile: LegacyCoinProfile<ErrorCodes>, | ||
| @inject(btcLegacyTypes.SignTransactionTask) | ||
| private readonly signTransactionTask: SignTransactionTask<ErrorCodes>, |
Contributor
There was a problem hiding this comment.
legit but pkg is unreleased
fAnselmi-Ledger
approved these changes
Oct 23, 2026
aussedatlo
force-pushed
the
feat/dsdk-1618-btc-legacy-basic-signing
branch
from
October 23, 2026 09:07
74a8212 to
9085941
Compare
Comment on lines
+138
to
+142
| const error = this.getTrustedInputTask.validate(transaction); | ||
| if (error !== undefined) { | ||
| return error; | ||
| } | ||
| } |
aussedatlo
force-pushed
the
feat/dsdk-1618-btc-legacy-basic-signing
branch
from
October 23, 2026 09:24
9085941 to
48d1110
Compare
aussedatlo
force-pushed
the
feat/dsdk-1618-btc-legacy-basic-signing
branch
from
October 23, 2026 10:16
48d1110 to
b74a0aa
Compare
aussedatlo
enabled stacked auto-merge
October 23, 2026 10:27
|
4 of 9 tasks
This branch was successfully 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.





📝 Description
Basic transaction signing for
signer-btc-legacy(ticket 1.4 of Plan: Bitcoin family on DMK). Stacked on #2000.signTransaction(transaction, { skipOpenApp })returns the signed transaction in hexadecimal. Its argument has the shape of hw-app-btc'screatePaymentTransactionargument, withUint8Arrays instead ofBuffers, so Ledger Wallet passes what it builds today (ADR, rule 3).Commands
0x42(trusted input),0x44(untrusted hash start),0x4A(hash outputs and change path) and0x48(sign). They take the profile's error map, likeLegacyGetAddressCommand, and are exported for signer-zcash.The flow is hw-app-btc's for inputs without SegWit: one trusted input per input, then for each input the whole transaction hashed with that input's script only, the change path, the outputs, and its signature.
The trusted input and signing tasks are services of the module (
btcLegacyTypes.GetTrustedInputTask,btcLegacyTypes.SignTransactionTask). Their format steps are hooks behind two tokens, bound to thestandardformat:TrustedInputSerializer: the previous transaction as the data of its0x42APDUs. This is where Zcash's v5/v6 parser goes.TransactionSerializer: the header of each0x44stream and the signed transaction. This is where Zcash's version group and branch IDs go.A kit on another format rebinds them in its container (
rebindSync, covered by a test).DOGECOIN_PROFILE(xpubVersion0x02facafd, from coin-bitcoin'snetworks.ts).Compared with Ledger Wallet. Four reference transactions were signed by ledger-live's own hw-app-btc
createTransaction(dd044b36c83) on the real Litecoin and Dogecoin 2.4.13 apps, through the mock server and Speculinho. For each coin: one input and one output; then two inputs with a change output, a lock time and RBF sequences. The previous transactions are synthetic transactions paying the Speculos seed, and their inputs carry 107-byte scripts, split into blocks.hw-app-btc first sends get app and version (
b001) to pick the SegWit trusted input mode. The kit leaves it out, as it has no SegWit flow yet.Not in this PR (1.5, DSDK-1619):
0x00here;Sample app:
LtcSignerDriverbecomesBtcLegacySignerDriver, which takes the coin, and gets adogeSignerfixture.6985.❓ 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 sign transaction API, new commands, tasks and format hooks in its module, Dogecoin profilesigners/litecoinandsigners/dogecoin(6 new specs, all on real Speculos), driver renamed🧐 Checklist for the PR Reviewers
🤖 Generated with Claude Code