Closed evanlinjin closed 4 months ago
After discussion with @evanlinjin, it has been decided that I will attempt to pick this up.
We've started a rough document here of the plan: https://hackmd.io/@bdk/electrum_spv
FYI, since I needed it for LDK's electrum integration, I added a utility to validate merkle proofs to rust-electrum-client
a while back: https://github.com/bitcoindevkit/rust-electrum-client/pull/122
Just mentioning it as they could potentially be useful.
Just chiming in that I think this should be a priority. It will need very careful engineering to make efficient. I think perhaps we should have CheckPoint in the BdkElectrumClient
to keep track of re-orgs. This would allow us to cache merkle proofs and block headers (because we know they haven't changed). Despite this I predict the code would actually get simpler. No more weird loop and restarting in case of re-orgs.
To start off with we don't need to actually return the proofs. They can just be used to make our algorithm actually sound and robust.
Since this doesn't touch the wallet APIs I moved it to the beta milestone.
@notmandatory my suggestions on #1489 means it would touch the wallet API. Please take a look.
Moving this and #1489 back to the 1.0.0-alpha milestone.
Describe the enhancement
As mentioned by @LLFourn in https://github.com/bitcoindevkit/bdk/pull/976#discussion_r1193920143:
Additional context
LocalChain
.~