Skip to content

WIP: Silent Payments (Send) - #1052

Draft
reez wants to merge 2 commits into
bitcoindevkit:masterfrom
reez:bdk-sp
Draft

reez wants to merge 2 commits into
bitcoindevkit:masterfrom
reez:bdk-sp

Conversation

@reez

@reez reez commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Description

This is a draft for adding experimental silent payment send support to bdk-ffi in small steps.

  • Add bdk_sp as an optional dependency behind experimental-silent-payments.
  • Expose the smallest useful send API.

The feature stays off by default, so existing builds are unchanged while we work through the API.

Notes to the reviewers

  • Before starting this the one bdk-sp change I wanted in place was bdk-sp #63. That fix is now included in bdk_sp 0.2.0.
  • SilentPaymentCode::new currently checks for an empty payload before calling bdk_sp which otherwise panics. Once fix: return an error for empty silent payment payloads bdk-sp#66 is released, this workaround and the direct Bech32m imports can be removed (silent_payments.rs line 3 can later be removed, line 23-26 defensive)
  • For now I’m mainly mainly looking for feedback on the dependency and feature setup, along with the direction of the wallet integrated send API.

Documentation

Changelog

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing
  • I've added exactly one changelog:* label
  • I've linked the relevant upstream docs or specs above

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@reez reez changed the title WIP: Silent Payments WIP: Silent Payments (Send) Jul 23, 2026
/// Attempts to parse a string as a silent payment code.
#[uniffi::constructor]
pub fn new(code: String) -> Result<Self, SilentPaymentCodeParseError> {
let checked_code = CheckedHrpstring::new::<Bech32m>(&code).map_err(|error| {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looking through the BdkSilentPaymentCode::try_from implementation I realize the manual pre-check using CheckedHrpstring is not necessary, it should be dropped if that's ok, since the BdkSilentPaymentCode::try_from implementation already performs internal Bech32m validation and catches all wrong-length or empty payload scenarios on its own.

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants