![]() |
VOOZH | about |
dotnet add package Nethereum.AccountAbstraction.Bundler --version 6.1.0
NuGet\Install-Package Nethereum.AccountAbstraction.Bundler -Version 6.1.0
<PackageReference Include="Nethereum.AccountAbstraction.Bundler" Version="6.1.0" />
<PackageVersion Include="Nethereum.AccountAbstraction.Bundler" Version="6.1.0" />Directory.Packages.props
<PackageReference Include="Nethereum.AccountAbstraction.Bundler" />Project file
paket add Nethereum.AccountAbstraction.Bundler --version 6.1.0
#r "nuget: Nethereum.AccountAbstraction.Bundler, 6.1.0"
#:package Nethereum.AccountAbstraction.Bundler@6.1.0
#addin nuget:?package=Nethereum.AccountAbstraction.Bundler&version=6.1.0Install as a Cake Addin
#tool nuget:?package=Nethereum.AccountAbstraction.Bundler&version=6.1.0Install as a Cake Tool
ERC-4337 bundler implementation with mempool management, UserOperation validation, bundle execution, reputation tracking, and ERC-7562 compliance checking.
Nethereum.AccountAbstraction.Bundler implements the bundler side of the ERC-4337 Account Abstraction protocol. A bundler collects UserOperations from users, validates them, bundles them into transactions, and submits them to the EntryPoint contract via handleOps. This package provides the full bundler pipeline: mempool management, multi-phase validation, gas estimation, bundle building and execution, entity reputation tracking, and ERC-7562 opcode/storage rule enforcement.
The bundler supports three operational modes: simplified AppChain mode (whitelisted, no strict rules), standard mode (full ERC-7562 validation), and production mode (strict + reputation + minimum stake requirements).
IBundlerService implements all spec-required RPC methodsInMemoryUserOpMempool with TTL, per-sender limits, and priority orderingEntryPoint.handleOps()handleAggregatedOps()dotnet add package Nethereum.AccountAbstraction.Bundler
SendUserOperationAsynchandleOps()The InMemoryUserOpMempool stores pending operations with:
maxPriorityFeePerGasERC7562SimulationService simulates UserOperation validation through the EVM to detect:
// Simplified: no strict rules, for private chains
var appChain = BundlerConfig.CreateAppChainConfig(entryPoint, beneficiary);
// Standard: full ERC-7562, for public testnets
var standard = BundlerConfig.CreateStandardConfig(entryPoint, beneficiary);
// Production: strict + reputation + min stake
var production = BundlerConfig.CreateProductionConfig(entryPoint, beneficiary);
using Nethereum.AccountAbstraction.Bundler;
var config = BundlerConfig.CreateStandardConfig(
entryPointAddress, beneficiaryAddress);
var bundler = new BundlerService(web3, config);
// Submit a UserOperation
string userOpHash = await bundler.SendUserOperationAsync(userOp, entryPointAddress);
// Check status
var receipt = await bundler.GetUserOperationReceiptAsync(userOpHash);
using Nethereum.AccountAbstraction.Bundler;
var config = new BundlerConfig
{
SupportedEntryPoints = new[] { entryPointAddress },
BeneficiaryAddress = bundlerAddress,
MaxBundleSize = 10,
MaxMempoolSize = 1000,
AutoBundleIntervalMs = 10000,
EnableERC7562Validation = true,
StrictValidation = true
};
var bundler = new BundlerService(web3, config);
// Auto-bundling starts automatically
var mempool = new InMemoryUserOpMempool(
maxSize: 5000, entryTtl: TimeSpan.FromMinutes(30));
var bundler = new BundlerService(web3, config, mempool: mempool);
// Disable auto-bundling
config.AutoBundleIntervalMs = 0;
var bundler = new BundlerService(web3, config);
// Submit operations
await bundler.SendUserOperationAsync(userOp1, entryPoint);
await bundler.SendUserOperationAsync(userOp2, entryPoint);
// Manually trigger bundle
var result = await bundler.ExecuteBundleAsync();
Console.WriteLine($"Bundled {result?.UserOpResults?.Length ?? 0} operations");
Core bundler implementing IBundlerServiceExtended.
public class BundlerService : IBundlerServiceExtended, IDisposable
{
// ERC-4337 spec methods
public Task<string> SendUserOperationAsync(PackedUserOperation userOp, string entryPoint);
public Task<UserOperationGasEstimate> EstimateUserOperationGasAsync(PackedUserOperation userOp, string entryPoint);
public Task<UserOperationReceipt?> GetUserOperationReceiptAsync(string userOpHash);
public Task<UserOperationInfo?> GetUserOperationByHashAsync(string userOpHash);
public Task<string[]> SupportedEntryPointsAsync();
// Extended methods
public Task<BundleExecutionResult?> ExecuteBundleAsync();
public Task<BundlerStats> GetStatsAsync();
}
Thread-safe in-memory mempool.
public class InMemoryUserOpMempool : IUserOpMempool
{
public Task<bool> AddAsync(MempoolEntry entry);
public Task<MempoolEntry?> GetAsync(string userOpHash);
public Task<MempoolEntry[]> GetPendingAsync(int maxCount, BigInteger? maxGas = null);
public Task MarkIncludedAsync(string[] userOpHashes, string transactionHash, BigInteger blockNumber);
public Task MarkFailedAsync(string[] userOpHashes, string error);
public Task PruneAsync();
}
EVM-based validation for opcode and storage rules.
public class ERC7562SimulationService
{
public Task<ERC7562ValidationResult> ValidateUserOperationAsync(PackedUserOperation userOp, string entryPoint);
}
Key properties:
SupportedEntryPoints - EntryPoint contract addressesBeneficiaryAddress - Address receiving bundle gas refundsMaxBundleSize (default: 10) - Operations per bundleAutoBundleIntervalMs (default: 10000) - Bundle trigger intervalEnableERC7562Validation - Enable opcode/storage simulationUnsafeMode - Skip all validation (testing only)| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Nethereum.AccountAbstraction.Bundler:
| Package | Downloads |
|---|---|
|
Nethereum.AccountAbstraction.Bundler.RocksDB
Nethereum Account Abstraction Bundler RocksDB - Persistent storage for ERC-4337 bundler mempool and reputation |
This package is not used by any popular GitHub repositories.