Skip to content

btc: require verified silent payment outputs - #190

Open
benma-agent wants to merge 2 commits into
BitBoxSwiss:masterfrom
benma-agent:benma-agent/fix-silent-payment-completeness
Open

benma-agent wants to merge 2 commits into
BitBoxSwiss:masterfrom
benma-agent:benma-agent/fix-silent-payment-completeness

Conversation

@benma-agent

@benma-agent benma-agent commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

BTCSign could succeed when the device omitted a generated silent payment script
or skipped the output exchange entirely. Require a verified generated script for
every requested silent payment before returning signatures, and reject generated
silent payment data on ordinary outputs.

Add regression coverage for omitted exchanges, missing or invalid proofs,
duplicate output requests, and valid mixed outputs. Keep the shared firmware
vectors unchanged and handle older firmware's acceptance of silent payment
metadata on owned outputs in the Go runner. Failed signing must leave PSBT
signatures and output scripts unchanged.

Includes commit ac372fc from #188 before the signing fix to disable goconst for
test files while retaining the rule for production code.

Repeated literals keep test inputs and expected results readable.
Exclude goconst from all _test.go files while retaining it for
production code.
@benma
benma requested a review from Beerosagos October 4, 2026 08:23
BTCSign could return successfully when the device omitted a generated
silent payment script or skipped the output exchange entirely. In both
cases the host skipped proof verification and left the original PSBT
output script unchanged.

Require a generated script for each silent payment output exchange,
verify it before recording it, and reject completion unless every
requested silent payment has a verified output. Reject generated silent
payment data on ordinary outputs as well.

Add regressions for omitted exchanges, missing or invalid proofs,
duplicate output requests, and valid mixed outputs. Keep the shared
firmware vectors unchanged and handle older firmware's acceptance of
silent payment metadata on owned outputs in the Go runner, expecting
the host to reject the missing script. Failed signing must leave PSBT
signatures and output scripts unchanged.
@benma-agent
benma-agent force-pushed the benma-agent/fix-silent-payment-completeness branch from 4033c84 to ec282be Compare October 4, 2026 08:24
@benma
benma marked this pull request as ready for review October 4, 2026 08:24
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.

1 participant