bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Add IndexedChain trait and implement for Esplora & Electrum

Open johncantrell97 opened this issue 4 years ago • 3 comments

Description

This PR introduces the trait IndexedChain that Blockchains can implement if they have access to chain data. There are lots of methods that could be added to this trait (the entire esplora/electrum apis) but I started with the data I needed to provide LDK with the chain data it needs to function.

I have implemented the trait for Esplora and Electrum blockchains.

All Submissions:

  • [x] I've signed all my commits
  • [x] I followed the contribution guidelines
  • [x] I ran cargo fmt and cargo clippy before committing

New Features:

  • [ ] I've added tests for the new feature
  • [x] I've added docs for the new feature
  • [x] I've updated CHANGELOG.md

johncantrell97 avatar Nov 30 '21 23:11 johncantrell97

Now that #501 is in you'll need to rebase on master to fix the CI issue.

notmandatory avatar Dec 16 '21 18:12 notmandatory

Concept ACK - would love to see this functionality get merged.

jlopp avatar Apr 14 '22 17:04 jlopp

FWIW my plan is not to merge this PR or something similar but rather to reduce the surface area that the main BDK lib has with blockchain interactions. I have got feedback that people really want a fully featured rust interface to esplora's http api though. The question to me is do we really need traits in BDK that define this behaviour? It seems like a small thing to leave up to the application developer if they indeed want to have blockchain data polymorphism.

LLFourn avatar Apr 19 '22 02:04 LLFourn