Blockchain , Developers

Learning curve for Solana

For developers already used to the Blockchain world, here is a small introduction to the Solana platform. The goal here is to compare the platform to others on the market and try to demonstrate what the learning curve would be for you, a developer with experience in other blockchain platforms, if you decided to venture ...

For developers already used to the Blockchain world, here is a small introduction to the Solana platform. The goal here is to compare the platform to others on the market and try to demonstrate what the learning curve would be for you, a developer with experience in other blockchain platforms, if you decided to venture into Solana.

When it comes to decentralised networks (DApp), Solana has one main difference between the other two platforms, which is to guarantee scalability. With this, you can ensure that transactions are more agile as well.

Well, let’s go. Assuming we know blockchain and its concepts, so let’s study the features and underlying technology of the Solana platform (SOL). Another thing that we have to take into account is that each blockchain has its own computational model, which is the mechanism used for transactions. Therefore, we have to understand how the consensus mechanism and also the scaling of the Solana blockchain works. The programming languages ​​used in Solana can also be a challenge for some, as he uses the languages ​​Rust, C and C++ for his Smart Contracts (Programs in Solana). But, it can also be an advantage in terms of Languages, as these languages ​​are already well established and are well known among most developers. So if you’re one of them, that won’t be a problem.

Understanding the Proof of History consensus algorithm

I won’t delve into it here, because POH is vast, but I’ll try to briefly describe what it is and how this mechanism that is used by Solana works.

Other blockchain networks use another mechanism, such as Ethereum, which uses Proof of Stake (PoS), however, this mechanism uses external systems to date and time stamp, and validate the correct order of transactions. Solana uses POH as a mechanism for this, which takes a different approach.

I will explain how POH works simply and succinctly.

In the blockchain network, a record is created when an event occurred at a specific time before or after other events. With this, the network nodes can believe in the source of the message and in the message itself, in addition to the blockchain being much faster and decentralised security.

All transactions and events are sha256 hashed, where sequential steps are required for it to be validated producing a unique and reliable result. This result is used as the input source for the next hash, aggregating the transaction output to the hash, forming a chain of transactions.

Solana creator and CEO Anatoly Yakovenko describes here very well why he chose this approach:

“The idea we had at the beginning using a verifiable delay function or proof of history, was to create a clock that is out of consensus and turns a ‘knob’ of when any block producer can transmit a block and does it in a way very predictable and very, very fast.”

In this way, Solana’s consensus mechanism makes it much more scalable than other blockchain platforms, as well as fully decentralised, as it doesn’t rely on any external solution for care and synchronization.

Below is a simple and widely used diagram that shows the flow in a simple and clear way:


Parallel processing of thousands of smart contracts (Sealevel), it is also critical to understand what it means and how it works. This is Solana’s transaction processing engine. It increases scalability so that Smart Contracts (Programs) can run concurrently without slowing down the blockchain.

Smart Contracts on Solana

Solana provides high-performance memory management for smart contracts, called Programs in Solana’s case.

With LLVM infrastructure and the ELF standard ensure dynamic compilation, binding and high performance execution, memory management and parallel execution of smart contracts.

To understand better, look at this article by Yakovenko High performance memory management for smart contracts

Solana Architecture

Looking at Solana’s architecture, the simple yet efficient model of providing the Programs (Smart Contracts), Client, JSON RPC API, and the high scalability of the Solana network is clear.

The image that shows the architecture is often used on networks to demonstrate how Solana works, but it is clear enough to demonstrate here as well. So I’m going to use it.

In practice

So now we know more about the Solana Blockchain in terms of the technical scope so that developers can start venturing into this highly scalable, high performance and fully decentralized platform.

On the Solana website,, it is possible to have access to a considerable volume of materials to help you in the development of your solution in Solana.

