Skip to content

HWI parity: cryptographically validate signatures and signed PSBTs #71

Description

@trevarj

Goal

Strengthen HWI parity tests for nondeterministic signatures without requiring byte-for-byte equality.

Current state

  • BitBox02 signmessage checks the JSON shape and that the base64 payload is 65 bytes, then skips exact comparison with the reference signature.
  • signtx compares the signed flag and unsigned transaction and checks that an expected partial-signature key exists.
  • Those checks can accept malformed signatures or meaningful PSBT differences.

Scope

  • Cryptographically verify each signmessage signature against the expected message and device public key.
  • Verify every expected PSBT signature against the correct transaction sighash, input, and public key.
  • Compare meaningful PSBT fields and metadata while excluding only genuinely nondeterministic signature encodings.
  • Apply the stronger helpers across Ledger, Jade, Coldcard, and BitBox02 parity cases.
  • Add negative unit tests proving malformed or wrong-key signatures are rejected.

Acceptance criteria

  • BitBox02 signmessage parity validates the signature instead of checking only length.
  • Every successful signtx parity case validates the device signature cryptographically.
  • Reference and candidate PSBTs are compared semantically outside nondeterministic signature bytes.
  • Corrupted, wrong-message, wrong-input, and wrong-key fixtures fail focused tests.
  • All four focused parity runners and upstream final gates remain green.
  • Required non-emulator checks pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions