bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Provide a one liner to sync with electrum

Open matthiasdebernardini opened this issue 6 months ago • 2 comments

Describe the enhancement

Currently there is a lot of boilerplate needed to sync a wallet with electrum, it would be great to have one function that lets you pass in a mutable reference to a wallet and then have it update its internals with block data.

It used to be much easier to sync with electrum in the prior versions of bdk, it would be great to have a return to that simplicity.

Use case

load a wallet, then sync it with electrum to get block data with a single line of code

Additional context

I personally think a builder method and some macros/convinience functions built on top of that would work well, I usually just want a full scan no matter what but every once in a while I'll need a fast sync.

  ElectrumBuilder::new(wallet)
          .url("tcp://electrum.blockstream.info:50001")
          .network(NETWORK)
          .stop_gap(25)
          .batch_size(30)
          .fast_sync() 
          .fetch_prev_txouts()
          .request()?;

I'll bring this up in the Thursday meeting with @evanlinjin since I know he is working with electrum.

matthiasdebernardini avatar Jun 10 '25 16:06 matthiasdebernardini

Hey, can I work on this?

Her-Code avatar Sep 03 '25 10:09 Her-Code

Hey, can I work on this?

Yes, assigned to you.

oleonardolima avatar Sep 05 '25 10:09 oleonardolima