Skip to content

Descriptor::Bare(PkH) string encoding doesn't roundtrip, parsed as Descriptor::Pkh #890

Description

@shesek

Since Bare descriptors are encoded as just the inner miniscript with no explicit bare() wrapper, Bare descriptors over a PkH miniscript fragment and Pkh descriptors are both encoded as "pkh(KEY)", which always decodes back to a Pkh descriptor.

This isn't terrible because both are semantically equivalent, refer to the same scriptPubKey and can be satisfied using the same assets, but it is surprising and unexpected if you treat descriptor strings as a stable serialization format.

It seems that this conflict is inherent due to the reuse of pkh() for miniscripts/descriptors and the lack of an explicit bare() wrapper so I don’t really have a concrete suggestion, just thought it was worth bringing up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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