omni_zk_rollup_gas_compression
Calculate ZK rollup calldata compression ratios, L2 transaction costs, and gas savings per transaction to compare Layer 2 rollup efficiency against Ethereum mainnet.
Instructions
Zero-Knowledge (ZK) Rollup Calldata Compression & L2 Gas Savings. Calculate batch compression ratios, state diff rollup costs, and gas savings per transaction on Ethereum Layer 2 rollups (Arbitrum, Optimism, zkSync, Starknet). Discipline: CRYPTO. Governing mathematical model / formula: L2 Cost = (L2 Execution Gas × L2 Gas Price) + (L1 Calldata Bytes × 16 gas/byte × L1 Price / Batch Size).
USAGE GUIDELINES:
WHEN TO USE: Invoke for deterministic calculation of l2_transaction_cost_usd (Effective L2 Transaction Cost), gas_reduction_pct (Gas Savings vs Ethereum Mainnet), mainnet_equivalent_usd (Ethereum L1 Mainnet Cost), data_compression_ratio (Calldata Compression Factor) using l1_gas_price_gwei (Ethereum L1 Gas Price (Gwei) in Gwei), batch_size_transactions (Batch Proof Aggregation Size in txs/batch), compressed_bytes_per_tx (Compressed Calldata Per Tx (Bytes) in bytes), eth_spot_price (ETH Market Price ($)). Guarantees exact machine floating-point precision, eliminating LLM arithmetic mistakes and formula hallucinations.
WHEN NOT TO USE: Do not use for qualitative evaluations or unquantified reasoning. All input parameters must be valid numerical values.
DISAMBIGUATION & BOUNDARIES:
Use this dedicated specialist tool for 'Zero-Knowledge (ZK) Rollup Calldata Compression & L2 Gas Savings' rather than generic dispatchers like omni_universal_query.
For multi-calculation chained jobs, use 'omni_batch_calculate'.
To inspect schema fields, see 'omni_describe_solver'.
BEHAVIOR & SAFETY:
Pure deterministic computation with machine floating-point precision.
Read-only, idempotent, and stateless. Zero side effects or persistent state mutations.
Input validation: All arguments are validated against physical and domain bounds. Out-of-bounds inputs return a safe diagnostic error status without throwing runtime exceptions.
RETURNS:
Structured JSON object containing:
status (string): "success" on valid execution or "error" if validation fails
calculator (string): "zk-rollup-gas-compression"
category (string): "crypto"
name (string): "Zero-Knowledge (ZK) Rollup Calldata Compression & L2 Gas Savings"
formula (string): Governing mathematical formula string
inputs (object): Echoed input parameter dictionary with applied defaults
metrics (object): Dictionary of computed outputs:
metrics.l2_transaction_cost_usd (Effective L2 Transaction Cost): Formatted display string (e.g. '$0.04 USD')
metrics.gas_reduction_pct (Gas Savings vs Ethereum Mainnet): Formatted display string (e.g. '99.4% Cheaper')
metrics.mainnet_equivalent_usd (Ethereum L1 Mainnet Cost): Formatted display string (e.g. '$6.72 USD')
metrics.data_compression_ratio (Calldata Compression Factor): Formatted display string (e.g. '4.6x Calldata Reduction')
execution_time_ms (number): Latency in milliseconds.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "omni_zk_rollup_gas_compression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| eth_spot_price | No | ETH Market Price ($). Current ETH spot price. Default: 3200. Min: 500. Max: 25000. | |
| l1_gas_price_gwei | No | Ethereum L1 Gas Price (Gwei) (Gwei). L1 base fee for settling batch proofs. Default: 30. Min: 5. Max: 300. | |
| batch_size_transactions | No | Batch Proof Aggregation Size (txs/batch). Number of transactions rolled into a single ZK SNARK/STARK proof. Default: 1200. Min: 100. Max: 10000. | |
| compressed_bytes_per_tx | No | Compressed Calldata Per Tx (Bytes) (bytes). State diff compression size (standard L1 tx = ~110 bytes). Default: 24. Min: 10. Max: 200. |