Open livid opened 2 years ago
Let me technically derive the feasibility of this solution:
We build an RPC proxy that translates requests to Ethereum RPC API into requests for Starcoin and the response of starcoin RPC into the response of Ethereum.
Translating the query API should not be too difficult. It is mainly an engineering task.
However, if we want to submit transactions, we encounter two difficulties:
One solution maybe is:
The user sends the Ethereum transaction to the proxy node, which packages the Ethereum transaction into a payload of Starcoin transaction and submits it to a smart contract on the Starcoin chain through the proxy account, we call the smart contract EVMProxy
.
The EVMProxy parses the Ethereum transaction and then verify and executes the transaction in the smart contract by simulating the user.
0x::Signature::ecrecover
Another approach might be to support Walletconnect, it supports multi chain, I record an issue: https://github.com/starcoinorg/starmask-extension/issues/54
Make some essential features usable with MetaMask by adding a JSON RPC endpoint:
Since MetaMask is already on millions of users' Chrome, if users can access some Starcoin features from MetaMask, it would be an easier first step for users to try Starcoin.
Some more complicated features like interacting with an EVM contract would not be possible at the moment.