[][src]Function transaction_builder::encode_rotate_authentication_key_script

pub fn encode_rotate_authentication_key_script(new_key: Vec<u8>) -> Script


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 LibraAccount::LibraAccount authentication_key field to new_key. new_key must be a valid ed25519 public key, and account must not have previously delegated its LibraAccount::KeyRotationCapability.


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_STATELibraAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTEDaccount has already delegated/extracted its LibraAccount::KeyRotationCapability.
Errors::INVALID_ARGUMENTLibraAccount::EMALFORMED_AUTHENTICATION_KEYnew_key was an invalid length.

Related Scripts