feature: RPC show decompiled P2SH redeemScript and P2WSH witnessScript #31256

pull naiyoma wants to merge 1 commits into bitcoin:master from naiyoma:feature/rpc-show-redeemscript-in-P2WSH-and-P2SH changing 1 files +24 −0
  1. naiyoma commented at 2:34 pm on November 8, 2024: contributor

    Closes #27391

    Add support for displaying the (decompiled) P2SH redeemScript and P2WSH witnessScript when calling getrawtransaction and getblock....2.

    I used this guide to create transactions and below are outputs from p2sh/p2wsh , getrawtransaction and getblock 2 on regtest

    0bitcoin-cli -regtest getrawtransaction $TXID 1 | jq -r '.vin[].redeemScript.asm                                                     
    1
    22 0332df518c53eba135966d45b350e7a9bbf9844ff76178f7434812ea277a006ee7 02380145a5ab10584c43e324946f1e655d41d873a35a01b1c18f2d95150d4f253d 03da394f90dc7c340583ecd3ffb18e219e369134e27a87c9f2eeb121d52e249c49 3 OP_CHECKMULTISIG
    
    0 bitcoin-cli getblock 5b9438aef225b1924603a390a6cebff661379ff9f23715ba200670f3fa2fc100 2 | jq -r '.tx[].vin[].redeemScript.asm'
    1null
    22 0332df518c53eba135966d45b350e7a9bbf9844ff76178f7434812ea277a006ee7 02380145a5ab10584c43e324946f1e655d41d873a35a01b1c18f2d95150d4f253d 03da394f90dc7c340583ecd3ffb18e219e369134e27a87c9f2eeb121d52e249c49 3 OP_CHECKMULTISIG
    
    0 bitcoin-cli getrawtransaction 804dcb275503d0fbdf1b44725437e4b3e30f7d537e05ab4931c7e5de41a6992c true | jq -r '.vin[].witnessScript.asm'
    1-5183226 0 5 OP_UNKNOWN OP_LSHIFT OP_UNKNOWN OP_INVERT OP_RIGHT OP_2MUL OP_IFDUP OP_UNKNOWN OP_UNKNOWN OP_LESSTHAN [error]
    
    0bitcoin-cli getblock 38bca65f708b9bd4b110a1c9a9595c1b85d80383e49e2266bbe277bd72d8d0b4 2 | jq -r '.tx[].vin[].witnessScript.asm'
    10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2-5183226 0 5 OP_UNKNOWN OP_LSHIFT OP_UNKNOWN OP_INVERT OP_RIGHT OP_2MUL OP_IFDUP OP_UNKNOWN OP_UNKNOWN OP_LESSTHAN [error]
    
  2. feature: RPC Show P2SH redeemScript and P2WSH witnessScript in transaction output 43d71bda49
  3. DrahtBot commented at 2:34 pm on November 8, 2024: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31256.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  4. fanquake commented at 2:37 pm on November 8, 2024: member
    I think this is already being worked on in #31252.
  5. naiyoma closed this on Nov 8, 2024

  6. polespinasa commented at 2:45 pm on November 8, 2024: none

    I think this is already being worked on in #31252. @naiyoma please feel free to contribute in my PR if you want to work on this. P2SH still on TODO, only P2WSH is implemented and solving functional test still also on TODO.


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-11-21 06:12 UTC

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