BLS cryptography

A major obstacle for Ethereum 2.0 in the effort to move into a Proof-of -Stake model was verifying cryptographic signatures efficiently enough to reach scalability expectations; for this task, Boneh-Lynn-Shacham signatures (BLS) were chosen.

BLS allows for efficient signature aggregation and verification at scale using Elliptic Curve cryptography. It was originally popularised within the tech community by the Dfinity Project, whom utilised BLS to create a source of distributed randomness through a mechanism called “threshold relaying”.

The BLS specification used by Ethereum 2.0 can be found in the official specifications repository.

How does it work?

As mentioned, Ethereum 2.0 uses the BLS signature scheme to facilitate secure cryptography within the protocol. This method allows validators to sign messages, and these resulting signatures are then aggregated and verified at scale. This enables a full Proof-of-Stake system with a massive number of validators to function efficiently in production.

Prysm utilises a pure Go BLS implementation for this initial testnet release. However, due to efficiency concerns, it will be replaced by a more performant implementation in the upcoming release (likely in C++).

Prysm contains the following public BLS API which can be used across the project:

func (s *Signature) Verify(msg []byte, pub *PublicKey, domain uint64) bool
func (s *SecretKey) Sign(msg []byte, domain uint64) *Signature
func (s *Signature) VerifyAggregate(pubKeys []*PublicKey, msg []byte, domain uint64) bool
func AggregateSignatures(sigs []*Signature) *Signature