-
Notifications
You must be signed in to change notification settings - Fork 22
FIP-52 Restake FIO tokens #368
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
Open
adsorptionenthalpy
wants to merge
7
commits into
fioprotocol:master
Choose a base branch
from
adsorptionenthalpy:adam-fip52
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
521a42e
Update README.md
adsorptionenthalpy 9b0e0d5
Create fip-0052.md
adsorptionenthalpy 43c2e81
Update fip-0052.md
adsorptionenthalpy f575379
Update fip-0052.md
adsorptionenthalpy 8375095
Update fip-0052.md
adsorptionenthalpy dd65c75
Update fip-0052.md
adsorptionenthalpy bebf25f
Update README.md
adsorptionenthalpy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| --- | ||
| fip: 52 | ||
| title: FIO Restake | ||
| status: Draft | ||
| type: Functionality | ||
| author: Adam Androulidakis <adam@fio.net> | ||
| created: 2025-05-18 | ||
| updated: 2025-07-14 | ||
| --- | ||
|
|
||
| # Abstract | ||
| This FIP introduces a restaking mechanism for FIO rewards, enabling FIO handles to reinvest their staked rewards without the mandatory 7-day unlock period. In exchange, accounts pay a new premium to the network for the restake. A portion of this is allocated to the block producer (BP) reward pool, increasing compensation for BPs and addressing their growing need for revenue. | ||
|
|
||
| New actions | ||
| |Contract|Action|Endpoint|Description| | ||
| |---|---|---|---| | ||
| |fio.token|restake|/retake_fio_tokens|Stakes specified FIO rewards.| | ||
|
|
||
| ## New getters | ||
| |End point|Description| | ||
| |---|---| | ||
| |n/a|n/a| | ||
|
|
||
| # Motivation | ||
|
|
||
| The restaking mechanism allows FIO handles to seamlessly compound their staking rewards by bypassing the 7-day unlock period, encouraging continuous participation and increasing the total FIO staked. The larger premium paid for restaking generates additional FIO for the network, which supports operational costs and protocol enhancements by directing a portion of these premiums to the BP reward pools. This mechanism enhances user convenience, boosts network revenue, and supports the BP reward pool. | ||
|
|
||
| # Specification | ||
| ## Process | ||
|
|
||
| ## New actions | ||
| ### Restake FIO | ||
| Restakes FIO staking rewards without the 7 day unlock period | ||
| #### Contract: fio.token | ||
| #### New action: *restake* | ||
| #### New end point: /restake_fio_tokens | ||
| #### New fee: restake_fio_tokens, fee amount will be determined during development and updated here | ||
| #### RAM increase: To be determined during implementation | ||
| #### Request body | ||
| |Parameter|Required|Format|Definition| | ||
| |---|---|---|---| | ||
| |fioaddress|Yes|FIO Address|FIO Address of the generating account. This will be used to verify domain ownership, and the NFT signature created for the address| | ||
| |amount|Yes|Positive Int|Amount of rewards to restake| | ||
| |max_fee|Yes|Positive Int|Maximum amount of SUFs the user is willing to pay for fee. Should be preceded by [/get_fee](https://dev.fio.net/reference/get_fee) for correct value.| | ||
| |tpid|Yes|FIO Address|FIO Address of the entity which generates this transaction. TPID rewards will be paid to this address. Set to empty if not known. Auto-renew transactions will carry this TPID.| | ||
| |actor|Yes|12 character string|Valid actor of signer| | ||
| ##### Example | ||
| ``` | ||
| { | ||
| "fioaddress": "1000000", | ||
| "amount": "1000000", | ||
| "max_fee": 30000000000, | ||
| "tpid": "rewards@wallet", | ||
| "actor": "aftyershcu22" | ||
| } | ||
| ``` | ||
| #### Processing | ||
| * FIO Address is validated | ||
| * Amount parameter is validated | ||
| * Request is validated per Exception handling | ||
| * RAM of actor calling action is increased | ||
| * restake_fio_tokens is charged to actor calling action | ||
| * a votable portion of fees are issued from the accounts rewards to the block producer reward pools | ||
| * Check for maximum FIO transaction size is applied | ||
| #### Exception handling | ||
| |Error condition|Trigger|Type|fields:name|fields:value|Error message| | ||
| |---|---|---|---|---|---| | ||
| |Invalid FIO Address|address format is not valid|400|"fioaddress"|Value sent in, e.g. "notvalidfioaddress"|"Nust be a valid FIO Address"| | ||
| |Invalid Amount|Amount is not positive|400|"amount"|Value sent in, i.e. "-1"|"Invalid Amount."| | ||
| |Invalid fee value|max_fee format is not valid|400|"max_fee"|Value sent in, e.g. "-100"|"Invalid fee value"| | ||
| |Fee exceeds maximum|Actual fee is greater than supplied max_fee|400|"max_fee"|Value sent in, e.g. "1000000000"|"Fee exceeds supplied maximum"| | ||
| |Insufficient balance|Available balance in account is less than fee|400|"max_fee"|Value sent in, e.g. "100000000000"|"Insufficient balance"| | ||
| |Insufficient rewards|Specified rewards are less than unlockable amount|400|"max_fee"|Value sent in, e.g. "100000000000"|"Insufficient balance"| | ||
| |Invalid TPID|tpid format is not valid|400|"tpid"|Value sent in, e.g. "notvalidfioaddress"|"TPID must be empty or valid FIO Address"| | ||
| |Signer not actor|Signer not actor|403|||Type: invalid_signature| | ||
| #### Response body | ||
| |Parameter|Format|Definition| | ||
| |---|---|---| | ||
| |status|String|OK if successful| | ||
| |fee_collected|Int|Amount of SUFs collected as fee| | ||
| ##### Example | ||
| ``` | ||
| { | ||
| "status": "OK", | ||
| "rewards_staked", "1000000000", | ||
| "fee_collected": 1000000000 | ||
| } | ||
| ``` | ||
|
|
||
| # Rationale | ||
| TBD | ||
|
|
||
| # Implementation | ||
| TBD | ||
|
|
||
| # Backwards Compatibility | ||
| No changes to existing actions. | ||
|
|
||
| # Future considerations | ||
|
|
||
| # Discussion link | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More detail definition is required here. What exactly is happening when user unstakes. The way that staking is designed is you earn SRPs when you stake, they appreciate in value while fees are collected, so when you unstake, the SRPs are converted to a higher amount of FIO. You would need to do some math here to figure out how that conversion happens and how that impacts your "principal". It's going to be tricky to figure this out. See FIP-21 for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting this into discussion and addressing. Thanks