Overview of Developing On-chain Programs | Solana (2024)

Home>Solana Documentation>Developing Programs

Developers can write and deploy their own programs to the Solana blockchain.This process can be broadly summarized into a few key steps.

Hello World: Get started with Solana development

To quickly get started with Solana development and build your first Rustprogram, take a look at these detailed quick start guides:

On-chain program development lifecycle #

  1. Setup your development environment
  2. Write your program
  3. Compile the program
  4. Generate the program's public address
  5. Deploy the program

1. Setup your development environment #

The most robust way of getting started with Solana development, isinstalling the Solana CLI tools on your localcomputer. This will allow you to have the most powerful development environment.

Some developers may also opt for usingSolana Playground, a browser based IDE. It will letyou write, build, and deploy onchain programs. All from your browser. Noinstallation needed.

2. Write your program #

Writing Solana programs is most commonly done so using the Rust language. TheseRust programs are effectively the same as creating a traditionalRust library.

Info

You can read more about other supported languages below.

3. Compile the program #

Once the program is written, it must be complied down toBerkley Packet Filterbyte-code that will then be deployed to the blockchain.

4. Generate the program's public address #

Using the Solana CLI, the developer will generatea new unique Keypair for the new program. Thepublic address (aka Pubkey) from thisKeypair will be used on-chain as the program's public address (akaprogramId).

5. Deploying the program #

Then again using the CLI, the compiled program can be deployed to the selectedblockchain cluster by creating many transactions containing the program'sbyte-code. Due to the transaction memory size limitations, each transactioneffectively sends small chunks of the program to the blockchain in a rapid-firemanner.

Once the entire program has been sent to the blockchain, a final transaction issent to write all of the buffered byte-code to the program's data account. Thiseither mark the new program as executable, or complete the process to upgradean existing program (if it already existed).

Support languages #

Solana programs are typically written in theRust language, butC/C++ are also supported.

There are also various community driven efforts to enable writing on-chainprograms using other languages, including:

  • Python via Seahorse (that acts as a wrapper the Rustbased Anchor framework)

Example programs #

You can also explore the Program Examples forexamples of onchain programs.

Limitations #

As you dive deeper into program development, it is important to understand someof the important limitations associated with onchain programs.

Read more details on the Limitations page

Frequently asked questions #

Discover many of the frequently asked questions otherdevelopers have about writing/understanding Solana programs.

Overview of Developing On-chain Programs | Solana (2024)

FAQs

Overview of Developing On-chain Programs | Solana? ›

Onchain Program Development: This is where you create and deploy custom programs directly to the blockchain. Once deployed, anyone who knows how to communicate with them can use them. You can write these programs in Rust, C, or C++.

What is the Onchain program in Solana? ›

Onchain programs are programs that run on Solana. Programs have one or more instruction handlers. Instruction handlers are functions that process the instructions in Solana transactions. Instruction handlers write their data to Solana accounts and then either succeed or fail.

What is the overview of Solana? ›

Solana is a blockchain built for mass adoption. It's a high-performance network that is utilized for a range of use cases, including finance, NFTs, payments, and gaming. Solana operates as a single global state machine and is open, interoperable and decentralized.

What can Solana programs do? ›

Solana programs are a type of smart contract. The programs contain executable code that stays on buffer storage, also known as accounts. You can execute Solana programs through transactions, just like smart contracts on Ethereum or EVM-compatible blockchains.

What programming language does Solana use? ›

Solana programs are typically written in the Rust language, but C/C++ are also supported. There are also various community driven efforts to enable writing on-chain programs using other languages, including: Python via Seahorse (that acts as a wrapper the Rust based Anchor framework)

What is the difference between Onchain and blockchain? ›

On-chain transactions are conducted directly on the blockchain, and are well-suited for high-value transactions due to their trustless framework. Off-chain transactions occur outside the main blockchain network, often through secondary layers. They offer fast processing speeds and lower fees.

What is the best project on Solana blockchain? ›

List of the Best Solana Projects – Exploring the Solana Ecosystem
  • Solend. Solend is a decentralized autonomous lending and borrowing protocol on the Solana network.
  • Marinade Finance. Marinade Finance is a non-custodial liquid staking platform with over 100,000 users.
  • Raydium. ...
  • Saber. ...
  • Orca. ...
  • Magic Eden. ...
  • Phantom. ...
  • Solflare.
Jan 29, 2024

What makes Solana so special? ›

Solana's fast, scalable, and programmable blockchain provides the infrastructure necessary for building apps that can achieve global adoption. Its massive throughput, low cost, and fast finality make it one of the best-performing blockchains available.

What problem does Solana solve? ›

Solana is a blockchain network that aims to solve for the blockchain trilema of balancing security, scalability and decentralization.

Why Solana is promising? ›

Solana has emerged as a major player in the NFT market thanks to its fast and low-cost transactions that offer significant advantages over other blockchains. NFT trading on the Solana blockchain is significantly cheaper and faster, which has attracted both new and existing NFT projects to move to the Solana ecosystem.

Why do developers like Solana? ›

With the ability to process up to 4000 transactions per second, Solana provides a seamless and responsive experience for users. Scalability: The modular architecture of Solana ensures higher scalability, allowing developers to build and deploy applications that handle growing workloads without sacrificing performance.

What technology is used in Solana? ›

Solana's Technology

PoS permits validators (those who validate transactions added to the blockchain ledger) to verify transactions based on how many coins or tokens they hold; PoH allows those transactions to be timestamped and verified very quickly.

How is Solana used in real life? ›

The most notable use case is Decentralized Finance (DeFi), with real-world examples being decentralised applications (dApps) and decentralised exchange platforms like Metamask, Uniswap, Cryptokitties, SocialX, etc., and NFTs as you can find on platforms like OpenSea.

What algorithm does Solana use? ›

Solana implements an innovative hybrid consensus model that combines a unique proof-of-history (PoH) algorithm with the lightning-fast synchronization engine, which is a version of proof-of-stake (PoS).

Is Solana a blockchain or token? ›

Solana is a blockchain with striking resemblances to Ethereum—in fact, it's frequently referred to as an “Ethereum killer.” Like Ethereum, the SOL token can be bought on most major exchanges.

Is Solana built on Rust? ›

Solana's developer environment relies heavily on Rust, and tools like Anchor and the Solana CLI are essential for creating and deploying applications on the platform, supported by initiatives from the Solana Foundation to promote community growth.

What is the Onchain? ›

On-Chain, as the name implies, refers to blockchain transactions that exist on and have been verified to the blockchain by miners or validators. On-Chain also means that transactions have been recorded to the blockchain.

What is the Solana transaction program? ›

Solana transactions consist of instructions that interact with various programs on the network, where each instruction represents a specific operation. Each instruction specifies the program to execute the instruction, the accounts required by the instruction, and the data required for the instruction's execution.

What is an Onchain withdrawal? ›

The on-chain is only used when a user makes a withdrawal from an exchange to a wallet. This type of exchange with a specific administrator is called a centralized exchange (CEX).

What is the reward for staking Solana? ›

This means that, on average, stakers of Solana are earning about 5.11% if they hold an asset for 365 days. 24 hours ago the reward rate for Solana was 5.11%. 30 days ago, the reward rate for Solana was 5.20%. Today, the staking ratio, or the percentage of eligible tokens currently being staked, is 65.62%.

Top Articles
Physical Bitcoin: How to Store Physical Bitcoins (2022) - Gryphon Digital Mining
XRP Could be Worth About $400 by 2026 - Crypto Analyst - Ethereum World News
Moto X3M Game - Play Unblocked Game Online for Free!
Sombouns Asian Market - Murfreesboro, TN
fir1 - Window-based FIR filter design
Summit County Fiscal
Trivial Pursuit Pogo Answers
Webcam Elllllllieeee
Hilton Head Craigslist Pets
No Prob-Llama Plotting Points
Free Atm For Emerald Card Near Me
Ultima Online Outlands Map
Magicseaweed Capitola
GameStop Corp (GME) Stock Price & News - Google Finance
Iwu Directory
Greenland Market Las Vegas Weekly Ad
Caroline G. Atkinson Intermediate School
Mycoxemail Login
Wyze Recover Deleted Events
Richard Sambade Obituary
SF bay area cars & trucks "chevrolet 50" - craigslist
Corruption Of Champions 2 Chest Puzzle
Michelle_Barbelle
Methstreams Boxing Stream
What Is The Best Center Build In 2K23
Sweetberry Weekly Ad
2068032104
Energy Healing Conference Utah
Battle for Azeroth Preview: Drustvar Visitor’s Guide - WoW
Meet Our Doctors | Laveen dental Laveen, AZ
How Old is Reyna: All Valorant Agent's Age, Name, & More - Unigamesity
Terramia Brick Oven Pizza & Trattoria Menu
10 Bedroom Airbnb Kissimmee Fl
Quick Links for Qtrac Login
Herbalism Guide Tbc
Splatoon ALL STAR COLLECTION Shiver - Juguete de peluche S, juego de... • EUR 38,30
Oodweynenews
TikTok hiring Brand Protection Analyst Intern (Global E-Commerce-Governance and Experience-AMS-External Collaborations and Engagements-Brand)- 2025 Summer (MBA) in Seattle, WA | LinkedIn
KOHLER K-728 INSTALLATION AND CARE MANUAL Pdf Download
Different Types of Conditional Sentences in English: Definition and Examples | Proofreading
Commercial Cleaning Tips and Tricks: The Ultimate Guide - Green Planet
Der frühere Jenaer Prorektor Otto Stamfort im Porträt
Estuary Thrift Shop
Sewing Alterations Near Me
Flashscore Tennis Scores
80 For Brady Showtimes Near Regal Largo Mall
West Coast Budmail
Uncutmazaa
Syracuseskipthegames
MLB Baseball - News, Scores, Stats, Standings, and Rumors - Major League Baseball
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 6741

Rating: 4.7 / 5 (77 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.