HashId

class blsct.HashId(blinding_pub_key: PublicKey, spending_pub_key: PublicKey, view_key: Scalar)

Represents a hash ID consisting of a blinding public key, a spending public key, and a view key. Also known as CKeyId which is an alias for uint160 on the C++ side.

>>> from blsct import ChildKey, HashId, PublicKey, Scalar
>>> blinding_pub_key = PublicKey()
>>> spending_pub_key = PublicKey()
>>> seed = Scalar()
>>> view_key = ChildKey(seed).to_tx_key().to_view_key()
>>> hash_id = HashId(blinding_pub_key, spending_pub_key, view_key)
>>> ser = hash_id.serialize()
>>> deser = HashId.deserialize(ser)
>>> ser == deser.serialize()
True
classmethod deserialize(hex: str) → Self

Deserialize the HashId from a hexadecimal string

serialize() → str

Serialize the HashId to a hexadecimal string