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.On Ethereum, one contract address holds the code and the count.
On Solana, one counter program serves any number of counter accounts.
In code, the Solidity contract declarescount 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.
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.Creating a token sends one transaction to the Token Program. You write no Rust and deploy no contract.
Accounts
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:Externally owned account: Controlled by a private key
- Signs and starts transactions.
- Holds a balance and a nonce.
- Has no code unless it delegates to a contract with EIP-7702.
Contract account: Controlled by its code
- Runs when a transaction or another contract calls it.
- Holds code and storage.
- Has no private key, so it cannot start a transaction.
| 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. |
- 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:Any wallet can pay the fee
Several instructions and signers
Programs sign for PDAs
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:Instruction arrives
Runtime loads accounts
Program executes
Changes are committed
- 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 |
Transactions 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.A transaction runs its instructions in order. If one fails, the whole transaction fails.
Ethereum transaction
- Calls one contract. Batching needs a multicall contract.
- Has one sender. Each contract sees its immediate caller as
msg.sender. - Is ordered by the sender’s account nonce.
- Does not have to declare state access up front.
Solana transaction
- Carries several instructions, each to any program, and executes them atomically.
- Can have several signers, and the fee payer does not have to be the user.
- Uses a recent blockhash and expires after 150 blocks, about 30 seconds.
- Lists every account it reads or writes before execution.
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.Build and sign
Send over RPC
Execute
Finalize
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.Base fee
Priority fee
Rent
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.Transaction size
Compute per transaction
Compute per block
Compute per account
Instruction stack depth
Blockhash lifetime
Reentrancy
The runtime blocks the commonA -> 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.| Solidity | Solana | How it maps |
|---|---|---|
mapping | Program Derived Addresses | Derive one account address per key from seeds, and store the value in that account. |
msg.sender | Signer accounts | A transaction can have several signers, and the fee payer may be someone else. List each required signer as an account and check it. |
constructor | An initialize instruction | Create and fill the program’s accounts in a dedicated instruction, and block it from running twice. |
onlyOwner | Signer and address checks | Store the authority’s address in an account or a constant, and require that address to sign. |
view functions | Client-side account reads | Account data is public. Fetch and decode it over RPC without calling the program. |
| Proxy upgrades | Upgrade authority | Programs are upgradeable by default. Redeploy to the same program ID, or remove the authority to make the program immutable. |
nonReentrant | Account and CPI validation | The runtime blocks indirect reentrancy. Verify account owners, PDA seeds, and the program IDs you call. |
| An ERC20 contract | A mint account | Create a mint under the Token Program instead of deploying token code. |
Mappings become PDAs
A Program Derived Address (PDA) gives you the key-to-value lookup thatmapping 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:
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:Map functions to instructions
init_candidate, and voteForCandidate becomes
vote_for_candidate. Each instruction takes a context that lists its accounts.Define the account that stores votes
votesReceived mapping with a Candidate account type. InitSpace
calculates how many bytes the account needs.Derive one account per candidate
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.Restrict who can add candidates
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.Deploy and vote
anchor init, add the program code, and set the OWNER
constant to the address of the wallet that runs your tests. Run anchor build,
then anchor test to deploy to a local validator and call init_candidate and
vote_for_candidate from a test. Build your first
program walks through this
workflow.Read the results
Candidate accounts from the client. In an Anchor test,
program.account.candidate.all() returns 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.- Validate every account’s owner, address or PDA seeds, discriminator, and data length, and how it relates to the other accounts in the instruction.
- Require each authority as an explicit signer or a validated PDA. There is no
implicit
msg.sender. - Reject duplicate mutable accounts when the instruction expects separate balances, vaults, or config accounts.
- Pin CPI targets to the expected program IDs so a caller cannot substitute a program or an account.
- Protect initialization from running twice, especially with helpers such as
init_if_needed. - Close accounts by draining their lamports and marking the state closed, so they cannot be revived in the same transaction.
- Use checked math, and confirm that token decimals, mint addresses, and the token program match your Solidity assumptions.
- Test account substitution, signer spoofing, arbitrary CPI program IDs, duplicate writable accounts, reinitialization, account closure, and stale reads after a CPI.
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 finality
Solana finality
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:Leader produces a block
Validators vote
Votes form a certificate
Block is final
| 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.Ethereum: Two clients per validator
- An execution client receives transactions, runs them in the EVM, and keeps the state.
- A consensus client runs Proof of Stake and agrees on the blocks the execution client validated.
Solana: One client per validator
- A single validator client executes transactions, produces blocks, and votes.
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 |