#include <pubkey.h>
|
static constexpr size_t | size () |
|
|
static const XOnlyPubKey | NUMS_H |
| Nothing Up My Sleeve point H Used as an internal key for provably disabling the key path spend see BIP341 for more details. More...
|
|
Definition at line 230 of file pubkey.h.
◆ XOnlyPubKey() [1/4]
XOnlyPubKey::XOnlyPubKey |
( |
| ) |
|
|
default |
Construct an empty x-only pubkey.
◆ XOnlyPubKey() [2/4]
◆ XOnlyPubKey() [3/4]
constexpr XOnlyPubKey::XOnlyPubKey |
( |
std::span< const unsigned char > |
bytes | ) |
|
|
inlineexplicitconstexpr |
Construct an x-only pubkey from exactly 32 bytes.
Definition at line 257 of file pubkey.h.
◆ XOnlyPubKey() [4/4]
XOnlyPubKey::XOnlyPubKey |
( |
const CPubKey & |
pubkey | ) |
|
|
inlineexplicit |
Construct an x-only pubkey from a normal pubkey.
Definition at line 260 of file pubkey.h.
◆ begin() [1/2]
unsigned char * XOnlyPubKey::begin |
( |
| ) |
|
|
inline |
◆ begin() [2/2]
const unsigned char * XOnlyPubKey::begin |
( |
| ) |
const |
|
inline |
◆ CheckTapTweak()
bool XOnlyPubKey::CheckTapTweak |
( |
const XOnlyPubKey & |
internal, |
|
|
const uint256 & |
merkle_root, |
|
|
bool |
parity |
|
) |
| const |
Verify that this is a Taproot tweaked output point, against a specified internal key, Merkle root, and parity.
Definition at line 251 of file pubkey.cpp.
◆ ComputeTapTweakHash()
uint256 XOnlyPubKey::ComputeTapTweakHash |
( |
const uint256 * |
merkle_root | ) |
const |
Compute the Taproot tweak as specified in BIP341, with *this as internal key:
- if merkle_root == nullptr: H_TapTweak(xonly_pubkey)
- otherwise: H_TapTweak(xonly_pubkey || *merkle_root)
Note that the behavior of this function with merkle_root != nullptr is consensus critical.
Definition at line 240 of file pubkey.cpp.
◆ CreateTapTweak()
std::optional< std::pair< XOnlyPubKey, bool > > XOnlyPubKey::CreateTapTweak |
( |
const uint256 * |
merkle_root | ) |
const |
Construct a Taproot tweaked output point with this point as internal key.
Definition at line 259 of file pubkey.cpp.
◆ data() [1/2]
unsigned char * XOnlyPubKey::data |
( |
| ) |
|
|
inline |
◆ data() [2/2]
const unsigned char * XOnlyPubKey::data |
( |
| ) |
const |
|
inline |
◆ end() [1/2]
unsigned char * XOnlyPubKey::end |
( |
| ) |
|
|
inline |
◆ end() [2/2]
const unsigned char * XOnlyPubKey::end |
( |
| ) |
const |
|
inline |
◆ GetEvenCorrespondingCPubKey()
CPubKey XOnlyPubKey::GetEvenCorrespondingCPubKey |
( |
| ) |
const |
◆ GetKeyIDs()
std::vector< CKeyID > XOnlyPubKey::GetKeyIDs |
( |
| ) |
const |
Returns a list of CKeyIDs for the CPubKeys that could have been used to create this XOnlyPubKey.
This is needed for key lookups since keys are indexed by CKeyID.
Definition at line 200 of file pubkey.cpp.
◆ IsFullyValid()
bool XOnlyPubKey::IsFullyValid |
( |
| ) |
const |
Determine if this pubkey is fully valid.
This is true for approximately 50% of all possible 32-byte arrays. If false, VerifySchnorr, CheckTapTweak and CreateTapTweak will always fail.
Definition at line 224 of file pubkey.cpp.
◆ IsNull()
bool XOnlyPubKey::IsNull |
( |
| ) |
const |
|
inline |
Test whether this is the 0 key (the result of default construction).
This implies !IsFullyValid().
Definition at line 254 of file pubkey.h.
◆ operator!=()
bool XOnlyPubKey::operator!= |
( |
const XOnlyPubKey & |
other | ) |
const |
|
inline |
◆ operator<()
bool XOnlyPubKey::operator< |
( |
const XOnlyPubKey & |
other | ) |
const |
|
inline |
◆ operator=()
◆ operator==()
bool XOnlyPubKey::operator== |
( |
const XOnlyPubKey & |
other | ) |
const |
|
inline |
◆ operator[]()
const unsigned char & XOnlyPubKey::operator[] |
( |
int |
pos | ) |
const |
|
inline |
◆ SERIALIZE_METHODS()
Implement serialization without length prefixes since it is a fixed length.
Definition at line 305 of file pubkey.h.
◆ size()
static constexpr size_t XOnlyPubKey::size |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ VerifySchnorr()
bool XOnlyPubKey::VerifySchnorr |
( |
const uint256 & |
msg, |
|
|
Span< const unsigned char > |
sigbytes |
|
) |
| const |
Verify a Schnorr signature against this public key.
sigbytes must be exactly 64 bytes.
Definition at line 230 of file pubkey.cpp.
◆ m_keydata
◆ NUMS_H
Initial value:{
[]()
consteval {
return XOnlyPubKey{
"50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0"_hex_u8}; }(),
}
Nothing Up My Sleeve point H Used as an internal key for provably disabling the key path spend see BIP341 for more details.
Nothing Up My Sleeve (NUMS) point.
NUMS_H is a point with an unknown discrete logarithm, constructed by taking the sha256 of 'g' (uncompressed encoding), which happens to be a point on the curve.
For an example script for calculating H, refer to the unit tests in ./test/functional/test_framework/crypto/secp256k1.py
Definition at line 239 of file pubkey.h.
The documentation for this class was generated from the following files: