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

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 DiemAccount::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_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.
  • Script::rotate_shared_ed25519_public_key