Create an account using the account create API
A transaction that creates a Hedera account. A Hedera account is required to interact with any of the Hedera network services as you need an account to pay for all associated transaction/query fees. You can visit the Hedera Developer Portal to create a previewnet or testnet account. You can also use third-party wallets to generate free mainnet accounts. To process an account create transaction, you will need an existing account to pay for the transaction fee. To obtain the new account ID, request the receipt of the transaction.When creating a new account using the
AccountCreateTransaction() API you will need an existing account to pay for the associated transaction fee.Transaction Fees and Signing
- The sender pays for the token association fee and the rent for the first auto-renewal period.
- See the transaction and query fees table for the base transaction fee.
- Use the Hedera fee estimator to estimate your transaction fee cost.
- The account paying for the transaction fee is required to sign the transaction.
Account Properties
Account Properties
Account Properties
For a complete list of account properties, see the accounts overview.
Maximum Auto-Associations and Fees
Accounts have a property,maxAutoAssociations, and the property’s value determines the maximum number of automatic token associations allowed.
| Property Value | Description |
|---|---|
0 | Automatic token associations or token airdrops are not allowed, and the account must be manually associated with a token. This also applies if the value is less than or equal to usedAutoAssociations. |
-1 | Unlimited automatic token associations are allowed, and this is the default for accounts created via auto account creation and for accounts that began as hollow accounts and are now complete. Accounts with -1 can receive new tokens without manually associating them. The sender still pays the maxAutoAssociations fee and initial rent for each association. |
> 0 | If the value is a positive number (number greater than 0), the number of automatic token associations an account can have is limited to that number. |
The sender pays the
maxAutoAssociations fee and the rent for the first auto-renewal period for the association. This is in addition to the typical transfer fees. This ensures the receiver can receive tokens without association and makes it a smoother transfer process.Constructor
| Constructor | Description |
|---|---|
new AccountCreateTransaction() | Initializes the AccountCreateTransaction object |
Transaction Properties
| Method | Type | Requirement |
|---|---|---|
setKey(<key>) | Key | Required |
setInitialBalance(<initialBalance>) | Hbar | Optional |
setReceiverSignatureRequired(<booleanValue>) | boolean | Optional |
setAutoRenewPeriod(<autoRenewPeriod>) | Duration | Optional |
setAccountMemo(<memo>) | String | Optional |
setMaxAutomaticTokenAssociations(<amount>) | int | Optional |
setStakedAccountId(<stakedAccountId>) | AccountId | Optional |
setStakedNodeId(<stakedNodeId>) | long | Optional |
setDeclineStakingReward(<declineStakingReward>) | boolean | Optional |
setHighVolume(<highVolume>) | boolean | Optional |
This transaction supports high-volume entity creation
(HIP-1313). Setting
setHighVolume(true) routes the transaction through dedicated
high-volume throttle capacity with variable-rate pricing. Always pair this with
setMaxTransactionFee() to cap your costs.Get Transaction Values
| Method | Type | Description |
|---|---|---|
getKey() | Key | Returns the public key on the account |
getInitialBalance() | Hbar | Returns the initial balance of the account |
getAutoRenewPeriod() | Duration | Returns the auto renew period on the account |
getDeclineStakingReward() | boolean | Returns whether or not the account declined rewards |
getStakedNodeId() | long | Returns the node ID |
getStakedAccountId() | AccountId | Returns the node account ID |
getReceiverSignatureRequired() | boolean | Returns whether the receiver signature is required or not |
getHighVolume() | boolean | Returns whether this transaction uses high-volume throttles |
This transaction supports high-volume entity creation (HIP-1313). Setting
setHighVolume(true) routes the transaction through dedicated high-volume throttle capacity with variable-rate pricing. Always pair this with setMaxTransactionFee() to cap your costs.