Enjoy the Lightspeed newsletter on Blockworks.co today. Get news delivered straight to your inbox tomorrow. Subscribe to the Lightspeed Newsletter.
Hello!
Today I’m going to talk about weed, so Jeffrey will tell the story of how transactions get onto the blockchain.
Admittedly, it’s a little funny that all this complex infrastructure basically helps degenerates buy memecoins. It reminds me a little of how liquor goes through a long distillation process before it can be diluted with cranberry juice or cola. But I digress:
Solana Transaction Lifecycle
Solana is generally so fast and efficient that transactions can seem instantaneous. But there’s actually a lot more going on under the hood than users might realize.
It also works a little differently than other networks, which tend to experience congestion and high fees due to their reliance on mempools.
Solana’s approach looks something like this:
- Creating and sending a transaction
A user initiates a transaction via a wallet, dapp, or other interface. The transaction details are immediately sent to an RPC (Remote Procedure Call) node via a JSON RPC API. Think of RPC nodes as intermediaries that help access and transmit on-chain data. Unlike Ethereum, where RPC nodes are sometimes also validators, Solana RPC nodes are primarily non-voting validators focused on accessing on-chain data.
2. Selecting a leader
Meanwhile, a leader is elected to create the next block on the blockchain. In Solana, the leader schedule is determined by a proof-of-stake mechanism, where validators take turns becoming leaders based on their stake.
- Incoming packet and QUIC
The RPC node establishes a fast and secure connection to the Transaction Processing Unit (TPU) of the master node using a communications protocol designed for fast and reliable data transfer called Quick UDP Internet Connections (QUIC). This protocol ensures secure delivery of data packets, reducing latency and improving overall network performance.
- Transaction Processing Unit (TPU)
TPU processes transactions in several stages, each of which handles a specific part of the process to ensure efficiency and security:
- Receiving stage: Transactions are grouped into batches of 128 for more efficient management.
- SigVerify stage: Each transaction signature is checked for validity to ensure it has not been tampered with. Duplicates are removed to prevent redundant processing.
- Stage of banking: This is where the real work happens. Transactions are executed in parallel, meaning that multiple transactions can be processed at the same time without having to wait for each other. This step ensures that all necessary checks and updates are performed on the accounts involved.
- Broadcast stage: After processing, the TPU broadcasts the transactions to the network, informing all nodes about new transactions.
- Gulf Stream Protocol
Unlike Bitcoin, Ethereum, and others, Solana uses a transaction forwarding protocol called Gulf Stream, which eliminates the need for a traditional mempool queue. In legacy systems, unconfirmed transactions sit in the mempool until miners include them in a block, which often leads to delays and congestion. However, the Gulf Stream protocol proactively forwards transactions to future leaders if the current leader is overloaded. This allows for high throughput and low latency, preventing congestion and keeping the network efficient.
- Proof of History (PoH) and Commitment
Proof of history (PoH) is a method of timestamping transactions to ensure that they are in the correct order without the need for traditional time synchronization. This solves the problems other systems face in maintaining the order and consistency of transactions. Verified transactions are then committed to the ledger and broadcast across the network, allowing all validators to update their ledgers accordingly.
- Synchronizing the cluster
Validators in Solana clusters then synchronize their states to maintain a consistent and updated ledger. Solana clusters are groups of validators that work together to maintain the ledger. Synchronization between these clusters ensures that all validators have a consistent view of the blockchain. This process ensures that each node’s ledger is up-to-date and consistent with the current state of the network.
- Completion and confirmation
Validators are nodes that process and verify transactions. Once a block has been confirmed by a large majority of validators, the transaction is finalized and permanently recorded on the blockchain. Solana’s optimized processing ensures that this process is fast and reliable.
So, the next time you send or receive a transaction on the Solana network, remember that it’s not just one click and done. There’s a lot of technical magic going on behind the scenes that makes it all possible.
– Jeffrey Albus
One good DM
Message from Chad’s helmetFounder ore: