Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SigHashType: add a method to error on non-standard hashtypes #573

Merged
merged 4 commits into from Feb 21, 2021

Commits on Feb 18, 2021

  1. doc: correct SigHashType doc comment

    Super nit, but a hashtype is not specific to a transaction but a
    signature.
    
    Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
    darosior committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    7f73d5f View commit details
    Browse the repository at this point in the history
  2. transaction: document why we mask sighash types with 0x9f

    Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
    Co-Authored-by: sanket1729 <sanket1729@gmail.com>
    darosior and sanket1729 committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    466f161 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2021

  1. transaction: add a method to err on non-standard types to SigHashType

    Right now, any sighash type could be parsed without error, which matches
    consensus rules. However most of them would be invalid by standardness,
    so it's a bit footgun-y (even more so for pre-signed transactions
    protocols for which standardness is critical).
    
    This adds `from_u32_standard()`, which takes care to error if we are
    passed an invalid-by-current-policy-rules SIGHASH type.
    
    Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
    darosior committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    bf98d9f View commit details
    Browse the repository at this point in the history
  2. transaction: deprecate SigHashType::from_u32 in favor of from_u32_con…

    …sensus
    
    Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
    darosior committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    e36f3a3 View commit details
    Browse the repository at this point in the history