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

staking pools need separate rewards channel when bonding #32

Open
dckc opened this issue Sep 17, 2020 · 7 comments
Open

staking pools need separate rewards channel when bonding #32

dckc opened this issue Sep 17, 2020 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@dckc
Copy link

dckc commented Sep 17, 2020

The proof of stake contract uses public keys to represent parties who stake REV. As far as I can tell, this excludes the use of multisig or other smart contracts as staking entities. Can you confirm? If so, I can evolve this into a concrete proposal...

If PoS used REV Addresses, we could use addresses from RevAddress.fromUnforgeable connected to multisigs, staking pools, etc.

See also https://github.com/rchain-community/rstake

@dckc dckc added the question Further information is requested label Sep 17, 2020
@tgrospic
Copy link
Collaborator

I see this main requirement. From the perspective of a validator who needs to sign a block, it must be "physical" private (public) key in the PoS contract.

@dckc
Copy link
Author

dckc commented Sep 18, 2020

I see... Then perhaps the bond method could take a (required) public key for signing blocks and (optionally) a separate rev address for rewards?

@dckc
Copy link
Author

dckc commented Dec 4, 2021

@jimscarver what do you think of getting this into the PoS contract in time for one of the upcoming hardforks?

@dckc
Copy link
Author

dckc commented Dec 27, 2021

We recently discussed this in discord...

@tgrospic writes:

This is interesting. Are you saying that something very simple can be enough to support staking pools, like REV address for rewards?

yes, I believe something very simple can be enough to support staking pools, like REV address for rewards

I'm not sure how risk is shared between pool users and the validator. Is it the case that pool users trust in competence of the validator or they should participate only with the loss of rewards?

in cosmos chains, delegators rely on the competence of the validator; if the validator double-signs and gets slashed, the delegators lose their stake (in proportion)

@zsluedem writes:

That sound like an additional abstract layer wrapping with staking vault.

Well, yes, of course, the staking pool contract is a layer on top.

Are you sure splitting the rewards address from the staking address is enough for the staking pool?

I can't be certain until I have more experience, but I'm pretty sure.

May I ask what would the whole structure of the staking pool with the method you provided above? More concretely, how does the user stake in the staking pool? And how is the relationship between the staking pool and the staking contract(POS contract in dev)?

I expect the user goes to the staking pool and trades REV for tokens representing their stake. And once every epoch, the staking pool contract calls the PoS contract to deposit or withdraw REV so that the total stake matches the sum of what its clients want staked. Something like that.

But what is the role of paying the reward with another rev address playing here?

That way the reward goes from the PoS contract to the staking pool contract.

Do you expect the reward to be paid in every epoch?

I expect users can start a withdrawal at any time; withdrawals take the length of an epoch to complete (21 days is typical in cosmos; I don't know how long an rchain epoch is)

Great~! Thanks very much. I think I got better view about your design now~! Things start to make sense.

@dckc dckc changed the title How to stake from a multisig or staking pool? staking pools need separate rewards channel when bonding Mar 5, 2022
@dckc
Copy link
Author

dckc commented Mar 5, 2022

@9rb @tgrospic would you please schedule this on one of the core dev milestones? Does this have sufficient support? Is there any argument against?

Does it help if I make an issue in rchain/rchain?

@tgrospic
Copy link
Collaborator

@dckc It would be very useful if you can create an issue with possible attack vectors if you can think of any. We discussed about your suggestion in our dev standup. @leithaus said he needs to think if there is some potential misuse but in general we had agreement that we want to implement it in PoS.

I'd like to include it HF2 because we already included some changes scheduled for HF3. If you can help us to write/review some of these changes in Rholang it would mean great deal for us. Please feel free to join any of our dev standup to discuss about details.

@dckc
Copy link
Author

dckc commented Mar 12, 2022

@dckc It would be very useful if you can create an issue ...

OK, will do.

@leithaus said he needs to think if there is some potential misuse but in general we had agreement that we want to implement it in PoS.

I can't think of any attack vectors just now. I'll think it over a bit.

In fact, this seems to be a standard practice in the Cosmos ecosystem:

image

https://www.mintscan.io/osmosis/account/osmo1hjct6q7npsspsg3dgvzk3sdf89spmlpfqua7lv

I'd like to include it HF2 ...

that would be great!

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

No branches or pull requests

4 participants