What Does Staking and Unstaking EOS Tokens Mean?

in #eos6 years ago (edited)

what does staking unstaking eos tokens mean.jpg

EOS Canada receives many questions regarding staked and unstaked tokens. Why are my tokens staked? Why do I have to stake EOS tokens? What do I get for staking my tokens? How do I stake my tokens? We’d like to help clarify this.

What Resources Exist on an EOS.IO Network

There are 3 different types of resources on the EOS mainnet; CPU bandwidth, Network bandwidth, and Memory (RAM). CPU and Network are both staked allocations, as they are both transient in nature - you consume it at a point in time, and then it regenerates for future usage. RAM, however, is persistent - you allocate it for usage at any future point in time. For these reasons, both CPU and Network are not purchased, while RAM is purchased.

CPU bandwidth signifies the processing time of an action, measured in microseconds. So if you were to make an EOS token transfer from your account to a friend’s account, this action would take some amount of time to complete. This amount of transaction time would come off of your allocation, and then regenerate over time.

Network bandwidth signifies the throughput capacity of the EOS network, measured in bytes. In the same example as above where you moved EOS tokens to a friend’s account, that transaction would require some of the network’s capacity. Same as with CPU, this transaction data would come off of your allocation, and then regenerate over time.

RAM is a precious resource on EOS. To have very high transaction throughput, we need persistent storage to be in RAM, which is a lot quicker, yet scarcer than spinning disks.

For CPU and Network allocations, if you stake 10 EOS, you will receive 10 EOS back when you unstake. However, the RAM market is different. The pricing of a byte of RAM fluctuates based on the available RAM left in the marketplace. This means that someone could profit or take a loss on their RAM purchases/sales. The goal was to incentivize developers and users from sitting on their unused RAM, encouraging them to release it back to the network.

What Is a Staked Token

A staked token describes a token that has been locked up for a time period. On the EOS mainnet, that locked period is followed by an unlocking period of 72 hours. This means that if you lock up a token (stake it) towards CPU, you will be allocated your prorated amount of CPU bandwidth as long as that token remains staked.

Once you decide to unlock that token (unstake), you will immediately lose your access to that portion of bandwidth, and you will regain control of that token after a 72-hour period passes. You will also see staking/unstaking referred to as delegating/undelegating.

Why Did My Account Start with Staked Tokens?

When the EOS mainnet was launched, the Block Producer doing the initial setup (the Appointed Block Producer, or ABP) used the chart below to determine how many tokens your account would have begun with in a staked state, or a liquid state (unstaked, free to transfer). The staked tokens were delegated 50/50 for CPU and Network.

Screen Shot 2018-06-11 at 1.29.18 PM-1

This made it simpler for users to vote while we were still in the unlocking period, as all they needed to do was cast a vote.

How Many Tokens Do I Need to Stake?

If you are using the network as a “normal” user, maybe making one or two transactions per day at most, then having 0.5 EOS staked for each CPU and Network will often be sufficient. If you wanted to interact with dApps more often, and execute more transactions, 1 or 2 EOS staked for each should suffice almost all users.

Here is the code that handles the resource limiting for CPU and Network, in case you wanted to dig deeper.

How Do I Stake/Unstake My Tokens?

Most wallets that you can use on the EOS mainnet have this feature already built in. Since all of them are set up differently, we can’t create a single walkthrough for this step. However, if you wanted to use `eosc`, a tool created by EOS Canada, we will walk you through the command below.

`eosc system delegatebw [from] [receiver] [network bw stake qty] [cpu bw stake qty] [flags]`

We’ll break this down bit by bit, to clarify what is going on.

`eosc` - this is the name of the program you’re executing

`system` - this is the command that contains all the subcommands related to the system contract.

`delegatebw` - this is the operation we’re interested in. Bandwidth is what a user is actually staking for, and bandwidth comes in the two varieties mentioned above: CPU and Network

`[from]` - this would be the name of the account whose tokens are going to be staked

`[receiver]` - this is the name of the account to which you are delegating. Most of this time, you would have the same account name in both fields, but you could also use this to delegate bandwidth to another account that you control, or perhaps a friend’s account

`[network bw stake qty]` - the amount of EOS you want to stake towards Network. In eosc, it can be specified as "1.0000 EOS", " 1.0000" or even "1", these three values being equivalent.

`[cpu bw stake qty]` - the amount of EOS you want to stake towards CPU

[flags] The flag defined by this function is `--transfer`. With this flag passed in, the EOS you delegate to the receiver can be unstaked and refunded to them, not you.

When I Unstake My Tokens, Where Are They?

This section is the same for unstaking, however it will have the opposite effect on an account.

This is the contract within EOS.IO that deals with delegating bandwidth (for CPU, Network, and RAM). Here is a link to the sections of code that creates the structure for staking of tokens and unstaking of tokens. Lastly, here is a link if you would like to read the Ricardian Contracts for the `delegatebw` action, `undelegatebw’ action, and `refund` action.

When you stake tokens, they are now under the control of the `eosio.stake` account. As noted above, when you wish to unstake your tokens, they take 72 hours before they are released back to your account in a liquid state.

Why Should I Stake My Tokens?

There is no economic incentive for staking your tokens. Aside from allocating you your portion of bandwidth for Network and CPU, staked tokens are what you vote with. Your voting weight is equal to the sum of your CPU and Network staked tokens. This allows you to voice your opinion on chain on who should be operating the EOS network on your behalf.

Two notable things that are brought to light through the staking mechanism is that it plays a part to make fee-less transactions possible, and it is also a means of not allowing network spam to lock out actual transactions from passing through. The infrastructure that Block Producers are collectively running allow for a certain amount of actions/transactions to be processed over a given period of time. To allocate that amongst the community, while not having to charge for that usage, staked tokens allow a user to make a claim for their needed allocation.

Since each user would be allotted their bandwidth capacity, they cannot be blocked out by someone spamming the network. Each user would be rate limited down towards what they have been allotted.

Hopefully this helps to clarify your understanding as to the mechanics of staking on EOS. Be sure to also view our video on staking and unstaking.

This article was originally published on eoscanada.com

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63792.82
ETH 2563.50
USDT 1.00
SBD 2.66