Skip to content

Test Bitcoin signing with shared vectors - #171

Open
benma-agent wants to merge 1 commit into
BitBoxSwiss:masterfrom
benma-agent:benma-agent/shared-btc-test-vectors
Open

Test Bitcoin signing with shared vectors#171
benma-agent wants to merge 1 commit into
BitBoxSwiss:masterfrom
benma-agent:benma-agent/shared-btc-test-vectors

Conversation

@benma-agent

@benma-agent benma-agent commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Consume the PSBT transaction vectors introduced by
BitBoxSwiss/bitbox02-firmware#2017 in
simulator signing tests. The PSBT conversion exercises the low-level
signing protocol without duplicating each vector as a raw request.

Centralize simulator stdout parsing and check versioned screens, errors,
signature insertion, generated outputs, and final transactions.

Close gaps exposed by the vectors: recognize Taproot policies when
loading previous transactions, preserve existing Taproot script-path
signatures, and forward silent-payment and payment-request metadata.

Remove obsolete transaction test helpers superseded by the vectors and
keep the simulator harness lint-clean.

@benma-agent
benma-agent force-pushed the benma-agent/shared-btc-test-vectors branch from f631baa to fe205a4 Compare July 21, 2026 09:59
Consume the PSBT transaction vectors introduced by
BitBoxSwiss/bitbox02-firmware#2017 in
simulator signing tests. The PSBT conversion exercises the low-level
signing protocol without duplicating each vector as a raw request.

Centralize simulator stdout parsing and check versioned screens, errors,
signature insertion, generated outputs, and final transactions.

Close gaps exposed by the vectors: recognize Taproot policies when
loading previous transactions, preserve existing Taproot script-path
signatures, and forward silent-payment and payment-request metadata.

Remove obsolete transaction test helpers superseded by the vectors and
keep the simulator harness lint-clean.
@benma-agent
benma-agent force-pushed the benma-agent/shared-btc-test-vectors branch from fe205a4 to 46f2dec Compare July 21, 2026 20:53
@benma
benma requested a review from cedwies July 30, 2026 20:58
@benma
benma marked this pull request as ready for review July 30, 2026 20:58

@cedwies cedwies left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the rebase:

For the three vectors that the PSBT finalizer cannot finalize, the test currently stops after checking the signature’s shape, etc. Could we still calculate the relevant sighash from the original PSBT and cryptographically verify the returned signature against the expected public key?
This would not be as strong as finalizing the PSBT and executing the complete Bitcoin scripts, but it would still prove that the firmware signed the transaction of the original PSBT and therefore stronger than the current test for the 3 special vectors. Is there a limitation that prevents doing so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants