From c1d21d221b61ab4dad953a5dc4ed8af32e88a5dc Mon Sep 17 00:00:00 2001 From: bradleat Date: Tue, 15 May 2018 11:31:12 -0700 Subject: [PATCH] ERC 1080: RecoverableToken Standard (#1080) * work on setting up the eip-governable-token * some notes * Update and rename eip-governable-token.md to eip-recoverable-token.md added the three levels of token recovery. considering adding separate process for loss because of theft * Update and rename eip-recoverable-token.md to eip-1080.md * added colon and discussion to link --- EIPS/eip-1080.md | 185 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 EIPS/eip-1080.md diff --git a/EIPS/eip-1080.md b/EIPS/eip-1080.md new file mode 100644 index 0000000000000..e5f7a46717772 --- /dev/null +++ b/EIPS/eip-1080.md @@ -0,0 +1,185 @@ +--- +eip: 1080 +title: Recoverable Token +author: Bradley Leatherwood +discussions-to: https://ethereum-magicians.org/t/erc-1080-recoverabletoken-standard/364 +status: Draft +type: Standards Track +category: ERC +created: 2018-05-02 +--- + +## Simple Summary + +A standard interface for tokens that support chargebacks, theft prevention, and lost & found resolutions. + +## Abstract + +The following standard allows for the implementation of a standard API for tokens extending ERC-20 or ERC-791. This standard provides basic functionality to recover stolen or lost accounts, as well as provide for the chargeback of tokens. + +## Motivation + +To mitigate the effects of reasonably provable token or asset loss or theft and to help resolve other conflicts. Ethereum's protocol should not be modified because of loss, theft, or conflicts, but it is possible to solve these problems in the protocol layer. + +## Specification + +## RecoverableToken + +### Methods + +#### claimLost + +Reports the `lostAccount` address as being lost. MUST trigger the `AccountClaimedLost` event. + +After the time configured in `getLostAccountRecoveryTimeInMinutes` the implementer MUST provide a mechanism for determining the correct owner of the tokens held and moving the tokens to a new account. + +Account recoveries must trigger the `AccountRecovered` event. + +``` js +function claimLost(address lostAccount) returns (bool success) +``` + +#### cancelLostClaim + +Reports the `msg.sender`'s account as being not being lost. MUST trigger the `AccountClaimedLostCanceled` event. + +MUST fail if an account recovery process has already begun. + +Otherwise, this method MUST stop a dispute from being started to recover funds. + +``` js +function claimLost() returns (bool success) +``` + +#### reportStolen + +Reports the current address as being stolen. MUST trigger the `AccountFrozen` event. +Successful calls MUST result in the `msg.sender`'s tokens being frozen. + +The implementer MUST provide a mechanism for determining the correct owner of the tokens held and moving the tokens to a new account. + +Account recoveries must trigger the `AccountRecovered` event. + +``` js +function reportStolen() returns (bool success) +``` + +#### chargeback + +Requests a reversal of transfer on behalf of `msg.sender`. + +The implementer MUST provide a mechanism for determining the correct owner of the tokens disputed and moving the tokens to the correct account. + +MUST comply with sender's chargeback window as value configured by `setPendingTransferTimeInMinutes`. + +``` js +function chargeback(uint256 pendingTransferNumber) returns (bool success) +``` + +#### getPendingTransferTimeInMinutes + +Get the time an account has to chargeback a transfer. + +``` js +function getPendingTransferTime(address account) view returns (uint256 minutes) +``` + +#### setPendingTransferTimeInMinutes + +Sets the time `msg.sender`'s account has to chargeback a transfer. + +MUST NOT change the time if the account has any pending transfers. + +``` js +function setPendingTransferTime(uint256 minutes) returns (bool success) +``` + +#### getLostAccountRecoveryTimeInMinutes + +Get the time account has to wait before a lost account dispute can start. + +``` js +function getLostAccountRecoveryTimeInMinutes(address account) view returns (uint256 minutes) +``` + +#### setLostAccountRecoveryTimeInMinutes + +Sets the time `msg.sender`'s account has to sit before a lost account dispute can start. + +MUST NOT change the time if the account has open disputes. + +``` js +function setLostAccountRecoveryTimeInMinutes(uint256 minutes) returns (bool success) +``` + +### Events + +#### AccountRecovered + +The recovery of an account that was lost or stolen. + +``` js +event AccountClaimedLost(address indexed account, address indexed newAccount) +``` + +#### AccountClaimedLostCanceled + +An account claimed as being lost. + +``` js +event AccountClaimedLost(address indexed account) +``` + +#### AccountClaimedLost + +An account claimed as being lost. + +``` js +event AccountClaimedLost(address indexed account) +``` + +#### PendingTransfer + +A record of a transfer pending. + +``` js +event PendingTransfer(address indexed from, address indexed to, uint256 value, uint256 pendingTransferNumber) +``` + +#### ChargebackRequested + +A record of a chargeback being requested. + +``` js +event ChargebackRequested(address indexed from, address indexed to, uint256 value, uint256 pendingTransferNumber) +``` + +#### Chargeback + +A record of a transfer being reversed. + +``` js +event Chargeback(address indexed from, address indexed to, uint256 value, uint256 indexed pendingTransferNumber) +``` + +#### AccountFrozen + +A record of an account being frozen. MUST trigger when an account is frozen. + +``` js +event AccountFrozen(address indexed reported) +``` + +## Rationale + +* A recoverable token standard can provide configurable saftey for users or contracts who desire this saftey. +* Implementations of this standard will give users the ability to select a dispute resolution process on an opt-in basis and benefit the community by decreasing the necessity of consideration of token recovery actions. + + +## Implementation + + +Pending. + +## Copyright +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).