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.
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-
OrfeasLitos commented at 9:40 PM on November 2, 2021: contributor
-
Define BIP-119 CheckDefaultCheckTemplateVerifyHash 1cab3e87f3
-
luke-jr commented at 11:05 PM on November 4, 2021: member
- luke-jr added the label Proposed BIP modification on Nov 4, 2021
-
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<unsigned char> and the checker takes a hash but maybe theres a constructor that does that coercion? Otherwise should use std::equal_range or something...
-
OrfeasLitos commented at 2:53 PM on November 5, 2021: contributor
I suspect that a
uint256()around thestack.back()that is passed toCheckDefaultCheckTemplateVerifyHashwould do the trick in a clean way. -
Cast 8-vector of u32 to u256 897e6458ce
-
Fix typo 1839f43779
-
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
JeremyRubin commented at 10:40 PM on November 11, 2021: contributorseems 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.
Convert inside CheckDefaultCheckTemplateVerifyHash 3ff4a4ce9dOrfeasLitos commented at 11:16 AM on November 21, 2021: contributorPTAL
JeremyRubin commented at 8:58 PM on November 21, 2021: contributorLooks good to me!
luke-jr merged this on Dec 15, 2021luke-jr closed this on Dec 15, 2021OrfeasLitos deleted the branch on Mar 31, 2024Contributors
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-05-01 19:10 UTC
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-05-01 19:10 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me