Solana Basic Concepts Guide: How is it different from EVM?

ForesightNews

For those who are only familiar with EVM.

Written by: NingNing

This guide translates EVM concepts into Solana concepts.

Transaction related concepts

Block

Solana’s block time is 400 milliseconds, called Slot. Slot and block height may be different in Solana.

Staking rewards are distributed to validators every Epoch, which takes about 2-3 days, equivalent to 432,000 Slots.

Wei

The minimum unit of SOL is lambor, and the precision is 9 (9 decimal places).

Most fungible tokens in the Solana ecosystem default to 6 decimal places instead of 18.

HEX/BINARY

Data in Solana is mostly represented in base58 and can be converted to hexadecimal using the from_base58() function.

PoS and Proof

Solana uses Delegated Proof of Stake (DPoS) by default for security.

Validators use the PoH mechanism to vote for Slots (the leader rotates every Epoch).

These all take place on the base chain, with two transaction types: voting and non-voting.

address

Solana’s addresses are also called “accounts”, and there is a special kind of account called “Program Derived Accounts” (PDA).

PDAs are required to pay a small amount of rent to prevent state bloat.

Smart Contract

It’s called a “program” on Solana.

The program is deployed through the BPF uploader and can be upgraded at any time.

Transaction Data

Called “commands” on Solana.

Each transaction has multiple “data” fields, nested within the “instructions” array.

Instructions can be processed using the solana.instruction_calls table.

From/To

From is the transaction initiator, and To is the execution account of the instruction.

Traces

Since the instruction data is stored in a nested array, unlike Ethereum’s ethereum.traces.

The solana.instruction_calls table can be used instead.

Function signature

Use “discriminators” instead, which can be 1, 4 or 8 bytes long.

Can be identified using the solana.discriminators table.

Event Signature

Events are mostly in log messages. Dune has not yet decoded the event or stored the event signature.

Gas

Use “compute units” to indicate the amount of computation, which can be found in log messages.

Native programs (, stake, vote) do not consume computing power.

Gas Fee

Solana has not yet implemented usage-based pricing, charging a flat fee of 5,000 lamports per transaction.

Priority charges can be added by calling the “Set Compute Unit Price” command.

50% of transaction fees and 50% of rental fees are destroyed.

Concepts related to smart contracts

programming language

Solana uses the Rust language for program development, while Ethereum uses the Solidity language.

Solana provides the Anchor language as an abstraction layer for Rust to simplify development.

ABI

Anchor programs have IDL (Interface Definition Language), while SPL programs need to be manually converted to IDL.

Some Solana projects will upload IDL to the chain, but not all projects do.

Smart Contract Factory (set)/Agent Smart Contract

The Solana program creates sub-accounts (PDAs) through the main program, instead of using factories and agency contracts like Ethereum.

storage

Solana stores data in the account’s binary buffer instead of Ethereum’s storage slots.

Nested/tree-structured accounts (PDAs) are often used to store data.

Token

Solana’s tokens are deployed through the spl_token program (or the new version of the token2022 program).

Token balances are stored in linked accounts rather than Ethereum’s balance map.

Staking

Solana’s staking is liquid by default and does not require locking tokens.

Anyone can create a staking account with any balance and delegate it to a validator.

ERC Standard

Solana does not have an ERC standard similar to Ethereum, and there is a lack of uniformity between protocols.

Core Standard Changes

Changes to Solana’s core code are managed through “feature gates” in the Solana code base, unlike Ethereum which has an EIP process.

The above content is compiled from ANDREW HONG’s

Disclaimer: The information on this page may come from third parties and does not represent the views or opinions of Gate. The content displayed on this page is for reference only and does not constitute any financial, investment, or legal advice. Gate does not guarantee the accuracy or completeness of the information and shall not be liable for any losses arising from the use of this information. Virtual asset investments carry high risks and are subject to significant price volatility. You may lose all of your invested principal. Please fully understand the relevant risks and make prudent decisions based on your own financial situation and risk tolerance. For details, please refer to Disclaimer.
Comment
0/400
No comments