Skip to content

Latest commit

 

History

History
45 lines (26 loc) · 6.31 KB

hederas-evm-equivalence-goals-and-exceptions.md

File metadata and controls

45 lines (26 loc) · 6.31 KB

Understanding Hedera for EVM Developers

Hedera vs Ethereum

While Hedera strives for EVM equivalence, it's important to recognize certain unique aspects and fundamental differences in its network architecture and operations, such as the handling of state data structures, hashing algorithms, and the management of accounts and transactions. These distinctions in network behaviors are intentional design choices made to align with EVM standards, thereby achieving EVM compatibility. This approach ensures that while Hedera aligns closely with Ethereum, it also maintains its distinctive features and optimization.

Network and Security Differences

FunctionHederaEthereum
Network State Data StructureVirtual Merkle TreeMerkle Patricia Trie
Hashing AlgorithmSHA-384Keccak-256*
SecurityHigh security with aBFTSecure with decentralized PoS network

{% hint style="info" %} *Note: Hedera'a EVM supports Keccak-256. Transactions received through EthereumTransaction (via the JSON-RPC relay) are hashed using Keccak-256. Only transactions using ED25519 keys through the Hedera API (HAPI) are hashed using SHA-384. {% endhint %}

Account and Authorization Differences

FunctionHederaEthereum
Authorization SignaturesUsed for transaction authorization outside of smart contractsTypically used within smart contracts
Special System AccountsAvailable with unique propertiesNot available
Non-ECDSA Accounts

Non-ECDSA accounts (such as ED or multi-key) are supported by Hedera and

ECDSA accounts are fully compatible

ECDSA accounts are supported by Ethereum and non-ECDSA accounts are not supported/compatible
Account DeletionPossibleNot possible

Contract and Gas Differences

FunctionHederaEthereum
Data Return on Static CallsData retrieval must be done through the relayData returned directly
Gas FeesCharges at least 80% of gas fees regardless of transaction outcomeGas fees depend on transaction outcome but typically 100% of the gas fees are charged and the unused portion is credited back
Contract LifecycleContract entities can expire, rent fees may applyNo expiration or rent fees

Transactions and Queries Differences

FunctionHederaEthereum
Transaction Size Limit6kbNo limit
Transaction ThrottlingTransactions may be throttled by gas limitsTransactions pending until future submission
Query CostsNot free, can use mirror node for free queriesFree read-only calls
MempoolsNo mempoolsMempools available
CostLow, predictable fees (fraction of a cent)Variable, often high gas fees

RPC Endpoint and Communication Differences

FunctionHederaEthereum
RPC Block Requests (e.g., eth_getBlockByHash* & eth_getBlockByNumber )Return zero 32bytes hexadecimal value for the stateRootReturns the stateRoot hexadecimal value of the final state trie of the block
CommunicationRequires communication with both consensus and mirror nodesDirect communication with nodes

{% hint style="info" %} Note: Hedera Consensus and mirror nodes do not provide Ethereum RPC API endpoints. {% endhint %}

Token and Fee Differences

FunctionHederaEthereum
Native TokensSupports native tokens in addition to ERC-20 and ERC-721 token standardsAll ERC token standards but primarily ERC-20 and ERC-721 tokens.
Fee StructureComplex with two different gas pricesSingle gas price
Token Association**Concept of token association No concept of token association
Keys for Token FunctionalityKeys control access to token functionality (KYC, FREEZE, WIPE, supply, fee, and PAUSE)No equivalent native functionality

{% hint style="info" %} **Note: Token Association only applies to native HTS tokens and does not affect ERC-20/721 tokens. {% endhint %}

Other Differences

FunctionHederaEthereum
Precheck FailuresMultiple precheck failure reasonsTypically single failure reason
HBAR Decimal Precision8 or 18 (varies across Hedera APIs)Consistent 18 point decimal precision