-
Notifications
You must be signed in to change notification settings - Fork 138
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
How to infer a descriptor #675
Comments
|
Inferring descriptors by itself requires the complete knowledge of spending transaction. You cannot infer a p2wsh witness script by only looking at the hash. |
I see. We've discussed this in other threads, but I was looking to compute the satisfaction weight of an individual TxIn, not a Transaction. It sounds like this isn't something Miniscript is designed to accomplish if I'm understanding right. |
@yancyribbens , it is actually the opposite. You don't "infer" a descriptor. The interpreter module is not for this case. Yes,
We have methods to compute the satisfaction_weight of each This is where output descriptors come in. For the two of three, you would have a descriptor Taking a guess here, maybe what you need is a simple BIP 84 descriptor like You can read about output descriptors: bip380 |
@sanket1729 I think we ought to have a method to infer a descriptor, or at least these lengths, from an appropriately-populated PSBT. I think that's a reasonable thing that people would want to do. I'm on the fence about promoting |
Agreed. This is only meant for block-explorers. And should not be used for most other use-cases. There is already a private
I think what @yancyribbens actually needs a lengths of descriptors. He can create a descriptor like |
@sanket1729 I'm looking to calculate the size of an input before adding it to a transaction. For example, given 3 inputs of different types and unlock scripts, how many weight units would each input be. I'm only looking for the weight that a TxIn might contribute to a transaction regardless of the size of the descriptor. |
From what I can tell, to infer a descriptor requires creating an
Interpreter
, then calling.inferred_descriptor()
. However, to build an interpreter, requires a BitcoinKey which is private not to mention the innner module and stack module which are also private. Is it possible to expose some interface to allow inferring a descriptor?The text was updated successfully, but these errors were encountered: