rpc: decode Miniscript descriptor when possible in decodescript #27037

pull darosior wants to merge 2 commits into bitcoin:master from darosior:decodescript_miniscript changing 6 files +25 −5
  1. darosior commented at 4:51 pm on February 3, 2023: member

    The descriptor inference logic would previously always use a dummy signing provider and would never analyze the witness script of a P2WSH scriptPubKey.

    It’s often not possible to infer a Miniscript only from the onchain Script, but it was such a low hanging fruit that it’s probably worth having it?

    Fixes #27007. I think it also closes #25606.

  2. DrahtBot commented at 4:51 pm on February 3, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK instagibbs, achow101, sipa

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label RPC/REST/ZMQ on Feb 3, 2023
  4. instagibbs commented at 4:53 pm on February 3, 2023: member
    Probably slightly better than my version; will test
  5. instagibbs commented at 5:03 pm on February 3, 2023: member

    ACK https://github.com/bitcoin/bitcoin/pull/27037/commits/03ccc34c9ec4fc6006b3163a36ea9f3fdc443690

    might need release note?

    here’s a couple more examples from taproot LN channels discussions that would be nice to include in test to check how it falls back to raw behavior:

    Offered HTLC: 82012088a914ffffffffffffffffffffffffffffffffffffffff882102ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffad51b2 “desc”: “wsh(and_v(and_v(v:hash160(ffffffffffffffffffffffffffffffffffffffff),v:pk(02ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)),older(1)))#twc36s59”

    miniscript incompatible Offered HTLC: 82012088a914ffffffffffffffffffffffffffffffffffffffff882102ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffacb2 “desc”: “wsh(raw(82012088a914ffffffffffffffffffffffffffffffffffffffff882102ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffacb2))#ra6w2xa7”

  6. fanquake requested review from achow101 on Feb 3, 2023
  7. darosior commented at 5:10 pm on February 3, 2023: member
    Thanks. I’m adding the incompatible one. The first one is already present: that’s the one from your issue but with BIP341’s NUMS pubkey as pubkey instead of ffff..ff.
  8. rpc: decode Miniscript descriptor when possible in decodescript
    The descriptor inference logic would previously always use a dummy
    signing provider and would never analyze the witness script of a P2WSH
    scriptPubKey.
    
    Note even a valid Miniscript might not always be decodable from Script
    without more contextual information (for instance the key preimage for a
    pk_h).
    dfc9acbf01
  9. darosior force-pushed on Feb 3, 2023
  10. doc: release notes for #27037 6699d850e4
  11. darosior commented at 5:19 pm on February 3, 2023: member
    Added a release note too.
  12. achow101 commented at 8:02 pm on February 3, 2023: member
    ACK 6699d850e466a65ddd0802be747188ef40cf9de0
  13. sipa commented at 8:30 pm on February 3, 2023: member
    utACK 6699d850e466a65ddd0802be747188ef40cf9de0
  14. achow101 merged this on Feb 3, 2023
  15. achow101 closed this on Feb 3, 2023

  16. sidhujag referenced this in commit f4fce72f9f on Feb 4, 2023
  17. josibake referenced this in commit 904c3f7306 on Apr 5, 2023
  18. 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 01:12 UTC

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