Skip to main content

Summary

Our batchVerifyIdentities() function was stress-tested across 14 batch sizes with 3 iterations each on a Hardhat local network configured to match Ethereum mainnet parameters (30M block gas limit). The test deployed the full UUPS proxy stack identical to production.

Methodology

42 individual transactions across 14 batch sizes (1 to 500 identities), each executed 3 times for variance analysis. Tests ran on a Hardhat local network with Ethereum mainnet gas parameters (30M block gas limit, identical EVM execution costs). The full UUPS upgradeable proxy was deployed fresh per test suite, matching the production deployment pattern. Each transaction was verified by reading back on-chain storage to confirm all identities were actually written, not just emitted as events. Gas measurements come directly from transaction receipts.

Key Metrics

75,518 gas

Gas cost per identity at scale (batch 350)

350 max proven

Largest batch that executed successfully (88.1% of block)

~397 theoretical

Absolute maximum before exceeding 30M block limit

Gas Usage by Batch Size

Green bars fit comfortably within a block. Yellow bars use over 50% of block gas. Red bars exceed the 30M limit and revert on mainnet.

Block Usage %

Gas per Identity (Efficiency Curve)

Cost per Identity at Various Gas Prices

Test Results

Batch SizeAvg Gas UsedGas/Identity% of BlockStatus
1110,190110,1900.37%Pass
5411,59382,3181.37%Pass
10788,33278,8332.63%Pass
251,918,66476,7466.40%Pass
503,802,67076,05312.68%Pass
1007,571,54975,71525.24%Pass
15011,341,39675,60937.80%Pass
20015,112,37375,56150.37%Pass
25018,884,35775,53762.95%Pass
30022,657,38675,52475.52%Recommended
35026,431,35275,51888.10%Risky
400~30.2M (est)~75,515~100.7%Reverted
500~37.8M (est)~75,510~125.9%Reverted

Cost Estimates

Adjust gas price and ETH price to see real-time cost projections:

Safety Margin Analysis

Block AvailabilityAvailable GasMax IdentitiesNote
50% (conservative)15,000,000198Safe for congested network
60%18,000,000238Good margin
70%21,000,000278Good margin
75% (recommended)22,500,000297Best balance of throughput and reliability
80%24,000,000318Tight, may get deprioritized by builders
90%27,000,000357Risky on busy network
100%30,000,000397Theoretical max, will fail in practice

Additional Findings

Across 3 iterations per batch size, the coefficient of variation was 0.0001-0.0012%. Gas costs are fully deterministic and predictable for any given batch size. There is no randomness in cost.
Batches containing invalid entries (duplicates, malformed data) do not revert. Invalid entries are skipped and returned in the failedIndices array, while all valid entries in the same batch are processed normally.
At 500 identities, calldata alone costs ~1,044,212 gas (80,324 bytes). This is a fixed L1 cost that cannot be optimized away. On L2s like Base or Arbitrum, calldata is the dominant cost factor instead of execution.

Identity Register

On-chain identity storage architecture

Customer Management

Customer verification workflows