[][src]Function transaction_builder::encode_create_recovery_address_script

pub fn encode_create_recovery_address_script() -> Script


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 LibraAccount::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.


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

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::INVALID_STATELibraAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTEDaccount has already delegated/extracted its LibraAccount::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.

Related Scripts