Off-chain Security

In the world of blockchain delegation, the act of voting for a validator entails more than a mere endorsement—it fundamentally alters the aggregate delegated sum. Consequently, it intricately adjusts the distribution of shares among all delegators, rendering share computation a complex endeavor that necessitates dynamic recalibration for every reward apportionment cycle. Such a dynamic process can incur substantial computational costs, particularly given our commitment to executing staking and reward distribution entirely on-chain. To streamline these computations within smart contracts, we adopt an epoch-based approach.

An epoch, delineated by a span encompassing N blocks, serves as the foundational unit of our staking protocol. While theoretically an epoch could comprise a solitary block, such a configuration would impose considerable storage burdens without commensurate benefits. To circumvent this potential inefficiency, we diligently seek an epoch length that strikes an optimal balance.

The optimal epoch length is pivotal, as deviating from it could inflate the transaction costs associated with claiming rewards while concurrently optimizing on-chain computations. Fundamentally, delegators are tasked with computing their rewards for each epoch at the point of claiming. Hence, identifying the optimal epoch length assumes paramount importance for both validators and delegators alike. After serious tests and calculations, we have adopted an epoch duration of one day—an interval deemed optimal for all parties involved, devoid of significant storage overhead or gas consumption concerns. With a one-day epoch, each user expends a modest 1.7 million gas units annually, offering ample time, approximately 40-50 years, for delegators to claim their rewards before they risk becoming unclaimable.

Divergent blockchain ecosystems tackle this temporal challenge through varying mechanisms. Some opt to extinguish all unclaimed rewards after a specified duration, typically one to two weeks. However, eschewing such punitive measures and aiming to mitigate the gas costs associated with reward claiming, we introduce an optimized staking paradigm: the StakingPool.

The StakingPool paradigm offers a departure from conventional delegation by providing a distinct staking model where users acquire a stake in a shared pool, rather than directly delegating tokens to individual validators. Rewards accrued by validators are subsequently distributed among delegators based on their share in the pool. By pooling resources within a shared infrastructure, the average cost of reward-claiming transactions is distributed equitably among all participants.

Crucially, the differentiation between direct staking and the StakingPool lies in the computational intricacies. Staking pool computations, while effective, may generate marginal discrepancies due to numerical rounding, potentially leading to residual amounts ("dust") in staking. Furthermore, staking pools may not be optimized for substantial staking amounts. Consequently, for significant stake holdings, direct staking remains preferable, while the StakingPool presents an attractive option for smaller staking amounts, ensuring an efficient and equitable staking experience for all stakeholders.