Solana Account Model | Solana (2024)

On Solana, all data is stored in what are referred to as "accounts”. The waydata is organized on Solana resembles akey-value store,where each entry in the database is called an "account".

Solana Account Model | Solana (1)Accounts

Key Points #

  • Accounts can store up to 10MB of data, which can consist of either executableprogram code or program state.

  • Accounts require a rent deposit in SOL, proportional to the amount of datastored, which is fully refundable when the account is closed.

  • Every account has a program "owner". Only the program that owns an account canmodify its data or deduct its lamport balance. However, anyone can increasethe balance.

  • Programs (smart contracts) are stateless accounts that store executable code.

  • Data accounts are created by programs to store and manage program state.

  • Native programs are built-in programs included with the Solana runtime.

  • Sysvar accounts are special accounts that store network cluster state.

Account #

Each account is identifiable by its unique address, represented as 32 bytes inthe format of an Ed25519 PublicKey. You can thinkof the address as the unique identifier for the account.

Solana Account Model | Solana (2)Account Address

This relationship between the account and its address can be thought of as akey-value pair, where the address serves as the key to locate the correspondingon-chain data of the account.

AccountInfo #

Accounts have amax size of 10MB(10 Mega Bytes) and the data stored on every account on Solana has the followingstructure known as theAccountInfo.

Solana Account Model | Solana (3)AccountInfo

The AccountInfo for each account includes the following fields:

  • data: A byte array that stores the state of an account. If the account is aprogram (smart contract), this stores executable program code. This field isoften referred to as the "account data".
  • executable: A boolean flag that indicates if the account is a program.
  • lamports: A numeric representation of the account's balance inlamports, the smallest unit of SOL (1 SOL = 1billion lamports).
  • owner: Specifies the public key (program ID) of the program that owns theaccount.

As a key part of the Solana Account Model, every account on Solana has adesignated "owner", specifically a program. Only the program designated as theowner of an account can modify the data stored on the account or deduct thelamport balance. It's important to note that while only the owner may deduct thebalance, anyone can increase the balance.

Info

To store data on-chain, a certain amount of SOL must be transferred to anaccount. The amount transferred is proportional to the size of the data storedon the account. This concept is commonly referred to as “rent”. However, youcan think of "rent" more like a "deposit" because the SOL allocated to anaccount can be fully recovered when the account is closed.

Native Programs #

Solana contains a small handful of native programs that are part of thevalidator implementation and provide various core functionalities for thenetwork. You can find the full list of native programshere.

When developing custom programs on Solana, you will commonly interact with twonative programs, the System Program and the BPF Loader.

System Program #

By default, all new accounts are owned by theSystem Program.The System Program performs several key tasks such as:

  • New Account Creation:Only the System Program can create new accounts.
  • Space Allocation:Sets the byte capacity for the data field of each account.
  • Assign Program Ownership:Once the System Program creates an account, it can reassign the designatedprogram owner to a different program account. This is how custom programs takeownership of new accounts created by the System Program.

On Solana, a "wallet" is simply an account owned by the System Program. Thelamport balance of the wallet is the amount of SOL owned by the account.

Solana Account Model | Solana (4)System Account

Info

Only accounts owned by the System Program can be used as transaction feepayers.

BPFLoader Program #

TheBPF Loaderis the program designated as the "owner" of all other programs on the network,excluding Native Programs. It is responsible for deploying, upgrading, andexecuting custom programs.

Sysvar Accounts #

Sysvar accounts are special accounts located at predefined addresses thatprovide access to cluster state data. These accounts are dynamically updatedwith data about the network cluster. You can find the full list of SysvarAccounts here.

Custom Programs #

On Solana, “smart contracts” are referred to asprograms. A program is an account that containsexecutable code and is indicated by an “executable” flag that is set to true.

For a more detailed explanation of the program deployment process, refer to theDeploying Programs page of this documentation.

Program Account #

When new programs aredeployedon Solana, technically three separate accounts are created:

  • Program Account: The main account representing an on-chain program. Thisaccount stores the address of an executable data account (which stores thecompiled program code) and the update authority for the program (addressauthorized to make changes to the program).
  • Program Executable Data Account: An account that contains the executablebyte code of the program.
  • Buffer Account: A temporary account that stores byte code while a programis being actively deployed or upgraded. Once the process is complete, the datais transferred to the Program Executable Data Account and the buffer accountis closed.

For example, here are links to the Solana Explorer for the Token ExtensionsProgram Accountand its correspondingProgram Executable Data Account.

Solana Account Model | Solana (5)Program and Executable Data Accounts

For simplicity, you can think of the "Program Account" as the program itself.

Solana Account Model | Solana (6)Program Account

Info

The address of the "Program Account" is commonly referred to as the “ProgramID”, which is used to invoke the program.

Data Account #

Solana programs are "stateless", meaning that program accounts only contain theprogram's executable byte code. To store and modify additional data, newaccounts must be created. These accounts are commonly referred to as “dataaccounts”.

Data accounts can store any arbitrary data as defined in the owner program'scode.

Solana Account Model | Solana (7)Data Account

Note that only the System Program cancreate new accounts. Once the System Program creates an account, it can thentransfer ownership of the new account to another program.

In other words, creating a data account for a custom program requires two steps:

  1. Invoke the System Program to create an account, which then transfersownership to a custom program
  2. Invoke the custom program, which now owns the account, to then initialize theaccount data as defined in the program code

This data account creation process is often abstracted as a single step, butit's helpful to understand the underlying process.

Solana Account Model | Solana (2024)

FAQs

What is the account model in Solana? ›

On Solana, all data is stored in what are referred to as "accounts”. The way data is organized on Solana resembles a key-value store, where each entry in the database is called an "account".

What percentage of Solana transactions fail? ›

Solana has around 75–80% Transaction success rate (TSR), which means around 20–25% of transactions fail daily. We first look at the program and methods behind these failed transactions to understand the reason for the failure.

What is the average Solana transaction fee answer? ›

Solana offers some of the cheapest transaction fees in the cryptocurrency market, typically costing between $0.003 and $0.030.

What problem is Solana solving? ›

Powered by its unique combination of proof of history and what's referred to as delegated proof-of-stake algorithms, the main problem Solana was attempting to solve was Ethereum's scalability issues.

What are the different types of accounts in Solana? ›

There are 3 kinds of accounts on Solana: Data accounts store data. Program accounts store executable programs. Native accounts that indicate native programs on Solana such as System, Stake, and Vote.

What is the maximum number of accounts in Solana? ›

2 Answers. Currently, the maximum number of accounts allowed in a transaction is 64. There is a feature to increase that number to 128 at https://github.com/solana-labs/solana/issues/27241, but it has not been enabled yet.

Why has Solana crashed so much? ›

The negative market trend is also influenced by a number of macroeconomic factors, according to Matteo Greco, Research Analyst Fineqia International. “The Bank of Japan recently raised interest rates for the first time in 17 years due to concerns over the Yen's declining purchasing power against the U.S. Dollar.

How long does it take to get money out of Solana? ›

One epoch in the SOL network lasts around 2-3 days. It takes one full epoch to deactivate your SOL delegation - once finished you will be able to withdraw it. This will include your original stake and any rewards you earned.

Why do my Solana transactions keep failing? ›

So it's important to note that these failed transactions do not mean there is a problem with Solana's activity - the Solana network is running as expected, so these failed transactions are just the result of the bots' transaction conditions not being met, and are not the main reason for Solana's poor user experience at ...

How to speed up Solana transactions? ›

Solana's fee priority system allows you to set an additional fee on top of the base fee for a transaction, which gives your transaction a higher priority in the leader's queue. By bidding more for priority status, your transaction will be more likely to be confirmed quickly by the network.

How much of Solana fees are burned? ›

Transaction fees are partially burned and the remaining fees are collected by the validator that produced the block that the corresponding transactions were included in. Specifically, 50% are burned and 50% percent are distributed to the validator that produced the block.

Is Solana better than Ethereum? ›

While both projects offer similar functionality, Solana is faster and cheaper, thanks to the underlying technology. Solana can process speeds of up to 29,000 transactions per second, while Ethereum can still only manage a maximum of around 45 transactions per second, even following several key upgrades.

What is Solana weakness? ›

Solana: Weaknesses
  • Decentralisation. The barrier to entry is still high for people that want to run Solana validators. ...
  • ‍Outages. Due to its rapid growth, the Solana blockchain still suffers from degraded performance and outage issues from time to time. ...
  • Ecosystem.

Can Solana ever recover? ›

Despite these challenges, Solana has demonstrated an ability to rebound. The last quarter of 2023 marked a significant turnaround for the coin, propelling its price above $US120 for the first time in years.

Why Solana is risky? ›

Risks and Rewards

Cryptocurrencies are known for their volatility, and Solana is no exception. Market sentiment, macroeconomic trends, and overall crypto market performance can significantly impact SOL's price. Moreover, the crypto industry is susceptible to regulatory changes, scams, and security breaches.

What is the account structure of Solana token? ›

A wallet can create multiple token accounts for the same type of token, but each token account can only be owned by one wallet and hold units of one type of token. Note that each Token Account's data includes an owner field used to identify who has authority over that specific Token Account.

Is Solana account based? ›

In Solana, all data is stored and executed based on Accounts. This means that in every case where state needs to be stored between transactions, it is saved using accounts. Similar to files in operating systems like Linux, accounts can store arbitrary data that persists beyond the lifespan of a program.

What is the difference between a token account and a Solana account? ›

Token Account: A Token Account is a regular Solana account that holds a specific type of token. It is similar to a regular Solana account but is specifically designed to hold tokens. Each token on the Solana blockchain has its own associated Token Account.

What is an SOL account? ›

Solana Accounts and Rent​

Information is stored on the Solana blockchain, such as token balances, NFTs, or other data, in "accounts." Keeping this data on-chain takes up space, so Solana charges a "rent" fee of ~0.002 SOL on accounts. Rent Facts: Each account has an individual rent fee.

Top Articles
Five Lucky Animals and Where to See Them in the Wild
Are Steam Achievements Pointless?
5 Bijwerkingen van zwemmen in een zwembad met te veel chloor - Bereik uw gezondheidsdoelen met praktische hulpmiddelen voor eten en fitness, deskundige bronnen en een betrokken gemeenschap.
Craigslist Dog Sitter
ds. J.C. van Trigt - Lukas 23:42-43 - Preekaantekeningen
Cvs Devoted Catalog
True Statement About A Crown Dependency Crossword
Florida (FL) Powerball - Winning Numbers & Results
Used Wood Cook Stoves For Sale Craigslist
Nonuclub
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Nebraska Furniture Tables
Classic Lotto Payout Calculator
Stihl Km 131 R Parts Diagram
Viha Email Login
Grayling Purnell Net Worth
Epguides Strange New Worlds
Skip The Games Fairbanks Alaska
Craigslist Pearl Ms
Joan M. Wallace - Baker Swan Funeral Home
Yosemite Sam Hood Ornament
Play It Again Sports Norman Photos
Avatar: The Way Of Water Showtimes Near Maya Pittsburg Cinemas
Craigslist Hunting Land For Lease In Ga
800-695-2780
UCLA Study Abroad | International Education Office
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
Wonder Film Wiki
Is Henry Dicarlo Leaving Ktla
How do you get noble pursuit?
Askhistorians Book List
Ringcentral Background
Desales Field Hockey Schedule
Moonrise Time Tonight Near Me
Smayperu
new haven free stuff - craigslist
Craigslist Lakeside Az
Skip The Games Grand Rapids Mi
Who Is Responsible for Writing Obituaries After Death? | Pottstown Funeral Home & Crematory
Foxxequeen
Pulaski County Ky Mugshots Busted Newspaper
Pink Runtz Strain, The Ultimate Guide
How Big Is 776 000 Acres On A Map
Bekkenpijn: oorzaken en symptomen van pijn in het bekken
Noga Funeral Home Obituaries
El Patron Menu Bardstown Ky
Goosetown Communications Guilford Ct
Houston Primary Care Byron Ga
Kenmore Coldspot Model 106 Light Bulb Replacement
Noelleleyva Leaks
Vrca File Converter
Latest Posts
Article information

Author: Rueben Jacobs

Last Updated:

Views: 6057

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Rueben Jacobs

Birthday: 1999-03-14

Address: 951 Caterina Walk, Schambergerside, CA 67667-0896

Phone: +6881806848632

Job: Internal Education Planner

Hobby: Candle making, Cabaret, Poi, Gambling, Rock climbing, Wood carving, Computer programming

Introduction: My name is Rueben Jacobs, I am a cooperative, beautiful, kind, comfortable, glamorous, open, magnificent person who loves writing and wants to share my knowledge and understanding with you.