Overview
Migrating to Hedera’s EVM implementation involves understanding key differences in account models, signature verification, and key types. On Ethereum, addresses are derived from ECDSA public keys, andECRECOVER is commonly used to validate signatures. Hedera, however, supports both ECDSA and ED25519 (Hedera-native account) keys, key lists, and threshold keys, and every account has a native account ID (0.0.<num>) alongside its EVM address.
This section helps you navigate ECDSA and ED25519 signature workflows, introduces the isAuthorized function from the system contract from HIP-632, and clarify how different account key scenarios map onto Hedera’s environment.
Understanding Account Models and Aliases
Hedera’s account model supports both ED25519 and ECDSA keys. Every account is identified by its account ID (0.0.<num>), and an account’s keys can be updated without changing that ID. Signature validation varies by key type: ED25519 keys use isAuthorized or isAuthorizedRaw, while ECDSA accounts with an EVM Address from Public Key can also use ECRECOVER.
Clarifying Account ID vs. EVM Address
Hedera accounts have a native Account ID (e.g.,0.0.xxxx) and can also have an EVM Address from Public Key (a 20-byte address like Ethereum’s, derived from the ECDSA public key). The EVM Address from Public Key makes the account compatible with ECRECOVER and other familiar EVM tools. For more details, see the Smart Contract Addresses page.
For a full explanation of how Hedera accounts work in EVM context — including hollow accounts (auto-created with no signing key) and accounts without an ECDSA key — see Account Model for EVM Developers.
Working With ECDSA Accounts in Testing
If you are writing an Ethereum smart contract and need to interact with an ECDSA Hedera account identified by its Account ID, reference it by its EVM Address so that functions likeECRECOVER resolve the correct account, as long as the EVM Address is correctly set from the account’s public key. Here are some considerations:
- During testing, use the EVM Address returned by the account object, not the Account ID (e.g.,
0.0.xxxx). If the account was created withsetECDSAKeyWithAlias(), that value is the EVM Address from Public Key (the 20-byteKeccak-256(publicKey)form) and works with EVM tools like Hardhat and Truffle and withECRECOVER. If no alias was set at creation, the account falls back to the EVM Address from Account ID (the long-zero form), which is not compatible withECRECOVER. Confirm which form your account uses before deploying. - Including this conversion step in your test setup saves time and confusion, ensuring your EVM-compatible smart contracts can reliably work with Hedera’s ECDSA accounts.
Key Permutations & Scenarios on Hedera
- ECDSA Accounts:
- Behave similarly to standard EVM accounts.
- Allow validation of ECDSA signatures with
ECRECOVER. - Provide smooth interoperability with EVM tools and dApps.
- ED25519 Accounts:
- Require
isAuthorizedorisAuthorizedRawfor signature validation. - Support complex configurations like multi-key or threshold-based approval.
- Enhance security and adaptability, but differ from EVM’s static address.
- Require
Using ECRECOVER for ECDSA Accounts on Hedera
Hedera supports ECDSA accounts, allowing EVM developers to validate ECDSA signatures using familiar tools likeECRECOVER. ECDSA accounts on Hedera use aliases derived from Keccak-256(publicKey), ensuring compatibility with Ethereum’s signature workflows.
Example: Verifying ECDSA Signatures Using ECRECOVER
- ECDSA accounts on Hedera behave just like EVM accounts when validating signatures with
ECRECOVER. - Use ECDSA accounts when interacting with EVM-compatible dApps, wallets, or bridges for minimal friction.
Using System Contract Functions for ED25519 Accounts
Hedera’s native key type is ED25519, which is not compatible withECRECOVER. To accommodate ED25519 (Hedera-native) accounts and more complex configurations, HIP-632 introduces Hedera Account Service system contract functions:
- isAuthorized: Validates a protobuf
SignatureMapagainst the account’s full key, supporting threshold or multi-key accounts. - isAuthorizedRaw: Validates a single ED25519 or ECDSA signature over a 32-byte hash, analogous to
ECRECOVERbut also for ED25519 keys.
0x16a through a typed interface and return its result:
- Hedera-Native Accounts:
Most Hedera accounts use ED25519 keys, soisAuthorizedRawis essential for verifying their signatures. - Multi-Key and Threshold Accounts:
UseisAuthorizedfor scenarios requiring multiple signatures, ensuring only properly authorized actions occur.
Note: For detailed parameter formats, consult the HIP-632 specification and the Hedera Account Service documentation. Ensure that
accountAlias, messageHash, and signatureBlob adhere to the required formats outlined there.Practical Use Case: Multi-Key Verification
Hedera supports advanced account configurations like multi-sig and threshold accounts, which may include both ECDSA and ED25519 keys. UsingisAuthorized, you can enforce complex signing requirements, such as requiring multiple parties to sign before executing a contract operation.
Example: DAO Governance Using Multi-Sig
Key Updates and EVM Addresses
For EVM-oriented applications, create accounts with an ECDSA key and set the EVM Address from Public Key at creation. That gives the account native compatibility with EVM wallets, JSON-RPC tooling,ECRECOVER, and smart contract interactions.
Why This Matters for EVM Developers:
- The EVM Address from Public Key is immutable. Updating an account’s keys with
CryptoUpdateTransactiondoes not change it; the address stays bound to the original ECDSA public key. After a key update, the account can no longer send EVM transactions: the network rejects a JSON-RPC transaction signed with the old key (INVALID_SIGNATURE, because it no longer matches the account’s key), and a signature from the new key recovers to a different address that does not belong to the account.ECRECOVERchecks against the address still accept the old key. - Recover by migrating, not by rotating. If an ECDSA key is compromised or must be replaced, create a new ECDSA account with a new EVM address and migrate assets and state to it. Do not rely on key rotation to keep the same EVM identity.
isAuthorizedfollows the account’s current key. Contracts that verify an account throughisAuthorizedcheck whatever key the account holds at call time, so they accept the new key after an update.- If you expect to rotate keys soon after creation, consider not setting the EVM Address from Public Key at creation. This is a trade-off: the account then uses its EVM Address from Account ID (the long-zero form), and it cannot send transactions from EVM wallets or through JSON-RPC at all, because the network finds the sender of an EVM transaction by the address its signature recovers to. It also does not work with
ECRECOVER. Native SDK transactions andisAuthorizedchecks keep working.
updateTrustedSigner. Production contracts usually add a separate recovery role, a timelock, or a multi-key account checked with isAuthorized.