Class Ed25519Account
- Namespace
- Aptos
- Assembly
- Aptos.dll
Represents an Ed25519 signer used to sign transaction with a Ed25519 private key.
public class Ed25519Account : Account
- Inheritance
-
Ed25519Account
- Inherited Members
Constructors
Ed25519Account(Ed25519PrivateKey)
Initializes a new instance of the Ed25519Account class with a private key and an optional account address.
public Ed25519Account(Ed25519PrivateKey privateKey)
Parameters
privateKeyEd25519PrivateKeyThe private key for the account.
Ed25519Account(Ed25519PrivateKey, AccountAddress?)
Initializes a new instance of the Ed25519Account class with a private key and an optional account address.
public Ed25519Account(Ed25519PrivateKey privateKey, AccountAddress? address = null)
Parameters
privateKeyEd25519PrivateKeyThe private key for the account.
addressAccountAddressThe account address.
Ed25519Account(Ed25519PrivateKey, byte[]?)
Initializes a new instance of the Ed25519Account class with a private key and an optional account address.
public Ed25519Account(Ed25519PrivateKey privateKey, byte[]? address = null)
Parameters
privateKeyEd25519PrivateKeyThe private key for the account.
addressbyte[]The account address.
Ed25519Account(Ed25519PrivateKey, string?)
Initializes a new instance of the Ed25519Account class with a private key and an optional account address.
public Ed25519Account(Ed25519PrivateKey privateKey, string? address = null)
Parameters
privateKeyEd25519PrivateKeyThe private key for the account.
addressstringThe account address.
Fields
PrivateKey
Gets the Ed25519PrivateKey for the account.
public readonly Ed25519PrivateKey PrivateKey
Field Value
Properties
Address
Gets the address of the account.
public override AccountAddress Address { get; }
Property Value
PublicKey
Gets the Ed25519PublicKey for the account.
public PublicKey PublicKey { get; }
Property Value
SigningScheme
The Ed25519 account uses a Ed25519 signing scheme.
public override SigningScheme SigningScheme { get; }
Property Value
VerifyingKey
Gets the Ed25519PublicKey for the account.
public override IVerifyingKey VerifyingKey { get; }
Property Value
Methods
FromDerivationPath(string, string)
Generates a new Ed25519 account from a derivation path and mnemonic.
The derivation path is a string that follows the BIP-44 standard.
public static Ed25519Account FromDerivationPath(string path, string mnemonic)
Parameters
pathstringThe derivation path (e.g. "m/44'/637'/0'/0'/0'").
mnemonicstringThe mnemonic phrase (e.g. "abandon ... flyer about").
Returns
- Ed25519Account
A new instance of Ed25519Account.
Generate()
Generates a new Ed25519 account.
public static Ed25519Account Generate()
Returns
- Ed25519Account
A new instance of Ed25519Account.
Sign(byte[])
Signs a message with the using the account's private key.
public override Signature Sign(byte[] message)
Parameters
messagebyte[]The message to sign as a byte array.
Returns
- Signature
The signed message.
SignWithAuthenticator(byte[])
Signs a message and returns an authenticator with the signature.
public override AccountAuthenticator SignWithAuthenticator(byte[] message)
Parameters
messagebyte[]The message to sign as a byte array.
Returns
- AccountAuthenticator
The authenticator containing the signature.
VerifySignature(byte[], Ed25519Signature)
Verifies a signature for a given message.
public bool VerifySignature(byte[] message, Ed25519Signature signature)
Parameters
messagebyte[]The message that was signed.
signatureEd25519SignatureThe signed message to verify.
Returns
- bool
True if the signature is valid; otherwise, false.