# Hedera Account Management

> Create and manage Hedera accounts programmatically — AccountCreate/Update/Delete/Info, ED25519 vs ECDSA keys, KeyList and ThresholdKey multisig, balances and memo updates. Use when the user mentions accounts, create account, multisig, threshold key, update keys, delete account, account info query, guardian keys, AccountCreateTransaction, AccountUpdateTransaction, CryptoTransfer to fund, or asks how Hedera accounts differ from Ethereum EOAs.

- Skill: `evaluris-solutions/hedera-account-management` (Agent Skill, multi-file: 7 files)
- Install (CLI): `npx skillmds@latest add evaluris-solutions/hedera-account-management`
- Raw SKILL.md: https://api.skillmd.com/api/skills/evaluris-solutions/hedera-account-management/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Evaluris-Solutions (https://skillmd.com/u/evaluris-solutions)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/evaluris-solutions/hedera-account-management

---


## Overview

Hedera accounts are **first-class entities** (`shard.realm.num`), hold **HBAR + token associations**, and support richer **key structures** than a single secp256k1 EOA. This skill maps SDK flows to official docs for [Accounts](https://docs.hedera.com/hedera/core-concepts/accounts.md) and SDK guides under [Accounts and HBAR](https://docs.hedera.com/hedera/sdks-and-apis/sdks/accounts-and-hbar.md).

## When to use this skill

- Generating **ED25519** vs **ECDSA(secp256k1)** keys for HTS vs EVM interoperability decisions.
- Funding new accounts via `CryptoTransfer` / `TransferTransaction`.
- Rotating keys with `AccountUpdateTransaction` while preserving account ID.
- Designing **m-of-n** multisig using `ThresholdKey` + `KeyList`.

## Prerequisites

- Completed environment setup (`OPERATOR_ID` / `OPERATOR_KEY` in `.env`).
- Testnet HBAR for account creation fees + initial balance transfers.

## Workflow

1. **Choose key type**
   - **ED25519** — default native curve; compact signatures.
   - **ECDSA** — aligns with many Ethereum workflows; required for some EVM-centric signing pipelines.

   Generate with `PrivateKey.generateED25519()` or `PrivateKey.generateECDSA()` ([Generate a new key pair](https://docs.hedera.com/hedera/sdks-and-apis/sdks/keys/generate-a-new-key-pair.md)).

2. **Create an account** — minimal pattern:

   ```javascript
   const newKey = PrivateKey.generateED25519();
   const tx = await new AccountCreateTransaction()
     .setKey(newKey.publicKey)
     .setInitialBalance(Hbar.fromTinybars(50_000_000)) // 0.5 ℏ example
     .freezeWith(client);
   const signTx = await tx.sign(operatorKey);
   const rx = await signTx.execute(client);
   const receipt = await rx.getReceipt(client);
   const newId = receipt.accountId;
   ```

   Reference implementation: [scripts/create-account.js](scripts/create-account.js).

3. **Query info / balance**

   - `AccountBalanceQuery` — hbars + token balances.
   - `AccountInfoQuery` — keys, memo, auto-renew period, proxies.

4. **Update account**

   - `AccountUpdateTransaction` — rotate keys, alter memo, extend expiration fields per network rules.

   See [scripts/update-keys.js](scripts/update-keys.js) — requires `TARGET_ACCOUNT_ID` and `OLD_KEY_DER`.

5. **Multisig**

   - Compose `KeyList` with N keys; wrap with `ThresholdKey` specifying `threshold` M.

   Example reference: [scripts/multisig-account.js](scripts/multisig-account.js).

6. **Delete account**

   - `AccountDeleteTransaction` removes account when remaining funds moved per docs — verify latest constraints under [Delete an account](https://docs.hedera.com/hedera/sdks-and-apis/sdks/accounts-and-hbar/delete-an-account.md).

## Examples

**Example 1**

> “Create a treasury account with ED25519 keys and 2 ℏ starting balance on testnet.”

Execute create workflow with `setInitialBalance(Hbar.from(2))`, securely persist **private** key material offline.

**Example 2**

> “We need 2-of-3 ops keys for our treasury.”

Build `ThresholdKey.of(2, KeyList.of(k1, k2, k3))`, document signer roster, test partial signatures failure cases.

**Example 3**

> “Rotate our admin key after a contractor offboarding.”

Use `AccountUpdateTransaction` with old key signing plus new key material; validate with `AccountInfoQuery`.

## Troubleshooting

| Code / symptom | Cause | Mitigation |
| --- | --- | --- |
| `INVALID_SIGNATURE` | Missing required signatures for multisig | Collect threshold signatures |
| `INSUFFICIENT_PAYER_BALANCE` | Operator cannot fund initial balance | Refill operator |
| `ACCOUNT_ID_DOES_NOT_EXIST` | Wrong network / stale ID | Confirm network in `Client` |
| EVM mismatch | Treating ECDSA account as if it were ETH address without alias handling | Read [Smart Contract Addresses](https://docs.hedera.com/hedera/core-concepts/smart-contracts/smart-contract-addresses.md) |

## References

- Local: [references/account-apis.md](references/account-apis.md), [references/key-types.md](references/key-types.md), [references/multisig-patterns.md](references/multisig-patterns.md)
- Docs: [Cryptocurrency Accounts protobuf reference](https://docs.hedera.com/hedera/sdks-and-apis/hedera-api/cryptocurrency-accounts.md), Java SDK recipes mirror JS closely.

