Skip to content

feat: bump bdk_wallet to 3.1.0#1030

Open
reez wants to merge 2 commits into
bitcoindevkit:masterfrom
reez:v3.1.0
Open

feat: bump bdk_wallet to 3.1.0#1030
reez wants to merge 2 commits into
bitcoindevkit:masterfrom
reez:v3.1.0

Conversation

@reez

@reez reez commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Dependency bump. The other commits are more experimental to see the shape of exposing new APIs.

Notes to the reviewers

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 linked an issue Jun 16, 2026 that may be closed by this pull request
23 tasks

@thunderbiscuit thunderbiscuit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will take some time to review, but I'm adding some questions here!

Comment thread bdk-ffi/src/signer.rs Outdated
/// Also looks at the corresponding descriptor to determine the `SignerContext` to attach to
/// the signers.
#[uniffi::constructor]
pub fn from_descriptor_with_context(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd like to make sure I understand well the use case(s) for this constructor. Can we add a test showcasing this?

Comment thread bdk-ffi/src/signer.rs Outdated

/// Returns the number of signers in the container.
pub fn len(&self) -> u64 {
self.inner.signers().len() as u64

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does this length represent? A reminder to myself to look into it.

Comment thread bdk-ffi/src/wallet.rs Outdated
/// extracts keys from the provided descriptor while loading.
#[uniffi::constructor(default(lookahead = 25))]
pub fn load_from_two_path_descriptor(
two_path_descriptor: Arc<Descriptor>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I added a PR on bdk_wallet bitcoindevkit/bdk_wallet#506 to fix the docs on this, and it indeed requires public descriptors to work. We should just pull that in here as well, and fix up the API docs to on the create_from_two_path_descriptor method to also copy what is now in the Rust API docs (old PR of mine too back then).

In our case the failure happens earlier than in the constructor however, since the user can't pass a string to the constructor and passes a full Descriptor type, which simply cannot be built using private+multipath (see our test for this on bdk-jvm here), so the user would never really get to the constuctor in the first place with their private multipath descriptor. Still I'd like to see the docs mention it here if possible (even though my PR 506 is not merged yet).

@reez reez marked this pull request as ready for review June 25, 2026 14:49

@thunderbiscuit thunderbiscuit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Added a few more comments. We can keep chewing through this PR one piece at a time and eventually it'll be ready all at once, but I wonder if maybe splitting it would help work + review on all features in parallel. Your call. I feel like some of those commits are ready to merge, some not yet (or at least I have more questions).

Comment thread bdk-ffi/src/wallet.rs Outdated
persister: Arc<Persister>,
lookahead: u32,
) -> Result<Wallet, LoadWithPersistError> {
let descriptor = two_path_descriptor.to_string_with_secret();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line can be removed, as no private constructor can make it this far, and the to_string_with_secret() method doesn't do anything on public descriptors.

Comment thread bdk-ffi/src/wallet.rs Outdated
}

/// Get the signers.
pub fn get_signers(&self, keychain: KeychainKind) -> Arc<SignersContainer> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't have a strong reason to block exposing a method available on the wallet on the Rust side in the first place, but I'm also not sure what this is useful for, since the goal of sign_with_signers is to create your own signers at that point in time (not get them from your wallet). It's also one of the APIs that's leaving the wallet at some point because the wallet will not own any signers anymore. See bitcoindevkit/bdk_wallet#70.

I'm not against it; just not sure if adding the code surface is worth it yet, let me know what you think.

Comment thread bdk-ffi/src/wallet.rs Outdated
///
/// Returns true if the PSBT was finalized, or false otherwise.
#[uniffi::method(default(sign_options = None))]
#[allow(deprecated)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this to pre-emptively silence the warning that will probably come with bitcoindevkit/bdk_wallet#505?

Comment thread bdk-ffi/src/tests/wallet.rs Outdated
wallet.get_signers(KeychainKind::Internal),
];

let finalized = wallet.sign_with_signers(psbt, signers, None).unwrap();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This tests that the signers already present in the wallet can sign the transaction, so the sign_with_signers works, but if possible I'd like to also test the more important/new API, the ability to create signers on the fly and sign with them.

@reez

reez commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Added a few more comments. We can keep chewing through this PR one piece at a time and eventually it'll be ready all at once, but I wonder if maybe splitting it would help work + review on all features in parallel. Your call. I feel like some of those commits are ready to merge, some not yet (or at least I have more questions).

Yeah definitely something where I can break it out into separate PRs, as a reviewer how would you best like them split out?

My assumption is bdk_wallet bump + foreign UTXO validation fix are ready... then split out:

  • two-path descriptor load/create docs and params
  • signer APIs

... but I'd rather do whatever is easiest split for you as a reviewer because it's no sweat on my end to chop it up any way.

@thunderbiscuit

Copy link
Copy Markdown
Member

Pretty much agree with your proposed split. I'd maybe do:

  • bump dep to 3.1.0 + foreign UTXO validation fix is ready
  • two path descriptor load also ready IMO (given the fixes to the docs and the small line removal I pointed out in one of the review comments)
  • Signers
  • Params (it's the one commit I haven't really reviewed yet).

@reez

reez commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Pretty much agree with your proposed split. I'd maybe do:

  • bump dep to 3.1.0 + foreign UTXO validation fix is ready
  • two path descriptor load also ready IMO (given the fixes to the docs and the small line removal I pointed out in one of the review comments)
  • Signers
  • Params (it's the one commit I haven't really reviewed yet).

Cool, will start doing this and also try to bring over the questions/comments for each respectively

@reez

reez commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Pretty much agree with your proposed split. I'd maybe do:

  • bump dep to 3.1.0 + foreign UTXO validation fix is ready
  • two path descriptor load also ready IMO (given the fixes to the docs and the small line removal I pointed out in one of the review comments)
  • Signers
  • Params (it's the one commit I haven't really reviewed yet).

Cool, will start doing this and also try to bring over the questions/comments for each respectively

Ok this Pr now has only bump dep to 3.1.0 + foreign UTXO validation fix is ready

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.

Release 3.1.0

2 participants