--- Log opened Sun Oct 31 00:00:19 2021 19:14 < sanket1729_> sipa: How to infer a tr descriptor from a script pubkey? Would it be a pk(x_only_key)? 19:14 < sanket1729_> Because normally the tr(x_only_key) would also do the tweaking to obtain the output key 19:27 -!- achow101 [~achow101@user/achow101] has quit [Quit: Bye] 19:28 -!- achow101 [~achow101@user/achow101] has joined ##miniscript 19:36 < sanket1729_> ^ maybe achow101 knows? 19:37 < achow101> sanket1729_: if you have the internal pubkey you can make a tr(pk()) 19:37 < sanket1729_> I only have the output key, not the internal key 19:38 < achow101> can't do anything with that then. it's the same problem as a p2pkh without knowing the hashed pubkey 19:38 < sanket1729_> I want to infer a descriptor from script pubkey from blockchain 19:38 < sanket1729_> Don't want to do any signing etc 19:38 < achow101> default to raw() 19:39 < achow101> or addr() 19:39 < achow101> for scriptPubKeys other than bare multisig and pk, you can really only do raw or addr 19:39 < achow101> as there is data missing to construct the real descriptor 19:40 < sanket1729_> In bitcoin core InferDescriptor function, it returns a pk(x only key). https://github.com/bitcoin/bitcoin/blob/9a86327512b3f41d2523457293c95ae2a2448c35/src/script/descriptor.cpp#L1255 19:40 < sanket1729_> But getdescriptorInfo fails pk(32 bytes key) 19:40 < achow101> sanket1729_: no, that's for a pk within a tr context 19:40 < achow101> notice ctx == ParseScriptContext::P2TR 19:41 < sanket1729_> Ah, thanks. 19:42 <@sipa> i have a patch that adds a rawtr(...) descriptor, but i'm not sure it's desirable to help 19:42 <@sipa> as it's not something that should be encouraged 19:42 <@sipa> in general if you just have a scriptPubKey, you cannot infer a tr() descriptor 19:43 <@sipa> similar to how you can't infer an sh() descriptor without knowing the redeemscript 19:43 < sanket1729_> Yeah, but it was possible to earlier infer the descriptor looking at already signed transaction 19:43 < sanket1729_> look at witness/script pubkey/script sig and infer a descriptor 19:44 <@sipa> right, that won't work either anymore 19:44 <@sipa> that's a good thing :p 19:44 <@sipa> it's just a side effect of tr spending not leaking the full information on chain anymore... 19:44 <@sipa> you can't know if there was a script tree either, and what was in it, etc 19:45 <@sipa> so a rawtr() could work, but it's not really more useful than an addr() is 19:45 <@sipa> except that it could capture key/origin info etc 19:46 < sanket1729_> understood. But if can some point, we add support for hidden nodes in tr descriptor, the inferance from script pubkey would be possible for script spends 19:47 <@sipa> yeah, i'm not opposed to supporting hidden nodes 19:48 < sanket1729_> My current logic for finalizing a psbt is 1) Infer a descriptor from psbt 2) satisfy the descriptor. I am having trouble doing that taproot descriptors since I cannot infer a descriptor for script spends 19:51 < achow101> sanket1729_: the psbt should have the internal key available 19:52 < sanket1729_> for script path 19:52 < sanket1729_> I cannot infer a tr descriptor because it would contain hidden nodes 19:54 < sanket1729_> It's not a big deal. I can write custom logic for finalizing a tr psbt. 20:31 <@sipa> sanket1729_: in the bitcoin core signing logic i have an intermediary representation which can represent partial trees; it gets populated from descriptors or psbt data, and is used for signing 21:00 -!- achow101 [~achow101@user/achow101] has quit [Quit: Bye] 21:00 -!- achow101 [~achow101@user/achow101] has joined ##miniscript 21:06 < _aj_> does seem like it would be nice to be able to have a partial tree via a tr() descriptor, if you can sign by either key path or a script you actually include. or maybe when you want to watch-only a tr() descriptor that you can't sign for and where you know a bunch of the scripts don't vary, even though the pubkey/some of the scripts do 23:02 -!- Netsplit *.net <-> *.split quits: andytoshi 23:03 -!- Netsplit over, joins: andytoshi --- Log closed Mon Nov 01 00:00:21 2021