Skip to content

DescriptorId is not unique enough #1483

@evanlinjin

Description

@evanlinjin

Describe the bug

As mentioned on Discord#development, there is a fundamental problem with how we define a DescriptorId. Currently DescriptorId does not uniquely identify a descriptor. I.e. we can change how the xpub is portrayed and it would completely change the DescriptorId. This is a problem because the whole point of DescriptorId is so that the last derivation index is stored with something that uniquely represents a descriptor.

Proposed Solutions

An idea (first mentioned to me by @LLFourn) is to use the hash of the first derived spk for the DescriptorId. We can consider disallowing non-wildcard descriptors in KeychainTxOutIndex (as they aren't keychains) and it allows us full uniqueness for DescriptorIds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdiscussionThere's still a discussion ongoing

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions