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

CN
1 year ago

For friends who are only familiar with EVM.

Author: NingNing

This guide will transform the concept of EVM into the concept of Solana.

Concepts related to Transactions

Blocks

Solana's block time is 400 milliseconds, referred to as a Slot. Slots and block heights may differ in Solana.

Staking rewards are distributed to validators every Epoch, approximately every 2-3 days, equivalent to 432,000 slots.

Wei

The smallest unit of SOL is lamport, with a precision of 9 (9 decimal places).

Most of the homogeneous tokens in the Solana ecosystem default to 6 decimal places, rather than 18.

Hexadecimal / Binary

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

PoS and Proof

Solana defaults to using Delegated Proof of Stake (DPoS) to ensure security.

Validators use the Proof of History (PoH) consensus mechanism to vote on slots (leadership rotates every Epoch).

These are all done on the base chain, with two types of transactions: voting and non-voting.

Addresses

Solana's addresses are also called "accounts," with a special type of account called "Program Derived Accounts" (PDA).

PDAs require a small rent payment to prevent state bloat.

Smart Contracts

Referred to as "programs" on Solana.

Programs are deployed through the BPF uploader and can be upgraded at any time.

Transaction Data

Referred to as "instructions" on Solana.

Each transaction has multiple "data" fields nested in the "instructions" array.

The solana.instruction_calls table can be used to process instructions.

From/To

From is the transaction initiator, and To is the account where the instruction is executed.

Traces

Due to the nested array storage of instruction data, it is not like Ethereum's ethereum.traces.

The solana.instruction_calls table can be used as a replacement.

Function Signatures

Use "discriminators" instead, which can be 1 byte, 4 bytes, or 8 bytes long.

The solana.discriminators table can be used for identification.

Event Signatures

Events mostly appear in log messages. Dune has not yet decoded or stored event signatures.

Gas

Use "compute units" to represent computational load, which can be found in log messages.

Native programs (system, stake, vote) do not consume computational load.

Gas Fee

Solana has not implemented usage-based pricing and charges a fixed fee of 5000 lamports per transaction.

Priority fees can be added by calling the "Set Compute Unit Price" instruction.

50% of the transaction fee and 50% of the rent fee are destroyed.

Concepts related to Smart Contracts

Programming Language

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

Solana provides the Anchor language as an abstraction layer for Rust, simplifying development.

ABI

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

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

Smart Contract Factory/Proxy Smart Contract

Solana programs create child accounts (PDAs) through the main program, rather than using factories and proxy contracts as in Ethereum.

Storage

Solana stores data in the binary buffer of accounts, unlike Ethereum's storage slots.

Nested/tree-like structure accounts (PDAs) are commonly used to store data.

Tokens

Solana's tokens are deployed through the spl_token program (or the newer token2022 program).

Token balances are stored in associated accounts, unlike Ethereum's balance mapping.

Staking

Staking in Solana is by default liquid, without the need to lock tokens.

Anyone can create staking accounts with any balance and delegate to validators.

ERC Standards

Solana does not have ERC standards like Ethereum, and there is a lack of uniformity between protocols.

Core Standard Changes

Changes to the core Solana code are managed through "feature gates" in the Solana codebase, unlike Ethereum's EIP process.

The above content is compiled from ANDREW HONG's https://read.cryptodatabytes.com/p/a-guide-to-solana-for-ethereum-analysts

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。

HTX:注册并领取8400元新人礼
Ad
Share To
APP

X

Telegram

Facebook

Reddit

CopyLink