bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Support addr() descriptors

Open andrewtoth opened this issue 3 years ago • 6 comments

Is there a reason that addr() descriptors aren't supported, so we can do DescriptorPublicKey::from_str("addr(...)")?

andrewtoth avatar Sep 21 '22 23:09 andrewtoth

They are not supported by miniscript, which is the library we use for handling our descriptors. I think the reason is that most of the things that miniscript provides (like estimating the witness size, constructing the witness, etc) wouldn't work without knowing the full script, so they just didn't implement them.

Once we complete #485 we should be able to "emulate" them inside bdk, but for the time being we depend on miniscript to add support for them.

afilini avatar Sep 22 '22 11:09 afilini

Any updates on support addr() descriptors? Is there any alternative for watch-only wallets using one or few addresses?

hisenb3rg avatar Sep 11 '23 07:09 hisenb3rg

@jurglic what are you trying to build? There are plenty of ways to use bdk 1.0.0-alpha.* without using descriptors at all (miniscript is an optional dependency of bdk_chain).

LLFourn avatar Sep 13 '23 01:09 LLFourn

@jurglic what are you trying to build? There are plenty of ways to use bdk 1.0.0-alpha.* without using descriptors at all (miniscript is an optional dependency of bdk_chain).

Hi, I'm trying to create a balance watcher for a couple of addresses and/or xpubs. I was thinking of using Wallet interface which I believe is always descriptor-based. Is there a better way without using Wallet?

hisenb3rg avatar Sep 13 '23 07:09 hisenb3rg

I tagged this as a documentation issue since I think we only need a better explanation/example of how to track individual and descriptor derived addresses (aka spks).

notmandatory avatar Nov 13 '23 17:11 notmandatory

@jurglic what are you trying to build? There are plenty of ways to use bdk 1.0.0-alpha.* without using descriptors at all (miniscript is an optional dependency of bdk_chain).

Hi, I'm trying to create a balance watcher for a couple of addresses and/or xpubs. I was thinking of using Wallet interface which I believe is always descriptor-based. Is there a better way without using Wallet?

Sorry for the late reply. Yes use SpkTxOutIndex. Insert the spks you care about and then scan transactions. It will find any associated outputs.

You could also put that SpkTxOutIndex into an IndexedTxGraph which will let you do stuff like find utxos in transactions you insert into the graph (you'll also need a ChainOracle to tell you what's in the actual blockchain

LLFourn avatar Nov 16 '23 02:11 LLFourn