Dear RIF on Chain community members,
As a dedicated contributor to the Rootstock ecosystem representing IOV Labs, I am pleased to put forth a proposal designed to enhance the security of the Rif on Chain protocol while also reinstating the minting operations for the RDOC stablecoin.
As you know the RoC protocol was recently frozen as a temporary measure to mitigate the impact caused by a price manipulation attack. Subsequently, you gave your valuable support to disable RDOC minting allowing the protocol to be safely unfrozen with fully enabled redeem operations.
In this proposal, we are excited to introduce an enhancement designed not only to fully reinstate all operations within the RIF on Chain protocol but also to fortify its overall stability. We would also like to propose enabling the RDOC minting operations to make the RoC protocol fully operational again.
Introducing the Flux Capacitor, a rate-limiting solution designed to safeguard against potential price manipulation attacks by imposing restrictions on trade amounts. The name ‘Flux Capacitor’ was chosen due to its conceptual similarity to an electric capacitor. We call it ‘Flux’ because it sounds cooler.
Much like its electronic counterpart, a capacitor, which stores electric charge and releases it to ensure voltage stability and operational efficiency, the Flux Capacitor operates on a similar principle within the RoC protocol. When there is a high demand on the protocol or high notional operations, the Flux Capacitor will fill in and when time passes and activity reduces, it will release rate limits avoiding any abnormal activity.
The Flux Capacitor functionality is based on the following two concepts:
- Maximum Transaction Value: involves setting a maximum transaction value for a specified number of consecutive blocks.
- Detection of Opposite Minting-Redeeming Patterns: this concept centers around identifying and preventing patterns of consecutive opposite minting and redeeming transactions. This measure is intended to prevent the misuse of these transactions in a price manipulation event.
The Flux Capacitor mechanics incorporate the following Implementation Components:
-
Absolute Accumulator (AA): this component tracks the absolute value of both minting and redeeming transactions working with the Pseudo-Lineal Decay Factor. Both types of transactions contribute to the cumulative value held in the AA.
-
Differential Accumulator (DA): in contrast, the DA records the signed value of minting and redeeming transactions working with the Pseudo-Lineal Decay Factor. Minting transactions add to the cumulative value, while redeeming transactions subtract from it.
-
Block Number of the Last Accepted Transaction (BNLAT): retains the block number of the most recent transaction. It’s continually updated with each new transaction.
We need to add new Parameters:
-
Absolute Maximum Transaction Allowed (AMTA): maximum limit allowed for the absolute accumulator (AA). If the amount of reserve token intended to operate reaches the AA limit, then the transaction will revert.
-
Maximum Operational Difference Allowed (MODA): maximum limit allowed for operational difference (OD = AA - |DA|). If the amount of reserve token intended to operate reaches the OD limit, then the transaction will revert.
-
Decay Block Span (BS): is the number of blocks that have to elapse for both accumulators to be 0 again.
And finally, here is the Pseudo-Lineal Decay Factor, the Formula to update both accumulators on each operation:
- LDF = (-n / BS) + 1
if LDF <0 → LDF =0 - AA’ = (AA * LDF) + amountToOperate
- DA’ = (DA * LDF) +/- amountToOperate (+ for mint ; - for redeem)
This development marks a significant milestone paving the way for an enhanced level of autonomy and security. With the Flux Capacitor enhancement in place, we believe that the RDOC minting operations should be enabled and users will be able to mint RDOC stablecoin again.
We invite all community members to participate in the vote on this proposal for the RIF on Chain protocol. And we eagerly await your valuable feedback and support.
Daniel Fogg
(With support from the brilliant IOV Labs team)