Accounts
Ref - https://solana.com/docs/core/accounts
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”.
Key points
- Accounts can store up to 10MB of data, which can consist of either executable program code or program state.
- Programs (smart contracts) are stateless accounts that store executable code.
- Data accounts are created by programs to store and manage program state.
- Accounts require a rent deposit in SOL, proportional to the amount of data stored, which is fully refundable when the account is closed.
- Every account has a program
owner
. Only the program that owns an account can modify its data or deduct its lamport balance. However, anyone can increase the balance. - Native programs are built-in programs included with the Solana runtime.
Account
Each account is identifiable by its unique address, represented as 32 bytes in the format of an Ed25519 PublicKey
. You can think of the address as the unique identifier for the account.
AccountInfo
Accounts have a max size of 10MB (10 Mega Bytes) and the data stored on every account on Solana has the following structure known as the AccountInfo.
Example accounts
-
Account with no data (Owner - SystemProgram)
https://explorer.solana.com/address/5gjLjKtBhDxWL4nwGKprThQwyzzNZ7XNAVFcEtw3rD4i
-
Account with some data (Owner - TokenProgram)
https://explorer.solana.com/address/8FQvjBxFdR51wbZfQVaWbkjR2sNNxDLyabNePPmsyou9
-
Program account (Owner - BPF Loader)
https://explorer.solana.com/address/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA