Generate ECDSA secp256k1 or Ed25519 key pairs with the Hiero SDKs to sign Hedera transactions, derive public keys, and set EVM-compatible account addresses.
ECDSA is recommended for new accounts and applications. It enables setting an EVM Address from Public Key on the account, native compatibility with EVM tooling, and msg.sender resolution in Solidity. See Keys and Signatures for the full comparison.
Create a new ECDSA (secp256k1) key pair used to sign transactions and queries on a Hedera network. The private key is kept confidential and is used to sign transactions that modify the state of an account, topic, token, smart contract, or file entity on the network. The public key can be shared with other users on the network.
Create a new ED25519 key pair used to sign transactions and queries on the Hedera network. The private key is kept confidential and is used to sign transactions that modify the state of an account, topic, token, smart contract, or file entity on the network. The public key can be shared with other users on the network.
PrivateKey.generate() is deprecated and silently generates an ED25519 key. Use PrivateKey.generateECDSA() for new accounts (recommended) or PrivateKey.generateED25519() if ED25519 is required.