Skip to content

BIP draft: Raw() as subscript for descriptors #1721

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

furszy
Copy link
Member

@furszy furszy commented Dec 17, 2024

Allowing arbitrary hex data to be wrapped in sh(), wsh(), or even within the TREE
argument of a tr(KEY, TREE) descriptor enables the representation of currently
inexpressible information.

Specifically, the absence of this feature limits the representation of non-standard redeem
and witness scripts. This occurs because they can currently only be represented as top-level
raw(HEX) descriptors, which retain only the output script information and lack the ability
to preserve the actual script.

This work stemmed from discussions with @sipa and @achow101 about the legacy
wallet migration path, particularly while investigating migrated descriptors that lacked
information about the script they were supposedly migrated from.

Additionally, issue #24114, specifically bitcoin/bitcoin#24114 (comment), provides
historical context and highlights other valid use cases enabled by this behavior change.

@jonatack jonatack changed the title Raw() as subscript for descriptors BIP draft: Raw() as subscript for descriptors Dec 17, 2024
@furszy furszy force-pushed the 2024_descriptors_raw_as_subscript branch 2 times, most recently from 634d18a to 47fed6d Compare December 18, 2024 15:11
@furszy furszy force-pushed the 2024_descriptors_raw_as_subscript branch 2 times, most recently from 1b3ef5c to a67af04 Compare December 20, 2024 19:00
@furszy furszy force-pushed the 2024_descriptors_raw_as_subscript branch from a67af04 to 9c59851 Compare December 24, 2024 02:17
Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could maybe use a bit more rationale. Has this already been submitted to the mailing list?

@furszy furszy force-pushed the 2024_descriptors_raw_as_subscript branch 2 times, most recently from bf8415b to 88f6b2e Compare December 27, 2024 20:37
@furszy furszy force-pushed the 2024_descriptors_raw_as_subscript branch from 88f6b2e to 3197eb9 Compare December 27, 2024 20:50
@furszy
Copy link
Member Author

furszy commented Dec 27, 2024

Has this already been submitted to the mailing list?

Not yet. Will do next year.

Comment on lines +36 to +38
there are other useful scenarios for this feature. For example, it allows representing
in a descriptor that we lack complete knowledge of all solvability paths but can still
solve the output. This includes cases like a taproot tree where we know only one of its
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit unclear for me, can you clarify what do you mean by can still solve the output?

Comment on lines +63 to +64
If a different version is required for any use case, a new BIP could introduce `raw(HEX, VERSION)`
in the future.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just support raw(HEX, VERSION) and be forward compatible which goes in line with what was suggested in the bitcoin/bitcoin#24114

@murchandamus murchandamus added the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label Feb 6, 2025
@achow101
Copy link
Member

Concept ACK I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New BIP PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants