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
Gimmighoul — Pokémon Scarlet and Pokémon Violet | Official Website
What are Incense? — Pokémon GO Help Center
WALB Locker Room Report Week 5 2024
10 Popular Hair Growth Products Made With Dermatologist-Approved Ingredients to Shop at Amazon
Craigslist Nj North Cars By Owner
Directions To Lubbock
Moe Gangat Age
Indiana Immediate Care.webpay.md
Nier Automata Chapter Select Unlock
Dumb Money
Classroom 6x: A Game Changer In The Educational Landscape
What Happened To Anna Citron Lansky
Everything We Know About Gladiator 2
Grayling Purnell Net Worth
Costco Great Oaks Gas Price
Yard Goats Score
Ups Print Store Near Me
Rochester Ny Missed Connections
Troy Gamefarm Prices
Lexus Credit Card Login
Kitchen Exhaust Cleaning Companies Clearwater
NV Energy issues outage watch for South Carson City, Genoa and Glenbrook
Mini-Mental State Examination (MMSE) – Strokengine
24 Hour Drive Thru Car Wash Near Me
Florence Y'alls Standings
Lawrence Ks Police Scanner
Shiftwizard Login Johnston
Nicole Wallace Mother Of Pearl Necklace
CVS Near Me | Somersworth, NH
Babylon 2022 Showtimes Near Cinemark Downey And Xd
Enjoy4Fun Uno
Marcus Roberts 1040 Answers
968 woorden beginnen met kruis
Live Delta Flight Status - FlightAware
Janaki Kalaganaledu Serial Today Episode Written Update
Www Craigslist Com Atlanta Ga
Fedex Passport Locations Near Me
Squalicum Family Medicine
Trending mods at Kenshi Nexus
Matt Brickman Wikipedia
Hampton In And Suites Near Me
Minecraft: Piglin Trade List (What Can You Get & How)
El Patron Menu Bardstown Ky
Fresno Craglist
Lux Funeral New Braunfels
Pilot Travel Center Portersville Photos
Bluebird Valuation Appraiser Login
Laurel Hubbard’s Olympic dream dies under the world’s gaze
Ok-Selection9999
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.