Summary
The docs for creating accounts with the SDK need to be updated to include all relevant key/alias setters on AccountCreateTransaction, reflect the deprecation of setKey, and provide a concise explanation of when to use each method.
Context
- Current docs list
setKey and setAlias in the methods table, and show setKeyWithAlias in the code snippet.
- The SDK exposes five related methods:
setKey (deprecated)
setAlias
setKeyWithAlias
setKeyWithoutAlias
setECDSAKeyWithAlias
- The Dev Playground currently uses
setECDSAKeyWithAlias.
Relevant page: https://docs.hedera.com/hedera/sdks-and-apis/sdks/accounts-and-hbar/create-an-account
Discussion Highlights
".setKey is deprecated"
"They all work as expected..."
"Deprecated means it should be discouraged from use and will continue to work until it is removed from support. We should encourage non-deprecated fields in our docs."
"You cannot have .setAlias without .setKey. These 2 methods go hand in hand...."
"We can list that it is deprecated and what they should use instead."
"We also need a brief explainer... The goal is to help the user understand what each method does, which one is the recommended one for most, and which one they need for their use case."
Action Items
Context
- The Dev Playground uses
setECDSAKeyWithAlias.
setECDSAKeyWithAlias only applies to ECDSA keys.
setKeyWithAlias works for both ED25519 and ECDSA keys.
- The docs currently mix
setKey, setAlias, and setKeyWithAlias. setKey is deprecated and should be avoided in samples.
Discussion Highlights
"Last I recall this was recommend setECDSAKeyWithAlias."
"The issue with using .setECDSAKeyWithAlias is that it only works for ECDSA keys... From a docs perspective we need to show samples that work for both. So that means either we show two code samples ... or we just show one code sample using .setKeyWithAlias."
Options to Decide
- Option A (ECDSA-first):
- Primary sample:
setECDSAKeyWithAlias (ECDSA)
- Secondary sample:
setKeyWithAlias (ED25519)
- Option B (One-size):
- Single sample:
setKeyWithAlias that works for both ED25519 and ECDSA
Action Items
Example Snippets (for reference)
-
ECDSA-only:
js
new AccountCreateTransaction()
.setECDSAKeyWithAlias(publicKey)
.execute(client)
-
Cross-key (ED25519 or ECDSA):
js
new AccountCreateTransaction()
.setKeyWithAlias(publicKey)
.execute(client),# Summary
Add documentation explaining how to derive EVM addresses from keys and existing accounts, including correct use of toEvmAddress() and the need to call AccountId.populateAccountEvmAddress(client) when starting from an AccountId.
Context
- Developers frequently need the EVM address corresponding to an account.
- When calling
toEvmAddress() directly on an AccountId string for an existing account, the result can be the long zero address unless the EVM address has been populated from Mirror Node.
- A helper call
AccountId.populateAccountEvmAddress(client) exists to fetch and set the correct EVM address for the account.
- There is an upcoming change where the long zero address cannot be used for secp256k1 (ECDSA) accounts, increasing the importance of correct usage.
Discussion Highlights
"The big piece missing from our docs is an explanation of the toEvmAddress helper function."
"You need to call an async AccountId.populateAccountEvmAddress() for it to work correctly."
"It's pretty common and some devs skip the populate step and go straight to .toEvmAddress, which can result in the incorrect address being used."
What to Document
-
Deriving from a known public key (typical during account creation; no populate needed):
js
const evmAddress = publicKey.toEvmAddress();
-
Deriving from an existing account ID (must populate first):
js
const evmAddress = (
await AccountId.fromString("0.0.1234").populateAccountEvmAddress(client)
).toEvmAddress();
-
Explain that calling AccountId.fromString("0.0.1234").toEvmAddress() without populate returns the long zero address if the EVM address is not already known locally.
-
Clarify terminology:
- “EVM Address derived from public key” (used during account creation when key is available)
- “EVM Address derived from account ID” (requires Mirror Node fetch via
populateAccountEvmAddress)
Action Items
Context
setKey is marked deprecated in the SDK and should be discouraged in docs, although it still functions.
- There is confusion about
setAlias because it is typically paired with setKey; combined methods (setKeyWithAlias, setECDSAKeyWithAlias) reduce this need.
- Prior discussions referenced a working group and HIP-1082 context; HIP-1082 remains in draft, and internal decisions predate the Hiero transition.
- The community deprecation communication may be incomplete or unclear.
References:
Discussion Highlights
"Was there any official decision to deprecate .setKey? Did we announce it?"
"Maybe we need to go back and do some cleanup... and do this in the new Hiero way so people in the community are actually aware of the deprecation and stop using it."
"Would we include setKey in the methods table... or do we just remove all mentions from docs?" — "We can list that it is deprecated and what they should use instead."
Action Items
Summary
The docs for creating accounts with the SDK need to be updated to include all relevant key/alias setters on
AccountCreateTransaction, reflect the deprecation ofsetKey, and provide a concise explanation of when to use each method.Context
setKeyandsetAliasin the methods table, and showsetKeyWithAliasin the code snippet.setKey(deprecated)setAliassetKeyWithAliassetKeyWithoutAliassetECDSAKeyWithAliassetECDSAKeyWithAlias.Relevant page: https://docs.hedera.com/hedera/sdks-and-apis/sdks/accounts-and-hbar/create-an-account
Discussion Highlights
Action Items
setKeyWithAlias,setKeyWithoutAlias, andsetECDSAKeyWithAliaswith clear descriptions and applicability (key type and behavior)setKeyas deprecated in the methods table with guidance on replacements (prefer combined methods; see recommendation decision in separate issue)setAliasrequires a key to be set, and discourage the separatesetKey+setAliaspattern in favor of combined methodssetECDSAKeyWithAliasis ECDSA-only;setKeyWithAliassupports both ED25519 and ECDSA)A definitive recommendation is needed for which method(s) to use in code samples across the docs when creating accounts with an alias.
Context
setECDSAKeyWithAlias.setECDSAKeyWithAliasonly applies to ECDSA keys.setKeyWithAliasworks for both ED25519 and ECDSA keys.setKey,setAlias, andsetKeyWithAlias.setKeyis deprecated and should be avoided in samples.Discussion Highlights
Options to Decide
setECDSAKeyWithAlias(ECDSA)setKeyWithAlias(ED25519)setKeyWithAliasthat works for both ED25519 and ECDSAAction Items
setKeyExample Snippets (for reference)
ECDSA-only:
js
new AccountCreateTransaction()
.setECDSAKeyWithAlias(publicKey)
.execute(client)
Cross-key (ED25519 or ECDSA):
js
new AccountCreateTransaction()
.setKeyWithAlias(publicKey)
.execute(client),# Summary
Add documentation explaining how to derive EVM addresses from keys and existing accounts, including correct use of
toEvmAddress()and the need to callAccountId.populateAccountEvmAddress(client)when starting from anAccountId.Context
toEvmAddress()directly on anAccountIdstring for an existing account, the result can be the long zero address unless the EVM address has been populated from Mirror Node.AccountId.populateAccountEvmAddress(client)exists to fetch and set the correct EVM address for the account.Discussion Highlights
What to Document
Deriving from a known public key (typical during account creation; no populate needed):
js
const evmAddress = publicKey.toEvmAddress();
Deriving from an existing account ID (must populate first):
js
const evmAddress = (
await AccountId.fromString("0.0.1234").populateAccountEvmAddress(client)
).toEvmAddress();
Explain that calling
AccountId.fromString("0.0.1234").toEvmAddress()without populate returns the long zero address if the EVM address is not already known locally.Clarify terminology:
populateAccountEvmAddress)Action Items
.toEvmAddress()onAccountIdwithout populateClarify and communicate the deprecation status of
AccountCreateTransaction.setKeyand evaluate whethersetAliasshould also be deprecated or retained, then align docs and SDK references with an official process.Context
setKeyis marked deprecated in the SDK and should be discouraged in docs, although it still functions.setAliasbecause it is typically paired withsetKey; combined methods (setKeyWithAlias,setECDSAKeyWithAlias) reduce this need.References:
Discussion Highlights
Action Items
setKeyacross SDKs (annotations/JSDoc, release notes, changelogs)setAlias(retain with guidance vs. deprecate) and document rationalesetKeyWithAlias/setECDSAKeyWithAlias)setKey