where the field is visible and the programmer thinks in constraints. division is exact (multiplicative inverse). every operation becomes a polynomial constraint in the zheng execution trace
Trident-only primitives: divine() (inject prover witness), hash() (Hemera, single constraint), merkle_step(), seal (hashed/private event emission)
| Layer | Scope | Types available | Compilation targets |
|---|---|---|---|
| 0 | Execute Anywhere | U32, Bool, structs, arrays | TASM, EVM, CosmWasm, SVM |
| 1 | Prove Anywhere | + Field, Digest, divine() | TASM (Triton VM) |
| 2 | Platform Powers | + chain-specific stdlib | Single target |
Tri is also the proving tier: field tower F_{pⁿ} over Goldilocks field processor (p = 2⁶⁴ − 2³² + 1). each extension is F_p[x]/(f(x)) where f is irreducible of degree n, chosen by the compiler for the algebraic structure required: n=1 for core STARK arithmetic, n=2 (f = x²+1) for complex amplitudes and quantum gates, n=3 (f = x³−x+1) for recursive proof soundness in FRI, higher n as needed. the tower is multiplicative — F_{p⁶} contains both F_{p²} and F_{p³} as subfields, so quantum and recursive proofs coexist in a common extension. all execution languages compile to Tri for settlement. see zheng for the STARK implementation architecture
see cyb/languages for the complete language set. see cyb/multiproof for the proving architecture
from subgraph trident
Trident
The weapon is their language. They gave it all to us. If you learn it, when you really learn it, you begin to perceive time the way that they do. So you can see what's to come.
Trident is a provable programming language.
Every variable, every operation, every function compiles to arithmetic over the Goldilocks prime field (p = 2^64 - 2^32 + 1). Programs produce STARK proofs — hash-based, post-quantum secure, no trusted setup.
Hello, Proof
program hello_proof
fn main() {
let a: Field = secret_read()
let b: Field = secret_read()
pub_write(a + b)
}
$ trident build hello.tri
$ trident prove hello --secret 7 --secret 13
Proof generated (924 cycles, 11 KB)
$ trident verify hello
Valid: output = 20, inputs hidden
A cryptographic proof that a + b = 20 without revealing a or b.
Quantum-safe. Zero-knowledge. No trusted setup. No elliptic curves.
The Mental Model
.tri source
|
| trident build
v
Target assembly (TASM) + static cost report
|
| target VM executes
v
Execution trace
|
| target VM proves
v
STARK proof + claim
|
| target VM verifies
v
true / false
Trident owns source -> assembly + cost. The backend owns execute -> trace -> prove -> verify. The compiler exists to expose cost, not hide it.
$ trident build coin.tri --cost
Total: 14,832 cycles
Hash: 8,440 (57%)
Field: 4,192 (28%)
Stack: 2,200 (15%)
You know the proving bill before you run.
Neptune
Neptune Cash is where Trident programs run. It is the only blockchain with recursive STARK proofs in production — a proof verifies another proof inside itself, so any chain of transactions collapses into a single cryptographic check. No other chain does this today.
Neptune is programmable, private, mineable, and quantum-safe. Trident is its native language, targeting Triton VM.
The following programs are proposed standards — specifications written in Trident, compiling to TASM today, under validation before deployment:
| Program | What it proposes |
|---|---|
| Coin | Fungible token (TSP-1) — pay, lock, mint, burn, composable hooks |
| Card | Non-fungible token (TSP-2) — royalties, creator immutability |
| Lock scripts | Multisig, timelock, symmetric spending authorization |
| Type scripts | Token conservation laws verified in every transaction |
| Programs | Recursive verification, proof aggregation, relay |
These compile and pass tests. They are not yet deployed. The interesting thing is not the tokens — it's that every transaction on Neptune already carries a recursive proof, and these programs extend what those proofs can express.
See the Gold Standard for the full PLUMB specification and the Skill Library for designed token capabilities.
Why a New Language
Provable VMs are not conventional CPUs. Treating them as such leaves orders of magnitude on the table.
The machine word is a field element, not a byte. Trident's
primitives — Field, Digest, XField — map directly to what the
VM computes. Rust compiled to RISC-V wraps field operations in
byte-level emulation.
The gap is not marginal:
| Operation | Trident on Triton VM | Rust on SP1 | Rust on RISC Zero |
|---|---|---|---|
| One hash (Tip5 / SHA-256) | 1 cycle | ~3,000 cycles | ~1,000 cycles |
| Merkle proof (depth 32) | ~100 cycles | ~96,000 cycles | ~32,000 cycles |
For hash-heavy programs — Merkle trees, content addressing, token transfers — this is decisive. See Comparative Analysis.
Bounded execution is not a limitation. It is what makes programs provable, costs predictable, and (eventually) circuits compilable to quantum hardware. All loops have explicit bounds. No recursion. No heap. No halting problem.
Proofs compose, calls don't. A proof can verify another proof inside it. Any chain of proofs collapses into one. Trident is designed for recursive proof composition — not invocation.
The Rosetta Stone
Three computational revolutions — quantum, privacy, AI — share a common algebraic root: the prime field.
A single lookup table over Goldilocks simultaneously functions as:
| Reading | Role | What it provides |
|---|---|---|
| Cryptographic S-box | Hash nonlinearity | Security |
| Neural activation | Network expressiveness | Intelligence |
| FHE bootstrap | Encrypted evaluation | Privacy |
| STARK lookup | Proof authentication | Verifiability |
One table. One field. Four purposes. When all systems operate over the same prime field, four separate mechanisms collapse into one data structure read four ways.
Trinity demonstrates this: a single Trident program encrypts input with LWE, runs a neural layer, hashes with Tip5, performs FHE bootstrapping, and commits via a quantum circuit — all inside one STARK trace.
To our knowledge, no existing system composes FHE, neural inference, hashing, and quantum circuits in a single proof.
See Quantum · Privacy · Verifiable AI · Vision
Formal Verification
Annotate. Then prove.
#[requires(amount > 0)]
#[requires(sender_balance >= amount)]
#[ensures(result == sender_balance - amount)]
fn transfer(sender_balance: Field, amount: Field) -> Field {
assert(amount > 0)
assert(sender_balance >= amount)
sender_balance - amount
}
$ trident audit transfer.tri
All 3 properties verified (0.2s)
No counterexample exists for any input in Field
Trident's restrictions — bounded loops, no recursion, finite field arithmetic — make verification decidable. The compiler proves correctness automatically. No manual proof construction. See Formal Verification.
Content-Addressed Code
Every function has a unique cryptographic identity derived from its normalized AST. Names are metadata. The hash is the truth.
$ trident deploy transfer.tri
Hash: #a7f3b2c1d4e8
Verified: (audit certificate attached)
Cost: 47 cycles
Published to registry
Rename a function — the hash doesn't change. Publish independently from the other side of the planet — same code, same hash. Verification certificates travel with the identity, not the name. See Content-Addressed Code.
Trusting, Not Trust
You download a compiler binary. Someone compiled it — you trust them. They used a compiler too — you trust that one as well. The trust chain stretches back to the first hand-assembled binary, and every link is opaque. Ken Thompson showed in 1984 that a compiler can inject backdoors invisible in the source.
Trident breaks the chain. The compiler self-hosts: Trident source compiles Trident source, and the execution produces a STARK proof that compilation was faithful. Not "we audited the binary." Not "we reproduced the build." A cryptographic proof, from the mathematics itself, that the output corresponds to the input.
Three producers compete on the same scoreboard:
$ trident bench baselines/triton/std/compiler
Module Tri Hand Neural Ratio
-------------------------------------------------------
std::compiler::lexer 288 8 - 36.00x
std::compiler::parser 358 8 - 44.75x
std::compiler::pipeline 0 1 - 0.00x
Tri — compiler output. Hand — expert-written assembly (the floor).
Neural — a 13M-parameter GNN+Transformer
learning to emit better assembly than the compiler. The dashes mean the
model is training. When it beats the compiler, the number appears.
src/ is the Rust bootstrap — it shrinks.
std/compiler/ is the Trident replacement — it grows.
Quick Start
cargo build --release
trident build main.tri # compile to TASM
trident check main.tri # type-check only
trident test main.tri # run #[test] functions
trident fmt main.tri # format source
trident audit main.tri # formal verification
trident bench main.tri # instruction count + cost
Design Principles
- Field elements all the way down. The machine word is
Field, notu64. - Bounded execution. Explicit loop bounds. No recursion. No halting problem.
- Compile-time everything. Types, array sizes, and costs known statically.
- Constraints are features. No heap, no dynamic dispatch — safety guarantees.
- Provable first. Designed for ZK. These constraints make great conventional programs too.
- Minimal dependencies. 5 runtime crates: clap, ariadne, blake3, tower-lsp, tokio.
Source Tree
src/ Compiler in Rust ~36K lines, 5 runtime dependencies
vm/ VM intrinsics in Trident Compiler primitives (hash, I/O, field ops)
std/ Standard library in Trident Crypto, math, neural networks, compiler
os/ OS bindings in Trident Per-OS config, programs, and extensions
vm.* Compiler intrinsics hash, sponge, pub_read, assert
std.* Standard library sha256, bigint, ecdsa, poseidon2
os.* Portable runtime os.signal, os.neuron, os.state, os.time
os.<target>.* Target-specific APIs os.neptune.xfield, os.solana.pda
Standard Library
Implemented: std.field · std.crypto · std.math · std.data ·
std.io · std.compiler
In development: std.nn (field-native neural networks) ·
std.private (ZK + FHE + MPC) · std.quantum (gates, error
correction)
Documentation
Organized with the Diataxis framework. Full index: docs/README.md
| Start here | |
|---|---|
| Tutorials | The Builder's Journey — from hello-proof to a DAO |
| Guides | Compiling a Program — build, test, deploy |
| Reference | Language Reference — types, operators, builtins |
| Explanation | Vision — why Trident exists |
Editor Support
| Editor | Setup |
|---|---|
| Zed | Extension in editor/zed/ |
| Helix | Config in editor/helix/languages.toml |
| Any LSP client | trident lsp — diagnostics, completions, hover, go-to-definition |
Status
This is a language from the future, under construction in the present.
Treat it as experimental unless you already understand the constraints you are adopting. The architecture is built to expand targets over time, without changing what a Trident program is.
License
Don't trust. Verify. Don't fear. Publish. Don't beg. Build.