> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stablenet.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Gas Fee Policy

## Purpose and Scope

This document describes the gas fee policy of StableNet.\
StableNet applies a **modified version of Ethereum’s EIP-1559 fee mechanism** to support a stablecoin-based transaction environment.\
This document covers the dual-component fee structure (base fee and priority fee), governance-controlled gas tips, and the fee delegation mechanism.\
For information on the governance system that controls gas tips, refer to [Validator Governance (GovValidator)](/en/governance-system/5.3-validator-governance-\(govvalidator\)).\
For details on transaction types and encoding, refer to [Transaction Types and Encoding](/en/core-architecture/3.5-transaction-types-and-encoding).

## Overview

StableNet implements a modified version of Ethereum’s EIP-1559 fee mechanism, tailored for a **1:1 fiat-backed stablecoin environment**.\
The primary design goals are to minimize fee volatility, provide a predictable cost structure, and enable governance-based control.

The following key modifications are applied.

1. **No Burning of the Base Fee**\
   Unlike Ethereum, the base fee is not burned but instead distributed to validators.\
   This follows the design principle that stablecoins should only be burned at the point of fiat redemption.
2. **Governance-Controlled Priority Fee**\
   Gas tips are determined through validator governance rather than market competition.
3. **Dual-Threshold-Based Base Fee Adjustment**\
   Clear rules are defined for increasing, maintaining, or decreasing the base fee based on gas utilization ranges.
4. **Priority Allowance for Authorized Accounts**\
   Authorized (certified) accounts may specify custom priority fees.
5. **Fiat-Denominated Cost Design**\
   All gas fees are designed in terms of the base stablecoin unit (e.g., KRW).

## Fee Components

### Base Fee and Priority Fee Structure

Gas fees in StableNet consist of the following two components.

* **Base Fee**\
  The minimum fee determined by the protocol based on network congestion
* **Priority Fee (Gas Tip)**\
  An additional fee to compensate validators and determine transaction processing priority

### Transaction Fee Fields

| Field                  | Description                                   | Set By            | Applies To       |
| ---------------------- | --------------------------------------------- | ----------------- | ---------------- |
| `gasLimit`             | Maximum gas allowed for transaction execution | User              | All transactions |
| `baseFeePerGas`        | Minimum gas cost included in the block header | Protocol          | London and later |
| `maxFeePerGas`         | Maximum gas cost the user is willing to pay   | User              | DynamicFeeTx     |
| `maxPriorityFeePerGas` | Maximum priority fee                          | User / Governance | DynamicFeeTx     |
| `gasPrice`             | Fixed gas price                               | User              | LegacyTx         |

On the Anzeon chain, for **general accounts**, the `maxPriorityFeePerGas` specified in the transaction is overridden by the governance-enforced gas tip.

## Base Fee Policy

### Adjustment Mechanism

StableNet modifies the EIP-1559 base fee adjustment mechanism to be more gradual and predictable.

**Standard Ethereum**

* Target utilization: 50%
* Adjustment rate: ±12.5% per block

**StableNet Dual-Threshold System**

StableNet applies the following rules based on the parent block’s gas utilization.

1. **Gas utilization > 20%**
   * Base fee increases by 2%
   * Enters this range at approximately 1,000 or more simple transfers per block
2. **6% ≤ Gas utilization ≤ 20%**
   * Base fee remains unchanged
   * Stable network operating range
3. **Gas utilization \< 6%**
   * Base fee decreases by 2%
   * Enters this range at fewer than approximately 300 simple transfers per block

Additional constraints are as follows.

* Adjustment rate: ±2% per block
* Minimum base fee: 20,000 gwei
* Maximum base fee: 20,000,000 gwei

Protocol constant definitions:

```
IncreasingThreshold = 20
DecreasingThreshold = 6
BaseFeeChangeRate   = 2
MinBaseFee          = 20_000_000_000_000
MaxBaseFee          = 20_000_000_000_000_000
```

### Base Fee Distribution

In StableNet, the base fee is handled as follows.

1. The base fee is not burned and is distributed as rewards to all validators.
2. The priority fee is paid to the block producer.

This structure ensures that the stablecoin supply decreases only through explicit, governance-approved burn operations.

## Priority Fee (Gas Tip) Policy

### Governance-Controlled Gas Tip

In the Anzeon configuration, gas tips are determined through validator consensus via the GovValidator contract, rather than by individual users.\
This removes gas price competition and provides a predictable cost environment.

### Gas Tip Update Mechanism

The governance-controlled gas tip is updated at the following times.

**At Initialization**

```
- Retrieve the initial gasTip from the GovValidator contract
- Set it based on the current block state
- Register callbacks for future updates
```

**After Block Production**

```
- After block production completes
- Re-fetch the gasTip from the new block state
- Apply it to the worker and TxPool
```

### General Accounts vs. Authorized Accounts

**General Accounts**

* Use the fixed gas tip set by governance
* Higher user-specified tips are ignored
* Transactions below the minimum gas tip are rejected
* No execution priority competition

**Authorized Accounts**

* May specify a per-transaction gas tip
* Priority is determined based on the actual tip value
* Intended for operational and system accounts

This design provides cost stability for general users while allowing flexibility for operational accounts.

## Transaction Fee Calculation

### Effective Gas Price

For EIP-1559 transactions, the effective gas price is calculated as follows.

```
effectiveGasPrice = baseFee + effectivePriorityFee
```

In Anzeon:

```
effectivePriorityFee = min(governanceTip, maxFeePerGas - baseFee)
```

### Total Cost

```
Total Cost = (gasUsed × effectiveGasPrice) + value
```

For blob transactions (EIP-4844), additional blob gas costs apply.

## Fee Delegation

StableNet supports fee delegation through `FeeDelegateDynamicFeeTxType` (0x16).

Key characteristics:

* Dual signatures from the sender and the fee payer
* Gas costs are charged to the fee payer
* Transaction value is deducted from the sender’s balance
* The transaction hash includes both signatures

## Protocol Parameters

### Gas Fee Constants

| Constant            | Value           | Description                     |
| ------------------- | --------------- | ------------------------------- |
| IncreasingThreshold | 20              | Base fee increase threshold (%) |
| DecreasingThreshold | 6               | Base fee decrease threshold (%) |
| BaseFeeChangeRate   | 2               | Adjustment rate per block (%)   |
| MinBaseFee          | 20,000 gwei     | Minimum base fee                |
| MaxBaseFee          | 20,000,000 gwei | Maximum base fee                |

### Maximum Block Gas Limit

```
Maximum Block Gas Limit = 105_000_000
```

This is designed to process approximately 5,000 basic transfer transactions per block.

## Fee Query APIs

| API                        | Description                                 |
| -------------------------- | ------------------------------------------- |
| `eth.maxPriorityFeePerGas` | Query the governance-configured gasTip      |
| `eth.gasPrice`             | Recommended price based on baseFee + gasTip |

## Comparison with Standard Ethereum

| Aspect           | Ethereum           | StableNet             |
| ---------------- | ------------------ | --------------------- |
| Base Fee         | Burned             | Paid to validators    |
| Adjustment Model | 50% target, ±12.5% | Dual thresholds, ±2%  |
| Priority Fee     | User competition   | Governance-controlled |
| Fee Volatility   | High               | Low                   |
| Fee Delegation   | Not supported      | Supported             |
| Block Gas Limit  | \~60M              | 105M                  |
| Currency Basis   | Non-pegged         | Fiat-pegged           |
