EVM -> Solana

Panduan Lengkap Pengembangan Solana untuk Developer Ethereum

Solana programs hold no state, one transaction can call several programs, and fee pressure stays local to the accounts a transaction writes. This guide maps Ethereum's accounts, contracts, transactions, fees, and tooling to their Solana equivalents, ports a Solidity contract step by step, and compares how the two networks reach consensus.

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.

ConceptEthereumSolana
ConsensusGasper: Casper-FFG plus LMD-GHOSTAlpenglow: Votor voting and finality
FinalityAbout 13 minutes (two epochs)About 150 milliseconds
StateStorage inside each contract accountData accounts owned by programs
User accountExternally owned account (EOA)Account owned by the System Program and controlled by a keypair
Smart contractContract account holding code and storageProgram: an executable account with no state of its own
Account abstractionERC4337 and EIP-7702Fee payers, multiple signers, and PDAs in the base protocol
Validator softwareAn execution client plus a consensus clientOne 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.

Ethereum
Counter contract
One address holds everything.
Code
increment()
Storage
count
Solana
Counter program
increment instruction, no state
owns
Counter account
count: 3
Counter account
count: 12
Counter account
count: 40
The same counter on both chains. One Solana program serves any number of counter accounts.

In 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.

Solidity
Solidity
contract Counter {
    uint256 public count;

    function increment() public {
        count += 1;
    }
}
Rust with Anchor
Rust
#[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.

Token Program
Deployed once
owns
Mint account
Token A: supply, decimals, authorities
Mint account
Token B: supply, decimals, authorities
Token accounts
Each holder's balance
Creating a token sends one transaction to the Token Program. You write no Rust and deploy no contract.
Bash
spl-token create-token

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.
FieldDescription
nonceNumber of transactions the account has sent. For a contract, the number of contracts it has created.
balanceETH the account holds, in wei.
codeHashHash of the account's EVM code. An EOA without a delegation has the hash of empty code.
storageRootRoot 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:

FieldDescription
lamportsBalance in lamports, the smallest unit of SOL. The equivalent of balance.
dataByte array the account stores. For a program, this is the executable code or a pointer to it.
ownerProgram that owns the account. Only the owner can change data or deduct lamports.
executableWhether the account is a program.
rent_epochLegacy 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.

EthereumSolanaNotes
balancelamportsBoth hold the native token balance.
nonceNo equivalentSolana transactions expire with a recent blockhash, not an account nonce.
codeHashexecutable and dataA program account is marked executable and stores the code.
storageRootdata in separate accountsState lives in data accounts that the program owns.
No equivalentownerEvery 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:

One limit remains
A program cannot start a transaction. An external signer submits and pays for every transaction: a user, a relayer, or a backend service.

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:

01
Instruction arrives
It names a program ID, a list of accounts, and a byte array of instruction data.
02
Runtime loads accounts
The runtime checks signatures and loads every account the instruction lists.
03
Program executes
One entrypoint receives the program ID, the accounts, and the instruction data.
04
Changes are committed
The runtime keeps the account changes only if the owner rules hold and every instruction succeeds.
How the runtime executes an instruction.
  • A program is an account with executable set 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:

FilePurpose
lib.rsRegisters the modules
entrypoint.rsEntrypoint to the program
instruction.rsProgram API and instruction data (de)serialization
processor.rsProgram logic
state.rsAccount types and state (de)serialization
error.rsProgram-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:

ClusterRPC endpoint
Mainnethttps://api.mainnet.solana.com
Testnethttps://api.testnet.solana.com
Devnethttps://api.devnet.solana.com
Localhosthttp://localhost:8899
Bash
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:

Bash
solana program set-upgrade-authority <PROGRAM_ADDRESS> --final

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.

Transaction
Signatures
One per required signer. The first signer pays the fee.
Message
Account addresses
Every account the instructions read or write.
Recent blockhash
Expires the transaction after 150 blocks, about 30 seconds.
Instructions
Instruction 1: transfer tokens
Program
Token Program
Accounts
Source, destination, owner
Data
Amount
Instruction 2: call your program
Program
Your program ID
Accounts
Accounts your program needs
Data
Arguments
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.

01
Build and sign
Your app builds the transaction and the wallet signs it.
02
Send over RPC
The RPC node forwards it to the current and upcoming leaders.
03
Execute
The leader runs the instructions and adds the transaction to a block.
04
Finalize
Validators vote, and the block is final about 150 milliseconds after it is produced.
The path of one transaction.
Choose a commitment level
RPC reads and confirmations accept a 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 invoke when the original signers cover the call. Use invoke_signed when 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
5,000 lamports
Charged per signature. Half is burned and half goes to the validator.
Priority fee
Optional
Compute unit limit multiplied by the compute unit price you set, in micro-lamports per compute unit. All of it goes to the validator that produces the block.
Rent
Refundable deposit
Sized by the bytes an account stores. You get it back when you close the account.

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
1,232 bytes
4,096 bytes with the v1 transaction format.
Compute per transaction
1.4M compute units
The default is 200,000 per instruction until you request more.
Compute per block
50M compute units
Shared by every transaction in the block. This limit scales with slot time.
Compute per account
20M compute units
Per block, for transactions that write the same account. This limit scales with slot time.
Instruction stack depth
5
The top-level instruction plus four nested CPIs. SIMD-0268 raises the limit to 9 once it activates.
Blockhash lifetime
150 blocks
About 30 seconds. After that, the transaction can no longer be included.

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 toolSolana equivalentUse it for
Hardhat node, AnvilSolana Test Validator, SurfpoolA local network. Surfpool can fork mainnet state.
Foundry testsLiteSVM, MolluskFast in-process program tests.
Ethers, viem@solana/kitBuilding, signing, and sending transactions from JavaScript.
RemixSolana PlaygroundWriting and deploying programs in the browser.
ABIAnchor IDLA JSON description of a program's instructions and accounts, used to generate clients.
EtherscanSolana Explorer, Solscan, OrbInspecting transactions, accounts, and programs.
scaffold-ethcreate-solana-dappScaffolding 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:

