-
Notifications
You must be signed in to change notification settings - Fork 324
Staking
This wiki is still in progress.
This wiki is about the development details of staking. please refer to http://docs.iotex.io/docs/ioctl.html#stake-vote for how to use ioctl
to stake.
A bucket is a collection of IOTX used in stake. Any bucket has the following properties
1. ID (int >= 0, auto increased)
2. Owner (the owner of the bucket)
3. delegate name (whom the IOTX is staked to)
4. duration (in days, 0<=duration<=1050, how many days the bucket is staked for)
5. Auto-stake (On/Off, if the stake duration stay the same or not)
Bucket information can be easily found by using ioctl bc bucket $n
.
A bucket has three possible status
1. Staked (Display as Ongoing)
2. Unstaked (user needs to submit unstake request after stake duration is over for it to succeed, i.e., block.Timestamp > bucket.StakeStartTime + bucket.StakedDuration. Upon success, bucket.UnstakeStartTime = block.Timestamp)
3. Ready to withdraw (3 days after successful unstaking a bucket, IOTX in the bucket can be withdrawn, i.e., block.Timestamp > bucket.UnstakeStartTime + 3 days)
Also, a bucket is Burndrop eligible if it meets
Duration >= 91 days and Auto-stake is On
A bucket is created by submitting an action StakeCreate
.
A bucket can be edited with the following actions
Change whom the bucket is staked for.
Bucket status is staked
Add new IOTX to the bucket. "Add Stake" for bucket with "Auto-Stake" is on.
Bucket status is staked and auto-stake is on.
Change duration and Auto-Stake status. Duration can only be increased.
Bucket status is staked.
Request to unstake the IOTX from bucket. After 3 days of unstaking start time, the bucket becomes "ready to withdraw.
Bucket status is staked. Bucket status is not auto-staked.
Request to withdraw IOTX from a bucket. The bucket will be destroyed.
Bucket status should be in unstaking and unstaking start time + 3 days <= today.
Change the owner of the bucket to someone else. The current owner will lose the bucket.
This action will change the owner of the bucket. Reassign can be done anytime.
After the IOTX of a bucket is withdrawn, the bucket is destroyed automatically.