Solana provides some environments for you to connect your application, the one used for development is DEVNET (

Well, let’s go. I will summarize here how to proceed to run your application on your desktop. But for more information and more detailed instructions, go to the Solana docs site. There you can find how to install the Client, configure your local environment, create a Program, deploy the Program on the Solana network, execute transaction, etc…

Creating a Smart Contract

So let’s create our first smart contract, the Hello World program! on the Solana network. The programming language used here is Rust.

use solana_program::{
fn process(
   program_id: &Pubkey,
   accounts: &[AccountInfo],
   instruction_data: &[u8],
) -> ProgramResult {
   msg!("Hello World!");

I will not go into the libraries, parameters, nomenclatures and also syntax of the programming language to be used here, but in the Smart Contract object, which, when invoked, emits the message Hello World!

The process() function will be executed and finally, it will emit the message. Note that the entrypoint() function is declared before the function that will execute your smart contract logic. This is mandatory, as only in this way can the Smart Contract be executed by the Client.

As it is the Rust language, it is essential to have the systems and packages management file for the language or Cargo.toml. This file contains the parameters necessary for your rust program to be compiled and finally executed within the Solana network. Parameters like: solana sdk version, solana program version, libs directories…

name = "hello-world"
version = "0.1.0"
edition = "2022"

solana-program = "1.9.9"

solana-program-test = "1.9.9"
solana-sdk = "1.9.9"

crate-type = ["cdylib", "lib"]

The time has come to compile and deploy the Smart Contract to the Solana network. But first, we have to perform some steps that will configure which Solana network environment we are going to deploy, in this case, it will be DEVNET

We are also going to create a Waller and AirDrop. In this example, we are going to apply a BIP-39 passphrase to our Wallet and 1 AirDrop. To do this, just run the instructions below from the command line.

solana-keygen new --no-bip39-passphrase
solana config set --keypair ~/.config/solana/id.json
solana config set --url
solana airdrop 1

Compiling and deploying

cargo build-bpf --manifest-path=./Cargo.toml --bpf-out-dir=dist/program
solana program deploy dist/program/

If you want to list the programs created, just run

solana program show --programs

To close a program

solana program close <id>


Let’s create a client in Node.js using the official Solana SDK @solana/web3.js. For this example, it was used as a reference and also content extracted from Solana Labs.

import {
} from '@solana/web3.js';
import fs from 'mz/fs';
import path from 'path';
 Our keypair we used to create the on-chain Rust program
const PROGRAM_KEYPAIR_PATH = path.join(
 path.resolve(__dirname, './dist/program'),
async function main() {
 Connect to Solana DEV net
 let connection = new Connection('', 'confirmed');
 Get our program's public key
 const secretKeyString = await fs.readFile(PROGRAM_KEYPAIR_PATH, {encoding: 'utf8'});
 const secretKey = Uint8Array.from(JSON.parse(secretKeyString));
 const programKeypair = Keypair.fromSecretKey(secretKey);
 let programId: PublicKey = programKeypair.publicKey;
 Generate an account (keypair) to transact with our program
 const triggerKeypair = Keypair.generate();
 const airdropRequest = await connection.requestAirdrop(
 await connection.confirmTransaction(airdropRequest);
 Conduct a transaction with our program
 const instruction = new TransactionInstruction({
   keys: [{pubkey: triggerKeypair.publicKey, isSigner: false, isWritable: true}],
   data: Buffer.alloc(0),
 await sendAndConfirmTransaction(
   new Transaction().add(instruction),
 () => process.exit(),
 err => {

Note that in the connection.requestAirDrop() method, in addition to the Keypair, the number LAMPORTS PER SOL is also passed. To learn more about lamports see here

A fact that is very much worth mentioning here. This name Lamport is in honor of the Turing Prize winner, Leslie Lamport, an American computer scientist 😀

Related Articles

software development workshops
Developers Workshops

Cyrex Enterprise Workshops: Turning Dreams into Achievable Action

We often find ourselves talking to clients with a fantastic business idea but feel overwhe...

Read more
Blockchain Web3

Secure Your Web3 Future: Cyrex’ Blockchain Wallet & Bridge Development

Unlock the power of Web3 with secure blockchain wallets and innovative bridges by Cyrex....

Read more
Secure web applications
Developers Security

Building Secure Web Applications in the Age of Cyber Threats: Essential Strategies

Build secure web applications that withstand evolving threats. Learn secure coding practic...

Read more
About us Blockchain Developers DevOps

Infrastructure, Blockchain, and Scalability with Erick Rettozi

In this article, Cyrex' Lead Backend Engineer Erick Retozzi offers expert advice on buildi...

Read more