pub fn encode_rotate_authentication_key_script_function(
    new_key: Vec<u8>
) -> TransactionPayload
Expand description

Summary

Rotates the account’s authentication key to the supplied new authentication key. May be sent by any account.

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
accountsignerSigner of the sending account of the transaction.
new_keyvector<u8>New authentication key to be used for account.

Common Abort Conditions

Error CategoryError ReasonDescription
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_with_nonce
  • AccountAdministrationScripts::rotate_authentication_key_with_nonce_admin
  • AccountAdministrationScripts::rotate_authentication_key_with_recovery_address