Nethereum.Beaconchain 7.1.0

Prefix Reserved
dotnet add package Nethereum.Beaconchain --version 7.1.0
                    
NuGet\Install-Package Nethereum.Beaconchain -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.Beaconchain" Version="7.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nethereum.Beaconchain" Version="7.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Nethereum.Beaconchain" />
                    
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.Beaconchain --version 7.1.0
                    
#r "nuget: Nethereum.Beaconchain, 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.Beaconchain@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.Beaconchain&version=7.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Nethereum.Beaconchain&version=7.1.0
                    
Install as a Cake Tool

Nethereum.Beaconchain

.NET client for the Ethereum Beacon Chain REST API, providing access to consensus-layer state, light client bootstrap, sync committee updates, and finality data.

Installation

dotnet add package Nethereum.Beaconchain

Or via Package Manager Console:

Install-Package Nethereum.Beaconchain

Key Components

Component Description
BeaconApiClient Main client for Beacon Chain REST API endpoints
IBeaconApiClient Interface for the beacon client (supports DI and testing)
LightClientApiClient Sub-client for light client specific endpoints (bootstrap, updates, finality)
ILightClientApi Interface for light client API operations
LightClientResponseMapper Maps JSON response DTOs to Nethereum.Consensus.Ssz domain models
StateForkResponse DTO for beacon state fork information (previous/current version, epoch)
BlobSidecarResponse DTO for EIP-4844 blob sidecar data from /eth/v1/beacon/blob_sidecars/{block_id}
BlobSidecarHelper Converts beacon blob responses to raw byte arrays for BlobEncoder.DecodeBlobs

Quick Start

Creating a BeaconApiClient

using Nethereum.Beaconchain;

var beaconClient = new BeaconApiClient("https://ethereum-beacon-api.publicnode.com");

You can also supply your own HttpClient or IRestHttpHelper:

var httpClient = new HttpClient();
var beaconClient = new BeaconApiClient("https://ethereum-beacon-api.publicnode.com", httpClient);

Getting Fork Version

Retrieve the fork data for a given state (defaults to "head"):

using Nethereum.Beaconchain;

var beaconClient = new BeaconApiClient("https://ethereum-beacon-api.publicnode.com");
var fork = await beaconClient.GetStateForkAsync();

var currentVersion = fork.Data.CurrentVersion;
var previousVersion = fork.Data.PreviousVersion;
var epoch = fork.Data.Epoch;

Fetching Blob Sidecars (EIP-4844)

using Nethereum.Beaconchain;
using Nethereum.Model;

var beaconClient = new BeaconApiClient("https://ethereum-beacon-api.publicnode.com");

// Fetch blobs for a specific slot
var response = await beaconClient.GetBlobSidecarsAsync("9000000");

// Or fetch latest
var latest = await beaconClient.GetBlobSidecarsAsync("head");

// Decode blob data back to original bytes
var originalData = BlobSidecarHelper.DecodeData(response);

// Or get raw blobs + commitments + proofs
var sidecar = BlobSidecarHelper.ToBlobSidecar(response);

Getting Finality Updates

using Nethereum.Beaconchain;
using Nethereum.Beaconchain.LightClient;
using Nethereum.Hex.HexConvertors.Extensions;

var beaconClient = new BeaconApiClient("https://ethereum-beacon-api.publicnode.com");

var response = await beaconClient.LightClient.GetFinalityUpdateAsync();
var finalityUpdate = LightClientResponseMapper.ToDomain(response);

var finalizedSlot = finalityUpdate.FinalizedHeader.Beacon.Slot;
var blockNumber = finalityUpdate.FinalizedHeader.Execution.BlockNumber;
var blockHash = finalityUpdate.FinalizedHeader.Execution.BlockHash.ToHex(true);

Getting Optimistic Updates

using Nethereum.Beaconchain;
using Nethereum.Beaconchain.LightClient;
using Nethereum.Hex.HexConvertors.Extensions;

var beaconClient = new BeaconApiClient("https://ethereum-beacon-api.publicnode.com");

var response = await beaconClient.LightClient.GetOptimisticUpdateAsync();
var optimisticUpdate = LightClientResponseMapper.ToDomain(response);

var attestedSlot = optimisticUpdate.AttestedHeader.Beacon.Slot;
var blockNumber = optimisticUpdate.AttestedHeader.Execution.BlockNumber;
var blockHash = optimisticUpdate.AttestedHeader.Execution.BlockHash.ToHex(true);

