0

For example, an address for a simple P2SH script puzzle like x+5=6 will always be the same address, so my understanding is that should not be ranged. Where can I understand the general logic for ranged vs non ranged descriptors? And also in particular, for the case of P2SH where the script can be almost anything.

1 Answer 1

0

For example, an address for a simple P2SH script puzzle like x+5=6 will always be the same address, so my understanding is that should not be ranged.

Descriptors cannot express such a script, so that example is irrelevant.

Where can I understand the general logic for ranged vs non ranged descriptors?

A descriptor is ranged if it has a /* in a derivation path somewhere, as that will be expanded differently for each position. If there are no expressions with * in it, then it is not ranged as clearly every position will yield the same script.

See the descriptors reference document for Bitcoin Core for details of the descriptor language.

And also in particular, for the case of P2SH where the script can be almost anything.

The same is true for P2WSH or P2TR; inside, arbitrary scripts can be placed, but descriptors can only express a small portion of that. In Bitcoin Core 24.0, miniscript descriptors can be used inside P2WSH (just watchonly, though), which greatly expands the power descriptors have. Even with that, it cannot express arbitrary scripts like the x+5=6 puzzle.

3
  • Can you elaborate "...yield the same script", particularly the scenario when it would yield a different script? and what determines if it can have an *? Maybe my confusion comes from the relationship with HD Keys and particularly, in P2SH when the script can be a multifirm with several keys, thanks Oct 29, 2022 at 22:20
  • What determines if it can have an *? Nothing. It has that when you put one in. It's valid in KEY expressions in the descriptor language, which occur as argument to pk(), pkh(), multi, multi_a, tr, ... Read the reference I linked to for a full explanation of the language. I don't understand the rest of your comment. Oct 29, 2022 at 22:34
  • Thanks @Pieter, I have read the reference, and I'm also reviewing other materials, Andrew Chow's interview with Stephan Livera, I will post my remaining doubts, if any, in another question. Oct 30, 2022 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.