Skip to main content
Try out the RareSkills ZK AI Tutor!

Solana

Browse all Solana articles.

6 min read

Reading Another Anchor Program's Account Data On Chain

In Solidity, reading another contract's storage requires calling a view function or the storage variable being public.

Last updated onAug 15, 2024
Read Article

3 min read

Multicall in Solana: Batching Transactions and Transaction Size Limit

In Ethereum, we use the multicall pattern if we want to batch multiple transactions together atomically. If one fails, the rest fails.

Last updated onAug 15, 2024
Read Article

4 min read

#[derive(Accounts)] in Anchor: different kinds of accounts

#[derive(Accounts)] in Solana Anchor is an attribute-like macro for structs that holds references to all the accounts the function will access during its…

Last updated onSep 9, 2024
Read Article

4 min read

Reading an account balance in Anchor: address(account).balance in Solana

The UncheckedAccount type tells to Anchor to not check if the account being read is owned by the program.

Last updated onAug 15, 2024
Read Article

6 min read

Tx.origin, msg.sender, and onlyOwner in Solana: identifying the caller

In Solidity, the msg.sender is a global variable that represents the address that called or initiated a function call on a smart contract.

Last updated onAug 15, 2024
Read Article

6 min read

PDA (Program Derived Address) vs Keypair Account in Solana

A program derived address (PDA) is an account whose address is derived from the address of the program that created it and the seeds passed in to the…

Last updated onSep 5, 2024
Read Article

7 min read

Init_if_needed in Anchor and the Reinitialization Attack

In previous tutorials, we've had to initialize an account in a separate transaction before we can write data to it.

Last updated onSep 7, 2024
Read Article

7 min read

The unusual syntax of Rust

Readers coming from a Solidity or Javascript background may find Rust's usage and syntax of &, mut, <_>, unwrap(), and ? to be weird (or even ugly).

Last updated onAug 15, 2024
Read Article

7 min read

Modifying accounts using different signers

In our Solana tutorials thus far, we've only had one account initialize and write to the account. In practice, this is very restrictive.

Last updated onSep 4, 2024
Read Article

4 min read

Transferring SOL and building a payment splitter: "msg.value" in Solana

This tutorial will introduce the mechanism by which Solana Anchor programs can transfer SOL as part of the transaction.

Last updated onSep 2, 2024
Read Article

7 min read

Understanding Account Ownership in Solana: Transferring SOL out of a PDA

The owner of an account in Solana is able to reduce the SOL balance, write data to the account, and change the owner.

Last updated onSep 6, 2024
Read Article

4 min read

Solana logs, "events," and transaction history

Solana programs can emit events similar to how Ethereum emits events, though there are some differences we will discuss.

Last updated onAug 30, 2024
Read Article