Welcome to the first of six blogs where I’ll be sharing my notes on the core Solana protocol. My goal is to help you grasp how the Solana protocol works, and I’ve included some diagrams to make things clearer.

A few days ago, I started coding in Rust and managed to run my first Solana program. I got it working, but I still had questions about the lifecycle of a typical transaction and what a lamport actually is. So, I decided to dig into Solana’s core elements.

In this post, I’ll break down four key concepts to get you started: the components of a Solana transaction.

How we interact with the Solana network?

Transactions are the mechanism through which users interact with the blockchain and its programs. A transaction include one or more instructions. Each instruction represents an action that will be executed on the Solana network.

Untitled-2024-09-10-0745.png

In the report “Solana: How it works,” it is explained that a transaction, more formally referred to as a "transaction message," consists of four main components: a header, a list of account addresses, a recent blockhash, and a set of instructions.

This explanation helped me realize that while at a basic level, a transaction may seem to simply contain one or more instructions, there are actually deeper structural elements involved.

A Solana Transaction is composed of two primary parts:

  1. Signatures: The user signs the transaction using their private key. This signature is then appended to the transaction data and can be verified by other network participants using the sender’s public key.
  2. Transaction Message: This is the core of the transaction, which includes four sections: the header, a list of account addresses, a recent blockhash (to prevent replay attacks), and the instructions that define the specific operations to be executed.

With this foundation, let's now dive deeper into the structure of a Solana transaction and its components.

Understanding a Solana Transaction

Untitled-2024-09-10-0742.png

Let’s break down the transaction message further:

  1. Account Addresses: This list includes all the accounts that will be read from or written to during the transaction. Creating this list for every transaction is unique to Solana and can be challenging for developers.
  2. Header: The header references the account address list, indicating which accounts must sign the transaction.