EVM Pallet
Overview
Glitch EVM Engine
The EVM pallet uses SputnikVM as the underlying EVM engine.
Execution lifecycle
There are a separate set of accounts managed by the EVM pallet. Glitch-based accounts can call the EVM pallet to deposit or withdraw the balance from the Glitch base currency into a different balance managed and used by the EVM pallet. Once a user has populated their balance, they can create and call smart contracts using this pallet.
There's a one-to-one mapping from Glitch accounts and EVM external accounts that are defined by a conversion function.
EVM pallet vs Ethereum network
The EVM pallet should be able to produce nearly identical results compared to the Ethereum mainnet, including gas cost and balance changes.
The available length of block hashes may not be 256 depending on the configuration of the System pallet in the Glitch runtime.
Given one Ethereum transaction and one Substrate account's private key, any Ethereum transaction can be converted into a transaction compatible with this pallet.
EVM account
Here are the steps to link the EVM account with the Glitch account:
Step 1: From the Glitch account, send a request
claim_account
with input 1: EVM pubkey and input 2: signatureStep 2.1: Get
public key
from EVM accountStep 2.2: To get
Signature
, call functionSign_account
(step 2.2.1) to sign EVM account with the input:private key
of Glitch account.
After claiming account successfully, EVM account with the Glitch account is synchronized with each other and has the same balance. It means that the EVM account uses balance of the Substrate account. So when making EVM transactions, users donβt have to deposit from the Substrate account to the EVM account.
Last updated