diff --git a/README.md b/README.md index 9b1b0b8..c8ec48b 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ FIPs describe proposed changes to the FIO Protocol. |[FIP-49](fip-0049.md)|FIO Domain Auto-renew On-chain|Draft| |[FIP-50](fip-0050.md)|FIO Assets|Draft| |[FIP-51](fip-0051.md)|Make FIO Domains Permanent (Forever Domains)|Draft| +|[FIP-52](fip-0052.md)|FIO Restake|Draft| ## Contributing ### Review FIPs diff --git a/fip-0052.md b/fip-0052.md new file mode 100644 index 0000000..e1bc8d3 --- /dev/null +++ b/fip-0052.md @@ -0,0 +1,101 @@ +--- +fip: 52 +title: FIO Restake +status: Draft +type: Functionality +author: Adam Androulidakis +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