LanguageSDK
JavaScript and TypeScript@solana/kit (legacy: @solana/web3.js)
Rustsolana_sdk
Pythonsolana-py
Gosolana-go
Javasolanaj
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
mapping
Solana
Program Derived Addresses
Derive one account address per key from seeds, and store the value in that account.
Solidity
msg.sender
Solana
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.
Solidity
constructor
Solana
An initialize instruction
Create and fill the program's accounts in a dedicated instruction, and block it from running twice.
Solidity
onlyOwner
Solana
Signer and address checks
Store the authority's address in an account or a constant, and require that address to sign.
Solidity
view functions
Solana
Client-side account reads
Account data is public. Fetch and decode it over RPC without calling the program.
Solidity
Proxy upgrades
Solana
Upgrade authority
Programs are upgradeable by default. Redeploy to the same program ID, or remove the authority to make the program immutable.
Solidity
nonReentrant
Solana
Account and CPI validation
The runtime blocks indirect reentrancy. Verify account owners, PDA seeds, and the program IDs you call.
Solidity
An ERC20 contract
Solana
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 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:

Solidity
Solidity
mapping(address => uint256) public balances;
Rust with Anchor
Rust
#[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:

Solidity
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;
    }
}
1
Map functions to instructions
The constructor becomes init_candidate, and voteForCandidate becomes vote_for_candidate. Each instruction takes a context that lists its accounts.
Rust
#[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(())
    }
}
2
Define the account that stores votes
Replace the votesReceived mapping with a Candidate account type. InitSpace calculates how many bytes the account needs.
Rust
#[account]
#[derive(InitSpace)]
pub struct Candidate {
    pub votes_received: u64,
}
3
Derive one account per candidate
Use the candidate name as the PDA seed. 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.
Rust
#[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>,
}
4
Restrict who can add candidates
A Solidity constructor runs once, for the deployer. Anyone can call a Solana instruction, so 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.
Rust
const OWNER: &str = "8os8PKYmeVjU1mmwHZZNTEv5hpBXi5VvEKGzykduZAik";

fn check(ctx: &Context<InitializeCandidate>) -> Result<()> {
    require_keys_eq!(
        ctx.accounts.payer.key(),
        OWNER.parse::<Pubkey>().unwrap(),
        OnlyOwnerError::NotOwner
    );
    Ok(())
}
5
Deploy and vote
Open the voting program in Solana Playground. Set the 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.
6
Read the results
Fetch the Candidate accounts from the client. In Solana Playground, select Fetch All under Accounts to list each candidate with its vote count.
What happened to the view functions?
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
~13 minutes
Two epochs of attestations under Gasper.
Solana finality
~150 milliseconds
One or two rounds of Votor votes under Alpenglow.

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:

01
Leader produces a block
The validator scheduled for the slot builds a block and broadcasts it with Turbine.
02
Validators vote
Validators send votes directly to one another. Votes are not transactions inside blocks.
03
Votes form a certificate
Votes aggregate into a stake-weighted certificate: 80% of stake in one round, or 60% of stake in each of two rounds.
04
Block is final
A block with a finalization certificate is final. Reversing it would take more than 20% of stake acting against the protocol.
How Votor finalizes a block.

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.

What changes for your app
Signing, sending, and reading transactions work the same way, and finality arrives sooner. See commitment levels for which level to wait for.
RoleEthereumSolana
Sybil resistanceProof of Stake (Proof of Work before 2022)Proof of Stake
FinalityCasper-FFG checkpointsVotor certificates
Voting and fork choiceLMD-GHOST attestationsVotor votes (Tower BFT with PoH before Alpenglow)
Block propagationGossipTurbine (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 roleClients
Ethereum executionGeth (Go), Nethermind (C#), Besu (Java), Erigon (Go), Reth (Rust)
Ethereum consensusLighthouse (Rust), Prysm (Go), Teku (Java), Nimbus (Nim), Lodestar (TypeScript)
Solana validatorAgave (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.

RoleEthereumSolana
Votes in consensusValidator running a full nodeVoting validator
Serves app reads and submits transactionsFull or archive node behind an RPC endpointRPC node: verifies every block and does not vote
Keeps full historyArchive nodeExternal archives such as Bigtable-backed warehouses or Old Faithful
Verifies block headers onlyLight nodeNo 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.

Next steps

© 2026 Yayasan Solana. Semua hak dilindungi.
Panduan Lengkap Pengembangan Solana untuk Developer Ethereum | Solana