Function diem_transaction_builder::stdlib::encode_publish_shared_ed25519_public_key_script_function
source · pub fn encode_publish_shared_ed25519_public_key_script_function(
public_key: Vec<u8>
) -> TransactionPayloadExpand 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
| Name | Type | Description |
|---|---|---|
account | signer | The signer of the sending account of the transaction. |
public_key | vector<u8> | A valid 32-byte Ed25519 public key for account’s authentication key to be rotated to and stored. |
Common Abort Conditions
| Error Category | Error Reason | Description |
|---|---|---|
Errors::INVALID_STATE | DiemAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTED | account has already delegated/extracted its DiemAccount::KeyRotationCapability resource. |
Errors::ALREADY_PUBLISHED | SharedEd25519PublicKey::ESHARED_KEY | The SharedEd25519PublicKey::SharedEd25519PublicKey resource is already published under account. |
Errors::INVALID_ARGUMENT | SharedEd25519PublicKey::EMALFORMED_PUBLIC_KEY | public_key is an invalid ed25519 public key. |
Related Scripts
AccountAdministrationScripts::rotate_shared_ed25519_public_key