# 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.

{% hint style="info" %}
Want to learn more about what an account is and how it works? Read: [What is an Account →](https://docs.keeta.com/components/accounts)
{% endhint %}

## 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.

{% hint style="warning" %}
Your seed is sensitive information. Anyone with access to your seed can access your account.
{% endhint %}

Here’s how to generate one and use it:

```typescript
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

```typescript
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.

```typescript
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:

```typescript
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:

```typescript
<img src={qrCode} />
```

{% hint style="success" %}
You don’t need a specific library — any QR code tool that supports text-to-QR conversion will work. Just pass in the address string, and you're good to go.
{% endhint %}

Now you are ready to start sending your first transaction:

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Send a Transaction</strong></td><td><a href="https://1876017793-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpitcpcamWc0BKEe28I1D%2Fuploads%2FIJYk6VY0isQoWJwkEPHF%2Fsend.png?alt=media&#x26;token=1bcacda6-e3e7-4538-a878-6dd2005c3ae7">send.png</a></td><td><a href="send-a-transaction">send-a-transaction</a></td></tr></tbody></table>
