← Back to home

Programmatic Delegation on Optimism

Delegate Cash gives crypto power of attorney, where any wallet can delegate message signing authority to another. This increases security and granularity in transactions. We're powering airdrops, crypto gaming, governance, custody, and payments.

Screenshots

Programmatic Delegation on Optimism screenshot 1
Programmatic Delegation on Optimism screenshot 2
Programmatic Delegation on Optimism screenshot 3

Problem Statement

Delegate Cash has been a long time coming, and is supporting by an EIP we recently filed in EIP-5639.Currently proof-of-ownership of assets to third parties is commonplace in the ETH ecosystem. This can be found in everything from airdrops to allowlists to verifying NFT ownership for gated communities.Users are required to sign messages of authentication, but this comes with significant dangers and risks to assets that exist in a wallet beyond the assets in questions, particularly if assets are stored in a "cold" wallet.While some people have rolled smart contracts, a global registry is necessary for widespread adoption and technical ease-of-use. ENS names are too dangerous to be relied on as an EIP standard. EPI-712 signatures do not work well with smart contracts. And custom solutions lack generalizability.Delegate Cash is fully immutable with no admin powers. This removes governance as an attack vector, and focuses on flexibility and upgradeability, with a neutral, trustless standard.Delegate Cash has 0 outside dependencies, and is fully self-contained.Delegation is also fully distinct from ownership, and is written with clearer method names to avoid confusion.Delegate cash uses a global registry with the same vanity address across multiple EVM chains to make it easy to access.We also built an all new UI/UX distinct from the launch UI/UX.

Solution

We used Optimism to deploy the latest instance of Delegate Cash. Having Delegate Cash work with a roll-up required a little bit of special work, but we were able to come through in the end.Here's an example of Delegate Cash under the hood:/// WRITE /// function delegateForAll(address delegate, bool value) external; function delegateForContract(address delegate, address contract_, bool value) external; function delegateForToken(address delegate, address contract_, uint256 tokenId, bool value) external; function revokeAllDelegates() external; function revokeDelegate(address delegate) external; function revokeSelf(address vault) external; /// READ /// function getDelegationsByDelegate(address delegate) external view returns (DelegationInfo[] memory); function getDelegatesForAll(address vault) external view returns (address[] memory); function getDelegatesForContract(address vault, address contract_) external view returns (address[] memory); function getDelegatesForToken(address vault, address contract_, uint256 tokenId) external view returns (address[] memory); function checkDelegateForAll(address delegate, address vault) external view returns (bool); function checkDelegateForContract(address delegate, address vault, address contract_) external view returns (bool); function checkDelegateForToken(address delegate, address vault, address contract_, uint256 tokenId) external view returns (bool);

Hackathon

ETHSanFrancisco 2022

2022

Contributors