CLI tool
otter-sec/anchor avatar
otter-sec/anchor

Anchor: the Solana program framework from otter-sec

⚓ Solana Program Framework

5,139 stars1,977 forksRustApache-2.0

At a glance

What is it?
Anchor gives Solana programs a Rust eDSL, an IDL, and generated TypeScript clients. It fits teams that want account validation and client codegen handled for them, and it is a poor fit for anyone who needs the constraints of raw Solana entrypoints.
Who is it for?
Anchor suits teams writing Solana programs in Rust who want account constraints declared in the account structs and clients generated from an IDL. It is the wrong choice if you need direct control over the raw entrypoint and instruction dispatch, or if you cannot accept that the README does not document a rollback path for the nightly channel.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Anchor solves for Solana program authors

A Solana program is not a contract with storage. It is an entrypoint that receives an instruction, a list of accounts, and a byte slice, and it must deserialize every account itself, check that each one is the type it expects, check that signers actually signed, and check that PDAs derive to the addresses it was handed. Anchor exists to remove that boilerplate. The README describes it as a framework providing "several convenient developer tools for writing Solana programs", listing four pieces: a Rust eDSL, an IDL specification, a TypeScript package that generates clients from the IDL, and a CLI with workspace management. The intended audience is a Rust developer who has decided to ship on Solana and does not want to hand-write account validation and client bindings for every instruction. The README also notes that developers coming from Solidity, Truffle, and web3.js will find the flow familiar, which tells you who the project is aimed at: people who already expect a framework layer between them and the runtime.

How the account structs and IDL drive the rest of the stack

The mechanism is a split between instruction handlers and account validation. In the counter example in the README, the `#[program]` module holds the handlers, and each handler takes a `Context<T>` where `T` is a struct deriving `Accounts`. Those structs are where the real work is declared. `Initialize` marks the counter account with `#[account(init, payer = authority, space = 48)]` and names a `Signer` and the `System` program. `Increment` uses `#[account(mut, has_one = authority)]`, which is a constraint rather than a comment: the framework checks that the authority field stored in the account matches the signer passed alongside it. The `#[account]` attribute on the `Counter` struct itself declares the on-chain data layout. From that same source, Anchor emits an IDL, and the TypeScript package turns the IDL into a client. So the data flow is one direction: Rust declarations produce a machine-readable interface description, and the client is generated from that description rather than hand-written against the program. If you change an account constraint, the client surface follows from the same source.

Installing the Anchor CLI with AVM

The README states the recommended install path is the Anchor Version Manager, not a direct cargo install. The installer script downloads the latest nightly AVM and Anchor CLI binaries, enables the nightly channel, and links `avm` and `anchor` into `~/.cargo/bin` when possible. After that, `anchor` uses the latest cached nightly build and periodically checks for updates.

bash
curl -sSfL https://raw.githubusercontent.com/otter-sec/anchor/master/avm/install | sh

If AVM is already present, the README gives a second route to the same state, which is to enable the nightly channel directly:

bash
avm nightly

To leave nightly mode and go back to normal AVM version resolution:

bash
avm nightly --disable

That is the whole documented install story. There is no documented rollback command for the nightly channel beyond `--disable`, and the README does not describe what happens to an existing workspace pinned to a specific version when the channel flips. Treat the nightly channel as the default posture of this install path, not an opt-in extra.

For a first real use, the README points to the examples and tests directories in the repository rather than giving a scaffold command, so the shortest verified path is to build a counter program against the documented shape. The program declares an id, a `#[program]` module with `initialize` and `increment`, an `Initialize` accounts struct using `#[account(init, payer = authority, space = 48)]`, an `Increment` struct using `#[account(mut, has_one = authority)]`, and a `Counter` account struct holding a `Pubkey` authority and a `u64` count. The `declare_id!` macro takes the program address, and the README example uses `Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS` as a placeholder. What you should see after building is an IDL artifact for the program and, once the TypeScript package runs against it, a generated client with methods matching the two instructions.

Where Anchor gets in the way

The framework's value is also its constraint. Every instruction goes through a `Context<T>` and an accounts struct, and the checks you get are the checks the attribute macros know how to express. A program that needs to inspect accounts in an order the struct cannot describe, or that dispatches on raw instruction data before account validation, is fighting the model. The nightly install path is a second constraint worth naming plainly: the recommended installer enables the nightly channel by default, and the README documents `avm nightly --disable` as the way out but says nothing about pinning a workspace to a released version during that transition. For a team with a CI pipeline that must reproduce builds byte for byte, a default that tracks nightly is a real operational cost, not a footnote. Third, the workspace file shows `solana-program = "3.0.0"` with the comment that it "must be kept in sync with `cli/solana-program-version`", and a FIXME noting that solana-sysvar 3.1.x contains breaking changes to sysvar retrieval. That is the maintainers telling you the dependency surface moves and that at least one pin is deliberate. Finally, the README does not document rollback, does not document a migration guide between the v0.30, v0.31 and v0.32 release lines, and does not state a support window for older minor versions.

Anchor compared with writing against the Solana entrypoint directly

The real alternative is not another framework; it is the raw Solana program entrypoint, where you receive the program id, the account list, and the instruction data, and you deserialize and validate each account yourself. The difference in approach is where correctness lives. With the raw entrypoint, every check is explicit in your handler and there is nothing between your code and the runtime, which matters when you need unusual account ordering, custom dispatch, or you are optimizing compute. With Anchor, the checks move into declarative attributes on account structs, and you gain an IDL plus generated TypeScript clients as a byproduct. The trade is that you now depend on what the macros can express and on the framework's release cadence. A team building a program with standard account patterns and a TypeScript frontend gets more from Anchor than it gives up. A team writing a program whose control flow does not fit the accounts-struct shape will spend its time working around the framework rather than with it.

Fuzzing, licence, and the cost of keeping up

The README documents `anchor fuzz`, which integrates Crucible for coverage-guided program fuzzing, with two commands: `anchor fuzz init program_name` to scaffold a harness and `anchor fuzz run program_name test_name --release` to run it. The repository layout backs this up with a `tests/` directory and a `bench/` directory at the top level, plus a `docker/` directory and a `setup-tests.sh` script. Maintenance is visible: the last push was on 2026-09-22, and three releases (v0.32.2, v0.31.2, v0.30.2) were published on 2026-09-14, which indicates the project backports to older minor lines rather than only shipping the newest. That is good news for anyone pinned to an older line and bad news for anyone hoping the version surface stays small, because three supported lines means three sets of release notes to track. The licence is Apache-2.0, and the README states that unless you explicitly state otherwise, any contribution intentionally submitted for inclusion is under the same terms. Apache-2.0 is permissive and includes a patent grant, which is the usual reason projects pick it over MIT; it also imposes notice and attribution obligations when you redistribute. That is a description of the licence text, not legal advice, and anyone shipping a derivative should read the LICENSE file in the repository rather than this summary. The upgrade cost is the part the README is quietest about: there is no documented migration path between minor lines, so a team on v0.30.2 moving to v0.32.2 has release notes and the changelog to work from, and the workspace pins to reconcile.

Editorial conclusion

Anchor suits teams writing Solana programs in Rust who want account constraints declared in the account structs and clients generated from an IDL. It is the wrong choice if you need direct control over the raw entrypoint and instruction dispatch, or if you cannot accept that the README does not document a rollback path for the nightly channel. Before adopting it, verify which release line your toolchain needs, because v0.32.2, v0.31.2 and v0.30.2 were all published on 2026-09-14, and confirm the nightly AVM channel is acceptable for your build pipeline.

Frequently asked questions

How do I install the Anchor CLI?

The README says the recommended way is the Anchor Version Manager, using the install script at the avm/install path in the repository. That installer downloads the latest nightly AVM and Anchor CLI binaries, enables the nightly channel, and links avm and anchor into ~/.cargo/bin when possible.

What version of Anchor is current?

The most recent release listed is v0.32.2, published on 2026-09-14. The same date also has v0.31.2 and v0.30.2, so older minor lines are still receiving releases.

Does Anchor support fuzzing?

Yes. The README states that anchor fuzz integrates Crucible for coverage-guided program fuzzing, with anchor fuzz init to scaffold a harness and anchor fuzz run to execute a test.

What licence does Anchor use?

Anchor is licensed under Apache-2.0, and the README states that contributions are submitted under the same terms unless stated otherwise. Apache-2.0 is permissive and includes a patent grant, with notice and attribution obligations on redistribution.

How do I leave the nightly channel after installing Anchor?

The README gives avm nightly --disable to leave nightly mode and return to normal AVM version resolution. It does not document a rollback path for a workspace already built against the nightly channel.

Official sources

  1. License: Apache-2.0
  2. otter-sec/anchor on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/otter-sec-anchor.svg)](https://hysenlabs.com/projects/otter-sec-anchor)