Accounts
Accounts are one of the core concepts in Solana. However, for those coming from an Ethereum (EVM) background, the way accounts function or the need for them can be a bit confusing.
Here is a thumb rule: everything in Solana is handled by accounts. This video will help walk you through this rule and accounts in general.
Details on Accounts
Solana programs are essentially stateless. This means they do not store any information. So, where do all the variables and states get stored? - in the accounts.
Accounts are responsible for holding all types of data on the Solana blockchain. This data can be an executable smart contract as a whole or variables/data associated with the smart contract. Accounts also just refer to the accounts on your wallet that be used to store, send and receive tokens.
Types of accounts
Non-executable account: Stores different types of data such as program variables, user balances, etc.
Executable account: This is used only for storing program code.
Account Ownership
Every time we create an account using a wallet, the created account is initialized to be owned by a built-in program called the System program. Each account includes some metadata such as owner(to define access control over the account), is executable(y/n), and other such parameters.
If you are coming from a Solidity background, here is a great guide to understanding accounts in Solana.
Comments
Post a Comment