[][src]Function transaction_builder::encode_publish_shared_ed25519_public_key_script

pub fn encode_publish_shared_ed25519_public_key_script(
    public_key: Vec<u8>
) -> Script

Summary

Rotates the authentication key of the sending account to the newly-specified public key and publishes a new shared authentication key under the sender's account. Any account can send this transaction.

Technical Description

Rotates the authentication key of the sending account to public_key, and publishes a SharedEd25519PublicKey::SharedEd25519PublicKey resource containing the 32-byte ed25519 public_key and the LibraAccount::KeyRotationCapability for account under account.

Parameters

NameTypeDescription
account&signerThe signer reference of the sending account of the transaction.
public_keyvector<u8>32-byte Ed25519 public key for account' authentication key to be rotated to and stored.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::INVALID_STATELibraAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTEDaccount has already delegated/extracted its LibraAccount::KeyRotationCapability resource.
Errors::ALREADY_PUBLISHEDSharedEd25519PublicKey::ESHARED_KEYThe SharedEd25519PublicKey::SharedEd25519PublicKey resource is already published under account.
Errors::INVALID_ARGUMENTSharedEd25519PublicKey::EMALFORMED_PUBLIC_KEYpublic_key is an invalid ed25519 public key.

Related Scripts