BIP143 example and clarify #292

pull jl2012 wants to merge 5 commits into bitcoin:master from jl2012:bip143example changing 4 files +99 −26
  1. jl2012 commented at 6:21 PM on January 20, 2016: contributor

    No description provided.

  2. Merge remote-tracking branch 'refs/remotes/bitcoin/master' 171c3929af
  3. jl2012 commented at 6:27 PM on January 20, 2016: contributor

    @sipa please review the scriptCode part.

    I have doubled checked the example and verified the sigHash

  4. jl2012 force-pushed on Jan 20, 2016
  5. Add example 7bf68e9f2c
  6. Clarify scriptCode c25f1e7b5f
  7. jl2012 force-pushed on Jan 21, 2016
  8. Links to reference implementation 7e4dec0d93
  9. Clarifying the behavior of OP_CODESEPERATOR ec5b1c097e
  10. in bip-0143.mediawiki:None in c25f1e7b5f outdated
      51 | +
      52 | +The item 5:
      53 | +*For P2WPKH witness program, the scriptCode is <code>0x1976a914{20-byte-pubkey-hash}88ac</code>.
      54 | +*For P2WSH witness program,
      55 | +**if the <code>witnessScript</code> does not contain any <code>OP_CODESEPERATOR</code>, the <code>scriptCode</code> is a <code>varInt</code> for the length of the <code>witnessScript</code>, followed by the <code>witnessScript</code>.
      56 | +**if the <code>witnessScript</code> contains any <code>OP_CODESEPERATOR</code>, the <code>scriptCode</code> is the evaluated script, with all <code>OP_CODESEPARATOR</code> and everything up to the last <code>OP_CODESEPARATOR</code> before the signature checking opcode being executed removed, and prepended by a <code>varInt</code> for the length of the trancated script.
    


    sipa commented at 2:02 PM on January 21, 2016:

    The length is not prepended again.

  11. jl2012 cross-referenced this on Jan 21, 2016 from issue WIP: Segwit wallet dev guide by jl2012
  12. CodeShark commented at 1:57 AM on January 22, 2016: contributor

    ACK

  13. btcdrak commented at 2:16 AM on January 22, 2016: contributor

    ACK

  14. luke-jr referenced this in commit e38e909f91 on Jan 22, 2016
  15. luke-jr merged this on Jan 22, 2016
  16. luke-jr closed this on Jan 22, 2016

  17. LadyS8214 approved

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-27 12:10 UTC

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