The OWL Staking Protocol

Leon
stealthswap
Published in
5 min readOct 19, 2020

StealthSwap is a privacy preserving payments protocol on Ethereum. Part of this protocol is the staking distribution algorithm. The algorithm StealthSwap will be implementing is the Dynamic Staking Algorithm (DSA).

This distribution contract will distribute 0.4214963119 OWL per Ethereum block mined. There are approximately 6500 Ethereum blocks mined per day, meaning there will be 2739.7260 OWL distributed per day. This brings us to a distribution model of 1 million OWL distributed per year over 4 years.

During the initial 4 year distribution period, the staking contract will collect fees from StealthPay. Every week after the staking contract launches, these fees will be distributed to users. The reward earned will be based on the same staking reward calculation described below.

Interact with the Staking Dashboard at https://staking.stealthswap.org
The staking dashboard will be operational on Oct 19th at 22:00 UTC

Technicals

Multiple custodial and non-custodial staking solutions exist with their advantages and inconveniences. Every method can be susceptible to hacks or exploits; however, custodial solutions represent a higher risk. Rather than users being in control of their assets, a small group or a single entity is in charge, exposing all assets to a higher attack surface.The main inconvenience of non-custodial solutions, such as autonomous smart-contracts, is the trade-off between gas consumption and the reward algorithm. Knowing that EVM is a state machine, implementing such algorithms will require saving every action done by a user (without using any array to optimize gas consumption) while taking into account other users actions to solve one of the major inconveniences of smart contract staking algorithms. Please note that from here on we assume that the staking purpose is to generate rewards for the users. Others can exist, but for the sake of simplicity we will use the most common ones (reward or dividend). The biggest challenge to overcome is that user’s actions are dependent to one another. Meaning that if User A, adds to his stake or withdraws, the reward of User B will be affected. The main goal is to achieve a linear reward computation for each user as demonstrated in equation

The goal of this use case implementation of DSA is to achieve a reward distribution by block; where a reward is distributed every block between stakers following their stake value. It can be seen as a monetary policy that requires users to stake if they want to get part of the rewarded tokens — RideSolo

Sample Reward Distribution

Essentially, rewards are distributed on a per block basis. Rewards are calculated by measuring a users staked balance against the total staked balance of all users. Therefore, users who stake more OWL are entitled to a larger portion of the block reward, and vice versa. This is the same for the StealthPay fee distribution.

Read more about DSA here: https://github.com/RideSolo/staking-library/blob/master/doc/dsa.pdf

Staking Dashboard

Visit the Staking Dashboard here: https://staking.stealthswap.org

The OWL Staking dashboard is where users will go to interact with the OWL Staking algorithm. Users will be able to deposit an amount of tokens that are less than or equal to their OWL balance. Once a user stakes a certain amount of OWL, they can withdraw that OWL at any time. Additionally, a user can claim their rewards at any time.

Staking Instructions

Step 1: Connect web3 provider

In order to connect to the OWL Staking Dashboard you must be using a web3 provider such as MetaMask or WalletConnect. Once you visit the staking website you will be shown this screen. Click on your provider of choice.

Once you connect via a web3 provider you should see your address in the upper right hand corner of the dashboard.

Staking OWL

Enter the amount of OWL you want to stake in the “Deposit OWL” section of the dashboard.

Click on the “Deposit” button. You will be prompted to confirm two transactions. The first transaction allows the tokens to be sent from the user account to the staking contract. The second transaction deposits the stake to the contract.

Click confirm on the first transaction

Click confirm on the second transaction

You are now staking OWL. Refresh the staking dashboard in order to see an updated Staked Balance value.

Claiming Rewards

Click on the “Claim Rewards” button. You will be prompted to confirm one transaction. This transaction will call the contract’s claim function which distributes the user their OWL rewards. Click confirm on this transaction.

You will now be distributed all of your OWL rewards.

Withdrawing Stake

Enter the amount of your staked balance that you want to withdraw in the “Withdraw Stake” section of the dashboard.

Click on the “Withdraw” button. You will be prompted to confirm one transaction. This transaction will call the contract’s withdraw function which sends the user their staked OWL. Click confirm on this transaction.

Your staked OWL will now be sent to your address.

Conclusion

We hope this blog post has enabled you to successfully participate in the OWL staking distribution protocol. If you still have any questions, then please reach out to us in Telegram.

Sources:
LALIDJI, F. (2020, March 12). Dynamic Staking Algorithm https://github.com/RideSolo/staking-library/blob/master/doc/dsa.pdf

--

--