Define BIP-119 CheckDefaultCheckTemplateVerifyHash #1226

pull OrfeasLitos wants to merge 4 commits into bitcoin:master from OrfeasLitos:define-check-119 changing 1 files +6 −0
  1. OrfeasLitos commented at 9:40 pm on November 2, 2021: contributor
    Adds pseudocode definition of CheckDefaultCheckTemplateVerifyHash() to BIP-119 specification in the obvious way. Even though it is trivial, it should be included to dissolve any doubts.
  2. Define BIP-119 CheckDefaultCheckTemplateVerifyHash 1cab3e87f3
  3. luke-jr commented at 11:05 pm on November 4, 2021: member
  4. luke-jr added the label Proposed BIP modification on Nov 4, 2021
  5. JeremyRubin commented at 2:04 pm on November 5, 2021: contributor
    ack – i’m not sure that it compile though because the type of stack.back() is vector and the checker takes a hash but maybe theres a constructor that does that coercion? Otherwise should use std::equal_range or something…
  6. OrfeasLitos commented at 2:53 pm on November 5, 2021: contributor
    I suspect that a uint256() around the stack.back() that is passed to CheckDefaultCheckTemplateVerifyHash would do the trick in a clean way.
  7. Cast 8-vector of u32 to u256 897e6458ce
  8. Fix typo 1839f43779
  9. in bip-0119.mediawiki:148 in 897e6458ce outdated
    144@@ -145,7 +145,7 @@ specification for the semantics of OP_CHECKTEMPLATEVERIFY.
    145         // If the argument was not 32 bytes, treat as OP_NOP4:
    146         switch (stack.back().size()) {
    147             case 32:
    148-                if (!checker.CheckDefaultCheckTemplateVerifyHash(stack.back())) {
    149+                if (!checker.CheckDefaultCheckTemplateVerifyHash(u256(stack.back()))) {
    


    JeremyRubin commented at 4:57 pm on November 11, 2021:
    typo
  10. JeremyRubin commented at 10:40 pm on November 11, 2021: contributor

    seems reasonable to me now – note that this differs from https://github.com/bitcoin/bitcoin/pull/21702/files#diff-a0337ffd7259e8c7c9a7786d6dbd420c80abfa1afdb34ebae3261109d9ae3c19R1910-R1918, the actual implementation.

    small preference to keep the interface of the checker the same.

  11. Convert inside CheckDefaultCheckTemplateVerifyHash 3ff4a4ce9d
  12. OrfeasLitos commented at 11:16 am on November 21, 2021: contributor
    PTAL
  13. JeremyRubin commented at 8:58 pm on November 21, 2021: contributor
    Looks good to me!
  14. luke-jr merged this on Dec 15, 2021
  15. luke-jr closed this on Dec 15, 2021

  16. OrfeasLitos deleted the branch on Mar 31, 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: 2024-12-21 18:10 UTC

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