Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETP2: How does smart staking work #3

Open
svanurin opened this issue Jun 24, 2020 · 0 comments
Open

ETP2: How does smart staking work #3

svanurin opened this issue Jun 24, 2020 · 0 comments

Comments

@svanurin
Copy link
Member

svanurin commented Jun 24, 2020

How does smart staking work

Metadata

  • Status: draft
  • Date: 2020 Feb
  • Author: Zhidanov
  • Translation: Yulia Bardinova

Summary

The smart staking system allows users to raise funds to participate in the PoS mechanism.

PoS Mining Mechanism

PoS mining is a voting operation of network nodes for a PoS leader as well as the operation as a leader (i.e., microblock publishing). PoS mining occurs on behalf of the PoS contract (see below).

Funds Management

Creating a PoS contract (create_pos)

To participate in the PoS mechanism, the user must create a PoS contract by sending a specific transaction (create_pos) to genesis. In the PoS-contact creating transaction the {fee} parameters are passed.

  • fee is the amount of rewards held by the PoS owner in one hundredth of a percent.

The result of the transaction for creating a PoS contract is the identifier of the created PoS contract. For the transaction of creating a POS contract, the sender is charged a standard system fee. Multiple PoS contracts creation from one account is possible.

Delegating funds (delegate)

To delegate funds to a PoS contract, the user should send a delegating transaction to genesis. In the delegate transaction, the {pos_id} parameters are passed.

  • pos_id is the identifier of an existing PoS contract.

For a delegationg transaction, the sender is charged a standard system fee. It is possible to send many delegating transactions to the same PoS contract from one account.

When delegating funds, the account balance is reduced by the amount of delegated funds.

Withdrawing funds (undelegate)

The undelegate transaction allows you to withdraw delegated funds. The undelegate transaction has parameters {pos_id, amount}.

  • pos_id is the identifier of an existing PoS contract;
  • amount is the amount of funds to be withdrawn.

As a result of the withdrawal operation, the amount of coins previously delegated to the specified PoS contract is moved to a temporary balance state linked with the user account and the PoS contract. Each undelegate transaction creates a separate temporary balance state.

For the undelegate transaction, the sender will be charged a standard system fee.

Unlocking funds (transfer)

The funds-unlocking transaction allows the user to transfer funds from a temporary balance to the main account balance. The transfer transaction has an {undelegate_id} parameter.

  • undelegate_id is the identifier of the temporary balance previously created by the undelegate transaction.

The transfer transaction will work no earlier than a specified number of macroblocks after the creation of a temporary balance. As a result of the operation, all funds in the temporary balance will be transfered to the main balance.

For the transfer transaction, the sender will be charged the standard system fee.

Claiming rewards (pos_reward)

The reward-claiming transaction allows the user to receive rewards for PoS mining. The pos_reward transaction has a {pos_id} parameter.

  • pos_id is the identifier of the PoS contract to which delegate transactions were previously sent.

As a result of the transaction, the reward is transferred to the main balance of the sender's account.

For the pos_reward transaction, the sender will be charged the standard system fee.

Reward Calculation Mechanism

The PoS-mining rewards are distributed among the one hundred PoS contracts that have the largest stakes, i.e., funds delegated to them. The stake sum of all PoS contracts participating in the PoS mining at a particular moment in time is called a total stake. The total reward for PoS mining is unchanged and amounts to 25% of the total emission. The amount of rewards for a particular contract is calculated as a portion of the total rewards in proportion to the contact stake in relation to total stake. The PoS-contracts rewards are calculated at the time of the macroblock publishing.

The PoS contract reward is divided into two parts in accordance with the fee parameter specified when creating the contract. The indicated percentage of funds is retained by the creator of the contract. The remaining funds are divided between the contract delegators in proportion to the funds contributed by them.

Rewards are accrued in arbitrary periods of time (from 1 to 3 days). When calculating rewards, the size of the user's delegated funds at the time of calculation is used.

To find out more on reward calculation, refer to ETP-4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant