Skip to content

Add scanblocks rpc, questions about RpcBlockchain #121

@chrisguida

Description

@chrisguida

I'm adding a new RPC to the rust-bitcoincore-rpc crate, and I'd love to know how I can use this in BDK.

The reason for this is that I'm rewriting my plugin, smaug, to use an RPC backend instead of an Esplora backend, since (to my knowledge) there are no public mainnet Esplora instances that don't ratelimit the BDK wallet scanning, and presumably Esplora is also not great for privacy.

The idea with scanblocks is that you give it one or more wallet descriptors and it returns a list of relevant block hashes after a few minutes. It's much better than any other wallet rescanning method I'm aware of, but I need to be able to easily get the blockhashes that result from this call and turn around and ask bitcoind for a full block for each block hash, then scan each block against my BDK Wallet to see which transactions belong to me.

There don't seem to be any examples for how to use the RpcBlockchain struct in such a custom way, though perhaps I'm not looking in the right place. It seems to simply store the wallet inside bitcoind, is that correct?

I currently have this Esplora code; how can I adapt this to use RpcBlockchain instead of EsploraBlockchain? Does it work in an async context? (ie does it work with cln-plugin?) And can I use a custom rust-bitcoincore-rpc crate (ie my PR listed above) as an upstream to bdk?

If not, is this even the right approach?

I'd love some guidance here; I'm a bit lost as to where my efforts are best spent. I'm completely happy to contribute any missing pieces :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or request

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions