Can not spent P2SH with correct script #14467

issue 3s3s opened this issue on October 12, 2018
  1. 3s3s commented at 10:33 AM on October 12, 2018: none

    <!--- What behavior did you expect? -->

    In bitcoin testnet I sent transaction ./bitcoin-cli sendrawtransaction 02000000012d0cf45773e4730cfde672d85447c8c6761621ff708850eb2b0505247255ac5d00000000345114c47907abd2a80492ca9388b05c0e382518ff3960511c63a614388756dc41f4eeadcb3fc5064535d1121a49d3f48867528868feffffff01905f0100000000001976a914d5d4a489e479dc7ab7d64b8dbe2917575cffc79788aca2e81500

    Expect that transaction should be accepted

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    error code: -26 error message: 16: mandatory-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation)

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    I have created this script OP_IF OP_RIPEMD160 388756dc41f4eeadcb3fc5064535d1121a49d3f4 OP_EQUALVERIFY OP_ELSE 2 OP_EQUALVERIFY OP_ENDIF P2SH address in testnet: 2MwGFm13NMXNcv3yTKHWTJ3wFBfxDWhVbpS

    Then try to redeem 1 c47907abd2a80492ca9388b05c0e382518ff3960 1 OP_IF OP_RIPEMD160 388756dc41f4eeadcb3fc5064535d1121a49d3f4 OP_EQUALVERIFY OP_ELSE 2 OP_EQUALVERIFY OP_ENDIF

    I expect that RIPEMD160('c47907abd2a80492ca9388b05c0e382518ff3960') = 388756dc41f4eeadcb3fc5064535d1121a49d3f4 But it seems that Bitcoin OP_RIPEMD160('c47907abd2a80492ca9388b05c0e382518ff3960') <> 388756dc41f4eeadcb3fc5064535d1121a49d3f4

    I have checked hash with several ways 1, https://md5calc.com/hash/ripemd160/c47907abd2a80492ca9388b05c0e382518ff3960 ripemd160(c47907abd2a80492ca9388b05c0e382518ff3960) = 388756dc41f4eeadcb3fc5064535d1121a49d3f4

    1. https://siminchen.github.io/bitcoinIDE/build/editor.html c47907abd2a80492ca9388b05c0e382518ff3960 OP_RIPEMD160 = 388756dc41f4eeadcb3fc5064535d1121a49d3f4

    2. nodejs module 'crypto' console.log(require('crypto').createHash("ripemd160").update('c47907abd2a80492ca9388b05c0e382518ff3960').digest('hex')) give me 388756dc41f4eeadcb3fc5064535d1121a49d3f4

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    "version": 140300

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    Ubuntu 16

  2. 3s3s commented at 7:15 PM on October 13, 2018: none
  3. 3s3s closed this on Oct 13, 2018

  4. DrahtBot locked this on Sep 8, 2021
Contributors

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: 2026-04-29 03:15 UTC

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