Trait darwinia_support::evm::DeriveSubstrateAddress
source · [−]pub trait DeriveSubstrateAddress<AccountId> {
fn derive_substrate_address(address: &H160) -> AccountId;
}
Expand description
A trait for converting from Ethereum address to Substrate account_id.
Required Methods
fn derive_substrate_address(address: &H160) -> AccountId
Implementors
impl<AccountId> DeriveSubstrateAddress<AccountId> for ConcatConverter<AccountId> where
AccountId: From<[u8; 32]>,
The ConcatConverter used to convert Ethereum address to Substrate account_id The concat rule included three parts:
- AccountId Prefix: concat(“dvm:”, “0x00000000000000”), length: 11 bytes
- EVM address: the original evm address, length: 20 bytes
- CheckSum: byte_xor(AccountId Prefix + EVM address), length: 1 bytes