cometa-0.1.0.0: Idiomatic Haskell bindings to cardano-c
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cometa.Pool.BlsKey

Description

Stake-pool BLS public keys and proofs of possession. Validation checks byte lengths only; it does not authenticate the key or verify its proof.

mkBlsKey publicKey proof validates 96 key bytes and 48 proof bytes.

Synopsis

Documentation

data BlsKey Source #

BLS public key (96 bytes) and possession proof (48 bytes). Only lengths are checked; construction does not verify group membership or proof validity. Equality and ordering compare public-key bytes, then proof bytes.

Instances

Instances details
Show BlsKey Source # 
Instance details

Defined in Cometa.Internal.Pool

Eq BlsKey Source # 
Instance details

Defined in Cometa.Internal.Pool

Methods

(==) :: BlsKey -> BlsKey -> Bool #

(/=) :: BlsKey -> BlsKey -> Bool #

Ord BlsKey Source # 
Instance details

Defined in Cometa.Internal.Pool

mkBlsKey :: ByteString -> ByteString -> Either Error BlsKey Source #

Validate public-key bytes (first argument, 96 bytes) and possession-proof bytes (second argument, 48 bytes). InvalidPoolBlsKeyLength reports both actual lengths. No cryptographic validation occurs.

publicKeyBytes :: BlsKey -> ByteString Source #

Exact 96 public-key bytes.

possessionProofBytes :: BlsKey -> ByteString Source #

Exact 48 possession-proof bytes.

encodeCbor :: BlsKey -> ByteString Source #

Fresh definite CBOR with shortest integer encodings. Re-encoding semantic data may change transaction identity.

decodeCbor :: ByteString -> Either Error BlsKey Source #

Decode the complete value. Definite or indefinite arrays and nonminimal unsigned integers are accepted. All field bounds, arities, UTF-8 and trailing bytes are checked; violations return InvalidPoolCbor. The original encoding is not retained.