Skip to content
hopper
Get started
v0.2.1 release line/hopperzero.dev is canonical

Zero-copy Solana state,
with the safety rails left on.

Write Solana programs with the Anchor shape developers already know, while Hopper verifies owner, role, discriminator, version, and layout fingerprint before account bytes reach a typed zero-copy borrow. Add bounded dynamic tails, Token-2022 checks, receipts, and manifests when the protocol needs more than a raw cast. Verify native Ed25519/secp256k1 payloads and hash with SHA-256, Keccak, or BLAKE3 without leaving the Hopper surface.

Start buildingRead the docsSupport Hopper
$cargo add hopper-lang --rename hopper --no-default-features -F hopper-native-backend -F proc-macros
0
heap allocations
no_std / no_alloc program path
16B
account header
disc, version, flags, layout id
5
access tiers
validated loads to raw escape hatches
0.2.1
release
framework, CLI, companion crates
#![no_std]contract-checked casts16-byte headerprofile = "tiny"segment borrow registryTailStr / TailBytesToken-2022 TLVdeclare_program!#[hopper::crank]hopper lint zcmulti-byte discriminatorsStateReceipt wire formatschema-epoch migrationshopper manager invokehopper profile elfhopper manager crank runPDA manifest fetch
§01 - why Hopper exists

The fast path should still have names, types, and guardrails.

access model

Choose the trust tier per field.

Use load::<T>() for full validation, segment_ref::<T>() for one field, raw_ref() for audited escape hatches, and load_cross_program::<T>() for foreign layouts. The access model is explicit at the call site.

token-2022

Token-2022 checks without a detour.

Screen transfer hooks, permanent delegates, transfer fees, confidential transfers, default account state, and more with direct TLV byte scans. The mint stays on the zero-copy path while your handler gets a typed rejection.

crypto

Precompile bytes you can review.

Hash with SHA-256, Keccak, or BLAKE3; inspect Ed25519 and secp256k1 native precompile instructions; and recover Ethereum addresses through the runtime syscall when a protocol needs it in-program.

receipts

State changes you can explain later.

Handlers can stamp the current 72-byte StateReceipt with fingerprints, changed fields, invariant indexes, and CPI flags. Decoders still accept the legacy 64-byte prefix for older programs.

cli and cranks

Every program is self-describing.

Export manifests, inspect accounts, explain layouts, decode receipts, run manager invoke or crank loops, and generate client SDKs or route scaffolds from metadata. Hopper treats the CLI as part of the framework surface.

$hopper solana-check --all --build-sbf
$hopper client gen --ts hopper.manifest.json
$hopper manager simulate hopper.manifest.json deposit
$hopper manager crank run hopper.manifest.json --once
$hopper tx explain 4Rb...signature
§02 - code

The authoring model stays Rust-native.

Start with the proc-macro path when you want speed. Drop to declarative macros or raw tiers when you need control. The layout, context, dispatcher, and CPI surface all stay inspectable.

1#[derive(Clone, Copy)]
2#[repr(C)]
3#[account(discriminator = 1, version = 1)]
4pub struct Counter {
5 pub authority: Address,
6 pub value: WireU64,
7}
versioned zero-copy account with Hopper layout identity
03 - protocol sample

Forward-secret messaging with verifier-bound ferry proofs.

The Styx ferry example uses Hopper accounts for prekeys, ratchet threads, and proof counters while exposing the Solana crypto surface: Keccak domain derivation, Ed25519 precompile checks, sibling instruction inspection, and typed verifier CPI.

Open Styx doc
01
Signed prekeys

Ed25519 precompile inspection ties the owner to the current signed prekey

02
Ratchet envelope

bounded ciphertext events with monotonic counters and sealed-message hashes

03
VSL proof gate

513-byte proof v2 with checked domain, fee tier, and base fee inputs

04
Verifier CPI

proof bytes are forwarded only to the config-pinned verifier program

examples/hopper-styx-ferry/src/lib.rscrypto + CPI
#[instruction(5)]
pub fn submit_zk_ferry(
    ctx: Ctx<SubmitZkFerry>,
    proof: HopperVec<u8, STYX_ZK_PROOF_V2_LEN>,
    encrypted_outputs: [u8; 64],
) -> ProgramResult {
    ctx.accounts.submit(proof, encrypted_outputs)
}
§03 - coverage

Coverage where zero-copy gets hard.

Hopper keeps the Anchor/Quasar authoring shape, then adds the contract layer serious state needs: layout identity, field-level borrows, Token-2022 extension checks, dynamic tails, receipts, manifests, migrations, and generated clients.

Zero-copy account access
Hopper
native
Quasar
supported
Anchor ZC
partial
Pinocchio
supported
Bounded dynamic fields + final raw tails
Hopper
native
Quasar
partial
Anchor ZC
partial
Pinocchio
missing
Token-2022 TLV validators
Hopper
native
Quasar
partial
Anchor ZC
missing
Pinocchio
missing
Hash wrappers + precompile payload checkers
Hopper
native
Quasar
missing
Anchor ZC
missing
Pinocchio
missing
Segment-level borrow tracking
Hopper
native
Quasar
missing
Anchor ZC
missing
Pinocchio
missing
72-byte receipts with invariant attribution
Hopper
native
Quasar
missing
Anchor ZC
missing
Pinocchio
missing
Schema-epoch migrations
Hopper
native
Quasar
missing
Anchor ZC
missing
Pinocchio
missing
On-chain manifest PDA
Hopper
native
Quasar
missing
Anchor ZC
missing
Pinocchio
missing
Generated clients: TS, Kotlin, Python, Go, C, Rust
Hopper
native
Quasar
supported
Anchor ZC
supported
Pinocchio
missing
Policy knobs (tiny / strict / sealed / raw)
Hopper
native
Quasar
missing
Anchor ZC
missing
Pinocchio
missing
Declarative init / close / realloc / has_one
Hopper
native
Quasar
supported
Anchor ZC
supported
Pinocchio
missing
ELF profiler + flamegraph CLI
Hopper
native
Quasar
supported
Anchor ZC
missing
Pinocchio
missing
measured vault snapshot

Same harness, same seeds, scoped claims.

Current release-facing numbers come from the sibling hopper-bench Mollusk harness, averaged across 8 deterministic seeds. Quasar's upstream vault exposes only deposit and withdraw, so validation-only rows stay n/a instead of being synthesized.

Scenario
Hopper
Pinocchio
Quasar
Authorize
431 CU
2512 CU
n/a
Auth-fail
72 CU
41 CU
n/a
Counter access
551 CU
2539 CU
n/a
Deposit
1669 CU
3856 CU
1767 CU
Withdraw
453 CU
2548 CU
603 CU
Binary size
7.53 KiB
7.73 KiB
6.27 KiB
§04 - go

Start from the published release line.

Add the published `hopper-lang` package under the Rust crate name `hopper`, install the CLI from crates.io, and scaffold a Solana program that already knows about Hopper layouts, manifests, receipts, and the native backend.

01
$ cargo add hopper-lang --rename hopper --no-default-features -F hopper-native-backend -F proc-macros
add the framework
02
$ cargo install hopper-cli
install the CLI
03
$ hopper init my-program --template minimal --yes
scaffold a program