-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
dip: 2 | ||
title: Seamless Account Integration Between EVM and Substrate | ||
description: This proposal introduces the adoption of `H160` account addresses in Substrate-based chains to unify address formats with EVM, which aims to simplify user interactions and enhance compatibility with the Ethereum ecosystem. | ||
authors: Darwinia Network (@AurevoirXavier, @boundless-forest, @hackfisher) | ||
status: Final | ||
type: Core | ||
created: 2023-12-13 | ||
--- | ||
|
||
|
||
## Abstract | ||
To facilitate Ethereum integration, Substrate-based chains are transitioning to `H160` account addresses, using `ECDSA` for signatures. | ||
This change streamlines the user experience by consolidating address types and wallets. | ||
|
||
|
||
## Rationale | ||
Ethereum-like and Substrate-based chains differ significantly in their account format. | ||
|
||
Ethereum uses `H160` for its account addresses, while Substrate opts for `H256`. | ||
|
||
With the EVM being a superior feature, more Substrate-based chains are incorporating it into their systems to tap into Ethereum's ecosystem | ||
Darwinia is doing the same. | ||
|
||
However, this creates an issue where users and developers must juggle two distinct address types and wallets. | ||
|
||
To avoid this disconnect, we've decided to adopt `H160` as the native account address type for Substrate. | ||
|
||
With this improvement, users only need to interact with one type of account and wallet. | ||
|
||
|
||
## Specification | ||
Utilize `ECDSA` as the signature algorithm for Substrate native runtime. | ||
|
||
```rs | ||
/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. | ||
pub type Signature = fp_account::EthereumSignature; | ||
|
||
/// Some way of identifying an account on the chain. | ||
/// We intentionally make it equivalent to the public key of our transaction signing scheme. | ||
pub type AccountId = <<Signature as sp_runtime::traits::Verify>::Signer as sp_runtime::traits::IdentifyAccount>::AccountId; | ||
``` | ||
|
||
The address is 20 bytes long, and the public key no longer has a corresponding SS58 address. | ||
|
||
All pallet addresses have been truncated to 20 bytes; simply remove the trailing zeros, which are 12 bytes long. | ||
|
||
|
||
## Copyright | ||
Copyright and related rights waived via [CC0](../LICENSE). |