Anchor: Solana Program Development Framework
A Rust-based framework for building Solana programs with IDL generation and TypeScript client support.
Learn more about Anchor
Anchor is a development framework for building programs on the Solana blockchain. It provides a Rust embedded domain-specific language (eDSL) that abstracts low-level Solana program development complexities. The framework generates Interface Description Language (IDL) specifications from Rust code and includes tooling for TypeScript client generation. Anchor includes CLI tools for workspace management and is commonly used for developing decentralized applications on Solana.
Rust eDSL
Provides high-level Rust abstractions for Solana program development with account validation and serialization handling.
IDL Generation
Automatically generates interface specifications from Rust code, enabling type-safe client generation across multiple languages.
Complete Toolchain
Includes CLI tools, workspace management, and both Rust and TypeScript client libraries for full-stack development.
use anchor_lang::prelude::*;
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
#[program]
pub mod my_program {
use super::*;
pub fn initialize(ctx: Context<Initialize>, data: u64) -> Result<()> {
let my_account = &mut ctx.accounts.my_account;
my_account.data = data;
my_account.authority = ctx.accounts.user.key();
Ok(())
}
pub fn update(ctx: Context<Update>, new_data: u64) -> Result<()> {
let my_account = &mut ctx.accounts.my_account;
my_account.data = new_data;
Ok(())
}
}
#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(
init,
payer = user,
space = 8 + 8 + 32
)]
pub my_account: Account<'info, MyAccount>,
#[account(mut)]
pub user: Signer<'info>,
pub system_program: Program<'info, System>,
}
#[derive(Accounts)]
pub struct Update<'info> {
#[account(
mut,
has_one = authority
)]
pub my_account: Account<'info, MyAccount>,
pub authority: Signer<'info>,
}
#[account]
pub struct MyAccount {
pub data: u64,
pub authority: Pubkey,
}See how people are using Anchor
Top in Crypto
Related Repositories
Discover similar tools and frameworks used by developers
NEAR Core
Reference implementation of NEAR Protocol blockchain, providing infrastructure for smart contracts and applications.
Aave V3 Core
Smart contracts for Aave Protocol V3, a decentralized liquidity market for lending and borrowing cryptocurrencies.
BitcoinJS
A TypeScript-based Bitcoin library providing cryptographic functions and transaction handling for Node.js and browsers.
Hyperledger Fabric
Modular enterprise blockchain framework with permissioned networks, pluggable consensus, and privacy controls.
Solmate
A collection of gas-optimized Solidity contracts including ERC token implementations and utility libraries.
Related Reading
Guides and comparisons from the Greptile content library
Best SAST Tools for Engineering Teams [2026 Review]
We compare five of the best SAST tools (Semgrep, Checkmarx One, Snyk, Aikido, and GitHub CodeQL) on core functionality, languages, pricing, and fit, plus why static scanning needs runtime testing and full-codebase review alongside it.
How to Evaluate Code Review Tools: The 4 Step Framework
A 4-step framework for evaluating code review tools on large teams with complex codebases: define what you need, build a shortlist, run a live test, and get developer feedback. Plus a shortlist of tools and how to future-proof your review process.
27 Code Quality Tools that Catch Bugs [2026 Review]
The best code quality tools that catch bugs, security vulnerabilities, and runtime errors, sorted by language, with type, noise level, cost, and who each one is for.
What is Shift Left Testing? Everything Engineering Leaders Need to Know
The five types of shift-left testing, the benefits and limitations of each, and how the approach changes when agents write and review a growing share of your code.