pub fn encode_publish_shared_ed25519_public_key_script_function(
    public_key: Vec<u8, Global>
) -> TransactionPayload
Expand description

Summary

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

Technical Description

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

Parameters

NameTypeDescription
accountsignerThe signer of the sending account of the transaction.
public_keyvector<u8>A valid 32-byte Ed25519 public key for account’s authentication key to be rotated to and stored.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::INVALID_STATEDiemAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTEDaccount has already delegated/extracted its DiemAccount::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.
  • AccountAdministrationScripts::rotate_shared_ed25519_public_key