solana-specific

Pinocchio

Anza's Rust library for Solana programs — no_std, zero-copy, significantly more compute-efficient than the classic solana-program crate. The basis of P-Token.


Pinocchio

Pinocchio is a Rust library from Anza for developing Solana programs. It replaces the classic solana-program crate when every compute unit counts. The name plays on “no strings attached” — no standard-library threads, no heavy dependencies.

Three properties

  • no_std architecture — no Rust standard library, no heap allocations
  • Zero-copy account access — direct memory read, no Borsh deserialization
  • Three entrypoint macros — selective allocator setup based on program needs

Comparison with Anchor

Anchor is a framework with IDL generation and macro layers, optimized for developer velocity. Pinocchio is a library, not a framework, and is optimized for compute efficiency. Both coexist — Anchor for rapid prototyping, Pinocchio for performance-critical production programs.

Where it is used

P-Token is the first major Pinocchio program on mainnet. More in the pipeline: p-ATA (Associated Token Account), p-memo (Memo program). Long term, Anza discusses Pinocchio for the System Program as well.

Repository

github.com/anza-xyz/pinocchio

Related Terms

P-Token Anchor Compute Unit Solana Program