Skip to content

Conversation

@EddieHouston
Copy link

@EddieHouston EddieHouston commented Jan 16, 2026

Description

This PR enables connections to Electrum servers behind API gateways that require authentication (e.g., JWT tokens, Bearer tokens, API keys, Basic auth, or custom authorization schemes).

What's being added:

  • New BdkElectrumClient::from_config() constructor that accepts custom Config for authorization and other settings

Notes to the reviewers

  • Dependency: This PR requires authorization provider support from rust-electrum-client. The feature is not yet in the published 0.24.0 release. Options:

  • This feature exposes the existing authorization capability from electrum-client through a new convenience constructor

  • The from_config() method is only implemented for BdkElectrumClient<electrum_client::Client> (not the generic ElectrumApi trait) since it needs to construct a concrete client

Changelog notice

Added:

  • Custom authorization support for Electrum connections via BdkElectrumClient::from_config()

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature (example implementation with documented usage)
  • I've added docs for the new feature (module docs, rustdoc examples, and usage guide)

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

@evanlinjin
Copy link
Member

NACK

This is a lot of description/documentation for a "convenient method" which saves 1 line of code.

@EddieHouston
Copy link
Author

NACK

This is a lot of description/documentation for a "convenient method" which saves 1 line of code.

Good feedback, I trimmed the noise down.

@evanlinjin
Copy link
Member

@EddieHouston this PR has nothing to do with using electrum behind gateways which require authentication.

This is adding a convenience method that saves one line of code. I'm not sure I see the value of this?

@EddieHouston
Copy link
Author

this PR has nothing to do with using electrum behind gateways which require authentication.

This is adding a convenience method that saves one line of code. I'm not sure I see the value of this?

Reasonable point, guess the value was the idea of helping people find out that using auth was possible. But you are right... and I don't see any other places this is done in the codebase.

I'll just focus on bitcoindevkit/rust-electrum-client#194 and if needed perhaps later we could add something to the example_electrum to show auth usage if it makes sense.

Thanks for your feedback and time 👍

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants