Skip to content

Commit e032589

Browse files
Apply suggestions from code review
Co-authored-by: Dawn Kelly <[email protected]>
1 parent 029b8b7 commit e032589

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

polkadot-protocol/smart-contract-basics/accounts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ The [`AccountId32Mapper`](https://paritytech.github.io/polkadot-sdk/master/palle
4040

4141
The conversion from 32-byte Polkadot accounts to 20-byte Ethereum addresses is more complex than the reverse direction due to the lossy nature of the conversion. The [`AccountId32Mapper`](https://paritytech.github.io/polkadot-sdk/master/pallet_revive/struct.AccountId32Mapper.html){target=\_blank} handles this through two distinct approaches:
4242

43-
- **For Ethereum-derived accounts** - The system uses the [`is_eth_derived`](https://paritytech.github.io/polkadot-sdk/master/pallet_revive/fn.is_eth_derived.html){target=\_blank} function to detect accounts that were originally Ethereum addresses (identified by the `0xEE` suffix pattern). For these accounts, the conversion simply strips the last 12 bytes to recover the original 20-byte Ethereum address.
43+
- **For Ethereum-derived accounts** - The system uses the [`is_eth_derived`](https://paritytech.github.io/polkadot-sdk/master/pallet_revive/fn.is_eth_derived.html){target=\_blank} function to detect accounts that were originally Ethereum addresses (identified by the `0xEE` suffix pattern). For these accounts, the conversion strips the last 12 bytes to recover the original 20-byte Ethereum address.
4444

45-
- **For native Polkadot accounts** - Since these accounts use the full 32-byte space and weren't derived from Ethereum addresses, direct truncation would lose information. Instead, the system:
45+
- **For native Polkadot accounts** - Since these accounts utilize the whole 32-byte space and weren't derived from Ethereum addresses, direct truncation would result in lost information. Instead, the system:
4646
1. Hashes the entire 32-byte account using Keccak-256
4747
2. Takes the last 20 bytes of the hash to create the Ethereum address
4848
3. This ensures a deterministic mapping while avoiding simple truncation

0 commit comments

Comments
 (0)