[][src]Function transaction_builder::encode_rotate_authentication_key_with_recovery_address_script

pub fn encode_rotate_authentication_key_with_recovery_address_script(
    recovery_address: AccountAddress,
    to_recover: AccountAddress,
    new_key: Vec<u8>
) -> Script


Rotates the authentication key of a specified account that is part of a recovery address to a new authentication key. Only used for accounts that are part of a recovery address (see Script::add_recovery_rotation_capability for account restrictions).

Technical Description

Rotates the authentication key of the to_recover account to new_key using the LibraAccount::KeyRotationCapability stored in the RecoveryAddress::RecoveryAddress resource published under recovery_address. This transaction can be sent either by the to_recover account, or by the account where the RecoveryAddress::RecoveryAddress resource is published that contains to_recover's LibraAccount::KeyRotationCapability.


account&signerSigner reference of the sending account of the transaction.
recovery_addressaddressAddress where RecoveryAddress::RecoveryAddress that holds to_recover's LibraAccount::KeyRotationCapability is published.
to_recoveraddressThe address of the account whose authentication key will be updated.
new_keyvector<u8>New ed25519 public key to be used for the account at the to_recover address.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDRecoveryAddress::ERECOVERY_ADDRESSrecovery_address does not have a RecoveryAddress::RecoveryAddress resource published under it.
Errors::INVALID_ARGUMENTRecoveryAddress::ECANNOT_ROTATE_KEYThe address of account is not recovery_address or to_recover.
Errors::INVALID_ARGUMENTRecoveryAddress::EACCOUNT_NOT_RECOVERABLEto_recover's LibraAccount::KeyRotationCapability is not in the RecoveryAddress::RecoveryAddress resource published under recovery_address.
Errors::INVALID_ARGUMENTLibraAccount::EMALFORMED_AUTHENTICATION_KEYnew_key was an invalid length.

Related Scripts