MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CheckTapTweak

Method CheckTapTweak

src/pubkey.cpp:257–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257bool XOnlyPubKey::CheckTapTweak(const XOnlyPubKey& internal, const uint256& merkle_root, bool parity) const
258{
259 secp256k1_xonly_pubkey internal_key;
260 if (!secp256k1_xonly_pubkey_parse(secp256k1_context_static, &internal_key, internal.data())) return false;
261 uint256 tweak = internal.ComputeTapTweakHash(&merkle_root);
262 return secp256k1_xonly_pubkey_tweak_add_check(secp256k1_context_static, m_keydata.begin(), parity, &internal_key, tweak.begin());
263}
264
265std::optional<std::pair<XOnlyPubKey, bool>> XOnlyPubKey::CreateTapTweak(const uint256* merkle_root) const
266{

Callers 1

VerifyTaprootCommitmentFunction · 0.80

Calls 5

ComputeTapTweakHashMethod · 0.80
dataMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected