Create Your First Account

To start interacting with KeetaNet, you’ll first need to create an account. Accounts are based on cryptographic key pairs, and they’re derived from a secure seed.

This page shows you how to generate a seed, turn it into an account, and connect that account to the Keeta test network.

Want to learn more about what an account is and how it works? Read: What is an Account →

Generate a Seed

The KeetaNet SDK includes utilities for generating secure random seeds. These seeds are used to create key pairs — think of them as the starting point for your identity on the network.

Here’s how to generate one and use it:

import * as KeetaNet from "@keetanetwork/keetanet-client";

async function main() {
  // Generate a secure random seed
  const seed = KeetaNet.lib.Account.generateRandomSeed({ asString: true });
  console.log("Generated seed:", seed);

  // Create an account using the generated seed
  const account = KeetaNet.lib.Account.fromSeed(seed, 0);

  // Connect to the Keeta test network with this account
  const userClient = KeetaNet.UserClient.fromNetwork("test", account);
  console.log("Public key:", account.publicKeyString.toString());
}

main().catch(console.error);

How it works

  • generateRandomSeed() creates a strong, random seed.

  • fromSeed(seed, 0) derives your first account (index 0) from that seed.

  • UserClient.fromNetwork("test", account) connects you to the testnet using your new account.

  • You can use this client to send transactions, fetch chain data, or interact with the ledger.

Receive a token

If someone wants to send tokens to your Keeta account, they’ll need your public address.

Option 1: Public Address from a Newly Created Account

import * as KeetaNet from '@keetanetwork/keetanet-client';

// Generate a secure random seed
const seed = KeetaNet.lib.Account.generateRandomSeed({ asString: true });

// Create a new account from the seed (index 0)
const account = KeetaNet.lib.Account.fromSeed(seed, 0);

// Get the public address
const publicKey = account.publicKeyString.toString();
console.log("Your public Keeta address:", publicKey);

Option 2: Public Address from an Existing Account

If you already have an account, you can share your publicKey to receive funds. This is the address others will send tokens to.

const existingSeed = "your existing seed string...";
const account = KeetaNet.lib.Account.fromSeed(existingSeed, 0);
const publicKey = account.publicKeyString.toString();

Generate a QR code

You can turn the public address into a QR code so others can scan and send easily. This works great on mobile wallets or in-person payments.

To generate a QR code image:

import { toDataURL } from "qrcode";

const qrCode = await toDataURL(accountPublicKey);

This gives you a base64 image URL (like data:image/png;base64,...) that you can embed in an <img> tag:

<img src={qrCode} />

Now you are ready to start sending your first transaction:

Last updated