Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC: web2 platform eth/token docking solution #586

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions ERCS/erc-2233.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
eip: to be assigned

Check failure on line 2 in ERCS/erc-2233.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `eip` must be an unsigned integer

error[preamble-eip]: preamble header `eip` must be an unsigned integer --> ERCS/erc-2233.md:2:5 | 2 | eip: to be assigned | ^^^^^^^^^^^^^^^ not a non-negative integer | = help: see https://ethereum.github.io/eipw/preamble-eip/

Check failure on line 2 in ERCS/erc-2233.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

file name must reflect the preamble header `eip`

error[preamble-file-name]: file name must reflect the preamble header `eip` --> ERCS/erc-2233.md:2:5 | 2 | eip: to be assigned | ^^^^^^^^^^^^^^^ this value | = help: this file's name should be `erc-to be assigned.md` = help: see https://ethereum.github.io/eipw/preamble-file-name/
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:

Check failure on line 6 in ERCS/erc-2233.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `discussions-to` is not a valid URL

error[preamble-discussions-to]: preamble header `discussions-to` is not a valid URL --> ERCS/erc-2233.md:6:16 | 6 | discussions-to: | ^ relative URL without a base | = help: see https://ethereum.github.io/eipw/preamble-discussions-to/

Check failure on line 6 in ERCS/erc-2233.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `discussions-to` should point to a thread on ethereum-magicians.org

error[preamble-re-discussions-to]: preamble header `discussions-to` should point to a thread on ethereum-magicians.org --> ERCS/erc-2233.md:6:16 | 6 | discussions-to: | ^ required pattern was not matched | = info: the pattern in question: `^https://ethereum-magicians.org/t/[^/]+/[0-9]+$` = help: see https://ethereum.github.io/eipw/preamble-re-discussions-to/
status: Draft
type: Standards Track
category: ERC
created: 2024-08-10
---

Check failure on line 12 in ERCS/erc-2233.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body is missing section(s): `Specification`, `Security Considerations`

error[markdown-req-section]: body is missing section(s): `Specification`, `Security Considerations` --> ERCS/erc-2233.md | | = help: must be at the second level (`## Heading`) = help: see https://ethereum.github.io/eipw/markdown-req-section/


## 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)

Check failure on line 50 in ERCS/erc-2233.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> ERCS/erc-2233.md | 50 | Simple single version [Simple_Imputation](https://github.com/ZWJKFLC/BestProxyWallet/blob/main/bk/Simple_Imputation/Simple_Imputation.sol) | = help: see https://ethereum.github.io/eipw/markdown-rel-links/
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)

Check failure on line 53 in ERCS/erc-2233.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> ERCS/erc-2233.md | 53 | 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)

Check failure on line 55 in ERCS/erc-2233.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> ERCS/erc-2233.md | 55 | Platform version [Simple_Imputations](https://github.com/ZWJKFLC/BestProxyWallet/tree/main/bk/Simple_Imputations) |


## Copyright

Copyright and related rights waived via [CC0](../LICENSE.md).

Loading