diff options
author | fanquake <fanquake@gmail.com> | 2021-03-05 09:42:31 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-03-05 10:30:33 +0800 |
commit | fbf5d16238d67f901a1f151ddd7e68a17088eeee (patch) | |
tree | a5ee63696badc8ea057f378c008e77ee9c874b19 /src | |
parent | 2620ac4ec3086de3189cd87282cc9ae0f2529cee (diff) | |
parent | 6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4 (diff) |
Merge #21246: doc: Correction for VerifyTaprootCommitment comments
6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4 Correction for VerifyTaprootCommitment comments (Russell O'Connor)
Pull request description:
According to BIP-341, 'p' is called the taproot *internal* key, not inner key.
ACKs for top commit:
sipa:
ACK 6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4
benthecarman:
ACK 6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4
theStack:
ACK 6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4
Tree-SHA512: 94f553476a8404bff4b2d5724a1a54c5f530b987a616cd00a3800095f245c06e3c7a9066c729976f32069a56029406859a70ba523151d333dc1ed874f242bce8
Diffstat (limited to 'src')
-rw-r--r-- | src/script/interpreter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index ecac3b9e7e..20a4ce48b0 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1834,7 +1834,7 @@ static bool ExecuteWitnessScript(const Span<const valtype>& stack_span, const CS static bool VerifyTaprootCommitment(const std::vector<unsigned char>& control, const std::vector<unsigned char>& program, const CScript& script, uint256& tapleaf_hash) { const int path_len = (control.size() - TAPROOT_CONTROL_BASE_SIZE) / TAPROOT_CONTROL_NODE_SIZE; - //! The inner pubkey (x-only, so no Y coordinate parity). + //! The internal pubkey (x-only, so no Y coordinate parity). const XOnlyPubKey p{uint256(std::vector<unsigned char>(control.begin() + 1, control.begin() + TAPROOT_CONTROL_BASE_SIZE))}; //! The output pubkey (taken from the scriptPubKey). const XOnlyPubKey q{uint256(program)}; @@ -1852,9 +1852,9 @@ static bool VerifyTaprootCommitment(const std::vector<unsigned char>& control, c } k = ss_branch.GetSHA256(); } - // Compute the tweak from the Merkle root and the inner pubkey. + // Compute the tweak from the Merkle root and the internal pubkey. k = (CHashWriter(HASHER_TAPTWEAK) << MakeSpan(p) << k).GetSHA256(); - // Verify that the output pubkey matches the tweaked inner pubkey, after correcting for parity. + // Verify that the output pubkey matches the tweaked internal pubkey, after correcting for parity. return q.CheckPayToContract(p, k, control[0] & 1); } |