Miniscript support for decodescript #25606

issue Sjors openend this issue on July 13, 2022
  1. Sjors commented at 3:02 pm on July 13, 2022: member

    Current behavior:

    0src/bitcoin-cli -signet decodescript 2103d3b9c8cc852f3b4a06bad1711fd1a1761a592bf1475edc0a5f97b31759eba330ac736476a914b6e87320e876a740fc1365aeb1f4b6ab2fe4210b88ad53b268
    
     0{
     1  "asm": "03d3b9c8cc852f3b4a06bad1711fd1a1761a592bf1475edc0a5f97b31759eba330 OP_CHECKSIG OP_IFDUP OP_NOTIF OP_DUP OP_HASH160 b6e87320e876a740fc1365aeb1f4b6ab2fe4210b OP_EQUALVERIFY OP_CHECKSIGVERIFY 3 OP_CHECKSEQUENCEVERIFY OP_ENDIF",
     2  "desc": "raw(2103d3b9c8cc852f3b4a06bad1711fd1a1761a592bf1475edc0a5f97b31759eba330ac736476a914b6e87320e876a740fc1365aeb1f4b6ab2fe4210b88ad53b268)#uul8nd2t",
     3  "type": "nonstandard",
     4  "p2sh": "2N62ryy2gBC2QBSdsm832Tv6qCW5py53wJn",
     5  "segwit": {
     6    "asm": "0 43c1d0387e91045591f19ff6d60af2bc0d91473b79dc3238aa9d0430f89741bc",
     7    "desc": "addr(tb1qg0qaqwr7jyz9ty03nlmdvzhjhsxez3em08wryw92n5zrp7yhgx7qj56vra)#ugngfnm5",
     8    "hex": "002043c1d0387e91045591f19ff6d60af2bc0d91473b79dc3238aa9d0430f89741bc",
     9    "address": "tb1qg0qaqwr7jyz9ty03nlmdvzhjhsxez3em08wryw92n5zrp7yhgx7qj56vra",
    10    "type": "witness_v0_scripthash",
    11    "p2sh-segwit": "2N9diLEHbASsz1oAeDQJPg5mb4LaAju9175"
    12  }
    13}
    

    It would be nice if this (also) returned miniscript.

    Perhaps getaddressinfo could do this as well (after #24148).

    cc @sipa, @darosior

  2. Sjors added the label Feature on Jul 13, 2022
  3. darosior commented at 4:45 pm on July 13, 2022: member

    After #24148 i think it should be the default behaviour to show a Miniscript descriptor (for the "desc" field) if one could be parsed: InferDescriptor would try parsing a Miniscript under P2WSH context (as in your example). EDIT: InferDescriptor is using a dummy sig provider so it wouldn’t work, see #27007 (comment).

    However, note your Script here would not be parsed because the Miniscript parser is not passed the preimage to the key hash for OP_DUP OP_HASH160 b6e87320e876a740fc1365aeb1f4b6ab2fe4210b OP_EQUALVERIFY OP_CHECKSIGVERIFY. So i’d say it’s the best we can reasonably do.

  4. instagibbs commented at 5:04 pm on January 31, 2023: member
    hmm seems I opened up a mostly similar issue in https://github.com/bitcoin/bitcoin/issues/27007
  5. achow101 closed this on Feb 3, 2023

  6. sidhujag referenced this in commit f4fce72f9f on Feb 4, 2023
  7. bitcoin locked this on Feb 3, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 04:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me