Core BLS abstraction and shared types for pluggable implementations.
$ dotnet add package Nethereum.Signer.BlsCore BLS signature abstraction for Ethereum consensus layer operations (Beacon Chain, sync committees, light clients).
Nethereum.Signer.Bls provides the abstraction layer for BLS (Boneh-Lynn-Shacham) signature verification in Nethereum. BLS signatures are used in Ethereum's consensus layer (Beacon Chain) for validator signatures, sync committees, and light client protocol. This package defines interfaces that are implemented by concrete BLS libraries like Nethereum.Signer.Bls.Herumi.
Key Features:
Use Cases:
dotnet add package Nethereum.Signer.Bls
dotnet add package Nethereum.Signer.Bls.Herumi # Concrete implementation
None - this is a pure abstraction package.
Implementations:
using Nethereum.Signer.Bls;
using Nethereum.Signer.Bls.Herumi; // Concrete implementation
// Create BLS instance with Herumi implementation
var blsBindings = new HerumiBlsBindings();
var bls = new NativeBls(blsBindings);
await bls.InitializeAsync();
// Verify aggregate BLS signature (e.g., from sync committee)
bool isValid = bls.VerifyAggregate(
aggregateSignature: aggregateSig, // 96 bytes
publicKeys: validatorPublicKeys, // Array of 48-byte public keys
messages: messages, // Array of signing roots
domain: domainSeparationTag // 32 bytes: forkDigest|domainType
);
Console.WriteLine($"Signature valid: {isValid}");
Core interface for BLS operations.
public interface IBls
{
/// <summary>
/// Verifies an aggregate BLS signature over one or more messages and public keys.
/// </summary>
bool VerifyAggregate(
byte[] aggregateSignature, // 96 bytes
byte[][] publicKeys, // Array of 48-byte public keys
byte[][] messages, // Array of 32-byte message hashes
byte[] domain // 32 bytes domain separation
);
}
Native BLS implementation wrapper.
public class NativeBls : IBls
{
public NativeBls(INativeBlsBindings bindings);
public Task InitializeAsync(CancellationToken cancellationToken = default);
public bool VerifyAggregate(byte[] aggregateSignature, byte[][] publicKeys, byte[][] messages, byte[] domain);
}
public enum BlsImplementationKind
{
None,
HerumiNative, // Herumi BLS (BLST/MCL)
Managed // Future: pure C# implementation
}
Ethereum consensus layer uses domain separation to prevent signature reuse:
domain = fork_version || domain_type
Common domain types:
DOMAIN_BEACON_PROPOSER = 0x00000000 - Block proposalsDOMAIN_BEACON_ATTESTER = 0x01000000 - AttestationsDOMAIN_SYNC_COMMITTEE = 0x07000000 - Sync committee signaturesBLS supports signature aggregation - multiple signatures can be combined into one:
| Use Case | Description |
|---|---|
| Sync Committees | 512 validators sign each beacon block |
| Light Clients | Verify beacon chain without full node |
| Portal Network | P2P light client network |
| Validator Signatures | Attest to beacon chain state |
| Verkle Proofs | Future: stateless client verification |