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

Initial draft of staking, rewards & penalties. #36

Merged
merged 26 commits into from
Nov 25, 2024
Merged

Conversation

happi
Copy link
Collaborator

@happi happi commented Nov 21, 2024

There are some details to be worked out.

  • Should rewards go through the staking contract or not?

    • Current suggestion: pay rewards directly to the beneficiary account, which could be a delegation contract.
    • It could be easier to handle penalties if rewards go through the contract, but distribution to delegation contracts might be more complex.
  • We need to figure out exact details on how to spot and create evidence of misconduct.
    Details about the size of the penalties.

  • When exactly does the tokens become locked. My current description is from the beginning of epoch N+1. That is, during the staking epoch you can increase and decrease your stake as you want it is only at the end of the epoch that amount is locked in. Of course if you have a stake from a previous cycle that stake is also locked in.

The details and the implementation of the chain economy will be done in the next iteration of Hyperchains after input from domain experts.

staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
@happi happi changed the title Initial draft of staking without fees and penalties. Initial draft of staking & rewards (without penalties). Nov 22, 2024
@happi happi changed the title Initial draft of staking & rewards (without penalties). Initial draft of staking, rewards & penalties. Nov 22, 2024
Copy link
Member

@hanssv hanssv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks promising, but it needs to align with the existing description of Hyperchains...

staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
staking.md Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
happi and others added 5 commits November 25, 2024 09:13
Co-authored-by: Hans Svensson <[email protected]>
Co-authored-by: Hans Svensson <[email protected]>
Co-authored-by: Hans Svensson <[email protected]>
Co-authored-by: Hans Svensson <[email protected]>
Co-authored-by: Hans Svensson <[email protected]>
staking.md Outdated Show resolved Hide resolved
#### **API Functions**

1. **`deposit(producer:pubkey)`** (Payable Endpoint)
- **Description**: Allows a participant to deposit tokens into the staking contract, increasing their Total Balance (TB) and Available Balance (AB).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

increasing their Total Balance (TB)

is above defined as "deposited in the staking contract via the stake() function", but should probably be explained either there or here that this also includes the automatic restaking balance for which the stake() function hasn't been called explicitly

staking.md Outdated Show resolved Hide resolved
staking.md Outdated Show resolved Hide resolved
staking.md Show resolved Hide resolved
Copy link
Collaborator

@thepiwo thepiwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we discussed it would probably be needed to have the beneficiary be a contract that receives the epoch/cycle those rewards were for if payed out with a delay, or something in state that allows this information to be fetched

Copy link
Contributor

@ThomasArts ThomasArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks fine to me

staking.md Show resolved Hide resolved
staking.md Show resolved Hide resolved
staking.md Show resolved Hide resolved
Comment on lines +374 to +376
- **Automatic Re-Staking:**
- Tokens do not automatically unlock, instead if no change in staking is registerd they remain at stake.
- Participants must call `adjustStake()` during the next Staking Epoch to free tokens during the next staking cycle.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not make it into the first version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, probably lots of things not making it into the first version.

@happi
Copy link
Collaborator Author

happi commented Nov 25, 2024

Ill merge now.

@happi happi merged commit ebd2990 into master Nov 25, 2024
1 check passed
@happi happi deleted the staking_proposal branch November 25, 2024 17:39
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

Successfully merging this pull request may close these issues.

5 participants