---
title: Programs on Solana
description:
  Learn about Solana programs (smart contracts) and how to develop them using
  Rust or the Anchor framework. Understand program deployment, upgrades, and
  verification on the Solana network.
h1: Programs
---

On Solana, "smart contracts" are called programs.
[Programs](/docs/core/accounts#program-account) are deployed on-chain to
accounts that contain the program's compiled executable binary. Users interact
with programs by sending transactions containing
[instructions](/docs/core/transactions#instruction) that tell the program what
to do.

## Key Points

- Programs are accounts containing **executable code**, organized into functions
  called **instructions**.
- While programs are **stateless**, they can include instructions that create
  and update other accounts to store data.
- An **upgrade authority** can update programs. Once this authority is removed,
  the program becomes immutable.
- Users can verify an on-chain program account's data matches its public source
  code through verifiable builds.

## Writing Solana Programs

Solana programs are predominantly written in the
[Rust](https://rust-book.cs.brown.edu/title-page.html) programming language,
with two common approaches for development:

- [Anchor](https://www.anchor-lang.com/docs): A framework designed for Solana
  program development. It provides a faster and simpler way to write programs,
  using Rust macros to significantly reduce boilerplate code. For beginners, it
  is recommended to start with the Anchor framework.

- [Native Rust](/docs/programs/rust): This approach involves writing Solana
  programs in Rust without leveraging any frameworks. It offers more flexibility
  but comes with increased complexity.

## Updating Solana Programs

To learn more about deploying and upgrading programs, see the
[deploying programs](/docs/programs/deploying) page.

On-chain programs can be
[directly modified](https://github.com/anza-xyz/agave/blob/v2.1.13/programs/bpf_loader/src/lib.rs#L704)
by an account designated as the "upgrade authority", which is typically the
account that originally deployed the program. If the
[upgrade authority](https://github.com/anza-xyz/agave/blob/v2.1.13/programs/bpf_loader/src/lib.rs#L894)
is revoked and set to `None`, the program becomes immutable and can no longer be
updated.

## Verifiable Programs

Verifiable builds allow anyone to check if a program's on-chain code matches its
public source code, making it possible to detect discrepancies between source
and deployed versions.

The Solana developer community has introduced tools to support verifiable
builds, enabling both developers and users to verify that onchain programs
accurately reflect their publicly shared source code.

- **Searching for Verified Programs**: To quickly check for verified programs,
  users can search for a program address on the [SolanaFM](https://solana.fm/)
  Explorer and navigate to the "Verification" tab. View an example of a verified
  program
  [here](https://solana.fm/address/PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY).

- **Verification Tools**: The
  [Solana Verifiable Build CLI](https://github.com/Ellipsis-Labs/solana-verifiable-build)
  by Ellipsis Labs enables users to independently verify onchain programs
  against published source code.

- **Support for Verifiable Builds in Anchor**: Anchor provides built-in support
  for verifiable builds. Details can be found in the
  [Anchor documentation](https://www.anchor-lang.com/docs/verifiable-builds).

## Berkeley Packet Filter (BPF)

Solana uses [LLVM](https://llvm.org/) to compile programs into
[ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) files. These
files contain Solana's custom version of
[eBPF](https://en.wikipedia.org/wiki/EBPF) bytecode, called "Solana Bytecode
Format" (sBPF). The ELF file contains the program's binary and is stored
on-chain in an executable account when the program is deployed.
