HomeBlockchainProposal: IBC Token Ratelimit Module Implementation

Proposal: IBC Token Ratelimit Module Implementation

-

On July 31, 2024, the Terra Luna network was hit by a major attack when a hacker exploited a vulnerability in the IBC module, resulting in the theft of $4 million in assets. This breach highlights the critical need for a robust mechanism to regulate the inflow and outflow of tokens, ensuring that transactions do not surpass a predefined threshold. By implementing this control, we can safeguard the network from similar attacks in the future.

This proposal aims to introduce a rate limit mechanism that carefully monitors token inflows and outflows within a fixed threshold. The goal is to prevent sudden spikes and mitigate the risk of malicious actors executing large-scale dump transactions, thus enhancing the overall security of the network.

Proposed Solution
A sliding time window will track the tokens transferred in and out of the chain. If the amount transferred exceeds 30% compared to the previous window, transactions will be blocked until the next time window.

Benefit

Implementing the IBC Token Ratelimit Module brings multiple benefits to the Terra Luna network. First, it significantly strengthens security by mitigating the risk of large-scale exploits similar to the July 2024 incident, ensuring that no single entity can drain liquidity in a short period of time. Second, it promotes network stability by smoothing token flows and reducing sudden volatility that could harm users and dApps. Third, it increases community confidence and trust in the chain’s resilience, which is critical for long-term adoption and growth. Finally, by introducing configurable parameters, the module provides flexibility for governance to adapt thresholds as market conditions evolve, ensuring the system remains both secure and efficient.

3. IBC Ratelimit Module
Architecture:

This module will store parameters in its settings to define the maximum token inflow/outflow per time window as well as the acceptable token rate changes. Specifically, if the token inflow in a time window exceeds a defined threshold compared to the previous window, incoming transactions will be considered invalid and must wait until the next window.

The time window will be defined as a series of consecutive blocks (the number of blocks can be defined and adjusted in the module parameters). At the end of each block, the earliest block in the window will be removed, and a new block will be added.

This structure ensures that the module tracks recent transactions while maintaining enough historical data for comparisons.

The module will handle IBC packets, checking if the packet is a transfer. If it is, the inflow/outflow of tokens will be updated. If the total or percentage of token flow exceeds the defined threshold, the packet will be considered to exceed the rate limit and will be reverted. If there are no transactions in the previous window, the module will compare the current transactions to a fixed base value (which can also be adjusted in the parameters).

State Structure:

  1. To implement the rate limit with tokens, a proposal is needed to set the rate limit parameters.
type TokenRatelimitSpecs struct {
    Denom                 string 
    Channel               []string
}
  1. For each IBC token, the module will maintain a state called Ratelimit in a key-value store:
type Ratelimit struct {
    prev_in          math.Int // Total tokens transferred in the previous time window
    prev_out         math.Int // Total tokens transferred out in the previous time window
    current_in       math.Int // Total tokens transferred in the current time window
    current_out      math.Int // Total tokens transferred out in the current time window
}

Additionally, the module will have specific parameters such as:
Param – Type : Value
Example
WindowSize – uint64: 10

MaxPercentSend- math.LegacyDec: “0.15”

MaxPercentRecv- math.LegacyDec: “0.15”

This proposal is intended to gauge community interest and gather feedback on the concept. If the community supports it, we (BLV Labs) will submit a follow-up technical proposal detailing the implementa

Lunc Daily
Lunc Dailyhttps://luncdaily.com
Your trusted source for Terra Classic (LUNC) news, blockchain updates, and market insights. Powered by Orbit Wire Ecosystem

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

LATEST POSTS

Did You Know: 416.75 Billion LUNC Burned Since May 2022

Since May 13, 2022, the Luna Classic (LUNC) community has relentlessly pushed for token burns to reduce supply and strengthen its ecosystem. Over this period,...

Luna Classic Hosts a Full Suite of Global Stablecoins – Here’s What You Need to Know

The Luna Classic blockchain is home to one of the most diverse stablecoin ecosystems in the crypto space. These stablecoins are pegged to major world...

The Truth About Proof of Stake on Luna Classic That Every Investor Should Know

The Terra Classic blockchain runs on a Proof of Stake (PoS) consensus mechanism, which determines how transactions are validated and how the network stays secure....

Did you know? The court once ordered Terra Form Labs (TFL) to burn tokens from its own wallets during the Terra Classic crash case

In the Terra Classic crash case, the court issued an order directing Terra Form Labs (TFL) to burn the assets stored in its wallets. In...

https://luncdaily.com/wp-
content/uploads/2025/08/IMG_3245.webp

Most Popular