Conversation
MusabYK
reviewed
Sep 13, 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| { |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a draft for adding experimental silent payment send support to bdk-ffi in small steps.
bdk_spas an optional dependency behindexperimental-silent-payments.The feature stays off by default, so existing builds are unchanged while we work through the API.
Notes to the reviewers
bdk_sp 0.2.0.SilentPaymentCode::newcurrently 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)Documentation
bdk_wallet::Wallet::signbdk_sp::encoding::SilentPaymentCodebdk_sp::send::psbt::derive_spChangelog
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingchangelog:*labelNew Features:
Bugfixes: