Rise In Logo

Build on Solana

Skim through the following sections. You can always come back to them.

C. Accounts

In Solana, an account is a persistent memory structure that a program can use for storing state. Every account in Solana is initially owned by the system program, but the system program can change the ownership if the correct private key for the account is provided. Each account includes several properties:

  1. Public Key (Pubkey): This is the unique identifier of the account.
  2. Signer Flag (is_signer): This flag indicates whether the account is a signer of the transaction. If true, the transaction must include the signature of this account.
  3. Writable Flag (is_writable): This flag indicates whether the data in the account can be modified. If true, the account's data can be written to in the current transaction.
  4. Lamports: This is the number of lamport's (the smallest unit of the native SOL token) held in the account. Lamports also serve as rent to keep the account on the network. 
  5. Data: This is a byte array that can hold arbitrary data. 
  6. Owner: This is another public key that identifies the program that has authority over the account's data. Only the owner program can modify the account's data.
  7. Executable Flag: Hold if the account is a smart contract. 
  8. Rent Epoch: This value represents the latest epoch that rent has been paid for the account. Rent is paid in SOL and ensures that the account remains active on the network.

In Solana, accounts not only hold the state of a program but can also be used to create complex relationships between different programs. 

Rise In Logo

Rise together in web3