pub fn encode_rotate_authentication_key_with_nonce_admin_script_function(
    sliding_nonce: u64,
    new_key: Vec<u8>
) -> TransactionPayload
Expand description

Summary

Rotates the specified account’s authentication key to the supplied new authentication key. May only be sent by the Diem Root account as a write set transaction.

Technical Description

Rotate the account’s DiemAccount::DiemAccount authentication_key field to new_key. new_key must be a valid authentication key that corresponds to an ed25519 public key as described here, and account must not have previously delegated its DiemAccount::KeyRotationCapability.

Parameters

NameTypeDescription
dr_accountsignerThe signer of the sending account of the write set transaction. May only be the Diem Root signer.
accountsignerSigner of account specified in the execute_as field of the write set transaction.
sliding_nonceu64The sliding_nonce (see: SlidingNonce) to be used for this transaction for Diem Root.
new_keyvector<u8>New authentication key to be used for account.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEA SlidingNonce resource is not published under dr_account.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_OLDThe sliding_nonce in dr_account is too old and it’s impossible to determine if it’s duplicated or not.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_NEWThe sliding_nonce in dr_account is too far in the future.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_ALREADY_RECORDEDThe sliding_nonce in dr_account has been previously recorded.
Errors::INVALID_STATEDiemAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTEDaccount has already delegated/extracted its DiemAccount::KeyRotationCapability.
Errors::INVALID_ARGUMENTDiemAccount::EMALFORMED_AUTHENTICATION_KEYnew_key was an invalid length.
  • AccountAdministrationScripts::rotate_authentication_key
  • AccountAdministrationScripts::rotate_authentication_key_with_nonce
  • AccountAdministrationScripts::rotate_authentication_key_with_recovery_address