pub fn encode_create_recovery_address_script() -> Script
Expand description

Summary

Initializes the sending account as a recovery address that may be used by the VASP that it belongs to. The sending account must be a VASP account. Multiple recovery addresses can exist for a single VASP, but accounts in each must be disjoint.

Technical Description

Publishes a RecoveryAddress::RecoveryAddress resource under account. It then extracts the DiemAccount::KeyRotationCapability for account and adds it to the resource. After the successful execution of this transaction other accounts may add their key rotation to this resource so that account may be used as a recovery account for those accounts.

Parameters

NameTypeDescription
account&signerThe signer of the sending account of the transaction.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::INVALID_STATEDiemAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTEDaccount has already delegated/extracted its DiemAccount::KeyRotationCapability.
Errors::INVALID_ARGUMENTRecoveryAddress::ENOT_A_VASPaccount is not a VASP account.
Errors::INVALID_ARGUMENTRecoveryAddress::EKEY_ROTATION_DEPENDENCY_CYCLEA key rotation recovery cycle would be created by adding account’s key rotation capability.
Errors::ALREADY_PUBLISHEDRecoveryAddress::ERECOVERY_ADDRESSA RecoveryAddress::RecoveryAddress resource has already been published under account.
  • Script::add_recovery_rotation_capability
  • Script::rotate_authentication_key_with_recovery_address