aboutsummaryrefslogtreecommitdiff
path: root/src/pubkey.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey.cpp')
-rw-r--r--src/pubkey.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pubkey.cpp b/src/pubkey.cpp
index 11e1b4abb5..13e3c2dbe0 100644
--- a/src/pubkey.cpp
+++ b/src/pubkey.cpp
@@ -13,6 +13,7 @@
#include <secp256k1_schnorrsig.h>
#include <span.h>
#include <uint256.h>
+#include <util/strencodings.h>
#include <algorithm>
#include <cassert>
@@ -181,6 +182,17 @@ int ecdsa_signature_parse_der_lax(secp256k1_ecdsa_signature* sig, const unsigned
return 1;
}
+/** 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
+ */
+static const std::vector<unsigned char> NUMS_H_DATA{ParseHex("50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0")};
+const XOnlyPubKey XOnlyPubKey::NUMS_H{NUMS_H_DATA};
+
XOnlyPubKey::XOnlyPubKey(Span<const unsigned char> bytes)
{
assert(bytes.size() == 32);