Skip to main content
Version: 3.5.0

Account Generation

On this page, we'll cover how to generate a new account on the AVN.

The Aventus blockchain is a Substrate-based blockchain, and like all Substrate-based blockchains, all keys use the SS58 address encoding format.

There are multiple ways to generate an account, and we'll explore three below.

avnSdk.accountUtils.generateNewAccount();

This account generation process happens offline and thus does not confine the generated account to any particular network. Also, this operation is gasless and thus does not cost any AVT.

Example

const { AvnApi, SetupMode, SigningMode } = require("avn-api");
const AVN_GATEWAY_URL = "https://testnet.gateway.aventus.io";

const options = {
suri: "0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24", // this is from the generated example account, replace with your suri
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};
const avnSdk = new AvnApi(AVN_GATEWAY_URL, options);

async function main() {
await avnSdk.init();
console.log(avnSdk.accountUtils.generateNewAccount());
}

(async () => {
await main();
})();
danger

The below account details are just an example and are public. Please, DO NOT send anything to it or use it for anything.

Example Generated Account

{
mnemonic: 'flag dynamic laptop often park illegal equip curve game blame junior warm',
seed: '0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24',
address: '5EYzWhGxbogEfwNKL52ZRDCgBxu4t8oWDFAsXXVYvH6dMQTo',
publicKey: '0x6e0b67f4590ac2b4e9daa9f229cc4a0c77b3109e8a622e5a1128518ad76e736b'
}


Note

The difference between these methods is the first and the second show you your private key (secret seed/mnemonic), while the third does not. However, you can still sign transactions with the third.

Save your account details securely and safely.