[][src]Constant secp256k1zkp::constants::GENERATOR_H

pub const GENERATOR_H: [u8; 64]

Generator point H

Used as generator point for the value in Pedersen Commitments. Created as NUMS (nothing-up-my-sleeve) curve point from SHA256 hash of G. Details: Calculate sha256 of uncompressed serialization format of G, treat the result as x-coordinate, find the first point on curve with this x-coordinate (which happens to exist on the curve)

Example in SageMath:

sage: import hashlib

sage: # finite field of secp256k1: sage: F = FiniteField (0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F) sage: # Elliptic Curve defined by y^2 = x^3 + 0x + 7 over finite field F ( = secp256k1) sage: secp256k1 = EllipticCurve ([F (0), F (7)])

sage: # hash of generator point G in uncompressed form: sage: hash_of_g = hashlib.sha256('0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'.decode('hex')) sage: hash_of_g_as_int = Integer(int(hash_of_g.hexdigest(),16))

sage: # get the first point on the curve (if any exists) from given x-coordinate: sage: POINT_H = secp256k1.lift_x(hash_of_g_as_int)

sage: # output x- and y-coordinates of the point in hexadecimal: sage: '%x %x'%POINT_H.xy()

sage Result: '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0 31d3c6863973926e049e637cb1b5f40a36dac28af1766968c30c2313f3a38904'

Format: x- and y- coordinate, without compressed/uncompressed prefix byte