Logo
New RPC users get 35% off their first monthView the offer
RPC Assistant

What Is a Solana Devnet Address and How Do You Use One?

Summary

A Solana devnet address is a public key on the Solana devnet cluster, a test network that mirrors mainnet behavior without using real SOL. You use it to airdrop test SOL, deploy programs, and run transactions before shipping to mainnet. The address format is identical to mainnet, so the only thing that changes is the RPC endpoint your tooling points at.

This article explains how devnet addresses differ from mainnet, how to generate and fund one, how to configure wallets and RPC clients, and how to debug the errors that show up when a devnet address is unfunded or pointed at the wrong cluster.

A Solana devnet address is a public key that exists on the Solana devnet cluster rather than mainnet. It looks exactly like a mainnet address — a base58 string such as 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin — but it only holds test SOL and only resolves against devnet RPC nodes. Developers use devnet addresses to deploy programs, simulate transactions, and run integration tests without spending real funds.

If you already know how mainnet addresses work, the mental model is simple: same key format, same JSON-RPC methods, different cluster. The confusion usually starts when a wallet, CLI, or SDK silently points at mainnet while you expect devnet, or when an address has no test SOL and every transaction fails. This page walks through generating an address, funding it, wiring it into your tooling, and fixing the errors that follow.

Quick recommendation: which devnet setup fits your workflow?

Before you copy an endpoint, decide what you are actually testing. The right devnet address setup depends on whether you need a throwaway keypair, a persistent funded account, or a shared environment for a team.

Your situationRecommended approachWhy
One-off script or tutorialGenerate a fresh keypair in code, airdrop a small amount, discard afterNo key management overhead
Local app developmentPersistent keypair file plus a devnet RPC endpoint in your configReusable balance, stable program IDs
CI or automated testsEphemeral keypair per run, funded via faucet or a pre-funded accountReproducible, no shared state
Team staging environmentDedicated or shared devnet RPC endpoint with a documented configConsistent behavior across machines
Pre-mainnet rehearsalDevnet address plus mainnet-style commitment settingsCloser to production semantics

If you are moving from a public endpoint to something more stable for repeated test runs, OnFinality's Solana Devnet RPC is one option, and you can compare plans on the RPC pricing page.

How a devnet address differs from a mainnet address

The address itself is not different. Solana uses Ed25519 keypairs, and the public key is the address on every cluster. What changes is the cluster your client talks to and the state that cluster holds.

  • Cluster identity. Devnet is a separate ledger. A program deployed on devnet does not exist on mainnet, even if the address matches.
  • Token value. Devnet SOL has no market value. It exists so you can pay transaction fees and rent during testing.
  • State resets. Devnet can be reset or experience instability. Do not treat devnet state as permanent storage.
  • Program availability. Some mainnet programs are not deployed on devnet, and some devnet-only programs are not on mainnet.

This is why a devnet address that works perfectly in one project can appear "empty" in another: the second project is querying a different cluster.

Generating a Solana devnet address

You can create an address with the Solana CLI, with JavaScript, or inside a wallet. The keypair is cluster-agnostic; you choose devnet by pointing your client at a devnet endpoint.

With the Solana CLI

# Create a new keypair file
solana-keygen new --outfile ~/.config/solana/devnet.json

# Point the CLI at devnet
solana config set --url https://api.devnet.solana.com

# Show the address
solana-keygen pubkey ~/.config/solana/devnet.json

With JavaScript

import { Keypair, Connection, LAMPORTS_PER_SOL } from "@solana/web3.js";

const keypair = Keypair.generate();
const address = keypair.publicKey.toBase58();
console.log("Devnet address:", address);

// Point the connection at a devnet RPC endpoint
const connection = new Connection("https://api.devnet.solana.com", "confirmed");
const balance = await connection.getBalance(keypair.publicKey);
console.log("Balance in lamports:", balance);

Notice that the code never says "devnet" beyond the endpoint URL. The address is just a public key; the endpoint decides which cluster it resolves against.

Funding a devnet address

A new devnet address has zero SOL, so it cannot pay fees or create accounts. You fund it with an airdrop, which is devnet's equivalent of a faucet.

# Request 2 SOL to your devnet address
solana airdrop 2

# Check the balance
solana balance

In JavaScript:

const signature = await connection.requestAirdrop(
  keypair.publicKey,
  2 * LAMPORTS_PER_SOL
);
await connection.confirmTransaction(signature, "confirmed");

Airdrop limits are enforced by the cluster and can change. If a request fails, wait and retry, or use a wallet that offers a devnet faucet. For heavier or repeated testing, a managed devnet endpoint can reduce the friction of public rate limits — see Solana Devnet RPC options.

