186+ * NUMS_H is a point with an unknown discrete logarithm, constructed by taking the hash of the
187+ * standard uncompressed encoding of the secp256k1 base point G as X coordinate.
188+ *
189+ * See https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs
190+ */
191+static const std::vector<unsigned char> NUMS_H_DATA = {0x50, 0x92, 0x9b, 0x74, 0xc1, 0xa0, 0x49, 0x54, 0xb7, 0x8b, 0x4b, 0x60, 0x35, 0xe9, 0x7a, 0x5e, 0x07, 0x8a, 0x5a, 0x0f, 0x28, 0xec, 0x96, 0xd5, 0x47, 0xbf, 0xee, 0x9a, 0xce, 0x80, 0x3a, 0xc0};
Any reason to drop the ParseHex, which allows to write this as a string literal?
Seemed unnecessary? Representing this as a byte vector allows us to create an XOnlyPublicKey
directly without an extra function call. Is there a reason to prefer having this as a string literal?
Just a style-nit, as it makes it easier to grep and compare the string literal. The function call could be moved to compile time, but I haven’t implemented it yet. Calling it once at runtime should be fine also, for now?
Just a nit in any case.
Ah cool, my slight aversion to ParseHex
was the call at runtime for a static const, but if we are going to move that to compile time and the string literal makes it easier to compare (e.g. with the value in BIP341, which is also a string literal), then happy to change it.