ERC-5883 · Stagnant · ERC · 2022-07-19
ERC-5883: Token Transfer by Social Recovery
A stagnant proposal for recovering tokens from a lost account by having enough trusted "neighbour" identities approve moving them to a new address, weighted by an on-chain reputation score.
What problem does it solve?
If you lose the private key to an account, every token in it is gone for good. That hurts the owner and also the token's ecosystem, since lost tokens leave circulation permanently.
ERC-5883 sketches a social recovery scheme: other people you know (called Souls, after the soulbound token idea) vote to move your token from the inaccessible account to a new one. Unlike a pure multisig, approval is meant to be a human judgement, and approvers' votes count according to an on-chain reputation score.
How it works
The interface has four functions:
| Function | Purpose |
|---|---|
addNeighbour(addr) / removeNeighbour(addr) |
Build your list of trusted identities |
requestTransfer(from, to) |
Ask to move your on-chain identity/token from from to to (payable) |
approveTransfer(from, to) |
A neighbour votes yes on that request |
Flow:
- The user, from any wallet, requests the transfer.
- Neighbours are notified off-chain (the spec mentions websockets or push services).
- Neighbours call
approveTransfer. - Once both the number of approvers and their cumulative score pass thresholds, the contract moves the asset to the new owner.
- Approvers receive a reward, which raises their own score.
The score of a node blends its own reward count with its neighbours' rewards, discounted by how long ago each neighbour was last rewarded, and squashes the result with tanh so it stays bounded (below 1). Recently active, well-rewarded neighbours therefore count for more than dormant ones.
Sample code
The interface from the spec:
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.7;
interface ISocialRecovery {
function approveTransfer(address from_, address to_) external;
function requestTransfer(address from_, address to_) external payable;
function addNeighbour(address neighbour_) external;
function removeNeighbour(address neighbour_) external;
}
The scoring idea in pseudocode (t is the current time or block number):
import math
def score(node, t):
s = 0.0
for nb in node.neighbours:
s += math.log(nb.rewards * (1 / (t - nb.last_reward_time + 1)))
return math.tanh(s / (len(node.neighbours) + 1) + node.rewards)
Things to know
- Status is Stagnant: there has been no recent progress and it is not a stable standard. Treat it as a design sketch, not something to build production wallets on.
- The spec leaves key details open: who may call each function, what the thresholds are, and what exactly "token" means. The authors say their threshold is a first guess.
- The authors list unsolved risks themselves: a wealthy user can farm rewards to raise their score, and if your neighbours become inactive, recovery can get stuck.
- Today, smart contract wallets built on ERC-4337 commonly implement guardian-based social recovery at the account level instead of per token.
- For the non-transferable "soul" tokens this idea builds on, see ERC-5192.