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
How Many Trading Strategies Do You Need To Succeed?
Here’s How to Answer “What’s Your Greatest Strength?”
NOAA: National Oceanic & Atmospheric Administration hiring NOAA Commissioned Officer: Inter-Service Transfer in Spokane Valley, WA | LinkedIn
Craftsman M230 Lawn Mower Oil Change
Collision Masters Fairbanks
Arrests reported by Yuba County Sheriff
Marist Dining Hall Menu
Lycoming County Docket Sheets
Where's The Nearest Wendy's
Blog:Vyond-styled rants -- List of nicknames (blog edition) (TouhouWonder version)
2024 Non-Homestead Millage - Clarkston Community Schools
2024 U-Haul ® Truck Rental Review
Samsung Galaxy S24 Ultra Negru dual-sim, 256 GB, 12 GB RAM - Telefon mobil la pret avantajos - Abonament - In rate | Digi Romania S.A.
Peraton Sso
NHS England » Winter and H2 priorities
50 Shades Of Grey Movie 123Movies
Wausau Marketplace
Https Paperlesspay Talx Com Boydgaming
Myhr North Memorial
Little Rock Skipthegames
Craigslist Apartments Baltimore
R&S Auto Lockridge Iowa
1145 Barnett Drive
27 Fantastic Things to do in Lynchburg, Virginia - Happy To Be Virginia
Astro Seek Asteroid Chart
Marlene2295
Vlacs Maestro Login
Obsidian Guard's Skullsplitter
Nurtsug
Promatch Parts
Bursar.okstate.edu
Smayperu
P3P Orthrus With Dodge Slash
Justin Mckenzie Phillip Bryant
Toonily The Carry
Studio 22 Nashville Review
Wattengel Funeral Home Meadow Drive
Bones And All Showtimes Near Johnstown Movieplex
Linda Sublette Actress
Reese Witherspoon Wiki
Gravel Racing
Silive Obituary
Best Restaurants West Bend
Vindy.com Obituaries
Lamont Mortuary Globe Az
Avatar: The Way Of Water Showtimes Near Jasper 8 Theatres
Interminable Rooms
Cara Corcione Obituary
Craigslist Marshfield Mo
Craigslist Com Brooklyn
O.c Craigslist
When Is The First Cold Front In Florida 2022
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.