Skip to content

Miniscript class doesn't derive xpubs #60

@bigspider

Description

@bigspider

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions