Nethereum.Signer.Bls 7.1.0

Prefix Reserved
dotnet add package Nethereum.Signer.Bls --version 7.1.0
                    
NuGet\Install-Package Nethereum.Signer.Bls -Version 7.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nethereum.Signer.Bls" Version="7.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nethereum.Signer.Bls" Version="7.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Nethereum.Signer.Bls" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nethereum.Signer.Bls --version 7.1.0
                    
#r "nuget: Nethereum.Signer.Bls, 7.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nethereum.Signer.Bls@7.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nethereum.Signer.Bls&version=7.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Nethereum.Signer.Bls&version=7.1.0
                    
Install as a Cake Tool

Nethereum.Signer.Bls

Core BLS signature abstraction for Ethereum consensus layer operations (Beacon Chain, sync committees, light clients).

Overview

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:

  • BLS aggregate signature verification (consensus layer)
  • Pluggable BLS implementation architecture
  • Ethereum 2.0 sync committee signature verification
  • Light client support (verify beacon chain data)
  • Domain separation for Ethereum consensus layer

Use Cases:

  • Light clients (verify beacon chain without running full node)
  • Sync committee verification
  • Consensus layer data validation
  • Portal Network implementations
  • Verkle tree state proofs (future Ethereum upgrades)

Installation

dotnet add package Nethereum.Signer.Bls
dotnet add package Nethereum.Signer.Bls.Herumi  # Concrete implementation

Dependencies

None - this is a pure abstraction package.

Implementations:

  • Nethereum.Signer.Bls.Herumi - Native Herumi BLS library wrapper

Quick Start

using Nethereum.Signer.Bls;
using Nethereum.Signer.Bls.Herumi;  // Concrete implementation

// Create BLS instance with Herumi implementation
var blsBindings = new HerumiNativeBindings();
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: domain                         // 32-byte consensus-spec domain
);

Console.WriteLine($"Signature valid: {isValid}");

API Reference

IBls Interface

Core interface for BLS operations, implemented by NativeBls.

public interface IBls
{
    // Verifies an aggregate BLS signature (typically sync committees) over one or
    // more messages and public keys; the domain is only length-checked (32 bytes).
    bool VerifyAggregate(byte[] aggregateSignature, byte[][] publicKeys, byte[][] messages, byte[] domain);

    // Aggregates multiple BLS signatures into a single signature.
    // Used for ERC-4337 BLS signature aggregation to reduce gas costs.
    byte[] AggregateSignatures(byte[][] signatures);

    // Verifies an individual BLS signature over a message.
    bool Verify(byte[] signature, byte[] publicKey, byte[] message);

    // Splits a combined signature+publicKey byte array (ERC-4337 format) into its parts.
    (byte[] Signature, byte[] PublicKey) ExtractSignatureAndPublicKey(byte[] signatureWithPubKey);
}

NativeBls Class

IBls implementation that routes verification requests to a native BLST/MCL backend via an INativeBlsBindings implementation (e.g. HerumiNativeBindings).

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 byte[] AggregateSignatures(byte[][] signatures);
    public bool Verify(byte[] signature, byte[] publicKey, byte[] message);
    public (byte[] Signature, byte[] PublicKey) ExtractSignatureAndPublicKey(byte[] signatureWithPubKey);
}

ExtractSignatureAndPublicKey is implemented directly on NativeBls (it is pure byte slicing — 96 bytes signature + 48 bytes public key — and needs no native call), so it works even before InitializeAsync is called.

IBls12381Operations Interface

EIP-2537 BLS12-381 precompile primitives (point/scalar operations), separate from the signature-verification surface of IBls. Implemented by Nethereum.Signer.Bls.Herumi's Bls12381Operations and consumed by Nethereum.EVM.Precompiles.Bls.

public interface IBls12381Operations
{
    byte[] G1Add(byte[] p1, byte[] p2);
    byte[] G1Mul(byte[] point, byte[] scalar);
    byte[] G1Msm(byte[][] points, byte[][] scalars);

    byte[] G2Add(byte[] p1, byte[] p2);
    byte[] G2Mul(byte[] point, byte[] scalar);
    byte[] G2Msm(byte[][] points, byte[][] scalars);

    bool Pairing(byte[][] g1Points, byte[][] g2Points);

    byte[] MapFpToG1(byte[] fp);
    byte[] MapFp2ToG2(byte[] fp2);
}

IBls12381OutcomeOperations Interface

An additive interface for implementations that report invalid EIP-2537 input as a return value instead of throwing. IBls12381Operations is unchanged and still throws; an implementation that can do both implements both, as Bls12381Operations does. The precompile handlers use the Try forms so that a call with malformed input fails the call without an exception (a zkVM guest is linked without exception handling).

public interface IBls12381OutcomeOperations
{
    bool TryG1Add(byte[] p1, byte[] p2, out byte[] result);
    bool TryG1Msm(byte[][] points, byte[][] scalars, out byte[] result);

    bool TryG2Add(byte[] p1, byte[] p2, out byte[] result);
    bool TryG2Msm(byte[][] points, byte[][] scalars, out byte[] result);

    bool TryPairing(byte[][] g1Points, byte[][] g2Points, out bool pairs);

    bool TryMapFpToG1(byte[] fp, out byte[] result);
    bool TryMapFp2ToG2(byte[] fp2, out byte[] result);
}

true means the input was valid and result (or pairs) holds the outcome; false means the input was malformed (wrong length, non-zero padding, a coordinate outside the field, a point off the curve or, where EIP-2537 requires it, outside the prime-order subgroup) and result is null.

IBls12381OutcomeOperations operations = new Bls12381Operations();

var infinity = new byte[128];
var accepted = operations.TryG1Add(infinity, infinity, out var sum);
var rejected = operations.TryG1Add(new byte[3], infinity, out var none);

Backed by FoundationsBlsDocExampleTests.Given_InvalidAndValidEip2537Input_When_TryG1AddIsCalled_Then_InvalidInputReturnsFalseAndTheFacadeThrows and FoundationsBlsDocExampleTests.Given_MismatchedPairingInputs_When_TryPairingIsCalled_Then_FalseIsReturnedAndAnEmptyInputPairs.

BlsImplementationKind Enum

public enum BlsImplementationKind
{
    None,
    HerumiNative,  // Herumi BLS (BLST/MCL)
    Managed        // Future: pure C# implementation
}

Important Notes

BLS12-381 Curve

  • Ethereum consensus layer uses BLS12-381 curve (NOT secp256k1)
  • Public keys: 48 bytes (compressed G1 point)
  • Signatures: 96 bytes (compressed G2 point)
  • Different from execution layer (which uses secp256k1/ECDSA)

Domain Separation

Ethereum consensus layer uses domain separation to prevent signature reuse:

domain is the 32-byte consensus-spec domain (domain_type followed by the first 28 bytes of fork_data_root). NativeBls/HerumiNativeBindings only validate that it is 32 bytes when supplied.

Common domain types:

  • DOMAIN_BEACON_PROPOSER = 0x00000000 - Block proposals
  • DOMAIN_BEACON_ATTESTER = 0x01000000 - Attestations
  • DOMAIN_SYNC_COMMITTEE = 0x07000000 - Sync committee signatures

Aggregate Signatures

BLS supports signature aggregation - multiple signatures can be combined into one:

  • Input: N signatures from N validators
  • Output: 1 aggregate signature (still 96 bytes)
  • Verification: Verify all N signatures at once

Performance

  • Aggregate verification is faster than verifying N signatures individually

Consensus Layer Use Cases

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

Implementations

  • Nethereum.Signer.Bls.Herumi - Native Herumi BLS (production-ready)

Used By (per ProjectReference/PackageReference in src/)

  • Nethereum.Consensus.LightClient - Beacon chain sync committee / light client verification
  • Nethereum.EVM.Precompiles.Bls - EIP-2537 BLS12-381 precompiles (IBls12381Operations)
  • Nethereum.AccountAbstraction.Bundler - ERC-4337 BLS signature aggregation
  • Nethereum.Wallet - Wallet BLS signing/verification
  • Nethereum.MainnetChain / Nethereum.MainnetChain.Server - via the Nethereum.Signer.Bls.Herumi package
  • Nethereum.Node.HarnessServer - via the Nethereum.Signer.Bls.Herumi package

Additional Resources

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Nethereum.Signer.Bls:

Package Downloads
Nethereum.Signer.Bls.Herumi

Herumi-backed native BLS implementation for Nethereum.

Nethereum.Consensus.LightClient

Beacon light client orchestration (bootstrap, updates, trusted execution headers).

Nethereum.Wallet

Core wallet services for managing accounts, vaults, and configuration across the Nethereum stack.

Nethereum.AccountAbstraction.Bundler

Nethereum AccountAbstraction Bundler - ERC-4337 bundler with UserOperation validation, mempool, gas estimation, and bundle submission

Nethereum.EVM.Precompiles.Bls

BLS12-381 precompile implementations for Nethereum EVM using Herumi MCL native library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.1.0 389 11/10/2026
7.0.0 457 10/2/2026
6.1.0 2,162 3/25/2026
6.0.4 423 3/18/2026
6.0.3 370 3/18/2026
6.0.1 390 3/17/2026
6.0.0 386 3/16/2026
5.8.0 397 1/6/2026