Skip to content

Feat/sp sending#496

Open
jvgelder wants to merge 10 commits intocaravan-bitcoin:mainfrom
jvgelder:feat/sp-sending
Open

Feat/sp sending#496
jvgelder wants to merge 10 commits intocaravan-bitcoin:mainfrom
jvgelder:feat/sp-sending

Conversation

@jvgelder
Copy link
Copy Markdown

@jvgelder jvgelder commented Mar 24, 2026

What kind of change does this PR introduce?

feature

Issue Number:

Fixes #467

Summary

Implements sending to silent payment Bip352 address via psbtv2 bip375.

Still work in progress but gives some insights in how I plan to integrate.

TODO:

  • DLEQ verification
  • Improve test coverage

Does this PR introduce a breaking change?

Should not introduce any breaking changes

Checklist

  • I have tested my changes thoroughly.
  • I have added or updated tests to cover my changes (if applicable).
  • I have verified that test coverage meets or exceeds 95% (if applicable).
  • I have run the test suite locally, and all tests pass.
  • I have written tests for all new changes/features
  • I have followed the project's coding style and conventions.
  • I have created a changeset to document my changes (npm run changeset)

Other information

Have you read the contributing guide?

Yes

Added encoders and decoders for the given silent payment fields.
Since we add new fields that are not allowed by v0 we also need to delete
them when converting to v0.
Allow the user to set and get a silentpayment object instead of a script.
As per BIP375 we need to make sure there is either an OUPUT_SCRIPT or
PSBT_OUT_SP_V0_INFO updated getter, validation and unsignedtx accordingly.
- Add silentpayment.ts with pure BIP352 crypto primitives:
  eligibleIndices, sumECDHShares, computeInputHash,
  deriveSilentPaymentOutput, bip352TaggedHash
- Add computeSilentPaymentOutputScripts() to PsbtV2 (Signer role)
  implementing BIP375 output script derivation from ECDH shares
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 24, 2026

🦋 Changeset detected

Latest commit: ea81977

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@caravan/psbt Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
caravan-coordinator Ready Ready Preview, Comment Mar 31, 2026 9:52am

Request Review

Return empty string instead of changing the signature, feels vary shaky.
- validate SegWit version range
- use full compressed spend keys in derivation
- enforce BIP352 scalar validity checks
Instead of having multiple places where we define checks call the proper
assert functions. Also added a missing Bspend check.
Our assert was contained the wrong message (mentioned k instead of m).
Also added a separate assert for 0 < k < Kmax (2323) output index check.
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.

Silent payment support

1 participant