I was playing around with a probably-too-cute script for LN channel smart contract, and was looking for something to decide for me if miniscript can infer the structure of the script.
f.e.
0decodescript 82012088a914ffffffffffffffffffffffffffffffffffffffff8820ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffad51b2
1
2{
3 "asm": "OP_SIZE 32 OP_EQUALVERIFY OP_HASH160 ffffffffffffffffffffffffffffffffffffffff OP_EQUALVERIFY ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff OP_CHECKSIGVERIFY 1 OP_CHECKSEQUENCEVERIFY",
4 "desc": "raw(82012088a914ffffffffffffffffffffffffffffffffffffffff8820ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffad51b2)#5guaahuv",
5 "type": "nonstandard",
6 "p2sh": "33YyjgxsJYwSi8Wbp7TaCSFAuJBoUfYWDQ",
7 "segwit": {
8 "asm": "0 99f5d0b69f9828fea9363198cf812e95d7fc5e94c7881092b8e3f43984c1bd5c",
9 "desc": "addr(bc1qn86apd5lnq50a2fkxxvvlqfwjhtlch55c7yppy4cu06rnpxph4wqrar3md)#wtlf0gwk",
10 "hex": "002099f5d0b69f9828fea9363198cf812e95d7fc5e94c7881092b8e3f43984c1bd5c",
11 "address": "bc1qn86apd5lnq50a2fkxxvvlqfwjhtlch55c7yppy4cu06rnpxph4wqrar3md",
12 "type": "witness_v0_scripthash",
13 "p2sh-segwit": "3MRJN2wTnD2BVm31HLcBwueAYpbbximrtk"
14 }
15}
Since it’s evaluated at “top level for desc
it cannot get any meaningful structure from it. Perhaps in segwit
it could try infering the miniscript in the segwit context