Documentation
¶
Overview ¶
Package bls implements Filecoin BLS12-381 signature verification using github.com/consensys/gnark-crypto/ecc/bls12-381. The Filecoin BLS Domain Separation Tag is
BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_
Filecoin uses the "minimum-pubkey-size" BLS variant: public keys live on G1, signatures on G2. Messages are hashed to G2 using the SSWU map with the DST above; verification computes the pairing equality
e(g1, sig) == e(pk, H(msg))
This package implements Verify and AggregateVerify with that scheme.
Index ¶
Constants ¶
const ( PrivateKeyBytes = 32 PublicKeyBytes = 48 SignatureBytes = 96 )
Sizes of compressed serialized group elements, matching filecoin-ffi.
const DST = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_"
DST is the Filecoin BLS domain separation tag.
Variables ¶
This section is empty.
Functions ¶
func Aggregate ¶
Aggregate combines a list of BLS signatures (each 96-byte compressed G2) into a single 96-byte aggregate signature via point addition on G2.
func HashVerify ¶
HashVerify checks an aggregated BLS signature over a sequence of (message, pubkey) pairs. Returns nil iff
e(G1, sig) == prod_i e(pk_i, H(msg_i)).
This mirrors filecoin-ffi's HashVerify, which is what Lotus uses to verify the BlockHeader.BLSAggregate field over the in-block BLS messages.
Types ¶
This section is empty.