Closed LeoComandini closed 10 months ago
Yeah, this solution seems good to me. It's not great but nothing I could come up with was great either.
I'd like to fix CI though before moving forward on this.
fix CI
Fixed by @RCasatta in #60 , I'll rebase on top of that once merged
Proposed additional test vectors for ELIP-150 (will post there once this gets a round of review)
View Descriptor with wildcard: ct(xprv9s21ZrQH143K28NgQ7bHCF61hy9VzwquBZvpzTwXLsbmQLRJ6iV9k2hUBRt5qzmBaSpeMj5LdcsHaXJvM7iFEivPryRcL8irN7Na9p65UUb/*,elwpkh(xpub661MyMwAqRbcEcT9W98HZP2kFzyzQQZkYnrRnrM8uD8kH8kSeFoQHq1x2iihLgC6PXGy5LrjCL66uSNhJ8pwjfx2rMUTLWuRMns2EG9xnjs/*))#
xprv9s21ZrQH143K28NgQ7bHCF61hy9VzwquBZvpzTwXLsbmQLRJ6iV9k2hUBRt5qzmBaSpeMj5LdcsHaXJvM7iFEivPryRcL8irN7Na9p65UUb/*
el1qqf6690fpw2y00hv5a84zsydjgztg2089d5xnll4k4cstzn63uvgudd907qpvlvvwd5ym9gx7j0v46elf23kfxunucm6ejjyk0
ert1qkjhlqqk0kx8x6zdj5r0f8k2avl54gmyn7qjk2k
Non-View Descriptor with wildcard: ct(xpub661MyMwAqRbcEcT9W98HZP2kFzyzQQZkYnrRnrM8uD8kH8kSeFoQHq1x2iihLgC6PXGy5LrjCL66uSNhJ8pwjfx2rMUTLWuRMns2EG9xnjs/*,elwpkh(xpub661MyMwAqRbcEcT9W98HZP2kFzyzQQZkYnrRnrM8uD8kH8kSeFoQHq1x2iihLgC6PXGy5LrjCL66uSNhJ8pwjfx2rMUTLWuRMns2EG9xnjs/*))#
xpub661MyMwAqRbcEcT9W98HZP2kFzyzQQZkYnrRnrM8uD8kH8kSeFoQHq1x2iihLgC6PXGy5LrjCL66uSNhJ8pwjfx2rMUTLWuRMns2EG9xnjs/*
el1qqf6690fpw2y00hv5a84zsydjgztg2089d5xnll4k4cstzn63uvgudd907qpvlvvwd5ym9gx7j0v46elf23kfxunucm6ejjyk0
ert1qkjhlqqk0kx8x6zdj5r0f8k2avl54gmyn7qjk2k
fix CI
Fixed by @RCasatta in #60 , I'll rebase on top of that once merged
@apoelstra rebased and CI is now green
Looks good to me. Obviously there are still some open API questions about doing derivations but the result of this is much better than the existing code.
The generic was only used by the
Bare
variant, which was inconsistent with its corresponding "secret" variant,View
.The generic could be used to handle the conversion from
ConfidentialDescriptor<DescriptorPublicKey>
toDescriptor<DefiniteDescriptorKey>
, specifically making sure that the descriptor blinding key does not have wildcards.For the
Bare
variant this could be done, but this cannot happen for theView
variant, since we don't have the definite version ofDescriptorSecretKey
.The proposed solution consists in:
ConfidentialDescriptor::at_derivation_index
that "removes" wildcards from both the "bitcoin" descriptor and the descriptor blinding key. This makes deriving an address from a CT descriptor with wildcards less cumbersome.Key::to_public_key(&self, secp, spk)
to return aResult
and error ifKey
has some wildcards. This will fix the casect(xprv/*,desc)
which is currently broken.