Aleph Zero Blog
Business

Fundamentals: Why Are Dynamic Fee Adjustments Important?

Apr 23, 2022

Maybe you have wondered why blockchains employ mechanisms that introduce dynamic fee adjustments instead of fixed rates? The simple answer to this question revolves around dealing with limited resources. Continue reading to find out Aleph Zero’s scoop on this practice. 

Dynamic fee adjustment practices have been the norm for years across several industries. Anyone who has tried to order a ride service through one of the many popular apps providing such solutions may observe that a ride may be priced differently depending on the time of day. Or you may have wanted to book that trip to Rome only to find out that the flight is more expensive in July than, say, September. These fluctuations have to do with the bedrock of all economic activity, the rules of supply and demand. In a world of finite resources, an increase in demand will generally lead to higher prices being incurred. 

The world of blockchain also abides by these rules, with the limited resources being storage and computational power. Transaction fees safeguard individual users from consuming too many of these resources and serve as anti-spam mechanisms. Aleph Zero also adopted such tools, which strive to level the playing field among Aleph Zero’s diverse group of users. 

Aleph Zero’s Approach Towards Dynamic Fee Adjustment 

Due to Aleph Zero’s connections to the Polkadot ecosystem and the significant influence of the Substrate framework, we’ve opted to adopt the solutions already pioneered by those that came before us. Historically, most of these solutions originated with Ethereum and became the foundation upon which subsequent projects developed. We’ve come to understand dynamic fee adjustment as a solution that should tackle two problems simultaneously. Firstly, it should serve as an organizational tool for the blockchain’s activity during times of peak traffic. Secondly, it should reflect the long-term development and growth of the network, providing adequate fees as we observe more user participation. 

Additionally, a tipping option permits users to prioritize their transactions when speed is of the essence.  After much deliberation, the team behind Aleph Zero opted to incorporate rapid price hikes as an anti-spam mechanism so that no single user eats up too many resources. For example, within 20 blocks, the transaction fees can be either doubled or halved depending on network congestion. We’ve also considered adding a warning in our custom wallet to notify users when transaction fees are higher than average.   

The Building Blocks of Dynamic Fee Adjustment 

The following four elements compose the basic fee adjustment mechanism. The dynamic adjustment mechanism depends on these elements. The foundational components of the adjustment mechanism are respectively:

  1. The base fee is the minimum amount a user must pay to complete a transaction. The cost of this ingredient is constant.
  2. The weight fee reflects the time (input, output, and computation) that a transaction needs for execution. 
  3. The length fee represents the size (the number of bytes) of the transaction. 
  4. The tip (an optional choice) allows users to financially incentivize validators to confirm their transactions quicker. 

The first three elements in this list comprise the inclusion fee and constitute the minimum amount required to complete a transaction. The weight fee and length fee are the facets of the equation that are subject to change. Weight and length fees increase the more resources we require. We’ll explain the ways through which weights evolve in the following section. 

Understanding Weights and Their Significance  

Weights are the tool through which we determine the time it takes to validate a block. This comes as a result of the limits put in place on storage and the required computational power. Due to these limitations, there is a threshold beyond which a block’s weight cannot expand. Substrate defines one unit of weight as one picosecond of execution time. The following equation explains this concept as 1012 weight = 1 second, or 1,000 weight = 1 nanosecond. The reference hardware is an Intel Core i7-7700K CPU with 64GB of RAM and an NVMe SSD. Another benefit of the weight system, besides affecting how fees get adjusted, is that they prevent a block from being filled with transactions that waste too much time to get executed.

The influence of weights on the price of transaction fees can be easily observed in how they impact the inclusion fee. The inclusion fee is the minimum amount of funds that must be available for a transaction to be included in a block. The inclusion fee is calculated by combining the base and the cost required to handle the weight and length.

What Happens to a Transaction if Your Account Balance Is Too Low? 

If your account doesn’t have sufficient funds to pay the inclusion fee, you will not be able to submit the transaction. Fortunately, users can take advantage of a function in the wallet that allows them to calculate the variations in price based on the number of transactions handled by each block. If the block has fewer transactions than the targeted block saturation, the price will diminish by a minute amount. If a block is subject to more transactions, the fees will be accordingly priced higher. However, there is a minimum below which we will never drop; even in the event of a period when all the blocks are empty, the fees will remain stable and will never reach zero. 

Dynamic Adjustment Fees Feed the Treasury

In order to work effectively, a blockchain ecosystem needs to ensure its liquidity. Unless decentralized governance decides otherwise, these funds are then used to maintain the network and incentivize developers. A healthy treasury is kept in two ways, by either receiving a portion of the freshly minted new tokens, which leads to inflation, or by profiting from transaction fees and slashing. Aleph Zero will be subject to an inflation rate of 30M tokens per year.  This mimics the way in which governments strive to ensure liquidity. We can imagine the profits made from transactions and slashing akin to those made through taxation and fines.

In an interesting twist, Aleph Zero decided to burn slashed funds rather than channel them to the treasury. We made this choice in order to disincentivize treasury authorities from enacting slashing indiscriminately. As of writing, only examples of obviously malicious behavior will be slashable, and no fully-automatic slashing will take place. Instead, every offense marked as slashable will have to undergo the approval first of the foundation and later, the decentralized governance (after it’s introduced).

Tokens collected from transaction fees will be repurposed as it allows the network to mint fewer coins and therefore have better control over inflation. 

Industry Solutions to Solve the Problem of Finite Resources 

It’s already been several years since the blockchain industry adopted dynamic fee adjustment practices, the most notable example of this being Ethereum’s gas fees. For better and for worst, these solutions were necessary to ensure the economic viability of blockchain systems. We must also observe differences between fee adjustments that impact chain traffic and are independent of the individual transactions and those that touch upon smart contracts. The fees that influence smart contract execution are dynamic and are measured on-the-fly as you cannot tell how much time it will take to complete the process. 

Although nobody argues against the necessity of dynamic transaction fees, there remains a heated debate on the way these practices are implemented. Ethereum is at the center of these discussions. Almost everyone who does business on their blockchain can find something to criticize regarding how absurdly high gas prices are calculated. This state of affairs is partly the fault of the prescribed formula that calculates Ethereum’s gas fees, but it is also important to note that gas fees went up because the price of Ethereum appreciated. One might say that Ethereum is simply the victim of its own success. 

The Price of Popularity 

Currently, there are over 3,000 decentralized applications running on Ethereum, which collect over 100,000 daily users who execute over 250,000 transactions per day. The popularity of the network resulted in the base fees for a transaction increasing. One of the fixes Ethereum aims to implement, which will hopefully introduce more reasonably priced transactions, involves moving from a proof-of-work (PoW) consensus protocol to a proof-of-stake (PoS) algorithm. PoS networks generally are faster and do not require miners to validate transactions, thus removing two roadblocks that led to Ethereum’s high gas prices. 

Dynamic Fee Adjustment Is Here to Stay 

As long as we live in a world of finite resources, dynamic fee adjustments will be unavoidable. They create the financial incentives for providing services and guarantee the further development of the project in question. All we can hope to achieve is a formula that will permit users of all financial backgrounds to participate in the Aleph Zero ecosystem. 

Related articles