Skip to content
 
 

Repository files navigation

Supersonic TX

CI Release Rust Solana Tests License: MIT

Cast fuzzy instruction bundles to make intent classification less reliable.

Supersonic TX is a Rust-only Solana program, planner, SDK, CLI, and adversarial evaluator built for Superteam Brazil's Privacy Through Noise bounty. It routes an intended instruction among shape-matched cover calls, executes each cast atomically through CPI, and refuses to proceed when configured safety or measurable public-observer anonymity gates fail.

Important

Supersonic is not encryption and does not provide anonymity, confidentiality, or unlinkability. All accounts, programs, instruction bytes, state changes, fees, and inner instructions remain public. The evaluator measures program, ordered privilege, account-identity, discriminator, and exact-data equality tiers; protocol-aware semantic decoders can still do better. Read privacy limitations before using it.

Verified release

Release v0.2.0 was validated on 18 July 2026:

Evidence Result
Native tests 20 passed, 0 failed
Rust quality rustfmt, Clippy with warnings denied, and rustdoc passed
Release build Complete locked Rust workspace built with LTO
SBF program 32,840 bytes; SHA-256 b7c202cdafb5369827edf899be95604f9670f2a613f9419c6032e26426f004d1
Live validator 2/2 casts simulated and 2/2 broadcast/confirmed
Dependency audit 0 known RustSec vulnerabilities; one documented transitive maintenance warning
Example observer result k=8, 12.5% enforced top-1; exact-data tier separately reports k=1, 100%

The reproducible command log, environment, threat boundaries, and remaining risks are recorded in AUDIT.md. Deployable SBF artifacts and checksums are published with each GitHub release.

Bounty alignment

Supersonic is designed around the requirements that matter on chain:

Objective Supersonic implementation
Rust end to end Rust workspace for the client, protocol, wire codec, and SBF program
Bundle instructions Up to eight arbitrary allowlisted CPIs inside each router transaction
No public intent marker Versioned wire format contains only uniform route calls
Program composability Stateless global SBF router plus JSON/Rust instruction exports
Realistic, customizable cover Weighted protocol-specific instruction templates supplied by integrators
Resist simple clustering Seeded call/cast ordering, compute-price/limit, and timing variation
Measurable result Tiered on-chain observer model with enforced k-anonymity/linkability gates
Production controls Exact reproduction, allowlists, budgets, simulation evidence, deadlines, retry caps, explicit send gates

Architecture

flowchart LR
    C["Strict YAML config"] --> P["Seeded Rust planner"]
    P --> E["Tiered public-observer gate"]
    E --> M["Role-free public plan"]
    M --> X["Rust transaction compiler"]
    X --> R["Supersonic SBF router"]
    R --> A["Atomic CPI call 1"]
    R --> B["Atomic CPI call 2..8"]
    M --> S["RPC simulation evidence"]
    S --> G["Explicit guarded send"]
Loading

Each cast is one Solana transaction. Its router payload is SSTX | version | calls[]; calls contain only a program-account index, per-CPI account indices/privilege flags, and opaque instruction data. There is no role bit. The router preserves privileges per CPI, verifies them against runtime AccountInfo flags, rejects privilege escalation, recursive calls, and non-executable targets, bounds allocations, and relies on Solana rollback if any CPI fails.

The planner fills casts from a weighted cover corpus, places intended calls in seeded random slots, shuffles again, then discards internal roles. It rejects the plan if any routed call is too unique under the configured public-feature model.

See architecture, threat model, and adversarial evaluation.

Workspace

crates/supersonic-wire      no_std, allocation-bounded SSTX codec
crates/supersonic-protocol  config, deterministic planner, safety and evaluator
crates/supersonic-cli       reusable compiler/RPC library and `supersonic` binary
programs/supersonic-router  stateless atomic CPI router for SBF

The canonical source program ID is 3wGNKKfYSSNxpHmR67aUbdm4yR3pd1pNVkuNRGJmK9ye. The program is stateless and does not depend on that address internally, so reviewers may deploy the compiled .so under a fresh program key and set router_program_id accordingly.

Requirements

  • Rust stable 1.91 or newer
  • Agave/Solana CLI 4.1 with cargo-build-sbf and solana-test-validator
  • A disposable localnet or devnet keypair for network commands

Build and test

cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --all-targets
cargo build --release --workspace
cargo build-sbf --manifest-path programs/supersonic-router/Cargo.toml

Install the CLI:

cargo install --path crates/supersonic-cli --locked
supersonic --help

Safe offline demo

Planning, inspecting, evaluating, and exporting need no RPC or keypair:

supersonic plan examples/basic-noise.yaml --output demo.plan.json
supersonic inspect demo.plan.json
supersonic evaluate demo.plan.json --output demo.evaluation.json
supersonic export-instruction demo.plan.json \
  --cast 1 \
  --signer YOUR_PUBLIC_KEY \
  --output cast-1.instruction.json

