sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.32k stars 189 forks source link

"Invalid output descriptor" error #51

Closed bitcoinhodler closed 3 years ago

bitcoinhodler commented 3 years ago

This is one of the examples given in the descriptors doc:

sh(multi(2,022f01e5e15cca351daff3843fb70f3c2f0a1bdd05e5af888a67784ef3e10a2a01,03acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe))

When I create a new wallet in Sparrow 0.9.9, click "Edit" next to the descriptor box, and paste this in, I get an error popup: "Invalid output descriptor", "Index 0 out of bounds for length 0".

I tried setting the Policy Type to Multisignature, the Cosigners to 2/2, and the Script Type to P2SH first, to match this descriptor, but it made no difference.

craigraw commented 3 years ago

This is because a keystore in Sparrow requires a HD pubkey and not a single one in order to derive the receive and change addresses. It's certainly a valid use case to have a descriptor for a single output, but it's not something supported at this time.

The error message however has been improved in https://github.com/sparrowwallet/drongo/commit/4da2c024d4fbe3ecbca9772a0761def6d5269c38

bitcoinhodler commented 3 years ago

I understand why single-address wallets are not supported.

I was expecting it to work based on the Features page promise of "All Wallet Types Welcome".

Perhaps that should read "All HD Wallet Types Welcome"?

craigraw commented 3 years ago

That's a good point. I've made this change.