Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
101 changes: 101 additions & 0 deletions fip-0052.md
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
Copy link
Member

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.

Copy link
Member Author

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

* 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