Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC-5883, which proposes transferring tokens held by an inaccessible address to another address with approvals from related parties.

This explanation translates, summarizes, and expands on the following specification.

For other proposals, see https://cardene.dev/proposals.

Overview

ERC-5883 proposes standardizing a social recovery mechanism for transferring tokens from an inaccessible account to a new account. Recovery requires approval from one or more addresses.

The approving parties are called Souls, a concept inspired by soulbound tokens (SBTs). They provide yes or no approvals. Tokens are transferred from the original account when the defined thresholds are satisfied.

Motivation

Losing a private key can make tokens held by the corresponding account inaccessible. This harms not only the token holder but also the broader ecosystem. As inaccessible tokens accumulate, they can hinder ecosystem growth and planned development.

ERC-5883 seeks to enable token recovery after key loss when the prescribed conditions are met.

Specification

The proposal defines a mechanism for migrating tokens or account-related rights to a new address when specified conditions are satisfied. Approvals are supplied by related addresses.

Interface

ISocialRecovery defines four functions.

js
pragma solidity ^0.8.7;

interface ISocialRecovery {
    /// @dev Related but independent identity approves the transfer
    function approveTransfer(address from_, address to_) external;

    /// @dev User wants to move their onchain identity to another wallet which needs to be approved by n-nearest neighbour identities
    function requestTransfer(address from_, address to_) external payable;

    function addNeighbour(address neighbour_) external;

    function removeNeighbour(address neighbour_) external;
}
  • approveTransfer(address from_, address to_): approves a migration between specified addresses.
  • requestTransfer(address from_, address to_): requests a wallet change and initiates the approval process.
  • addNeighbour(address neighbour_): adds a trusted related address.
  • removeNeighbour(address neighbour_): removes a previously registered trusted address.

Score Calculation Formula

The approval system evaluates the trustworthiness of nodes, representing accounts or individuals, through a score.

score(n)=tanh⁡(∑i=1∣N∣log⁡(nir×1t−nit+1)∣N∣+1+nr)score(n) = \tanh \left( \frac{\sum_{i=1}^{|N|} \log \left( n_i^{r} \times \frac{1}{t - n_i^{t} + 1} \right)}{|N| + 1} + n^{r} \right)

The variables are:

  • t: current time, such as block time or block number.
  • n^r: the number of rewards received by node n, reflecting approval participation.
  • N: the list of neighbours of node n.
  • n_i^r: the number of rewards received by neighbour i.
  • n_i^t: the timestamp at which neighbour i last received a reward.

The formula considers prior approval history and trust rather than simple majority voting alone.

Approval Process

When migration is requested, related parties provide approvals, and migration occurs if the required conditions are met.

Approval Flow

  1. Submit a request. The user asks the contract to change the address.
  2. Send notifications. Registered neighbours are notified using mechanisms such as WebSocket or EPNS.
  3. Collect approvals. Related parties submit yes or no decisions to the contract.
  4. Check approval count and score. Determine whether the number of approving parties and their cumulative score exceed their respective thresholds.
  5. Transfer tokens. If the conditions are met, tokens are transferred to the new address.
  6. Distribute rewards. Participating parties receive rewards.

Additional Considerations

The proposal aims for a resilient and fair incentive structure. Time-based weighting is intended to improve fairness, so the calculation considers long-term trust relationships instead of merely collecting numerous approvals. This is intended to give the on-chain score itself value.

Security

Risk of Improper Reward Collection

The described mechanism has no definitive way to prevent users from accumulating excessive rewards. Doing so may require significant investment, but well-funded participants might meet those conditions.

A possible mitigation is a stronger binding between addresses and real individuals, for example hashing real-world information to generate unique identifiers. Such hashes may depend on imprecise input data, however, and do not necessarily provide rigorous identity verification.

Approval Thresholds

Token migration is permitted only when sufficient approvals are obtained. The proposal does not establish a generally appropriate threshold, so preliminary values would need to be adjusted through operational experience.

Inactive Recovery Networks

The mechanism assumes that the network of approving parties remains active. If participants become inactive, the user may not be able to collect enough approvals to recover tokens. Continued participation is therefore a prerequisite for the system's effectiveness.

Citation

Erhard Dinhobl (@mrqc), Kevin Riedl (@wsdt), "ERC-5883: Token Transfer by Social Recovery [DRAFT]," Ethereum Improvement Proposals, no. 5883, July 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5883.

Conclusion

ERC-5883 proposes moving tokens held by an inaccessible address to a new address through social recovery and approvals from related parties.

Further reading and author links:

https://chaldene.net/