Understanding Solana's transaction anatomy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyrinNew
    Senior Member
    • Feb 2024
    • 5168

    #1

    Understanding Solana's transaction anatomy

    πŸ“– Overview

    For the past week, I’ve been reading data from the Solana blockchain. This project marks the shift from reading state to writing state. The goal was simple but fundamental: understand what actually happens when a transaction is sent on Solana.





    🎯 Objective

    • Send a real transaction on Solana Devnet
    • Inspect it using CLI and Explorer
    • Understand its internal structure
    • Build a mental model for how state changes occur





    βš™οΈ What I Did

    1. Created a Temporary Wallet


    Generated a fresh keypair to act as the recipient.






    solana-keygen new --no-bip39-passphrase -o /tmp/temp-wallet.json







    This generated a transaction signature, which acts as:

    • A receipt
    • The transaction ID
    • The first cryptographic signature


    Example:








    2. Sent a Transaction






    solana transfer --allow-unfunded-recipient $(solana address -k /tmp/temp-wallet.json) 0.001 --url devnet







    Transferred a small amount of SOL on Devnet.

    This produced a transaction signature (ID).


    Example:







    3. Inspected the Transaction via CLI






    solana confirm -v







    This revealed:

    • Transaction status and slot
    • Accounts involved
    • Instruction execution details


    Example:







    4. Analyzed in Explorer

    Visualized It in Solana Explorer


    Using the transaction signature, I examined:

    • Signatures β†’ Authorization proof
    • Recent Blockhash β†’ Freshness + anti-replay
    • Account Keys β†’ All accounts involved
    • Instruction β†’ System Program transfer








    🧠Mental Model Upgrade

    What you sent is not:


    β€œSend 0.001 SOL to X”


    It is:


    β€œExecute instruction #2 of the System Program, using these accounts, with this encoded data, authorized by this signature.”




    More...
Working...