To delegate, an eGold holder needs to send appropriate transaction(s) to the Delegation (system) Smart Contract corresponding to the chosen Staking Provider by accessing his own MultiversX web wallet or xPortal app and selecting the corresponding action - Delegate. The minimum amount to delegate is 10 eGold.
Every user who delegated can claim the currently accumulated rewards for his account. A transaction has to be sent to the Delegation (system) Smart Contract with the “claim” action. At processing time, it is calculated how many rewards the account the account should get, by calculating the difference between the last time the claim was called and the current nonce, calculating the total earned rewards by the Staking Provider on that time period. The service fee is taken out and the rest is sent to the user. Only the account that delegated can claim the rewards (same public key). A separate claim transaction needs to be sent to the Delegation (system) Smart Contract of each separate Staking Provider to which a user is delegated.
A Delegator or anyone can view the rewards associated with an address by accessing the web wallet or by querying the reward address in the blockchain explorer.
The separation of nodes from rewards came from the fact that the Delegation (system) Smart Contract cannot ensure the number of nodes which are eligible in a certain epoch. Therefore, it cannot ensure that a given amount of eGold will be earned every day. Moreover, nodes are shuffled in and shuffled out. Thus, the rewards can vary from epoch to epoch. Furthermore, in case the staking- as-a-service provider is malicious or has a set of bad machines or just bad-luck, its rating might get affected or it might be getting jailed, producing even less rewards. It is up-to the community delegating into such a service to decide when to get out, if the Staking Provider is good enough and the terms and conditions are met. The Delegation (system) Smart Contract is the narrow waist on which other conditions might be added by different communities. The Staking Provider owner of such a Delegation (system) Smart Contract can be a DAO that makes their own rules.
At the end of each epoch, when the rewards are distributed, the Delegation (system) Smart Contract of a Staking Provider will get the reward tokens at the reward address for those Staking Provider nodes which are in the contract’s address. In order to keep the rewards separately, the total of accumulated rewards is saved under a special key in the smart contract’s trie. Then these rewards are claimable by those who delegated in the contract. Delegators who claim their rewards will need to pay the transaction fees (gas) themselves for the claim transaction.
If a user decided to withdraw from the Delegation (system) Smart Contract, this process involves 2 steps: Un-delegate - a transaction which “tells” the Delegation (system) Smart Contract that the delegator wants a specific amount (all or just a part) to be withdrawn from delegation. After the un-Stake function is called, funds might still be locked for delegation several epochs depending on the system load ratio. For this reason, funds will remain locked in the Auction Smart Contract for 10 epochs. After 10 epochs have passed, the Delegation (system) Smart Contract should call the un-Bond function to actually retrieve the funds.
After a successful un-delegate and 10 epochs have passed the eGold can be withdrawn through a transaction which interacts with the Delegation (system) Smart Contract. The Delegation (system) Smart Contract will call Auction Smart Contract which will then give the requested amount. This will return all of the withdrawable tokens together to the given delegator.