Back to writing
April 20, 2026· 4 min read

Kicking off 100 Days of Solana. Day 1: generate a keypair with @solana/kit, fund it from the devnet faucet, and verify the balance.


Why

Starting a 100-day Solana challenge to build real on-chain intuition. Day 1 is the simplest possible starting point: generate a keypair, fund it, read the balance back.

Stack

Generate a keypair

JAVASCRIPT
import { generateKeyPairSigner } from '@solana/kit';

const wallet = await generateKeyPairSigner();
console.log('Your new wallet address:', wallet.address);

Each run produces a different address. The private key lives only in memory and is discarded when the process exits — no persistence yet (that's Day 2).

Fund it

  1. Run the script, copy the printed address.
  2. Go to faucet.solana.com, select Devnet, paste the address.
  3. Request airdrop. Free test SOL lands in seconds.

Verify the balance

JAVASCRIPT
import { createSolanaRpc, devnet, address } from '@solana/kit';

const rpc = createSolanaRpc(devnet('https://api.devnet.solana.com'));
const funded = address('FWfsV8wkM5EYk6XMK5qFokBRk9rwaRpqFEWz8zjvDJMc');

const { value: balance } = await rpc.getBalance(funded).send();
const balanceInSol = Number(balance) / 1_000_000_000;

console.log(`Balance: ${balanceInSol} SOL`);

Output:

JAVASCRIPT
Wallet address: FWfsV8wkM5EYk6XMK5qFokBRk9rwaRpqFEWz8zjvDJMc
Balance: 5 SOL

Gotcha: Bun doesn't work here

I tried bun run check-balance.mjs first and got:

JAVASCRIPT
TypeError: undefined is not a function
  at new e (.../@solana/rpc/dist/index.node.mjs:52:18)

@solana/rpc calls setMaxListeners(n, AbortSignal) from node:events. Bun's shim doesn't implement that signature. Run with Node, not Bun.

Lamports vs SOL

1 SOL = 1,000,000,000 lamports (10⁹). The RPC always returns lamports — divide by 1_000_000_000 for display.

Next

Day 2: persist the keypair to disk so the wallet survives process restarts.


Code: github.com/knhn1004/100-days-of-solana

    — Writing