Anchor v2 alpha is here! Up to 95% smaller binaries, 3.0 to 50.4× fewer CU
Anchor Docs
A lone boy hauls an anchor on the shore, evoking the weight of maritime destiny and Homer's mastery of atmosphere and technique.
Boy with Anchor, Winslow Homer, 1873

Anchor v2 is the new foundation for Solana programs.

Anchor v2 gives you a Rust framework for writing Solana programs, checking accounts safely, generating IDLs and client code, and testing everything from one workspace.

Scroll for more

One framework, one program loop

Write programs with the workflow you know, backed by a leaner runtime, clearer account types, generated IDLs, and first-class tests.

Account validation

Define account requirements declaratively and reject bad inputs before handlers run.

IDLs and generated clients

Describe your program once and generate typed client surfaces.

A complete workspace loop

Scaffold programs, build artifacts, run tests, and deploy from one CLI.

Composable Solana programs

CPI helpers, SPL integrations, and generated account metadata make programs easier to connect.

Anchor v2 in practice

Anchor v2 keeps the workflow developers rely on while making the generated program smaller, lighter, and cheaper to run.

95%
less deployed bytecode
9.9x
average CU reduction
50.4x
largest CU reduction
v1 baselinev2 runtime
helloworld
Single-instruction counter
v1124.8 KBv26.5 KB
19.2x
smaller
prop-amm
Oracle feed with asm fast-path
v1140.5 KBv28.3 KB
16.8x
smaller
vault
Single-depositor SOL vault
v1107.5 KBv25.4 KB
19.8x
smaller
nested
Shared validation via Nested<T>
v1157.3 KBv213.3 KB
11.9x
smaller
multisig
Four-instruction SOL multisig
v1170.1 KBv231.2 KB
5.4x
smaller

Start where you are

Whether you are learning Anchor, moving a v1 program, or deciding if v2 is ready, start from the path closest to your code.

Esc

Start typing to search the docs.