Configuring wallets and clients for devnet

Most devnet problems are configuration problems. Check these three places whenever an address behaves unexpectedly.

ToolWhat to changeCommon mistake
Solana CLIsolana config set --url <devnet endpoint>Leaving the default mainnet URL
web3.js / AnchorConnection endpoint and AnchorProvider clusterHardcoded mainnet endpoint in a shared config
Browser walletNetwork selector set to DevnetWallet on Mainnet while the app expects devnet
.env filesRPC_URL and CLUSTER variablesStale endpoint copied from another project
Program deploy--url devnet flagDeploying to mainnet by accident

A useful habit is to log the cluster at startup. Fetching the genesis hash and comparing it to the known devnet value tells you immediately which cluster you are on.

const genesisHash = await connection.getGenesisHash();
console.log("Cluster genesis hash:", genesisHash);

Debugging common devnet address errors

When a devnet address "does not work," the symptom usually points to a specific cause. Match the message to the fix.

SymptomLikely causeFix
Account not foundAddress never funded or wrong clusterAirdrop test SOL; verify endpoint
Insufficient funds for rentBalance too low to create an accountFund the address with more SOL
Blockhash not foundEndpoint lagging or cluster mismatchRetry; confirm you are on devnet
429 Too Many RequestsPublic endpoint rate limitingBack off, batch calls, or use a managed endpoint
Transaction succeeds locally, fails in CIDifferent RPC endpoint or unfunded keypairStandardize the endpoint and pre-fund the test key
Program ID not foundProgram deployed on a different clusterRedeploy to devnet

If you are seeing rate-limit or connectivity errors repeatedly, the issue is often the endpoint rather than the address. A dedicated or shared RPC service can give you a stable devnet target; OnFinality's API service and dedicated node options are worth reviewing if your test suite runs frequently.

Devnet versus mainnet versus testnet

Solana has more than one non-production cluster, and mixing them up is a frequent source of confusion.

ClusterPurposeTypical use
MainnetProduction ledger with real SOLLive apps
DevnetPrimary testing cluster with a faucetApp development, program deploys
TestnetSeparate testing cluster, often used for validator and network testingProtocol-level testing

For most application developers, devnet is the right default. Testnet is more commonly used when you are testing validator behavior or network-level changes. If you need mainnet-style endpoints for comparison, see Solana RPC.

Operational checklist before you ship to mainnet

A devnet address is a rehearsal, not a guarantee. Before moving to mainnet, confirm the following:

  1. Programs are deployed to mainnet at the addresses your app expects.
  2. Key management is production-grade. Never reuse a devnet keypair for mainnet funds.
  3. Endpoints are environment-driven, not hardcoded, so you can switch clusters safely.
  4. Commitment levels match your risk tolerance. confirmed and finalized behave differently under load.
  5. Error handling covers rate limits and timeouts, since public endpoints can throttle.
  6. Monitoring is in place for balance, transaction success rate, and RPC latency.

If you would rather not run your own Solana nodes for production, OnFinality provides RPC API and dedicated node infrastructure across many supported networks, including Solana and Solana Devnet.

Key Takeaways

  • A Solana devnet address is a normal Ed25519 public key; the cluster is determined by the RPC endpoint, not the address format.
  • Generate addresses with the Solana CLI or web3.js, then fund them with a devnet airdrop before sending transactions.
  • Most "broken address" issues are actually cluster mismatches, unfunded accounts, or public endpoint rate limits.
  • Log the genesis hash at startup to confirm which cluster your client is using.
  • For repeated or team testing, a managed devnet endpoint reduces the friction of public faucet and rate limits.

Frequently Asked Questions

Is a Solana devnet address different from a mainnet address?

No. The address format is identical. What differs is the cluster your RPC client connects to and the state that cluster holds. A devnet address holds test SOL and resolves only against devnet nodes.

How do I get test SOL to a devnet address?

Use the Solana CLI solana airdrop, the web3.js requestAirdrop method, or a wallet that supports a devnet faucet. Airdrop limits are set by the cluster and can change over time.

Why does my devnet address show a zero balance?

Either it has never been funded, or your client is pointing at a different cluster. Confirm the endpoint and check the genesis hash, then request an airdrop.

Can I use the same keypair on devnet and mainnet?

Technically yes, but you should not reuse a devnet keypair for mainnet funds. Treat devnet keys as disposable and use separate, securely managed keys for production.

What RPC endpoint should I use for devnet?

You can start with a public devnet endpoint for light testing. For repeated runs, CI, or team environments, a managed devnet RPC service such as OnFinality's Solana Devnet RPC gives you a more stable target. Compare options on the RPC pricing page.

RPC Knowledge Base

Related RPC details

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started