Serializes a Serializable
value to its BCS representation.
This function is the TypeScript SDK equivalent of bcs::to_bytes
in Move.
the BCS representation of the Serializable instance as a byte buffer.
Converts the BCS-serialized bytes of a value into a Hex instance. This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
Creates an instance of the Ed25519Signature class from a hex input. This constructor validates the length of the signature to ensure it meets the required specifications.
The hex input representing the Ed25519 signature.
Static
Readonly
LENGTHLength of an Ed25519 public key
Generates an authentication key from the public key using the Ed25519 scheme. This function is essential for creating a secure authentication key that can be used for further cryptographic operations.
The generated authentication key.
Serializes the data into a byte array using the provided serializer. This allows for the conversion of data into a format suitable for transmission or storage.
The serializer instance used to perform the serialization.
Get the public key as a hex string with a 0x prefix.
The public key in hex format.
Convert the internal data representation to a Uint8Array.
Uint8Array representation of the data.
Verifies a signed message using a public key.
The arguments for verification.
Represents the arguments required to verify a digital signature.
Note: Ed25519Signatures can be verified syncronously.
Verifies the provided signature against the given message. This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
The arguments for signature verification.
A boolean indicating whether the signature is valid for the given message.
Static
deserializeDeserialize bytes into an Ed25519Signature object. This function is used to convert serialized byte data into a usable Ed25519Signature instance.
The deserializer instance used to read the byte data.
Static
isDetermines if the provided public key is a valid Ed25519 public key. This function checks for the presence of the "key" property and verifies that its data length matches the expected length for Ed25519 public keys.
The public key to validate.
A boolean indicating whether the public key is a valid Ed25519 public key.
Static
isDetermine if the provided public key is an instance of Ed25519PublicKey.
The public key to check.
True if the public key is an instance of Ed25519PublicKey, otherwise false.
Represents the public key of an Ed25519 key pair.
Since AIP-55 Aptos supports
Legacy
andUnified
authentication keys.Ed25519 scheme is represented in the SDK as
Legacy authentication key
and also asAnyPublicKey
that represents anyUnified authentication key
.