# Staking Chain
---
# Staking Recap
- stake(amount, RewardDestination)
- nominate(targets)
- unstake(amount)
- withdraw()
- reward
- slash
----
## Nomination Pool Recap
- join(amount, pool_id)
- claim_payout()
---
# Minimal Relay Chain
> The Relay-chain should do one thing and do it well. That means being the head of a secure decentralised multicore computer. Sticking an EVM smart contract in there and/or continuing to allow end-user-application-level transactions and general interaction goes directly against this mantra. - Gavin Wood
----
RFC: `polkadot-fellows/RFCs/pull/32`
- Functional Isolation.
- First chain with no user transactions :rocket:
---
# Staking Chain
Dedicated staking core could allow us to possibly do even more things in future:
- Restaking.
- Electing collators for all system parachains.
---
## Relay Chain

---
## Staking Chain

---
**Relay Chain** => *Staking Chain*
- **Block Authored (buffered)** => *Assign era points*.
- **New offence** => *Apply Slash*.
- **New session** => *Make note of session change*.
---
*Staking Chain* => **Relay Chain**
- *Send new validator set proactively before era ends* => **Staking Client stores the result to apply at next session change.**
- *Apply Slash* => **Disable Validator**.
- *Validator sets session keys* => **store keys**.
----
## Pallet-session (skip)
- Babe tells pallet-session to end session.
- should_epoch_change? If yes then end session.
- Session asks Staking for new validator set.
- Session informs following pallets of new session change with the new validator set:
`grandpa, babe, im_online, para_validator, para_assignment, authority_discovery, beefy`.
---
## Transition Phase:
- Parallel Independent Staking.
- Slow transition with incremental increase in validators selected from Staking Chain.
- This approach allows us to fearlessly refactor current staking pallets.
- Chance for new validators to get in the active validator set.
----
## Potential discussion points
- May be temporary mismatch of economic security of validators from these two different staking systems but market economics should find a state of balance.
- Established validators may be unhappy about losing their approval scores.
- Provide a way to move staked balance easily without waiting for unstake period.
----
## Alternative approach
- Would mean one switch transition (no fallbacks).
- Currently, staking is not PoV friendly and has collected tech debts over the years.
- Harder to refactor staking since we have to make sure current storages are compatible or can be translated.
---
## How would validator reward work?
Governance sets inflation and how much of it goes where. Taking an example
- `max_inflation` e.g. 20%, from those:
- Validator rewards: 60%
- Treasury: 20%
- Rest to system chain collators
---
- Staking chain signals (XCM) AssetHub to mint new era inflation
- AssetHub calculates and *mints* new inflation DOT
- AssetHub teleports or transfers minted inflation to sovereign pot of the System Parachains
- -- OR --
- leak the notion of era to AH (e.g. `SessionsPerEra`) and let it mint + distribute proactively
---
## Validator
- Teleport DOTs to Staking Chain.
- Run node.
- author_rotateKeys() on their relay chain node.
- Set session Key on the session-lite/staking pallet on Staking Chain.
----
## Validator
- Stake Dots.
- Attact more nominator funds.
- Win election.
- Author blocks.
- Earn rewards and payout staker every era.
---
## Nominator (Native Staking)
- Teleport DOTs to Stake Chain.
- Bond Dot and nominate validator set.
- Or, join an existing pool.
---
# Remote Staking (v2)
- Ability to lock funds in one chain (such as Asset Hub), and stake on another (such as Staking Chain).
- An ambitious Goal: **Being able to stake any asset on Asset Hub**.
- The only thing required, there is a parachain that supports staking of that asset.
---
## How would it work?
- `XCM::StakeAsset(asset: MultiAsset, chain: MultiLocation, id: Multilocation)`
- `XCM::UnstakeAsset(asset: MultiAsset, chain: MultiLocation, id: Multilocation)`
- `XCM::UnlockAsset { asset: MultiAsset, target: MultiLocation }`
---
The ~~End!!~~
Beginning...
{"title":"Introducing Staking Chain","description":"Staking Recap","contributors":"[{\"id\":\"46ac327a-d39a-47e3-badb-0f1a789408ee\",\"add\":413,\"del\":511},{\"id\":\"33174ac8-6465-4419-a9c8-69548e822262\",\"add\":6789,\"del\":2369}]"}