Solana with Rust and Anchor 1.x: how to build in 2026
Why a Solana program validates every account it receives, what Anchor 1.x has automated since April 2026 and when Pinocchio pays off over Anchor.

On Solana, a program does not store its own state. The program is an executable account that holds code, and the data it operates on (balances, configuration, user records) lives in other accounts that the transaction passes to it in each instruction, along with which ones have signed and which ones may be modified. Those programs are written mostly in Rust, and Anchor is the framework that generates much of the code that reads, checks and writes back those accounts.
That separation concentrates security in one place: since the client chooses which accounts to pass, the program has to check that each one is what it claims to be, that it belongs to whom it should and that it does not appear twice where it should not. Anchor 1.x, stable since April 2026, automates more checks by default than earlier versions, including the rejection of duplicate mutable accounts. Rust without a framework and Pinocchio give control over compute and program size in exchange for writing and testing every one of those checks.
Why a Solana program validates the accounts it receives
Every account has an owner, the program allowed to modify its data, and every instruction declares the list of accounts it will read or write. The runtime enforces general rules, such as only the owning program writing an account's data or only accounts that signed the transaction counting as signers, but it does not know what each account means to the business. It does not know that a deposit account must belong to the signing user, or that a transfer's destination must differ from its source. Those rules are written by the program, with or without the help of a framework.
Declaring accounts upfront is also what allows transactions that do not write the same accounts to run in parallel, and it is combined with a compute budget. According to the constants in the Agave client, each program instruction gets 200,000 compute units by default, and a transaction can request at most 1,400,000 (execution_budget.rs, version 4.4.1). Every check consumes part of that budget, which is where the debate over writing a program with or without Anchor begins.
Anchor 1.x: what has changed since April 2026
Anchor released 1.0.0, its first stable major version, on 2 April 2026, and the latest release as of 8 November is 1.2.2, published on 28 October. The 1.0 release notes make part of the earlier guides obsolete: the TypeScript package moves from @coral-xyz/anchor to @anchor-lang/core, the framework targets Solana 3.x (with 3.1.10 as the recommended version), anchor test and anchor localnet use Surfpool by default instead of solana-test-validator, and anchor init creates tests from a LiteSVM template, which runs them in-process without starting a validator.
Other changes affect security directly. An account declared as AccountInfo inside #[derive(Accounts)] produces a compile-time warning recommending UncheckedAccount, a type whose name makes it explicit that Anchor does not check it; calling .reload() on an Account re-checks its owner; and the IDL is published through the Program Metadata Program, so legacy IDL accounts must be closed before deploying a program built with 1.0. Version 1.2.1, from October, added support for Solana v4 crates. The Anchor team also maintains earlier lines: on 3 November 2026 it published versions 0.30.4, 0.31.3 and 0.32.3.
The same account as source and destination of a transfer
Take a hypothetical program that keeps internal balances in Vault accounts and a transfer instruction that receives two of them, from and to, both declared as mutable Account<'info, Vault>, plus the signer. The code subtracts the amount from from.balance and adds it to to.balance. The has_one = owner constraint on from checks that the account's owner field matches the signer's key, so nobody can move balance out of someone else's deposit. One rule the business takes for granted is missing: source and destination are different accounts.
If a user passes their own account as both from and to, Anchor deserializes two copies of the same data. The subtraction is applied to one copy and the addition to the other, and when the instruction ends both are written back to the same account. As issue #3825 in the Anchor repository describes, the second account's state overwrites the first: the debit disappears and the balance grows by the transferred amount. In versions before 1.0, preventing it required an explicit check, such as a constraint = from.key() != to.key() constraint that the developer had to remember to write.
Since 1.0.0, Anchor rejects by default the same account appearing twice as mutable in one instruction, and only allows it if one of them carries the dup constraint (CHANGELOG, PR #3946; constraints reference). A later fix limited the check to types that serialize when the instruction ends (Account, LazyAccount, InterfaceAccount and Migration), which are the ones that can overwrite each other. With Anchor 1.x, the case above fails without writing anything; if an instruction declares one of those accounts as UncheckedAccount, the protection does not apply and the check is once again the program's responsibility.
The acceptance test covers both sides. A valid transfer between two accounts preserves the sum of balances; a transfer from an account to itself is rejected; a signer who does not own the source gets an error; and an account from another program with compatibly formatted data is not accepted, because Account checks the owner before deserializing. With the LiteSVM template generated by anchor init, those four tests become part of continuous integration without a local validator.
Rust without a framework and Pinocchio: control over compute, checks by hand
Writing a program without Anchor means receiving accounts as a list and checking every property in code: signer, owner, data type, relationships between accounts and duplicates. Pinocchio, Anza's library, takes that approach further. It has no external dependencies beyond the Solana SDK types for on-chain programs, it is no_std, it reads input data without copying it (zero-copy), and it is optimized for compute units and binary size; its documentation explains that the standard entrypoint! consumes compute units before the program begins executing. Version 0.12.0 was released on 28 October 2026.
In the transfer case, a Pinocchio program gets no protection against the duplicate account: it has to compare the two keys itself. It does not generate an IDL either, and clients are produced with tools such as Codama, which generates clients and documentation from the program's description. Pinocchio makes sense when an instruction approaches its compute budget, when several instructions must share a transaction's 1,400,000-unit maximum, or when binary size is a deployment constraint.
How to compare implementations without dropping checks
A compute comparison between an Anchor version and a Pinocchio version is only valid if both perform the same checks. If the Pinocchio variant consumes less because it does not verify an account's owner or compare source and destination, it is measuring a different program. The reliable procedure is to write the rejection tests first, the same four as in the case above, run them against both implementations, and only then compare the units consumed by the same instruction with the same inputs, as recorded by the transaction.
The result is read against the budget. A saving that leaves an instruction far from its limit does not justify the extra validation code that has to be maintained and audited; a saving that allows several instructions to be composed in one transaction, or keeps an operation under the limit in the worst case, can justify it.
Anchor or Pinocchio on Solana: only measured compute justifies writing checks by hand
Anchor 1.x turns account validation, which in native Rust is written by hand in every instruction, into declarative constraints that now cover cases such as the duplicate mutable account by default, and it generates the IDL that clients need. It does not solve business-specific rules: has_one checks a relationship that someone has to declare, and an account marked as UncheckedAccount falls outside its checks. For a new program, starting with Anchor 1.x and measuring leaves fewer checks to the team's memory.
Pinocchio and Rust without a framework are tools for a measured problem: an instruction close to its compute limit or a binary that has to shrink. Choosing them from the start shifts every check Anchor performs by default onto the team, and that responsibility is paid for in tests and security review.
The Solana, Rust and Anchor pages summarize each technology, and the origin of the network's design is covered in the profile of Anatoly Yakovenko. At Metlabs we develop smart contracts and Solana programs; our guide to Solana development companies explains how to compare providers. If you are starting a program, tell us which instructions it needs and we will tell you which checks each one requires.
Frequently asked questions
Got a blockchain project in mind?
From idea to product, strategy and technology must move forward together.







