Skip to content

WIP: Add Silent Payments + BIP 375 Support#587

Draft
macgyver13 wants to merge 13 commits intoColdcard:new_edgefrom
macgyver13:silentpayments-bip375-psbt
Draft

WIP: Add Silent Payments + BIP 375 Support#587
macgyver13 wants to merge 13 commits intoColdcard:new_edgefrom
macgyver13:silentpayments-bip375-psbt

Conversation

@macgyver13
Copy link
Copy Markdown

@macgyver13 macgyver13 commented Nov 26, 2025

Tested with Sparrow Air Gapped Wallet commit a6081970 and simulator on mainnet

After putting together some python BIP 375 examples I took a look at the coldcard firmware and discovered it would be a easy lift to create a Proof of Concept to evaluate silent payments since PSBTv2 was already supported. This PR focuses on core behavior and minimal UI/UX changes.

The commits were organized to make review as easy as possible. There are some # TODO: in code where I don't have enough knowledge to make a decision at this time. Appreciate your feedback and advice on this PR.

TODOs:

  • verify silent payments labeled address handling
  • (partial) verify multi sig silent payment workflows - need to implement on wallet coordinator side first
  • (partial) address edge cases / attack scenarios
  • (on hold) test on real hardware - evaluate memory and performance
  • (partial) proper UI/UX for Silent Payments

Screenshots

Updated UX with - silent payment address - appended to - to address -

SHIFT SYM CAPS SHIFT SYM CAPS SHIFT SYM CAPS

Contribute Shares Prompt

0F056943EDGE

@macgyver13 macgyver13 force-pushed the silentpayments-bip375-psbt branch from 2554014 to b39d529 Compare March 26, 2026 13:29
@macgyver13 macgyver13 marked this pull request as draft March 26, 2026 13:33
external/ckcc-protocol
external/libngu
update libngu
- add interface for s_ec_pubkey_tweak_mul
- add interface for s_ec_pubkey_combine
add bip352 crypto primitives / helpers
add bip352 tagged hashes
add bip374 tagged hashes
add dleq bip374 reference generate_dleq_proof, verify_dleq_proof functions
extend psbt handling with silent payment specific functions
incorporate BIP375 test validation functions
- psbt_structure, input_eligibility, ecdh_coverage
only store key_data for short_values - remove key_type
only serialize PSBT_OUT_SCRIPT if self.script has a value
adjust v2 script assert to not required if sp_v0_info is present
…nified

provides silent payments testing framework with access to MockPSBT
migrate test_silentpayments to use simulator and bip375_test_vectors.json
- add devtest/unit_silentpayments.py
- add devtest/verify_sp_outputs.py
mirror psbt fields in testing/psbt
correct input eligibility ecdh share assumptions
integrate preview silent payment address as output in auth workflow
integrate silent payments in signing workflow
add sp_hrp property to chains
add silent payments fields to psbt
refactor _derive_input_privkey
use sp_tweak when spending silent payment output
create end-to-end tests for silent payments
handle sp_tweak tweak parity when matching private key
introduce mine vs theirs seed construct to fake_txn
add test to validate 'Contribute Shares?' UX
add silent payments label change tests
- detect presence or absence of 'Change back:' in UI story
add multi-signer incomplete coverage scenario tests
fix sp_spend test failure when B_spend has odd Y parity
@macgyver13 macgyver13 force-pushed the silentpayments-bip375-psbt branch from b39d529 to ecbd31f Compare March 27, 2026 01:25
@macgyver13
Copy link
Copy Markdown
Author

Still have plenty of tasks to do on this PR but wanted to provide a checkpoint given the number of changes. I can break this into multiple PRs if preferred. I expect commits 7887701 through c516610 to remain stable.

Core Changes:

  • fix: (psbt v2)
  • fix: (usb_test)

Silent Payments Changes:

  • Standardized testing to use pytest and simulator instead of ngu_wrapper
  • Added bip375_test_vectors.json and parameterized test_silentpayments to use each vector
  • Introduced the workflow of contributing shares but not signing when multi-signers contribute to a SP output
  • Silent Payments Address is now appended to UI text instead of replacing - to address -
  • Labeled silent payments addresses are rendered correctly for change
  • Added BIP376 fields and associated operations

TODOs:

  • Considering how to show BIP353 HRN when provided by wallet coordinator like Sparrow
  • Identify sensitive material areas that need to be cleared
  • Add more tests to handle edge cases - open to suggestions
  • Consider doc/silentpayments.md

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.

3 participants