Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ACP-103 proposes dynamic fees for Avalanche's P-Chain. Fees rise when the network is busy and fall when demand subsides.
This article translates, summarizes, and expands on the proposal below.
I also write about other EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.
Overview
ACP-103 introduces a dynamic fee mechanism for Avalanche's P-Chain, which handles platform operations such as creating subnets, registering validators, and staking. Transaction fee rates adjust according to demand for network resources. The design also lays the foundations for separately pricing compute, storage, and bandwidth in the future.
The EVM-compatible C-Chain adopted a similar mechanism with Apricot Phase 3. When demand surges, higher costs discourage usage. As demand falls, lower prices encourage it again, moving the cost of execution and inclusion toward the price at which supply and demand balance.
At the proposal's baseline, the P-Chain charged fixed fees regardless of network conditions. ACP-77, part of the Reinventing Subnets changes, was expected to increase load. ACP-103 proposes dynamic fees to help the P-Chain handle congestion and discourage spam and denial of service. The X-Chain, which issues and transfers assets, had lower usage and no planned new functionality. The proposal leaves dynamic fees for the X-Chain to a later ACP to avoid extra complexity.
Motivation
Blockchains have finite compute, storage, and network bandwidth. Users pay for executing transactions and getting them included in blocks. The fee mechanism should signal how demand for those resources compares with node capacity and should discourage spam and denial-of-service attacks.
Fixed fees are straightforward and predictable, but they cannot reflect congestion or resource constraints. Senders have little incentive to wait during a demand spike because the price stays the same. Transactions can therefore accumulate while the fee remains below the market-clearing price, harming network performance and the user experience through delays and failures.
The C-Chain adopted dynamic pricing with Apricot Phase 3. The rate goes up when demand is high and falls when demand is low. If the rate rises too far, activity subsides, which in turn lowers the rate. This feedback can bring transaction execution and inclusion costs closer to market equilibrium.
The P-Chain's fixed fee model could struggle with temporary peaks caused by ACP-77's subnet improvements and expansion. As the chain manages validator and subnet lifecycles, congestion there affects the wider ecosystem. Fees that respond to demand can add a price-based deterrent against spam and denial of service and improve resilience during peak load.
Dynamic fees on the less heavily used X-Chain would add implementation and operational complexity despite no planned new features at the time. ACP-103 prioritizes the P-Chain and leaves X-Chain adoption for a later proposal.
ACP-103 also sets the stage for multidimensional pricing. Instead of charging a single gas price, such a system would adjust rates for compute, storage, and bandwidth independently. The proposal starts with a one-dimensional dynamic mechanism for the P-Chain and leaves a multidimensional extension for later, once its costs and benefits can be evaluated.
Fixed and dynamic fees compared
| Aspect | Fixed fees (baseline P-Chain and X-Chain) | Dynamic fees (used on C-Chain and proposed for P-Chain) |
|---|---|---|
| Price changes | Constant regardless of demand | Automatically rise or fall with demand |
| Congestion | Little incentive to defer transactions, so backlogs persist | A higher price reduces demand and eases congestion |
| Spam and denial-of-service resistance | Limited price deterrent | Rising prices discourage excess usage |
| Market equilibrium price | Can diverge from equilibrium | Tends to move toward equilibrium |
| Implementation and operating complexity | Low | Requires adjustment logic already used on the C-Chain |
| Future multidimensional pricing | Has no direct path to resource-specific pricing | Can extend to resource-specific pricing in stages |
Terms
- P-Chain The Avalanche chain for platform operations such as creating subnets, managing validators, and staking.
- C-Chain The EVM-compatible smart contract chain. It introduced dynamic fees with Apricot Phase 3.
- X-Chain The chain primarily used to issue and transfer assets. It used fixed fees at the proposal's baseline, with dynamic fees deferred.
- Market equilibrium price The price at which supply and demand balance. Fees closer to that level can allocate network resources more efficiently.
- Multidimensional fees Pricing each resource type separately. The proposal starts with one dynamic price and leaves resource-specific pricing for a later stage.
Specification
ACP-103 defines dynamic fees and how quickly transactions can consume P-Chain resources. The current fee calculation combines resource usage into a single gas measure, while the design leaves room for separate metering by resource.
A token bucket controls sudden bursts of resource use. Its tokens represent how much gas is available to spend and replenish at a fixed rate. The bucket balance limits the gas each block can use. A block that exceeds that amount is invalid.
Gas dimensions and consumption
Transaction gas on the P-Chain represents the resources a transaction uses for processing, data operations, and communication. The gas cost is based on four resource dimensions.
| Symbol | Dimension | Meaning | Unit |
|---|---|---|---|
| Bandwidth | Network bandwidth used to broadcast the transaction | Transaction size in bytes | |
| Reads | State or database reads during execution | Integer count | |
| Writes | State or database writes during execution | Integer count | |
| Compute | CPU time for verification and execution | Microseconds, each one millionth of a second |
The four dimensions combine into one gas value.
- Each read or write costs
1000gas,1microsecond of compute costs4gas, and1byte of transaction data costs1gas. - A future ACP can extend the mechanism to price each dimension separately according to its consumption.
Fee adjustment
The objective is to maintain a target gas consumption rate of per second. Gas prices rise when usage exceeds the target and fall when it stays below, helping average consumption approach gas per second.
Excess gas consumption and its initial value
- Before activation, initialize the value as follows.
- When building or executing block , decrease the value by the amount corresponding to the elapsed seconds .
Here, $\Delta t$ is the timestamp difference in seconds between block $b$ and its parent. Subtract the amount implied by the target consumption rate $T$ and clamp negative results to `0`.Gas price for block
The gas price for block is an exponential function with a minimum price .
- The minimum gas price. Gas cannot cost less than this amount.
- The constant controlling how quickly gas prices change. If excess gas rises by , the price increases by a factor of approximately . A larger makes increases more gradual and a smaller makes them more sensitive to excess gas.
- The exponential function. To reduce computational work, implementations approximate it with a Taylor series as specified in EIP-4844 and illustrated below.
See the following article for more on EIP-4844.
[EIP-4844] How Shard Blob Transactions work
# EIP-4844 流儀の近似: factor * e ** (numerator / denominator)
def fake_exponential(factor: int, numerator: int, denominator: int) -> int:
i = 1
output = 0
numerator_accum = factor * denominator
while numerator_accum > 0:
output += numerator_accum
numerator_accum = (numerator_accum * numerator) // (denominator * i)
i += 1
return output // denominatorUpdating after processing a block
When processing block finishes, its actual combined gas consumption is known. Add it to .
A block that consumes a large amount of gas increases and raises the gas price exponentially starting with the following block. Higher fees discourage transactions and reduce average consumption. As time passes, reduces and prices gradually decline. This adjustment keeps average gas consumption near the target .
Rate control with a token bucket
The token bucket permits consumption only when enough tokens are available. Here, the tokens represent available gas. The capacity limits bursts and the refill rate determines sustained throughput.
- Before activation, initialize the value as follows.
is the current amount of gas in the bucket.
- When processing block begins, refill the bucket according to the time since the parent block.
- After processing block , its actual gas usage is known.
If this comparison is true, the block is invalid.
For a valid block, subtract the gas consumed.
The mechanism needs no separate block gas-limit parameter. The available amount is determined by the starting , replenishment of , and the cap in the refill formula. The Japanese article gives as an upper bound before applying the cap. The usable balance after refill is at most .
Initial parameters at activation
| Parameter | P-Chain setting |
|---|---|
| (target gas per second) | 50,000 |
| (minimum gas price) | 1 nAVAX |
| (price adjustment constant) | 2,164,043 |
| (bucket capacity) | 1,000,000 |
| (gas refilled per second) | 100,000 |
is chosen so that the gas price approximately doubles every 30 seconds at sustained capacity ( gas per second). At that rate, net excess gas grows by per second. Over 30 seconds it therefore grows by about , which doubles the exponential price. The Japanese article's parenthetical example uses the gross rate of 100,000 without subtracting the target and describes an -fold increase when reaches . The doubling calculation uses the net rate.
These parameters can be adjusted to allow higher gas consumption rates if the network's processing capacity increases.
Why use an exponential function?
Gas pricing should change by the same percentage whether the starting rate is high or low. A linear function cannot provide that property.
Linear adjustment example
Let be the current gas price and the excess gas. If and , then , an increase of 10%. If and , then , an increase of just 0.1%. With a linear adjustment, the same absolute change has less impact when the price is already high.
Exponential adjustment example
When and , , an increase of about 171%. When and , , again an increase of about 171%. An exponential adjustment changes the price by the same percentage regardless of its current level. ACP-103 uses for this reason.
Block construction
The AVAX a P-Chain transaction burns and the gas it consumes determine the maximum gas price it can pay. A priority queue replaces the first-in, first-out mempool. Transactions with higher maximum rates are selected first, so bid price determines the order of inclusion.
- Determine how much AVAX the transaction burns. Compute , where inputs and outputs are the transaction's total AVAX input and output amounts. The Japanese article reverses these operands.
- Calculate the transaction's total gas . The equation yields the same value on every node for identical inputs.
- Calculate the maximum payable gas price. The numerator in the formula below is the amount burned.
- Order the mempool by descending maxGasPricePerTx. The priority queue makes transactions that pay the higher rates available first during block construction. It replaces the previous FIFO queue.
Example block processing pseudocode
This pseudocode summarizes the specification. The code comments retain their original Japanese wording.
state x = 0 # 超過ガス消費
state r = 0 # バケット内ガス量
on begin_block(b):
Δt = timestamp(b) - timestamp(parent(b))
x = max(x - T * Δt, 0)
r = min(r + R * Δt, C)
price = M * exp_approx(x / K)
# メンプールから price を支払える Tx を maxGasPrice 降順で詰める
G_block = 0
for tx in mempool.sorted_by_maxGasPrice_desc():
if G_block + G(tx) > r:
break # これ以上は不正(超過)になる
include(tx)
G_block += G(tx)
if G_block > r:
reject_block_as_invalid()
on end_block(b):
r = r - G_block
x = x + G_blockCompatibility
Changing the fee mechanism changes consensus rules and requires a mandatory network upgrade. Node operators who do not upgrade can no longer participate in network consensus.
Implementations must continue using the fixed fee rules until the activation condition is met. Applying the new behavior early can make nodes disagree about results and split the chain.
After activation, all P-Chain transactions must follow the dynamic fee mechanism. If congestion raises the fee and a user wants earlier inclusion, they can reconstruct the transaction with a higher fee. Setting the transaction's maximum payable gas price sufficiently above the current rate gives it higher priority in the mempool.
Reference implementation
AvalancheGo implements ACP-103 behind the Etna upgrade flag. An upgrade flag switches behavior once a designated block height or time is reached. It lets nodes continue using the earlier rules until the activation condition is met, then transition together.
The AvalancheGo pull requests labeled acp103 document the implementation and review history. They cover the exponential approximation for gas pricing, token-bucket gas limits, and the move to a priority queue for the mempool. The label provides a way to follow those changes in order.
The following pseudocode illustrates the change in behavior at activation.
if now < activation_point("Etna"):
# 従来の固定手数料ルールを適用
gas_price = fixed_price
else:
# 新しい動的手数料ルールを適用
x = max(x - T * Δt, 0)
gas_price = M * exp_approx(x / K)
r = min(r + R * Δt, C)
validate_tx_with_priority(tx, gas_price, r)Security considerations
At the proposal's baseline, the P-Chain and X-Chain both used fixed fees. Constant prices offer no additional deterrent against spam or denial-of-service attacks when transaction volume suddenly spikes or new functionality creates extra demand. Transactions can accumulate and overall processing can slow.
The P-Chain supports foundational operations such as subnet creation and validator management, so delays can affect the wider Avalanche network. For example, ACP-77's subnet changes could temporarily increase P-Chain demand. Dynamic fees respond to loads above processing capacity with higher prices and give users an incentive to adjust when they submit transactions. This helps bring additional load within capacity and preserve network availability.
The proposal assessed the risk of X-Chain congestion as low because utilization was low and no new features were planned. It therefore deferred dynamic fees for the X-Chain while laying the groundwork to apply the mechanism if the need arises.
Conclusion
ACP-103 introduces a dynamic transaction fee mechanism for Avalanche's P-Chain. Fees rise as congestion increases and fall when demand subsides.
Send questions via Twitter DM.
Find more of my work here.


