Skip to main content

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, and ECRECOVER 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 like ECRECOVER 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 with setECDSAKeyWithAlias(), that value is the EVM Address from Public Key (the 20-byte Keccak-256(publicKey) form) and works with EVM tools like Hardhat and Truffle and with ECRECOVER. 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 with ECRECOVER. 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 isAuthorized or isAuthorizedRaw for signature validation.
    • Support complex configurations like multi-key or threshold-based approval.
    • Enhance security and adaptability, but differ from EVM’s static address.
This flexibility enables interoperability and more robust security models than standard EVM environments.

Using ECRECOVER for ECDSA Accounts on Hedera

Hedera supports ECDSA accounts, allowing EVM developers to validate ECDSA signatures using familiar tools like ECRECOVER. ECDSA accounts on Hedera use aliases derived from Keccak-256(publicKey), ensuring compatibility with Ethereum’s signature workflows. Example: Verifying ECDSA Signatures Using ECRECOVER
Key Considerations:
  • 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 with ECRECOVER. To accommodate ED25519 (Hedera-native) accounts and more complex configurations, HIP-632 introduces Hedera Account Service system contract functions:
  • isAuthorized: Validates a protobuf SignatureMap against 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 ECRECOVER but also for ED25519 keys.
Example: Validating ED25519 Signatures Call the Hedera Account Service system contract at 0x16a through a typed interface and return its result:
Check the values these functions return. An invalid signature returns false from a successful call, so a low-level call that only checks the call’s success flag accepts forged signatures.
Why This Matters for EVM Developers:
  • Hedera-Native Accounts:
    Most Hedera accounts use ED25519 keys, so isAuthorizedRaw is essential for verifying their signatures.
  • Multi-Key and Threshold Accounts:
    Use isAuthorized for 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. Using isAuthorized, you can enforce complex signing requirements, such as requiring multiple parties to sign before executing a contract operation. Example: DAO Governance Using Multi-Sig
This example demonstrates how you might require multiple signatures to approve a DAO proposal, enhancing the security and trustworthiness of your governance mechanisms.

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 CryptoUpdateTransaction does 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. ECRECOVER checks 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.
  • isAuthorized follows the account’s current key. Contracts that verify an account through isAuthorized check 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 and isAuthorized checks keep working.
Example: Replacing a Trusted Signer in a Contract Contracts that store a trusted signer’s EVM address need a way to point at the new account after a migration:
If the current signer’s key is compromised, the attacker can also call updateTrustedSigner. Production contracts usually add a separate recovery role, a timelock, or a multi-key account checked with isAuthorized.

Additional References and Resources