LayerZeroFault
Solana & Bitcoin CODE: 0x1 Reviewed & Verified:

Solana Error 0x1: Insufficient Lamports for Rent Exemption Fix

Verified by Victor Vance • Lead Technical Analyst & Systems Researcher
Quick Diagnostic Answer (Executive Summary) GSC Snippet Verified

Solana error 0x1 (decimal 1) is the System Program error InsufficientFundsInAccount. It occurs when a source account lacks enough lamports (1 SOL = 1,000,000,000 lamports) to complete a transfer, pay transaction fees, or fund rent exemption for a newly initialized data account. On Solana, all accounts must maintain a minimum lamport balance for rent exemption to avoid being garbage-collected. Fund the fee payer account to fix.

# Root Cause & Technical Architecture

The Solana System Program enforces: `if from_account.lamports < amount { return Err(SystemError::ResultWithNegativeLamports.into()); }`. Furthermore, under Solana rent rules, any account created or modified must hold at least 2 years of rent exemption (calculated via `getMinimumBalanceForRentExemption(data_len)`). If a transaction attempts to transfer funds that would leave an account with a non-zero balance below the rent-exempt threshold, or if the fee payer cannot cover the 5,000 lamport base fee, the runtime throws `Custom Program Error: 0x1`.

# 4-Step Actionable Diagnostic Protocol

Step-by-Step Resolution
01

Check Fee Payer SOL Balance (Not SPL Tokens)

Call connection.getBalance(feePayerPublicKey). Ensure the wallet holds at least 0.05 SOL to pay transaction base fees and priority compute units.

02

Calculate Exact Rent Exemption for Account Data Size

Use connection.getMinimumBalanceForRentExemption(accountSize) to calculate the precise lamports required when creating new accounts or ATAs.

03

Avoid Draining Source Accounts Below Rent Minimum

When transferring native SOL, reserve at least 0.002 SOL in the sender account. Attempting to transfer 100% of SOL often fails rent rules.

04

Verify Associated Token Account (ATA) Creation Funds

Receiving a new SPL token for the first time requires ~0.00203928 SOL to initialize the token account on-chain.

# Diagnostic Verification Code / Command

typescript
check-solana-rent.ts
// Verify Rent Exemption & Balance in @solana/web3.js
import { Connection, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';

async function checkRentAndBalance(connection: Connection, walletPubkey: PublicKey, accountSize: number) {
  const balance = await connection.getBalance(walletPubkey);
  const minRent = await connection.getMinimumBalanceForRentExemption(accountSize);
  const txFee = 5000; // Base fee in lamports

  const totalRequired = minRent + txFee;
  if (balance < totalRequired) {
    throw new Error(`Custom Program Error 0x1: Balance (${balance / LAMPORTS_PER_SOL} SOL) cannot cover rent (${minRent / LAMPORTS_PER_SOL} SOL) + fee!`);
  }
}
Zero-Secrets Client Sandbox

Launch Derivation Path Inspector

Execute client-side cryptographic simulation and parameter checks safely in your browser via native WebCrypto without sending private keys or mnemonics over the wire.

Open Sandbox →
Comprehensive In-Depth Guide

Read Full Investigation & Recovery Workflow

Explore complete architectural diagrams, edge-case failure trees, and detailed post-mortem analysis in our verified deep guide.

Read Guide →

# Related Diagnostic Codes in Solana & Bitcoin

Related Hex Statuses

# Frequently Asked Questions

FAQ Schema

Why do I get error 0x1 when I have plenty of USDC in Phantom?

USDC is an SPL token. Solana network transactions require native SOL lamports for transaction fees and account rent exemption.

What is rent exemption on Solana?

Rent exemption is a refundable deposit of lamports stored in an account proportional to its byte size, preventing the account from being purged by validators.

Can I recover rent lamports from closed token accounts?

Yes! When you close an empty token account via closeAccount instruction, all locked rent lamports (~0.002 SOL) are returned to your main wallet.