Trident: guided fuzzing for Anchor programs
Install Trident, scaffold fuzz tests from IDL, write Anchor-like sequences, and catch constraint bugs unit tests miss — Ackee’s Solana fuzzer.
devrels.xyz/a/242short linkTrident: guided fuzzing for Anchor programs. Trident (Ackee Blockchain) is a Rust fuzzer purpose-built for Solana: up to thousands of transactions per second, Anchor-like macros, and manually guided strategies so the search stays on realistic program flows instead of pure random instruction soup.
Why guided fuzzing
Black-box random txs thrash the SVM but rarely build the account graphs your program needs (mint → ATA → vault → authority). Unit tests cover the paths you already understand. Guided fuzzing sits between them: you specify setup → action permutations → teardown; Trident mutates data and ordering inside those rails and watches for panics, constraint failures, and invariant breaks.
| Layer | Strength | Gap |
|---|---|---|
| Unit / LiteSVM | Fast, deterministic | Only paths you wrote |
| Trident | Stateful exploration at SVM speed | Needs good flow definitions |
| Audit | Human threat model | Expensive; not continuous |
Install and scaffold
# CLI
cargo install trident-cli
# inside an Anchor workspace
trident init
# generates fuzz test scaffolding from IDL when available
trident fuzz run <fuzz_target>
# or follow current CLI subcommands from usetrident.xyz / READMEPrefer pinning a release that matches your Anchor version. Ackee documents IDL-driven generation so instruction builders stay aligned with the program interface.
Writing a guided target
Structure mirrors how a real user (or attacker) would call the program:
- Setup — create mints, fund payers, initialize config PDAs with legal constraints.
- Sequence body — deposit / withdraw / update / close in orders that matter; allow Trident to shuffle and mutate amounts, seeds, and optional accounts inside bounds you define.
- Invariants — vault balance vs sum of user shares, authority still the expected pubkey, no token account with wrong owner.
// Illustrative shape — check Trident macros for your installed version
// Fuzz transactions are built with Anchor-like instruction helpers.
fn fuzz_escrow_flow(fuzzer: &mut Fuzzer) {
// 1) always-valid setup
initialize_escrow(fuzzer);
// 2) guided permutations
match fuzzer.gen_range(0..3) {
0 => deposit_random(fuzzer),
1 => withdraw_random(fuzzer),
_ => cancel_random(fuzzer),
}
// 3) invariant: vault tokens == sum of open escrows
assert_vault_consistent(fuzzer);
}The value is the middle step: random legal-looking calls that still violate a missing has_one, an unchecked account, or a CPI signer seed typo.
What it typically finds
- Missing or incomplete account constraints on Anchor contexts
- Token amount / decimals edge cases and empty vault paths
- Unauthorized state transitions (wrong authority still succeeds)
- Reinitialization / close-and-reuse surprises
When a campaign crashes, keep the seed and replay under Seer or a minimal LiteSVM test so the fix is regression-locked.
Ops tips
| Topic | Practice |
|---|---|
| CI | Nightly long runs; PR-sized smoke targets under a minute |
| Coverage | Add flows when you ship new instructions — not only happy path |
| Metrics | Use Trident's dashboard/metrics when available to see dead ends |
| School of Solana | Ackee teaches Trident in their Solana security curriculum |
People and links
| Who / what | Link |
|---|---|
| Product | usetrident.xyz |
| GitHub | Ackee-Blockchain/trident |
| X | @TridentSolana |
| Org | Ackee Blockchain |
| Contributor | Andrej Lukačovič (@andrej_xyz) |
| Project | /projects/trident |
Resources
Keep reading
Seer attaches source context to every step of a Solana transaction so you debug programs from your repo, not raw logs.
An audit report is worthless if you can't confirm the deployed bytecode is what was audited. Solana verified builds fix that: a Docker-pinned toolchain produces a deterministic .so, its hash is compared to the on-chain program data, and the result is written to a PDA anyone can read. Solana Explorer shows a verified badge. Here's the full workflow.
Keys born offline, live in RAM only, sign via QR — no Faraday cloud, Pi Zero has no radio silicon.
Get new articles in your inbox
Technical deep-dives on Solana tooling, infrastructure, and ecosystem. No noise.
