Signature

class blsct.Signature(priv_key: Scalar, msg: str)

Represents the signature of a transaction.

>>> from blsct import PublicKey, Scalar, Signature
>>> sk = Scalar()
>>> pk = PublicKey.from_scalar(sk)
>>> sig = Signature(sk, 'navio')
>>> sig.verify('navio', pk)
>>> ser = sig.serialize()
>>> deser = Signature.deserialize(ser)
>>> ser == deser.serialize()
>>> True
classmethod deserialize(hex: str) → Self

Deserialize the Signature from a hexadecimal string

serialize() → str

Serialize the Signature to a hexadecimal string

verify(msg: str, pub_key: PublicKey) → bool

Verify a signature using the public key corresponding to the private key that signed the transaction.