ERC-4886 Proxy ownership registry (Proxy Ownership Register)

Stagnant · Accounts & wallets · created 2022-09-03

An on-chain registry that lets a nominator designate a proxy address, allowing cold wallet assets to be safely stored while still proving ownership, and letting newly received assets go directly to a specified delivery address.

Why it is needed

In situations that require proving asset ownership, such as Discord role verification, whitelist minting, or DAO voting, users must sign or interact with a contract directly using the wallet holding that asset. As a result, a wallet holding valuable assets cannot be fully isolated in cold storage, and every interaction exposes it to the risk of asset theft by a malicious contract. Users end up having to choose between security and convenience, worried that storing assets in a cold wallet means missing out on benefits, which lowers overall trust in the Ethereum ecosystem. In addition, newly issued assets are only delivered to the wallet used for the interaction, leaving no way to receive them directly into the wallet intended for storage.

What to implement

In depth

Nominations, proxy records, and the two-step structure

A proxy relationship is created in two steps. First, the nominator nominates an address to serve as proxy using makeNomination, which creates a Nomination that is still pending. Only when the nominated proxy address calls acceptNomination to accept and sets a delivery address does a Proxy Record get registered and activated in the registry. Both the nominator and the proxy can delete the record and nomination at any time, and unless deleted, the proxy relationship persists eternally.

The data structure stored by the registry

Nominations are stored as a mapping (address => address) from the nominator address to the proposed proxy address. Proxy records are stored as a mapping (address => struct) keyed by the proxy address, containing a struct with the nominator address and delivery address. In other words, the proxy address is the reference point for lookups, from which both the nominator and delivery address are obtained. The delivery address is first set by the proxy in acceptNomination, and can be changed at any time afterward via updateDeliveryAddress. Only the proxy has this authority to change it.

Rules against duplicate nominations and nominator reversion

An address that is already acting as a nominator or proxy in an active proxy relationship cannot be nominated again. If the registry receives a nominator address, it reverts. This is the more important rule. Because the proxy enjoys benefits on behalf of the nominator, if the nominator also simultaneously received the same benefits, the same holdings would be double counted across two addresses. Once the nominator deletes the record, they can interact directly again immediately, and the proxy immediately loses the related benefits.

Backward-compatible handling for addresses with no mapping

If the registry receives an address with no active mapping, it returns that same address as both the nominator and delivery address. In other words, a plain address that has not set up a proxy relationship is treated as acting on its own behalf, preserving existing behavior. Thanks to this, contracts or apps querying this registry can apply the same lookup logic to every address, with no effect on users who do not use a proxy.

View functions for lookups

The registry provides various lookup functions. nominationExists, proxyRecordExists, and nominatorRecordExists each check for the existence of a nomination or record, while getProxyRecord and getNominatorRecord together return the nominator, proxy, and delivery addresses. getAddresses returns the nominator and delivery address along with whether the given address is a proxy (isProxied), and getRole reports the current status of an address as a string. Most functions also come with a ForCaller version based on msg.sender, so a contract can call them with no arguments when looking itself up.

State-changing functions and the provider parameter

makeNomination, acceptNomination, updateDeliveryAddress, deleteRecordByNominator, and deleteRecordByProxy are all state-changing functions that all require a uint256 parameter called _provider. If there is no separate Provider ID, you can pass 0 to use the default EPS provider. acceptNomination takes both the nominator and delivery address together, and acceptance only succeeds if the nominator passed in matches the nominator actually recorded in the nomination. Record deletion is split into deleteRecordByNominator, called from the nominator side, and deleteRecordByProxy, called from the proxy side; if a record exists, both the record and nomination are deleted together, and if no record exists, only the nomination is deleted.

The four states distinguished by getRole

getRole and getRoleForCaller return the current status of an address as a string. None means the address appears in neither a nomination nor a record at all, Nominator - Pending means it has nominated as a nominator but the proxy has not yet accepted, Nominator - Active means the nomination has been accepted and it has become the nominator of an active proxy record, and Proxy - Active means it has become the proxy of an active proxy record. These four states let the calling side clearly distinguish the current stage of the relationship.

Proposal status

This proposal is in Stagnant status, meaning discussion is no longer progressing and has stalled. The body lists contract addresses deployed on mainnet, Ropsten, and Rinkeby as test cases. However, since the standard itself is a stalled proposal, it should be noted that it could be resumed or revised.

Things to watch out for

Original ERC · ← ERCs