How to make a Solana wallet: a technical guide
Author: Usman Asim
In the past few years, Solana has exploded onto the scene as one of the most active blockchain networks, averaging over 1.2 million daily active users and 60M+ transactions (non-voting) per day. That activity is driven by DeFi, DePIN, institutions, enterprises, and more, all happening at lightning speed and at fractions of a penny per transaction.
If you're looking to build on Solana and tap into the the hot and growing ecosystem, then starting with a wallet is a great entry point. Wallets are the gateway to interacting with any chain: signing transactions, holding assets, and powering apps.
In this guide, we'll walk you through creating a regular Solana wallet using Alchemy's reliable RPC endpoints for seamless network connections, then compare regular and smart wallets. Let's dive in and get you set up, starting on devnet so you can test things out without spending real SOL.
Wallets on Solana: the basics
On Solana, wallets aren't quite like what you might be used to on Ethereum. Instead of a strict split between user controlled externally owned accounts (EOAs) and smart contracts, Solana treats everything as accounts, which are data storage units on the blockchain. A "wallet" here is often just a keypair (public and private keys) that lets you control one or more of these accounts. Accounts can hold SOL tokens, other assets, or even executable code for programs (Solana's version of smart contracts).
This uniform approach opens the door to cool features like program derived addresses (PDAs), where programs can generate addresses and even sign transactions on behalf of users without needing their private keys.
It's a more flexible setup than Ethereum's model, where EOAs are purely for signing and contracts handle the logic separately. For more on Solana's account model, check out the official Solana docs on accounts and wallets.
Solana wallets generally fall into two camps:
- Regular wallets (keypair based): These are your straightforward cryptographic keypairs for signing transactions and managing accounts. They're great for scripts or testing, but you'll handle keys and fees manually.
- Smart wallets (with account abstraction): These level up the experience by hiding away the nitty gritty details like key management. Smart wallets support things like social authentication (e.g., signing in with email or passkeys instead of seed phrases), gas/rent sponsorship (where someone else pays transaction fees), batched transactions (multiple actions in one go), and even automated behaviors powered by programmable logic. Solana's design makes these especially potent for apps, going beyond Ethereum's ERC-4337 focus on UX tweaks. Dive deeper into Solana's account abstraction in the Solana Cookbook on wallet management and the deep dive of ERC-4337 on Solana.
In this tutorial, we'll build a regular wallet using Alchemy's RPC endpoints, which give you reliable access to the Solana network without spinning up your own node. For smart wallet features like social login, pair a wallet provider with Alchemy's infrastructure.
Prerequisites: setting up your Devnet environment
Before we jump into the code, let's make sure you're ready. This tutorial assumes you're comfortable with basic JavaScript, but we'll explain concepts along the way so everyone can keep up. Here's what you'll need:
-
Node.js (v16 or higher) and npm/yarn: This is your runtime for running JS code outside the browser. You can download it from nodejs.org if you haven't already.
-
A code editor like VS Code or Cursor: Somewhere to write and debug your code. VS Code is free and has great extensions for blockchain development. You can get set up here. Cursor is like a cooler, AI-enabled version of VS Code. You can check it out here.
-
Basic JavaScript knowledge: The examples use Node.js and Solana web3.js.
-
An Alchemy account: Sign up for free at dashboard.alchemy.com. Create a new app, select Solana (devnet for testing, mainnet for production), and grab your API key. While you're there, enable an EVM chain like Sepolia if you want hybrid support – it's handy for cross-chain apps.
-
For regular wallets: Install the Solana web3.js library, which handles key generation, connections, and transactions. This library is the go to for interacting with Solana programs.
npm install @solana/web3.js
Pro tip: Build everything on devnet first. It's the main test environment that mimics deploying on mainnet perfectly and allows you to test your contracts, run through your flows, make sure everything works. Once you're confident, have deployed to testnet and thoroughly tested everything, deploying to mainnet is as simple as swapping the RPC URL. No code changes needed: just flip the switch.
Understanding Solana's wallet structure
Before we generate a wallet, let’s back up and give some quick context on how Solana wallets work. This will help you grasp why the steps we're about to take make sense, especially if you're coming from Ethereum.
- Accounts vs. wallets: In Solana, a wallet is essentially a keypair that owns accounts. Accounts are like buckets for data: they can store your SOL balance, tokens, or program code. Unlike Ethereum, where EOAs (user addresses) are distinct from contract addresses, Solana blurs the lines: everything is an account. This means you can create accounts on the fly, fund them separately, and even have programs control them via PDAs. No automatic account creation on key gen; you fund to initialize. For a deeper dive, see Solana's core concepts.
- Rent instead of dynamic gas fees: Solana doesn't use Ethereum style gas for every computation unit: transactions have flat fees (super low, like $0.00025 on average as of 2025) but accounts pay "rent" to keep their data stored on the chain if your balance dips below a threshold (about 0.00089 SOL per KB). It's like a storage deposit: pay upfront or maintain enough SOL to exempt it. This keeps the network lean by pruning inactive accounts. Transactions still cost fees, but rent is the unique twist for persistence. You can compare it to Ethereum's gas, which hits you per operation and can spike during congestion. Solana's model prioritizes speed instead. Read more in Solana's rent docs.
- PDAs and programmability: Programs can derive "program derived addresses" that look like regular addresses but are controlled by code, not keys, which allows smart wallet features like automated signing. It's more baked in to the core Solana Architecture than Ethereum's contract wallets.
Grasping these concepts helps you see why Solana wallets feel more "programmable" out of the box. It all comes back to that concept of flexible accounts.
How to make a regular Solana wallet: step-by-step
Regular wallets are your entry level setup: a simple keypair for signing transactions. They're perfect for backend scripts, testing, or when you want full control without abstractions. In this tutorial, we'll use @solana/web3.js to generate a keypair.
Then we will use Alchemy's RPC to connect to the network; without a RPC connection, your wallet can't query balances or send transactions.
Step 1: generate a keypair
Generating a wallet on Solana means creating a fresh cryptographic keypair, essentially a pair of mathematically linked keys that work together. The public key becomes your wallet address on Solana, which you can share freely with anyone who needs to send you funds or interact with your account. The private key (also called the secret key) is what proves you own that address and allows you to sign transactions.
Here's an important distinction from Ethereum: on Ethereum, when you generate an Externally Owned Account (EOA), it's immediately "ready" and exists on the blockchain. On Solana, generating a keypair just creates the cryptographic keys, the actual account on the blockchain doesn't exist until someone funds that address. This is part of Solana's account model where accounts need rent exemption balance to persist on chain.
Create a new JS file (say, regular-wallet.js) and run this snippet:
import { Keypair } from '@solana/web3.js';
const wallet = Keypair.generate();
console.log('Public Key (Wallet Address):', wallet.publicKey.toString());
console.log('Secret Key:', wallet.secretKey); // Secure this immediately! Never log in production.Run this script with node.js and boom: you've got a wallet.
Here's what you should have gotten returned:
- Public Key (Wallet Address): This is a base58-encoded string that looks something like
7xj9WkvP6Az8vG5nXJh4Fq3qY8kPqT9wXVZN2xMqGnD4. This is what you'll share with others when you want to receive funds, and it's what you'll use when connecting to apps or checking your balance. Think of it like your bank account number, it's safe to share publicly. - Secret Key: This is returned as a
Uint8Array(an array of 64 bytes). This is your private key and is the cryptographic proof that you control this wallet. Anyone with access to this secret key can sign transactions and move funds from your wallet. Never, ever share this or commit it to version control.
Critical security practices for the secret key:
- Never log it in production: The
console.login our example is fine for local testing, but remove it before deploying any real application. - Use environment variables: Store it in a
.envfile that's added to your.gitignore. Access it withprocess.env.PRIVATE\_KEYin your code. - Consider hardware wallets: For production applications handling significant value, integrate hardware wallets like Ledger or Trezor that keep private keys isolated in secure hardware.
- Encrypt if storing: If you must store the secret key in a database or file, encrypt it first using strong encryption libraries.
For security best practices, check Solana's security guide.
Step 2: connect to the network via Alchemy RPC
Now, connect your wallet to Solana's devnet using an RPC endpoint. This "connection" object lets your code talk to the blockchain, fetch balances, submit transactions, etc. Alchemy's RPC is like a supercharged proxy to Solana nodes, handling load balancing so your app stays responsive.
Add this to your script (replace <YOUR_API_KEY> with your key from the Alchemy dashboard):
import { Connection } from '@solana/web3.js';
const connection = new Connection(
'https://solana-devnet.g.alchemy.com/v2/<YOUR_API_KEY>', // Devnet for testing
'confirmed' // Commitment level: 'confirmed' for speed with some finality
);
async function checkBalance(publicKey) {
const balance = await connection.getBalance(publicKey);
console.log('Balance:', balance / 1e9, 'SOL'); // Convert lamports (1 SOL = 1e9 lamports)
}
await checkBalance(wallet.publicKey);This connection enables you to check whether you wallet is funded and to interact with apps. Run the script; if unfunded, the response will show 0 SOL. For full RPC methods, see Solana's RPC docs or our Alchemy Solana RPC guide.
Step 3: fund and interact with your wallet
With the connection live, let's interact onchain. This is where the fun starts: funding via airdrop (devnet only), signing transactions, etc. These basics let you transfer SOL, call programs, or build simple tools.
Request an airdrop (funding on devnet)
Devnet gives free SOL for testing, allowing you to fund your account if it's empty, but be mindful that you are limited to ~24 SOL/day per IP address.
You’ll need to fund your account for rent exemptions in fees. This method also only works for devnet. In production, where fees are paid in real SOL (and not test SOL), you will need to buy/fund your account via an exchange like Coinbase. See Solana's Devnet Sol Guide.
const airdropSignature = await connection.requestAirdrop(
wallet.publicKey,
1e9 // 1 SOL in lamports
);
await connection.confirmTransaction(airdropSignature);
console.log('Airdrop complete! Check balance again.');Here's what's happening:
- Request the airdrop:
connection.requestAirdrop\(\)asks the devnet for test SOL. It takes your wallet's public key and the amount in lamports (1e9= 1 SOL), then returns a transaction signature, a unique identifier for this transaction. - Confirm the transaction:
await connection.confirmTransaction\(\)waits for the network to process your airdrop. This is crucial, without waiting for confirmation, your balance might still show 0 SOL even though the airdrop was requested. Solana processes transactions asynchronously, so you need to wait. - Success: Once confirmed, run
checkBalance\(\)again and you should see 1 SOL in your wallet.
Sign and send a transaction
Let's transfer 0.1 SOL to another address. This example demonstrates transaction signing, where your private key cryptographically authorizes the transaction, proving you own the sending wallet. We'll build a transaction, sign it with your keypair, and broadcast it to the network via RPC. Transaction fees (around 0.000005 SOL) are deducted automatically from your balance. For more complex operations like multi-instruction transactions or program calls, explore Solana's transaction basics documentation.
Run this code to send SOL:
import { Transaction, SystemProgram, PublicKey, sendAndConfirmTransaction } from '@solana/web3.js';
const recipient = new PublicKey('recipient_address_here'); // Replace with a real address`
const tx = new Transaction().add(
SystemProgram.transfer({
fromPubkey: wallet.publicKey,
toPubkey: recipient,
lamports: 1e8 // 0.1 SOL
})
);
// Simplest approach - handles blockhash and confirmation automatically
const signature = await sendAndConfirmTransaction(
connection,
tx,
[wallet] // Signers
);
console.log('Transfer signature:', signature);Here's what's happening:
- Create the recipient:
new PublicKey\(\)converts a base58-encoded address string into a PublicKey object that Solana can work with. Replace'recipient\_address\_here'with an actual Solana address (you could even use your own wallet's public key to test sending to yourself). - Build the transaction:
new Transaction\(\).add\(\)creates a transaction and adds a transfer instruction. TheSystemProgram.transfer\(\)call specifies the sender (fromPubkey), recipient (toPubkey), and amount in lamports (1e8 = 0.1 SOL). - Send and confirm:
sendAndConfirmTransaction\(\)is a helper function that handles three steps in one: it fetches the latest blockhash (required for all Solana transactions), signs the transaction with your wallet keypair, sends it to the network, and waits for confirmation. The\[wallet\]array contains all signers, in this case, just your wallet. - Transaction signature: The returned signature is your proof of execution, a unique identifier for this specific transaction on the blockchain.
- Security Tip: Never hardcode secret keys. Instead use
process.env.PRIVATE\_KEY. For production, integrate hardware wallets to alleviate any other points of attack. For more on secure key management, view our best practices for key management & security.
And if all went well, you should have gotten a successful transaction signature back! That signature is your proof the transaction was processed on Solana's blockchain. You can look it up on Solana Explorer to see the full details: sender, recipient, fee paid, and block confirmation.
That's the essence of interacting with a simple Solana wallet on devnet: generate a keypair, connect via RPC, fund it, and sign transactions. These building blocks: keypair generation, network connection, balance checks, and transaction signing are the foundation for any Solana development work.
These regular keypair based wallets we just interacted with are perfect for backend scripts that need programmatic control, testing and development, for folks who prefer direct management of their keys, and simple uses cases like basic transfers and program interactions. However, you can see they come with their own trade offs: users must manage their own keys, pay their own fees, and handle the technical complexity of blockchain interactions. For consumer facing apps where UX matters, this friction can be a dealbreaker.
That's where smart wallets come in. They abstract away the complexity while giving you powerful features like social login, gasless transactions, and session keys.
Regular vs. smart wallets: a quick comparison
To help you decide what you need for your use case, here's a table breaking down the key differences in wallet types on Solana. This highlights when to use each in your projects.
Best practices: tips to keep in mind while building
As you craft your Solana wallet, here are some best practices and tips to ensure it's secure, scalable, and user-friendly.
- Security first: For regular wallets, always use hardware wallets (like Ledger or Trezor) for mainnet to keep keys offline. With smart wallets, use your wallet provider's passkeys or multi-factor authentication to reduce phishing risks by avoiding seed phrases. Never expose secrets in code; use encrypted storage. Audit your setup with tools like Solana's security guide.
- Test thoroughly: Always start on devnet or testnet to iterate without costs. Use Alchemy's dashboard to monitor RPC usage, transaction failures, and performance metrics. It's like a built in debugger for your blockchain calls. Simulate edge cases like network congestion to ensure retries work.
- Error handling and reliability: Wrap RPC calls in try-catch blocks and add exponential backoff retries (e.g., via libraries like p-retry). Solana's speed can lead to race conditions, so confirm transactions with 'finalized' commitment for max safety. This keeps your app robust, especially for high-volume apps.
- Scalability considerations: Alchemy's infrastructure auto-scales for high loads, so you won't bottleneck on RPC. For smart wallets, batch where possible to minimize transactions. Monitor rent exemptions to avoid surprise costs. Tools like Solscan explorer help track this.
- Resources for deeper dives: Stay updated with Alchemy's Solana docs for SDK changes, and explore Solana's official react wallet adapters for UI integrations.
Wrapping up: time to build on Solana
There you have it – you've now got the know how on how to spin up a regular Solana wallet with Alchemy's help, and how smart wallets compare. Whether you're scripting simple transfers or building a killer dApp with gasless logins, Solana's ecosystem is primed for innovation. Now's the time to jump in and start experimenting. For more, check out our full Solana developer resources and the Solana docs. Happy building – if you run into questions, visit the Alchemy support center. Let's make some onchain magic!
Frequently asked questions
What is a Solana wallet?
A Solana wallet is a keypair (public and private keys) that lets you control accounts on the Solana blockchain, which can hold SOL tokens, other assets, or executable code. Unlike Ethereum's EOA model, Solana treats everything as accounts with a more flexible, programmable structure.
Do I need to pay to create a Solana wallet?
No, generating a keypair is free, but accounts on Solana require rent (about 0.00089 SOL per KB) to persist on-chain and transaction fees average $0.00025. On devnet you can get free test SOL via airdrop, but mainnet requires purchasing SOL.
What's the difference between regular and smart Solana wallets?
Regular wallets are basic keypairs where you manually manage keys and pay fees, ideal for scripts and testing. Smart wallets use account abstraction to offer social login, gas sponsorship, batched transactions, and programmable logic, perfect for user-facing apps.
Can I use social login instead of seed phrases?
Yes, many smart wallet providers let users authenticate via email, Google, or passkeys instead of managing seed phrases. This eliminates the friction of traditional key management for users.
How do I fund my Solana wallet on devnet?
Use connection.requestAirdrop() to get free test SOL on devnet (limited to ~24 SOL/day per IP). For mainnet, you'll need to purchase SOL through an exchange like Coinbase.
What is rent on Solana?
Rent is a storage deposit system where accounts must maintain a minimum SOL balance (about 0.00089 SOL per KB) to stay active on-chain. It differs from Ethereum's gas fees and helps keep the network efficient by pruning inactive accounts.
Can smart wallets sponsor transaction fees for users?
Yes, some smart wallet providers support gas and rent sponsorship. This lets your app pay user fees, enabling gasless experiences that boost conversions and simplify onboarding.
Do I need to run my own Solana node?
No, our RPC endpoints provide reliable access to the Solana network without running your own node. The service handles load balancing, scaling, and provides both HTTP and WebSocket connections for real-time updates.
Alchemy Newsletter
Be the first to know about releases
ニュースレターに登録する
Alchemyの最新のプロダクト情報とリソースをお届けします
メールアドレスを入力すると、当社のマーケティング情報およびプロダクト最新情報の受信に同意したことになります。Alchemyが受け取った情報をプライバシー通知に従って取り扱うことに同意するものとします。購読はいつでも解除できます。
Related articles

Introducing Activity Log for Enterprises
Activity Log is now available for enterprise teams. Review account changes in the dashboard, or send them to your SIEM.

What Solana builders ship on Alchemy
See how Solflare, Phantom, Collector Crypt, and other Solana teams build wallets, trading platforms, and real-world assets on Alchemy's Solana RPC and gRPC infrastructure.

Turn Claude Code into an onchain research agent
Turn Claude Code into an onchain research agent with the Alchemy CLI. Trace token launches, deployer wallets, and admin keys by asking the right questions.