Getting Light Client Bootstrap

Bootstrap requires a block root, typically obtained from a finality update:

using Nethereum.Beaconchain;
using Nethereum.Beaconchain.LightClient;
using Nethereum.Consensus.Ssz;
using Nethereum.Hex.HexConvertors.Extensions;

var beaconClient = new BeaconApiClient("https://ethereum-beacon-api.publicnode.com");

var finalityResponse = await beaconClient.LightClient.GetFinalityUpdateAsync();
var finalityUpdate = LightClientResponseMapper.ToDomain(finalityResponse);
var blockRoot = finalityUpdate.FinalizedHeader.Beacon.HashTreeRoot();

var response = await beaconClient.LightClient.GetBootstrapAsync(blockRoot.ToHex(true));
var bootstrap = LightClientResponseMapper.ToDomain(response);

var slot = bootstrap.Header.Beacon.Slot;
var syncCommitteePubKeyCount = bootstrap.CurrentSyncCommittee.PubKeys.Count;
var branchCount = bootstrap.CurrentSyncCommitteeBranch.Count;

Getting Sync Period Updates

Fetch light client updates for one or more sync committee periods:

using Nethereum.Beaconchain;
using Nethereum.Beaconchain.LightClient;

var beaconClient = new BeaconApiClient("https://ethereum-beacon-api.publicnode.com");

var finalityResponse = await beaconClient.LightClient.GetFinalityUpdateAsync();
var finalityUpdate = LightClientResponseMapper.ToDomain(finalityResponse);
var currentSlot = finalityUpdate.FinalizedHeader.Beacon.Slot;
var currentPeriod = currentSlot / (32 * 256);

var responses = await beaconClient.LightClient.GetUpdatesAsync(currentPeriod, 1);
var updates = LightClientResponseMapper.ToDomain(responses);

foreach (var update in updates)
{
    var attestedSlot = update.AttestedHeader?.Beacon?.Slot;
    var finalizedSlot = update.FinalizedHeader?.Beacon?.Slot;
}

Response DTO Structure

The API returns JSON responses that are deserialized into DTO classes in the Nethereum.Beaconchain.LightClient.Responses namespace. Key types:

DTO Key Fields
LightClientBootstrapResponse Data.Header, Data.CurrentSyncCommittee, Data.CurrentSyncCommitteeBranch
LightClientUpdateResponse Data.AttestedHeader, Data.NextSyncCommittee, Data.FinalizedHeader, Data.SyncAggregate, Data.SignatureSlot
LightClientFinalityUpdateResponse Data.AttestedHeader, Data.FinalizedHeader, Data.FinalityBranch, Data.SyncAggregate
LightClientOptimisticUpdateResponse Data.AttestedHeader, Data.SyncAggregate, Data.SignatureSlot
StateForkResponse Data.PreviousVersion, Data.CurrentVersion, Data.Epoch
LightClientHeaderDto Beacon (slot, proposer index, roots), Execution (block number, hash, gas, timestamps), ExecutionBranch

Use LightClientResponseMapper.ToDomain() to convert any response DTO into the corresponding domain model from Nethereum.Consensus.Ssz (e.g., LightClientBootstrap, LightClientUpdate, LightClientFinalityUpdate, LightClientOptimisticUpdate).

Relationship to Other Packages

  • Nethereum.Consensus.Ssz - Provides the domain model types (LightClientBootstrap, LightClientUpdate, BeaconBlockHeader, ExecutionPayloadHeader, SyncCommittee, SyncAggregate) that LightClientResponseMapper maps into. Also provides HashTreeRoot() for SSZ hash tree root computation.
  • Nethereum.Consensus.LightClient - Implements the light client sync protocol (LightClientService) on top of this package. Uses ILightClientApi to fetch updates and LightClientResponseMapper to convert them for verification.
  • Nethereum.Signer.Bls.Herumi - BLS signature verification used by LightClientService to validate sync committee signatures.
  • Nethereum.ChainStateVerification - Uses the light client to obtain trusted headers and verify execution-layer state proofs (account balances, storage, code) against them.

Additional Resources

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Nethereum.Beaconchain:

Package Downloads
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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.1.0 135 11/10/2026
7.0.0 349 10/2/2026
6.1.0 1,155 3/25/2026
6.0.4 335 3/18/2026
6.0.3 289 3/18/2026
6.0.1 332 3/17/2026
6.0.0 318 3/16/2026
5.8.0 357 1/6/2026