The safe example produces two casts with four CPI calls each. All eight calls share program, privilege shape, account identity, exact length, and an eight-byte prefix, so every enforced tier reports k=8 and 12.5% worst top-1 probability. Exact Memo bytes intentionally differ and therefore report k=1 / 100%; this exposes, rather than hides, the limit of generic analysis.

Representative output:

observer anonymity: shape=8 accounts=8 discriminator=8 exact-data=1
enforced linkability<=12.50% / exact-data equality<=100.00%

Local-validator end-to-end demo

Build and preload the router:

cargo build-sbf --manifest-path programs/supersonic-router/Cargo.toml

solana-test-validator --reset \
  --bpf-program 3wGNKKfYSSNxpHmR67aUbdm4yR3pd1pNVkuNRGJmK9ye \
  target/deploy/supersonic_router.so

In another terminal, create and fund a disposable signer:

solana-keygen new --silent --no-bip39-passphrase --outfile /tmp/supersonic-local.json
export SOLANA_KEYPAIR_PATH=/tmp/supersonic-local.json
solana airdrop 1 --url http://127.0.0.1:8899 \
  "$(solana-keygen pubkey /tmp/supersonic-local.json)"

Use the dry-run configuration first:

supersonic doctor examples/basic-noise.yaml
supersonic plan examples/basic-noise.yaml --output demo.plan.json
supersonic simulate demo.plan.json \
  --config examples/basic-noise.yaml \
  --output demo.simulated.json

The safe example cannot broadcast. The separate local-validator-send.yaml permits only localnet and exercises the complete path:

supersonic plan examples/local-validator-send.yaml --output local.plan.json
supersonic simulate local.plan.json \
  --config examples/local-validator-send.yaml \
  --output local.simulated.json
supersonic send local.simulated.json \
  --config examples/local-validator-send.yaml \
  --yes \
  --output local.receipts.json

Never use a production wallet for a noise experiment.

CLI

Command Network Signer Purpose
plan No No Deterministically build a role-free public plan
inspect No No Print aggregate safety and privacy evidence
evaluate No No Re-run all public-observer adversary tiers
export-instruction No Public key only Export a router instruction for external composition
simulate Yes Yes Simulate every exact cast and persist evidence
send Yes Yes Reproduce, freshly simulate, send, and confirm under all gates
doctor Yes Yes Check config, signer, RPC, deployment, balance, and readiness

send requires an exact deterministic reproduction of the original plan, successful simulation evidence for the same fee payer, dry_run: false, broadcast_enabled: true, and --yes. Mainnet additionally requires policy opt-in and --mainnet-i-understand. No flag bypasses allowlists, budgets, limits, or fresh preflight.

Integrating a protocol

  1. Encode the intended protocol instruction as program_id, ordered account metas, and base64 data.
  2. Add audited harmless cover templates for that protocol and public shape. Supersonic does not invent generic state-changing decoys because that would be unsafe.
  3. Add targets to allowed_program_ids; signer privilege is limited to $SIGNER.
  4. Set privacy thresholds. Planning fails if program, shape, account-aware, or discriminator-aware anonymity is too small.
  5. Simulate with a disposable environment and inspect semantic distinguishability separately.
  6. Export the router instruction or use the Rust compile_cast API in a wallet/backend.

Cover instructions execute for real. Integrators are responsible for choosing calls whose effects, costs, protocol invariants, and legal implications are acceptable.

Boundaries

  • Exact instruction data and inner CPI traces remain visible.
  • A semantic decoder may identify intent even when every enforced public-feature tier matches.
  • Signers, funding, accounts, RPC origin, timing, and bundle boundaries remain linkable.
  • Multiple casts are not atomic as a group; each individual cast is atomic.
  • Noise costs fees and compute.
  • The router has not received an independent third-party security audit.

See AUDIT.md for reproducible validation evidence.

Documentation

Document Purpose
Architecture Component boundaries, wire format, execution, and trust model
Threat model Observer classes, defended claims, attacks, and exclusions
Adversarial evaluation Feature tiers, metrics, negative controls, and interpretation
Privacy limitations What remains public and where semantic classifiers still win
Public plan schema Machine-readable artifact contract
Security policy Coordinated vulnerability reporting
Contributing Engineering and review requirements
Changelog Versioned release history

Responsible use and license

Supersonic is bounded research tooling, not an unrestricted spammer. Defaults are dry-run, broadcast-disabled, localnet/devnet-only, simulation-required, and low-budget. Do not use it to evade platform rules, manipulate markets, overload infrastructure, or conceal unlawful activity.

MIT licensed. Security reports follow SECURITY.md.

About

Deterministic Rust/SBF transaction privacy router for Solana with policy-driven noise, adversarial evaluation, and fail-closed CPI execution.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages