At a glance
Use this table as a lookup while you read. Each row links an Ethereum concept to the section that explains its Solana counterpart.
| Concept | Ethereum | Solana |
|---|---|---|
| Consensus | Gasper: Casper-FFG plus LMD-GHOST | Alpenglow: Votor voting and finality |
| Finality | About 13 minutes (two epochs) | About 150 milliseconds |
| State | Storage inside each contract account | Data accounts owned by programs |
| User account | Externally owned account (EOA) | Account owned by the System Program and controlled by a keypair |
| Smart contract | Contract account holding code and storage | Program: an executable account with no state of its own |
| Account abstraction | ERC4337 and EIP-7702 | Fee payers, multiple signers, and PDAs in the base protocol |
| Validator software | An execution client plus a consensus client | One validator client |
The mental model: programs and accounts
The account model is the largest change when you move from Ethereum. A Solidity contract keeps its code and its storage at one address. A Solana program is stateless: it stores nothing itself, and every instruction passes in the accounts it reads and writes.
Solana uses this design to run transactions in parallel. Each transaction declares its accounts up front, so the runtime can execute transactions that do not write the same accounts at the same time on separate cores.
increment()countincrement instruction, no statecount: 3count: 12count: 40In code, the Solidity contract declares count as a state variable. The Anchor program declares a Counter account type and lists that account in the Increment context. The caller chooses which counter account to pass in.
contract Counter {
uint256 public count;
function increment() public {
count += 1;
}
}#[program]
pub mod counter {
use super::*;
pub fn increment(ctx: Context<Increment>) -> Result<()> {
let counter = &mut ctx.accounts.counter;
counter.count = counter.count.checked_add(1).unwrap();
Ok(())
}
}
#[derive(Accounts)]
pub struct Increment<'info> {
#[account(mut)]
pub counter: Account<'info, Counter>,
}
#[account]
pub struct Counter {
pub count: u64,
}One program, many accounts
Stateless programs are reusable. On Ethereum, every new ERC20 token is a new contract deployment. On Solana, a new token is a new mint account under the Token Program that is already deployed. The mint account records the supply, the decimals, and who may mint or freeze.
spl-token create-tokenAccounts
Ethereum has two kinds of accounts, and a contract account holds its own storage. On Solana, every piece of state is an account with the same five fields. This section compares the two models field by field.
Ethereum accounts
Both kinds of Ethereum account have an address and can hold ETH. They differ in what controls them:
| Field | Description |
|---|---|
nonce | Number of transactions the account has sent. For a contract, the number of contracts it has created. |
balance | ETH the account holds, in wei. |
codeHash | Hash of the account's EVM code. An EOA without a delegation has the hash of empty code. |
storageRoot | Root hash of the Merkle Patricia trie that holds the contract's storage. |
Solana accounts
On Solana, wallets, programs, token balances, and application state are all accounts. An account works like a file: it has an address, holds bytes, and carries metadata that tells the runtime who may change it. Every account has the same five fields:
| Field | Description |
|---|---|
lamports | Balance in lamports, the smallest unit of SOL. The equivalent of balance. |
data | Byte array the account stores. For a program, this is the executable code or a pointer to it. |
owner | Program that owns the account. Only the owner can change data or deduct lamports. |
executable | Whether the account is a program. |
rent_epoch | Legacy field. Rent collection is disabled, so the field no longer changes. |
Three rules follow from these fields:
- Programs own data. A program stores state in accounts it owns, and the runtime rejects writes from any other program. A wallet is an account owned by the System Program.
- Programs can control addresses. A Program Derived Address (PDA) is derived from a program ID and a set of seeds, and it has no private key. Only the program that derived it can sign for it. PDAs take the place of Solidity mappings: derive one address per key and store the value in that account.
- Storage needs a deposit. Each account holds a minimum lamport balance in proportion to its data size, called rent. Rent is a refundable deposit, not a recurring fee: you pay it when you create the account and get it back when you close the account.
Field by field
Most Ethereum account fields have a Solana counterpart. Two do not map one to one: the nonce and the storage root.
| Ethereum | Solana | Notes |
|---|---|---|
balance | lamports | Both hold the native token balance. |
nonce | No equivalent | Solana transactions expire with a recent blockhash, not an account nonce. |
codeHash | executable and data | A program account is marked executable and stores the code. |
storageRoot | data in separate accounts | State lives in data accounts that the program owns. |
| No equivalent | owner | Every Solana account names the program that controls it. |
Account abstraction
On Ethereum, only an EOA can start a transaction and pay for gas, so sponsored fees, batching, and custom signing rules need extra machinery. ERC4337 added that machinery through a separate EntryPoint contract, bundlers, and paymasters, and it went live on Ethereum mainnet in March 2023. EIP-7702, part of the Pectra upgrade in May 2025, lets an EOA delegate to contract code.
Solana's transaction format covers fee sponsorship and batching without a separate standard. Custom signing rules still need a wallet program, which signs through a PDA:
invoke_signed, which lets it hold tokens and enforce custom authorization rules.Programs
A program is the account that holds executable code. Each instruction names the accounts it reads and writes, and the runtime passes those accounts to the program:
- A program is an account with
executableset to true. A loader program owns it. - Programs compile to sBPF, Solana's bytecode format. Most are written in Rust, and any language with an LLVM backend that targets sBPF works.
- Because state lives in accounts, one deployed program serves any number of users and assets without being deployed again.
Native programs and the Solana Program Library
Solana ships with programs that most applications call instead of rewriting. Native programs provide core functions: the System Program creates accounts and transfers SOL. The Solana Program Library (SPL) covers tokens and related functions: the Token Program mints and transfers tokens, and the Associated Token Account Program creates each wallet's token account at a derived address.
Writing programs
Most teams write programs in Rust with Anchor, a framework that generates account validation and serialization code.
A Rust program written without a framework usually splits into these files:
| File | Purpose |
|---|---|
lib.rs | Registers the modules |
entrypoint.rs | Entrypoint to the program |
instruction.rs | Program API and instruction data (de)serialization |
processor.rs | Program logic |
state.rs | Account types and state (de)serialization |
error.rs | Program-specific errors |
Deploying and upgrading
Develop and test against a local validator or Devnet, then deploy to Mainnet. Clients reach each cluster through its RPC endpoint. The public endpoints are shared and rate-limited, so use an RPC provider in production:
| Cluster | RPC endpoint |
|---|---|
| Mainnet | https://api.mainnet.solana.com |
| Testnet | https://api.testnet.solana.com |
| Devnet | https://api.devnet.solana.com |
| Localhost | http://localhost:8899 |
solana program deploy <PROGRAM_FILEPATH>Deploying uploads the compiled program and creates a program account. That account's address is the program ID that every instruction references.
Programs are upgradeable by default. The program's upgrade authority can replace the code while the program ID stays the same, so you need no proxy contract. To make a program immutable, remove the upgrade authority:
solana program set-upgrade-authority <PROGRAM_ADDRESS> --finalTransactions and instructions
An instruction is one call to one program, the equivalent of a function call on an Ethereum contract. A transaction bundles one or more instructions with the signatures that authorize them.
msg.sender.From wallet to finality
Solana has no public mempool. An RPC node forwards a transaction straight to the current leader and the next leaders on the schedule. If the transaction is not included before its blockhash expires, the client signs a new one with a fresh blockhash.
commitment level, which replaces counting block confirmations on Ethereum. processed is the node's newest block and can still be skipped. finalized is a block with a finalization certificate. confirmed returns the same block as finalized and is kept for compatibility. Use finalized before you ship goods, release funds, or write settlement records.Calling other programs
A Cross-Program Invocation (CPI) is one program calling an instruction on another, the way a Solidity contract calls another contract. Three rules differ from the EVM:
- The transaction must list every account the whole call chain touches before execution starts.
- The callee receives only the signer and writable privileges the caller holds, and it spends from the same compute budget.
- Use
invokewhen the original signers cover the call. Useinvoke_signedwhen your program signs for one of its PDAs.
Fees and local fee markets
A Solana transaction pays up to three kinds of cost. Amounts are in lamports: 1 SOL is 1,000,000,000 lamports. Compute units play the role of gas.
Local fee markets
Because each transaction declares the accounts it writes, Solana prices contention per account. A popular NFT mint raises priority fees for transactions that write the mint's accounts. A USDC transfer that touches other accounts in the same block keeps paying the usual fee. On Ethereum, one busy contract can raise the base fee for every transaction in the block.
See fees for how to set a compute unit limit and price.
Limits to design around
Solana caps what one transaction and one block can do. Check a migrated design against these numbers before you write code. The block limits are feature-gated, so confirm the current values in the compute budget reference.
Reentrancy
The runtime blocks the common A -> B -> A reentrancy path with a ReentrancyNotAllowed error, so you do not need a nonReentrant guard for it. A program can still call itself directly, within the stack depth and compute limits. The risk moves elsewhere: callers choose the accounts and instruction data they pass to your program, so validate every account and every CPI target. See the full list of program limitations.
Languages and tooling
Most EVM tools have a direct Solana counterpart.
| EVM tool | Solana equivalent | Use it for |
|---|---|---|
| Hardhat node, Anvil | Solana Test Validator, Surfpool | A local network. Surfpool can fork mainnet state. |
| Foundry tests | LiteSVM, Mollusk | Fast in-process program tests. |
| Ethers, viem | @solana/kit | Building, signing, and sending transactions from JavaScript. |
| Remix | Solana Playground | Writing and deploying programs in the browser. |
| ABI | Anchor IDL | A JSON description of a program's instructions and accounts, used to generate clients. |
| Etherscan | Solana Explorer, Solscan, Orb | Inspecting transactions, accounts, and programs. |
| scaffold-eth | create-solana-dapp | Scaffolding a full-stack app. |
Programming languages
Most Solana programs are written in Rust, usually with the Anchor framework, which handles account validation and serialization.
On the client side, SDKs exist for most languages:
| Language | SDK |
|---|---|
| JavaScript and TypeScript | @solana/kit (legacy: @solana/web3.js) |
| Rust | solana_sdk |
| Python | solana-py |
| Go | solana-go |
| Java | solanaj |
| C# | Solnet |
| C++ | solcpp |
Reading program source
On Ethereum, you read a contract's source on Etherscan after the deployer verifies it. Solana's counterpart is verified builds. The author builds the program deterministically and records the repository and commit onchain. OtterSec's verification service reproduces the build from that repository, and explorers show the result on the program's page. A program without a verified build shows only bytecode. Treat it like an unverified contract.
Solidity patterns on Solana
Most Solidity idioms have a Solana equivalent, though few translate line by line. Use this map when you read a contract you plan to port.
mappingmsg.senderSigner accountsconstructoronlyOwnerview functionsnonReentrantMappings become PDAs
A Program Derived Address (PDA) gives you the key-to-value lookup that mapping provides. The seeds are the key, and the account at the derived address holds the value. In this example, the string balance and the signer's public key derive one balance account per user:
mapping(address => uint256) public balances;#[account(
init,
payer = signer,
space = 8 + Balance::INIT_SPACE,
seeds = [b"balance", signer.key().as_ref()],
bump
)]
pub balance: Account<'info, Balance>,Port a Solidity contract
This walkthrough ports a small voting contract. The Solidity version stores a vote count per candidate in a mapping, sets the candidate list in its constructor, and exposes one function to vote:
contract Voting {
mapping(bytes32 => uint256) public votesReceived;
bytes32[] public candidateList;
constructor(bytes32[] memory candidateNames) {
candidateList = candidateNames;
}
function voteForCandidate(bytes32 candidate) public {
require(validCandidate(candidate));
votesReceived[candidate] += 1;
}
function validCandidate(bytes32 candidate) public view returns (bool) {
for (uint256 i = 0; i < candidateList.length; i++) {
if (candidateList[i] == candidate) return true;
}
return false;
}
}init_candidate, and voteForCandidate becomes vote_for_candidate. Each instruction takes a context that lists its accounts.#[program]
pub mod voting {
use super::*;
#[access_control(check(&ctx))]
pub fn init_candidate(
ctx: Context<InitializeCandidate>,
_candidate_name: String,
) -> Result<()> {
Ok(())
}
pub fn vote_for_candidate(
ctx: Context<VoteCandidate>,
_candidate_name: String,
) -> Result<()> {
let candidate = &mut ctx.accounts.candidate;
candidate.votes_received = candidate.votes_received.checked_add(1).unwrap();
Ok(())
}
}votesReceived mapping with a Candidate account type. InitSpace calculates how many bytes the account needs.#[account]
#[derive(InitSpace)]
pub struct Candidate {
pub votes_received: u64,
}init creates the account, payer funds its rent deposit, and space adds 8 bytes for the discriminator, the tag Anchor writes at the start of each account to identify its type. A seed holds at most 32 bytes, so hash longer names. The VoteCandidate context, not shown, uses the same seeds with mut in place of init.#[derive(Accounts)]
#[instruction(_candidate_name: String)]
pub struct InitializeCandidate<'info> {
#[account(mut)]
pub payer: Signer<'info>,
#[account(
init,
space = 8 + Candidate::INIT_SPACE,
payer = payer,
seeds = [_candidate_name.as_bytes().as_ref()],
bump,
)]
pub candidate: Account<'info, Candidate>,
pub system_program: Program<'info, System>,
}init_candidate checks that the signer is the owner. This check stands in for both the constructor and onlyOwner. OnlyOwnerError is a custom error enum, not shown.const OWNER: &str = "8os8PKYmeVjU1mmwHZZNTEv5hpBXi5VvEKGzykduZAik";
fn check(ctx: &Context<InitializeCandidate>) -> Result<()> {
require_keys_eq!(
ctx.accounts.payer.key(),
OWNER.parse::<Pubkey>().unwrap(),
OnlyOwnerError::NotOwner
);
Ok(())
}OWNER constant to your Playground wallet address, then build the program and deploy it to Devnet. In the test tab, call initCandidate with a name and generate the candidate PDA from that name as the seed. Call voteForCandidate with the same name to add a vote.Candidate accounts from the client. In Solana Playground, select Fetch All under Accounts to list each candidate with its vote count.validCandidate is no longer needed: vote_for_candidate fails when the candidate account does not exist. The votesReceived getter moves to the client, which reads the Candidate account directly.Security checklist
Reentrancy is a standard item in an EVM security review. On Solana, the main items are account and CPI validation, because callers control the accounts and instruction data they pass in. Check each item before you deploy a migrated program.
msg.sender.init_if_needed.Consensus and finality
Ethereum and Solana both use Proof of Stake (PoS): validators stake tokens to earn the right to produce blocks and vote on them. The two chains differ in how validators reach agreement and in how long a block takes to become final.
Ethereum: Gasper
Ethereum launched on Proof of Work and moved to Proof of Stake with the Merge in September 2022. Its consensus algorithm, Gasper, combines two parts:
- LMD-GHOST is the fork choice rule. When several blocks compete, validators publish attestations, and the chain follows the branch with the most stake behind it, counting each validator's latest attestation.
- Casper-FFG is the finality gadget. It marks checkpoint blocks as justified and then finalized once two-thirds of stake has attested across two epochs.
Solana: Alpenglow
Alpenglow is Solana's consensus protocol. Its voting component, Votor, finalizes a block in one or two rounds of votes:
Alpenglow replaced Tower BFT on Mainnet in October 2026. Tower BFT was a variant of Practical Byzantine Fault Tolerance (PBFT) that used Proof of History (PoH) as a shared clock and recorded votes as onchain transactions. Votor replaced that voting layer, and Proof of History is no longer part of how validators reach agreement.
Alpenglow has a second component, Rotor, which is planned and not live yet. Solana still propagates blocks with Turbine, its tree-based broadcast protocol. Rotor will replace it with a single relay layer that cuts the network hops between the leader and the other validators.
| Role | Ethereum | Solana |
|---|---|---|
| Sybil resistance | Proof of Stake (Proof of Work before 2022) | Proof of Stake |
| Finality | Casper-FFG checkpoints | Votor certificates |
| Voting and fork choice | LMD-GHOST attestations | Votor votes (Tower BFT with PoH before Alpenglow) |
| Block propagation | Gossip | Turbine (Rotor planned) |
Clients and nodes
Both networks have more than one validator client, which limits the damage a bug in one implementation can do. They differ in how the software is split.
Validator clients
The share of Ethereum validators running each client is tracked at clientdiversity.org.
| Network and role | Clients |
|---|---|
| Ethereum execution | Geth (Go), Nethermind (C#), Besu (Java), Erigon (Go), Reth (Rust) |
| Ethereum consensus | Lighthouse (Rust), Prysm (Go), Teku (Java), Nimbus (Nim), Lodestar (TypeScript) |
| Solana validator | Agave (Rust), Jito-Solana (Rust, a fork of Agave), Firedancer (C), Sig (Zig) |
Node types
Ethereum classifies nodes by how much history they store: full, archive, and light. Solana classifies them by whether they vote. Its transaction volume makes it impractical for every node to keep the full ledger, so history is served from external archives.
| Role | Ethereum | Solana |
|---|---|---|
| Votes in consensus | Validator running a full node | Voting validator |
| Serves app reads and submits transactions | Full or archive node behind an RPC endpoint | RPC node: verifies every block and does not vote |
| Keeps full history | Archive node | External archives such as Bigtable-backed warehouses or Old Faithful |
| Verifies block headers only | Light node | No widely deployed equivalent |
Applications on both chains usually read and write through an RPC provider. Some providers serve both Ethereum and Solana. See the list of Solana RPC providers.