Add missing SIGHASH flag to BIP 143 Example #1545

pull davidgumberg wants to merge 1 commits into bitcoin:master from davidgumberg:sighash changing 1 files +1 −1
  1. davidgumberg commented at 12:42 AM on January 29, 2024: none

    The first example (Native P2WPKH) signature in BIP 143 was missing a SIGHASH flag. The signature scheme requires a DER encoded signature with a one-byte SIGHASH/'hash type' flag appended. (Excepting schnorr signatures which can omit a flag to implicitly signal SIGHASH_DEFAULT)

    This pull request corrects the example to include the 0x01 / SIGHASH_ALL flag.

  2. Add missing SIGHASH flag to BIP 143 Example
    The first example ('Native P2WPKH') signature in BIP 143 was missing
    a SIGHASH flag. The signature scheme requires a DER encoded signature
    with a one-byte SIGHASH/'hash type' flag appended. (Excepting schnorr
    signatures which can omit a flag to implicitly signal SIGHASH_DEFAULT)
    cc1ee270ba
  3. davidgumberg force-pushed on Jan 29, 2024
  4. lorenzolfm commented at 5:09 PM on February 11, 2024: none

    ACK, since all other examples have the sighash flag appended in the signature. Either this or include a new field "sighash flag" and exclude the sighash flag from all other signature examples

  5. 0xGRAV3R approved
  6. 0xGRAV3R commented at 1:40 AM on February 24, 2024: none

    This addresses an error in the example provided for Native P2WPKH (Pay to Witness Public Key Hash) signatures in BIP 143. In Bitcoin transaction signatures, a SIGHASH flag indicates which parts of the transaction are covered by the signature. The correction ensures that the example includes the proper SIGHASH_ALL flag (0x01), which signifies that all inputs and outputs are covered by the signature.

    This correction is crucial for clarity and correctness in implementing the BIP 143 standard, as the absence of the SIGHASH flag would lead to incorrect signature generation or verification.

  7. murchandamus assigned sipa on Apr 23, 2024
  8. murchandamus commented at 8:53 PM on April 23, 2024: contributor

    Duplicate of #748

  9. murchandamus marked this as duplicate on Apr 23, 2024
  10. murchandamus closed this on Apr 23, 2024


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 13:10 UTC

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