Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miniscript class doesn't derive xpubs #60

Open
bigspider opened this issue Apr 17, 2024 · 0 comments
Open

Miniscript class doesn't derive xpubs #60

bigspider opened this issue Apr 17, 2024 · 0 comments

Comments

@bigspider
Copy link

bigspider commented Apr 17, 2024

The Miniscript class doesn't seem to derive pubkeys when compiling to bytes:

from io import BytesIO
from embit.descriptor.miniscript import Miniscript

desc_str = "pk(tpubD6NzVbkrYhZ4XgHkCEtfpuZPJDLaLPxu5ZBEtAbub9GcUX1mTS2t3eCnBYbsr3Ya2KGVfoWGNfa65rNS8fx3ssuwAwitJiFN4WPwEUTnqsy/0/3)"
s = BytesIO(desc_str.encode())
desc = Miniscript.read_from(s, taproot=True)

print(desc.compile().hex())

This prints

20f689e19cb157cc096342294b02485cc5d9723a849a36c68a7553fe90020bb53cac

where f689e19cb157cc096342294b02485cc5d9723a849a36c68a7553fe90020bb53c is the pubkey of tpubD6NzVbkrYhZ4XgHkCEtfpuZPJDLaLPxu5ZBEtAbub9GcUX1mTS2t3eCnBYbsr3Ya2KGVfoWGNfa65rNS8fx3ssuwAwitJiFN4WPwEUTnqsy; the correct derived pubkey is c600d12b3e8cd23fbb2318ceca0f5d7f59c28e7b4227c06a04673f4c3d0ec1c6.

For context, I was using that instead of Descriptor because I was trying to compile a single taproot leaf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant