Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions src/pages/protocol/tips/tip-1010.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
id: TIP-1010
title: Mainnet Gas Parameters
description: Initial gas parameters for Tempo mainnet launch including base fee pricing, payment lane capacity, and transaction gas limits.
authors: Dankrad Feist
status: Draft
related: TIP-1000, Payment Lane Specification
protocolVersion: Mainnet Launch
---

# TIP-1010: Mainnet Gas Parameters

## Abstract

This TIP specifies the initial gas parameters for Tempo mainnet, including base fee pricing, payment lane capacity, and main transaction gas limits. These parameters are calibrated to support Tempo's target of approximately 20,000 TPS for payment transactions while maintaining economically sustainable fee levels.

## Motivation

Tempo is designed as a high-throughput blockchain optimized for stablecoin payments. To achieve this, the gas parameters must be carefully calibrated to:

1. **Enable high throughput**: Support ~20,000 TPS for payment transactions
2. **Maintain low fees**: Target 0.1 cent per standard TIP-20 transfer
3. **Prevent spam**: Ensure fees are high enough to deter abuse
4. **Balance capacity**: Allocate appropriate gas limits between payment lane and general transactions

The parameters defined in this TIP represent the initial mainnet configuration and may be adjusted through future governance processes.

---

# Specification

## Base Fee

**Value**: `2 × 10^10` wei (20 gwei)

**Rationale**:
- A standard TIP-20 transfer costs approximately 50,000 gas
- At 20 gwei base fee: `50,000 × 20 × 10^9 = 10^15 wei = 0.001 USD` (assuming 1 ETH = $1000 for unit conversion reference)
- This targets approximately **0.1 cent per TIP-20 transfer**

**Note**: The base fee may fluctuate based on network demand through the existing EIP-1559-style mechanism. This value represents the target equilibrium base fee.

## Payment Lane Gas Limit

**Value**: 500,000,000 gas per block

**Rationale**:
- At 50,000 gas per TIP-20 transfer: `500,000,000 / 50,000 = 10,000 transfers per block`
- With 500ms block time: `10,000 × 2 = 20,000 TPS` for payment transactions
- This capacity supports Tempo's target throughput for payment use cases

**Constraints**:
- Only transactions qualifying for the payment lane (simple TIP-20 transfers, memos, etc.) consume this gas limit
- Complex contract interactions use the general gas limit instead

## Main Transaction Gas Limit

**Value**: 30,000,000 gas per block (`general_gas_limit`)

**Rationale**:
- Aligned with the transaction gas cap to ensure maximum-sized contract deployments can be included in a block
- Supports general smart contract interactions beyond simple payments
- Provides capacity for:
- Contract deployments (including max 24KB contracts)
- DEX swaps
- Complex multi-step transactions
- Other non-payment use cases

:::warning
**Transactions exceeding 16,000,000 gas are not recommended.** The elevated gas limits (30M) exist solely to accommodate maximum-sized contract deployments under TIP-1000 state creation costs. Applications should not rely on transactions consuming more than 16M gas for normal operations. When storage pricing is moved to a separate mechanism (e.g., storage rent or state expiry), the transaction gas cap is expected to return to 16,000,000 gas.
:::

## Transaction Gas Cap

**Value**: 30,000,000 gas per transaction

**Rationale**:
- Increased from the previous 16,000,000 gas limit
- Accommodates deployment of maximum-size contracts (24,576 bytes per EIP-170) under TIP-1000 state creation costs:
- Base transaction cost: 21,000 gas
- Calldata for initcode (up to 49,152 bytes per EIP-3860): ~500,000-800,000 gas
- CREATE base cost (TIP-1000, includes keccak/codesize fields): 500,000 gas (replaces old 32,000)
- Initcode execution: variable (~3,000 gas minimum)
- Contract code storage (TIP-1000): `24,576 bytes × 1,000 gas/byte = 24,576,000 gas`
- Account creation (TIP-1000): 250,000 gas
- **Total**: ~25,850,000-26,150,000 gas (fits within 30M limit)

## Gas Schedule Summary

| Parameter | Value | Purpose |
|-----------|-------|---------|
| Base fee | `2 × 10^10` wei (20 gwei) | Target 0.1 cent per TIP-20 transfer |
| Payment lane gas limit | 500,000,000 gas/block | Support ~20,000 TPS for payments |
| General gas limit | 30,000,000 gas/block | General contract interactions |
| Transaction gas cap | 30,000,000 gas | Allow max-size contract deployment |

## Economic Analysis

### Fee Revenue Projections

At full payment lane utilization:
- 10,000 transfers per block × 50,000 gas × 20 gwei = 10^16 wei per block
- At 2 blocks/second: 2 × 10^16 wei/second = ~$0.02/second (at reference pricing)
- Daily: ~$1,728 in base fees from payment lane alone

### Cost Per Operation

| Operation | Gas Cost | USD Cost (at target base fee) |
|-----------|----------|-------------------------------|
| TIP-20 transfer (existing recipient) | 50,000 | $0.001 (0.1 cent) |
| TIP-20 transfer (new recipient) | 300,000 | $0.006 (0.6 cent) |
| First transaction from new account | 300,000 | $0.006 (0.6 cent) |
| Small contract deployment (1KB) | ~1,800,000 | $0.036 (3.6 cents) |
| Max contract deployment (24,576 bytes) | ~26,200,000 | $0.524 (~52 cents) |

---

# Invariants

1. **Base Fee Floor**: The base fee MUST NOT fall below a minimum threshold that would enable economically viable spam attacks.

2. **Payment Lane Priority**: Transactions qualifying for the payment lane MUST be able to consume up to the full payment lane gas limit, independent of general transaction demand.

3. **Gas Limit Separation**: The payment lane gas limit and general gas limit MUST be tracked and enforced separately.

4. **Transaction Gas Cap**: No single transaction MUST be allowed to consume more than the transaction gas cap (30,000,000 gas).

5. **Block Gas Validity**: A block MUST be invalid if either:
- Payment lane transactions exceed the payment lane gas limit
- General transactions exceed the general gas limit

## Implementation Notes

These parameters are configured at the chainspec level and applied during block validation. Future adjustments may be made through:

1. Hard fork upgrades (for significant changes)
2. Governance proposals (if on-chain governance is implemented)
3. Emergency response procedures (for critical security issues)

## Test Cases

1. **Base fee targeting**: Verify that at equilibrium, TIP-20 transfers cost approximately 0.1 cent
2. **Payment lane capacity**: Verify that 10,000 TIP-20 transfers can be included in a single block
3. **General gas limit**: Verify that general transactions are correctly bounded by the 25M gas limit
4. **Transaction gas cap**: Verify that transactions exceeding 30M gas are rejected
5. **Contract deployment**: Verify that a 24KB contract can be deployed within the transaction gas cap
6. **Lane separation**: Verify that payment lane and general transactions are independently tracked