[][src]Function transaction_builder::encode_rotate_authentication_key_with_nonce_admin_script

pub fn encode_rotate_authentication_key_with_nonce_admin_script(
    sliding_nonce: u64,
    new_key: Vec<u8>
) -> Script


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

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.


lr_account&signerThe signer reference of the sending account of the write set transaction. May only be the Libra Root signer.
account&signerSigner reference 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 Libra Root.
new_keyvector<u8>New ed25519 public key to be used for account.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEA SlidingNonce resource is not published under lr_account.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_OLDThe sliding_nonce in lr_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 lr_account is too far in the future.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_ALREADY_RECORDEDThe sliding_nonce in lr_account has been previously recorded.
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