I would like to service users on both Substrate and EVM (Ethereum Virtual Machine) blockchains. But the two systems do some things differently. What would be the best way to deploy a blockchain that supports both Substrate and EVM?
-
1just to be clear: by default a substrate chain does nothing, you have to add pallets for the protocol, WASM Contracts, EVM contracts, governance, even the token is a pallet. So be careful and make sure your chain has all the bells and whistles you need.– Micha RoonCommented Feb 8, 2022 at 23:23
3 Answers
You can deploy to Moonbeam/Astar or if you fancy having a go yourself you can check out the EVM Pallet
-
The EVM Pallet seems interesting. Do you have any idea about the stated "customizable conversion functions" used to map Substrate accounts and EVM external accounts?– John OtuCommented Feb 9, 2022 at 9:14
Most evm compatible substrate chains uses pallet-evm and pallet-ethereum provided by frontier, for example Moonbeam, ChainX, Edgeware etc.
You can start with the Substrate Frontier Node Template project.
It is a FRAME-based Substrate node with the Ethereum RPC support, ready for hacking.
You can deploy the frontier node the same way you do a substrate node.
-
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– Community BotCommented Feb 23, 2022 at 17:36
-
@navigaid: Frontier is the Ethereum compatibility toolkit. To have EVM compatibility alone, you don't need to make your chain Ethereum compatible. You could just use
pallet-evm
. Commented Mar 21, 2022 at 16:54
You can turn your substrate into being as close as possible to ethereum by adopting ethereum conventions for example changing address types to match. But if you do that, those addresses need a translation step when talking to other parachains (not a problem if you have a solo chain). It's a question of trade offs and finding a happy medium.
There was a fantastic walk-though of how to create a compatible chain at Sub0 (it's intense but an amazing demonstration of the flexibility that the generics gives you).
Remember the other option which may be more appropriate to your use case is rather than doing all the work to build an EVM compatible chain, you could build on one of the existing EVM compatible chain platforms like Moonbeam, Acala or Astar for example that each have chosen different tradeoffs on EVM compatibility.