--- eip: to be assigned title: web2 platform eth/token docking solution description: Solve the recharge problem of web2 platform with all advantages using only EVM contract author: Jame (@ZWJKFLC) discussions-to: status: Draft type: Standards Track category: ERC created: 2024-08-10 --- ## Abstract Solve the recharge issue when connecting to ETH/Token on the web2 platform. Without changing the current operating habits of users depositing into exchanges, a new design is implemented on the underlying implementation to achieve the following features. 1. It is easy for web2 platform development to be connected to the blockchain. 2. Decentralization 3. No need to worry about the security of the secret key 4. Lower gas fees 5. 0 maintenance cost ## Motivation If a web2 developer needs to use virtual currency to collect payments, he will spend a lot of time learning and developing a series of things, and the security of his secret key is not easy to guarantee (usually stored on the server or encrypted, but There is a secret key in the runtime memory). Or use the dex solution, and the security is provided by dex, but even so, the dex security solution is actually not easy to use, and uses an extremely complicated system to ensure the security of the secret key. To this end, I thought of a systematic way to solve this series of problems using only contracts. Use proxy contract, minimum proxy contract, create2 to implement this sub-wallet. The following features can be achieved: 1. Lower gas fee. The gas to create a sub-wallet only requires 32,000 gas and can be reused. If SELFDESTRUCT can also be used. It is destroyed after creation and use, and can be executed with lower gas fees. Generally, you need to transfer eth to pay gas and then transfer other assets out. This cannot be combined and processed, which is a waste of gas fees. 2. Higher security. When generating and aggregating sub-wallets, you only need to provide the public key of the parent wallet and do not need to use the private key of the parent wallet. The parent wallet can be a multi-signature wallet, which provides higher security. 3. More convenient docking. Use this solution to create a unified contract and decentralized web page. Ordinary web2 developers can dock using only rpc, and the aggregation operation is performed on the decentralized web page. 4. 0 maintenance cost, maintained by the chain, no web2 developers are required to maintain servers for financial security. 5. It is implemented using only contracts and can be used as the infrastructure of each EVM chain. 6. Upgradeable and expandable. Using agency contracts, their logical functions can be upgraded. ## Rationale ## Backwards Compatibility This ERC does not change the consensus layer, so there are no backwards compatibility issues for Ethereum as a whole. ## Reference Implementation See `https://github.com/ZWJKFLC/BestProxyWallet/tree/main/Hardhat_Contract/contracts` Simple single version [Simple_Imputation](https://github.com/ZWJKFLC/BestProxyWallet/blob/main/bk/Simple_Imputation/Simple_Imputation.sol) It is the most simplified version of the idea. Excluding the openzepplin code, there are only less than 70 lines of core code. A more complete single version [Imputation](https://github.com/ZWJKFLC/BestProxyWallet/blob/main/Hardhat_Contract/contracts/Imputation/Imputation.sol) Platform version [Simple_Imputations](https://github.com/ZWJKFLC/BestProxyWallet/tree/main/bk/Simple_Imputations) ## Copyright Copyright and related rights waived via [CC0](../LICENSE.md).