Solana Account Model Simplified
Let’s get started with the topic!
Solana stores everything as a key-value store: the key is the account address (or public key) that you own, and attached to it is the account information.
Here’s a representation of this:
Key Data Fields in Solana Accounts:
Data -> This depends on the account's purpose, and the data stored will vary accordingly. For example, a wallet account stores the Solana balance or token information it holds. If the account is a smart contract, it will store executable code.
Executable-> This field is either true or false. In the case of a smart contract, it will be true because it has executable logic. In other cases, such as a wallet, it will be false.
Lamports -> This represents the account balance in lamports, the smallest unit of SOL (1 SOL = 1 billion lamports)..
Owner -> *Specifies the public key *(program ID) of the program that owns the account.
The owner is crucial because it determines what actions can be performed on the account. Think of the owner as having the rights to modify the data. For example, in the case of a wallet, the owner can decrease the balance or transfer tokens.
For example:
If the owner is the System Program, it can handle basic wallet management tasks.
If the owner is the BPF Loader, it can run smart contracts.
Here’s a visual representation of how the owner is involved in the process:
From the above, you can see how the owner differs in terms of what it can do, and how it governs the actions that can be performed on the account.
Next we are going to learn about some native programs and how data is stored on Solana. Stay tuned, for further blog posts.
SOCIAL SHARE CARD GENERATOR