Skip to content

Ed25519 Accounts

The Aptos .NET SDK provides a simple way to create and manage Ed25519 accounts. In this guide we will provide snippets of creating or importing existing accounts.

Ed25519Accounts are created to sign transactions and interact with the blockchain.

To generate an account from a private key, you will need to create the Ed25519PrivateKey object and pass into the Ed25519Account constructor. The private key can be given a string or byte[] representation.

var privateKey = new Ed25519PrivateKey("0x1234...abcdef");
var account = new Ed25519Account(privateKey);

To generate an account from a phrase, you can use Ed25519Account.FromDerivationPath and pass in the phrase and the derivation path. The derivation path that is typically used throughout the Aptos ecosystem is m/44'/637'/0'/0'/0'.

var account = Ed25519Account.FromDerivationPath(
"m/44'/637'/0'/0'/0'",
"apple banana cat dog elephant fox ..."
);

To create a random account, you can use the Account.Generate() method.

var account = Account.Generate();