A transaction that updates the properties of an existing account. The network will store the latest updates on the account. If you would like to retreive the state of an account in the past, you can query a mirror node.
Transaction Signing Requirements
The account key(s) are required to sign the transaction
If you are updating the keys on the account the OLD KEY and NEW KEY must sign
If either is a key list then the key list keys are all required to sign
If either is a threshold kye, the threshold value is required to sign
If you do not have the required signatures, the network will throw an INVALID_SIGNATURE error
Account Properties
Field | Description |
Key | The new key for the account. The old key and new key must sign the transaction. If the old key or new key is a threshold key then only the threshold of the old key and new key are required to sign the transaction. |
Expiration | The new expiration for the account |
Receiver signature required | If true, all the account keys must sign any transaction depositing into this account (in addition to all withdrawals). default: false |
Auto renew period | The new period of time in which the account will auto-renew in seconds. The account is charged tinybars for every auto-renew period. Duration type is in seconds. For example, one hour would result in the input value of 3,600 seconds. NOTE: This is fixed to approximately 3 months (7890000 seconds). Any other value will return the following error: AUTORENEW_DURATION_NOT_IN_RANGE. default: 2,592,000 seconds |
Proxy account | The new account ID to which this account is proxy staked . |
Memo | Add or update a short description that should be recorded with the state of the account entity (maximum length of 100 characters). Anyone can view this memo on the network. |
Constructor | Description |
| Initializes the AccountUpdateTransaction object |
new AccountUpdateTransaction()
Method | Type | Requirement |
| AccountId | Required |
| Key | Optional |
| Boolean | Optional |
| String | Optional |
| Duration | Disabled |
| Instant | Disabled |
| AccountId | Disabled |
Java//Create the transaction to update the key on the accountAccountUpdateTransaction transaction = new AccountUpdateTransaction().setAccountId(accountId).setKey(updateKey);​//Sign the transaction with the old key and new key, submit to a Hedera networkTransactionResponse txResponse = transaction.freezeWith(client).sign(oldKey).sign(newKey).execute(client);​//Request the reciept of the transactionTransactionReceipt receipt = txResponse.getReceipt(client);​//Get the transaction consensus statusStatus transactionStatus = receipt.status;​System.out.println("The transaction consensus status is " +transactionStatus);​//Version 2.0.0
JavaScript//Create the transaction to update the key on the accountconst transaction = await new AccountUpdateTransaction().setAccountId(accountId).setKey(updateKey).freezeWith(client);​//Sign the transaction with the old key and new keyconst signTx = await (await transaction.sign(oldKey)).sign(newKey);​//SIgn the transaction with the client operator private key and submit to a Hedera networkconst txResponse = await signTx.execute(client);​//Request the reciept of the transactionconst receipt = await txResponse.getReceipt(client);​//Get the transaction consensus statusconst transactionStatus = receipt.status;​console.log("The transaction consensus status is " +transactionStatus.toString());​//v2.0.5
Go//Create the transaction to update the key on the accounttransaction, err := hedera.NewAccountUpdateTransaction().SetAccountID(newAccountId).SetKey(updateKey.PublicKey()).FreezeWith(client)​if err != nil {panic(err)}​//Sign the transaction with the old key and new key, submit to a Hedera networktxResponse, err := transaction.Sign(newKey).Sign(updateKey).Execute(client)​//Request the reciept of the transactionreceipt, err := txResponse.GetReceipt(client)if err != nil {panic(err)}​//Get the transaction consensus statustransactionStatus := receipt.Status​println("The transaction consensus status is ", transactionStatus)​//Version 2.0.0
Method | Type | Requirement |
| AccountId | Required |
| PublicKey | Optional |
| Duration | Optional |
| Instant | Optional |
| Boolean | Optional |
| AccountId | Optional |
Java//Create the transaction to update the key on the accountAccountUpdateTransaction transaction = new AccountUpdateTransaction().setAccountId(accountId).setKey(updateKey);​//Sign the transaction with the old key and new key, submit to a Hedera networkTransactionId txId = transaction.build(client).sign(oldKey).sign(newKey).execute(client);​//Request the reciept of the transactionTransactionReceipt receipt = txId.getReceipt(client);​//Get the transaction consensus statusStatus transactionStatus = receipt.status;​System.out.println("The transaction consensus status is " +transactionStatus);​//Version 1.3.2
JavaScript//Create the transaction to update the key on the accountconst transaction = new AccountUpdateTransaction().setAccountId(accountId).setKey(newKey);​//Sign the transaction with the old key and new key, submit to a Hedera networkconst txId = await transaction.build(client).sign(oldKey).sign(newKey).execute(client);​//Request the reciept of the transactionconst receipt = await txId.getReceipt(client);​//Get the transaction consensus statusconst transactionStatus = receipt.status;​console.log("The transaction consensus status is " +transactionStatus);​//v1.4.4
Return the properties of an account create transaction.
Method | Type | Description |
| Key | Returns the public key on the account |
| Hbar | Returns the initial balance of the account |
| boolean | Returns whether the receiver signature is required or not |
| Instant | Returns the expiration time |
| Duration | Returns the auto renew period on the account |
Java//Create a transactionAccountUpdateTransaction transaction = new AccountUpdateTransaction().setAccountId(accountId).setKey(newKeyUpdate);​//Get the key on the accountKey accountKey = transaction.getKey();​//v2.0.0
JavaScript//Create a transactionconst transaction = new AccountUpdateTransaction().setAccountId(accountId).setKey(newKeyUpdate);​//Get the key of an accountconst accountKey = transaction.getKey();​//v2.0.0
Go//Create the transactiontransaction, err := hedera.NewAccountUpdateTransaction().SetAccountID(newAccountId).SetKey(updateKey.PublicKey())​//Get the key of an accountaccountKey := transaction.GetKey()​//v2.0.0