pub fn encode_rotate_authentication_key_script(
    new_key: Vec<u8, Global>
) -> Script
Expand description

Summary

Rotates the transaction sender’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 ed25519 public key, and account must not have previously delegated its DiemAccount::KeyRotationCapability.

Parameters

NameTypeDescription
account&signerSigner reference of the sending account of the transaction.
new_keyvector<u8>New ed25519 public 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.
  • Script::rotate_authentication_key_with_nonce
  • Script::rotate_authentication_key_with_nonce_admin
  • Script::rotate_authentication_key_with_recovery_address