βββββββββββββββββββββββ
β Applications β
β std.agent β
β std.defi β
β std.science β
ββββββββββββ¬βββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββ
β β β
βββββββββββ΄βββββββββ ββββββββββ΄βββββββββ βββββββββββ΄βββββββββ
β Intersections β β β β β
β std.nn_quantum β β std.nn_private β β std.quantum_priv β
β (Quantum ML) β β (Private AI) β β (Quantum Crypto) β
βββββββββββ¬βββββββββ ββββββββββ¬βββββββββ βββββββββββ¬βββββββββ
β β β
βββββββββββ΄βββββββββ ββββββββββ΄βββββββββ βββββββββββ΄βββββββββ
β Three Pillars β β β β β
β std.nn β β std.private β β std.quantum β
β (Intelligence) β β (Privacy) β β (Quantum) β
βββββββββββ¬βββββββββ ββββββββββ¬βββββββββ βββββββββββ¬βββββββββ
β β β
ββββββββββββββββββββββΌβββββββββββββββββββββ
β
ββββββββββββ΄βββββββββββ
β Token Infrastructure β
β std.token β
β std.coin β
β std.card β
β std.skill β
ββββββββββββ¬βββββββββββ
β
ββββββββββββ΄βββββββββββ
β Foundation β
β std.field β
β std.math β
β std.data β
β std.graph β
β std.crypto β
β std.io β
βββββββββββββββββββββββ
Everything builds on this. These modules provide the mathematical and data infrastructure that all three pillars require.
The bedrock. Every computation in Trident reduces to operations over the Goldilocks field
std.field
βββ core Field type, add, mul, sub, inv, neg, pow
βββ ext2 F_{p^2} quadratic extension (complex amplitudes)
βββ ext3 F_{p^3} cubic extension (STARK soundness)
βββ batch Batched field operations (SIMD-style parallelism)
βββ poly Polynomial arithmetic over F_p
β βββ eval Evaluation, multi-point evaluation
β βββ interp Lagrange interpolation
β βββ ntt Number Theoretic Transform (FFT over F_p)
β βββ inv_ntt Inverse NTT
β βββ commit Polynomial commitment (FRI)
βββ matrix Matrix operations over F_p and extensions
β βββ mul Matrix multiplication
β βββ transpose Transpose
β βββ inv Matrix inversion (via adjugate or LU over F_p)
β βββ det Determinant
β βββ decomp LU, QR decomposition in field arithmetic
βββ random Deterministic PRG over F_p (for reproducibility)
+ divine()-based randomness injection
Higher-level mathematical functions built on field arithmetic.
std.math
βββ arithmetic Modular arithmetic beyond F_p (arbitrary moduli via CRT)
βββ number_theory GCD, Legendre symbol, quadratic residues, primitive roots
βββ combinatorics Binomial coefficients, permutations, combinations in F_p
βββ statistics Mean, variance, covariance, correlation β all in F_p
β βββ descriptive Central moments, quantiles (via sorting networks)
β βββ regression Linear regression over F_p (least squares via matrix ops)
β βββ sampling Reservoir sampling, stratified sampling with divine()
βββ optimization Optimization algorithms over F_p
β βββ gradient Gradient descent, Adam, RMSprop β all field arithmetic
β βββ linear_prog Simplex method over F_p (exact, no floating-point)
β βββ convex Convex optimization (projected gradient, ADMM)
β βββ combinat Branch and bound, simulated annealing via divine()
βββ linalg Linear algebra beyond basic matrix ops
β βββ eigen Eigenvalue computation over F_p (characteristic polynomial)
β βββ svd Singular value decomposition (iterative, over F_p)
β βββ solve Linear system solving (Gaussian elimination, exact)
β βββ sparse Sparse matrix operations (CSR/CSC formats)
βββ approx Function approximation in F_p
β βββ poly_approx Polynomial approximation of transcendentals
β βββ lookup Lookup table construction and interpolation
β βββ piecewise Piecewise polynomial approximation
β βββ minimax Minimax approximation for optimal field representations
βββ constants Precomputed field constants (roots of unity, sqrt_inv, etc.)
Provable computation needs provable data structures.
std.data
βββ array Fixed-size arrays (compile-time bounded)
β βββ sort Sorting networks (Batcher, bitonic β bounded depth)
β βββ search Binary search, interpolation search
β βββ aggregate Reduce, scan, map β all bounded-loop
βββ vector Variable-length vectors with capacity bound
βββ matrix 2D array with row/column operations
βββ tensor N-dimensional tensors (for neural network weights)
β βββ reshape View manipulation without data movement
β βββ slice Subview extraction
β βββ broadcast Broadcasting rules (NumPy-compatible semantics)
β βββ einsum Einstein summation (general tensor contraction)
βββ tree Merkle trees and authenticated data structures
β βββ merkle Standard Merkle tree over Tip5/Poseidon2
β βββ sparse Sparse Merkle tree (for large key spaces)
β βββ append_only Append-only Merkle tree (for logs, histories)
β βββ indexed Indexed Merkle tree (for efficient updates)
βββ map Key-value maps (hash map over F_p)
β βββ fixed Fixed-capacity hash map (compile-time size)
β βββ merkle_map Merkle-authenticated key-value store
βββ accumulator Cryptographic accumulators
β βββ rsa RSA accumulator (membership proofs)
β βββ hash Hash-based accumulator
βββ commitment Vector commitments
β βββ merkle Merkle vector commitment
β βββ poly Polynomial commitment (KZG-like over F_p)
β βββ inner_prod Inner product argument
βββ encoding Serialization / deserialization
βββ field Pack/unpack bytes β field elements
βββ utf8 UTF-8 string handling in F_p
βββ json JSON parsing into field element structures
Graphs are central to knowledge graphs (Bostrom), social networks, and quantum walk algorithms.
std.graph
βββ types Graph representation types
β βββ adjacency Adjacency matrix (dense, over F_p)
β βββ sparse Sparse adjacency (CSR/COO)
β βββ edge_list Edge list representation
β βββ weighted Weighted graph (edge weights in F_p)
βββ algorithms
β βββ traversal BFS, DFS (bounded-depth)
β βββ shortest Dijkstra, Bellman-Ford over F_p weights
β βββ pagerank PageRank / CyberRank (iterative, field arithmetic)
β βββ spectral Spectral analysis (eigenvalues of adjacency/Laplacian)
β βββ matching Maximum matching (bounded algorithms)
β βββ flow Maximum flow / minimum cut
β βββ community Community detection (spectral, label propagation)
βββ random_walk Classical random walks on graphs
β βββ standard Standard random walk
β βββ lazy Lazy random walk
β βββ metropolis Metropolis-Hastings walk
βββ quantum_walk Quantum walks on graphs (bridges to std.quantum)
βββ coined Coined quantum walk
βββ szegedy Szegedy quantum walk
βββ continuous Continuous-time quantum walk
The security foundation. Most of this already exists in Triton VM; the stdlib exposes it cleanly.
std.crypto
βββ hash Hash functions
β βββ tip5 Tip5 (algebraic hash, STARK-native)
β βββ poseidon2 Poseidon2 (alternative algebraic hash)
β βββ rescue Rescue-Prime (alternative)
β βββ sponge Sponge construction (generic over permutation)
βββ commitment Commitment schemes
β βββ pedersen Pedersen commitment (additive homomorphic)
β βββ hash_commit Hash-based commitment
β βββ vector Vector commitment (batched)
βββ signature Digital signatures
β βββ schnorr Schnorr signatures over F_p
β βββ bls BLS signatures (if pairing available)
β βββ hash_sig Hash-based signatures (SPHINCS+, post-quantum)
βββ merkle Merkle tree operations (shared with std.data.tree)
βββ nullifier Nullifier computation (for UTXO privacy)
βββ proof STARK proof primitives
β βββ fri FRI protocol components
β βββ air Algebraic Intermediate Representation
β βββ verify STARK verifier (for recursive proofs)
β βββ recursive Recursive proof composition
βββ pq Post-quantum primitives
βββ lattice Lattice-based constructions (if needed)
βββ hash_based Hash-based constructions (primary)
How Trident programs interact with the world.
std.io
βββ pub_input Public inputs (visible to verifier)
βββ pub_output Public outputs (visible to verifier)
βββ divine Witness injection (private, prover-only)
β βββ value Single field element
β βββ array Array of field elements
β βββ struct Structured witness data
β βββ oracle Oracle query (for Grover, optimization)
βββ storage On-chain state access
β βββ read Read from authenticated storage
β βββ write Write to authenticated storage
β βββ merkle_auth Merkle-authenticated state transitions
βββ call Contract-to-contract calls
β βββ internal Call within same VM
β βββ cross_chain Cross-chain message passing (Level 1 compatible)
βββ time Block time, timestamps (public inputs)
Tokens are the economic foundation. While Layer 0 provides mathematical and cryptographic primitives, and Layer 1 provides computational pillars, the token layer provides the economic substrate β standards for value transfer, unique asset ownership, and composable token behaviors.
All token modules build on the PLUMB framework (Pay, Lock, Update, Mint, Burn) β five operations that cover every token lifecycle event. See the PLUMB reference for the shared framework, TSP-1 Coin and TSP-2 Card for standard-specific constraints.
The shared foundation for all token standards. Defines the config model, leaf structure, authorization, hook system, and proof composition.
std.token
βββ config Token configuration (5 authorities + 5 hooks)
β βββ authority Authority types (disabled, required, optional)
β βββ hook Hook program references (content hash or [Atlas](atlas.md) name)
β βββ validate Config hash computation and verification
βββ leaf Token leaf structure (10-field standard layout)
β βββ read Leaf field access
β βββ write Leaf field mutation (within circuit constraints)
β βββ hash Leaf hash computation for Merkle inclusion
βββ auth Authorization primitives
β βββ verify Auth hash verification (divine + hash + assert)
β βββ dual Dual authorization (account + config authority)
β βββ controller Controller-based authorization
βββ hook Hook system
β βββ signal Signal a hook program for proof composition
β βββ compose Compose multiple hook proofs
β βββ verify Verify hook proof is valid for operation
βββ tree Merkle tree operations for token state
β βββ include Inclusion proof (leaf exists in tree)
β βββ update Update proof (old leaf β new leaf)
β βββ root Root computation and verification
βββ event Standard token events
βββ nullifier Nullifier emission (UTXO consumption)
βββ supply Supply change tracking
βββ state State transition logging
Divisible value transfer. Conservation law: sum(balances) = supply. Every operation that changes a balance must preserve total supply (except mint and burn, which adjust it).
std.coin
βββ account Account leaf (10 fields: account_id, balance, nonce, auth_hash,
β β lock_until, controller, locked_by, lock_data, reserved x2)
β βββ create Account creation with initial balance
β βββ read Account field access
β βββ validate Account leaf invariant checking
βββ ops PLUMB operations for coins
β βββ pay Transfer: debit sender, credit receiver, preserve sum
β βββ lock Time-lock: extend lock_until, set locked_by
β βββ update Config update: admin-only, rehash config
β βββ mint Create value: credit recipient, increase supply
β βββ burn Destroy value: debit holder, decrease supply
βββ conservation Supply conservation enforcement
β βββ check Verify sum(inputs) = sum(outputs) Β± mint/burn
β βββ supply Global supply tracking (supply tree)
βββ metadata Token metadata
β βββ name Token name and symbol
β βββ decimals Decimal precision
β βββ supply_cap Maximum supply (if capped)
βββ events Coin-specific events
βββ transfer Balance transfer event
βββ mint Supply increase event
βββ burn Supply decrease event
See TSP-1 Coin reference for the complete specification.
Unique asset ownership. Conservation law: owner_count(id) = 1. Every asset has exactly one owner at all times.
std.card
βββ asset Asset leaf (10 fields: asset_id, owner_id, nonce, auth_hash,
β β lock_until, collection_id, metadata_hash, royalty_bps, creator_id, flags)
β βββ create Asset creation at mint
β βββ read Asset field access
β βββ validate Asset leaf invariant checking
βββ ops PLUMB operations for cards
β βββ pay Transfer ownership: change owner_id, enforce royalties
β βββ lock Time-lock: extend lock_until
β βββ update Metadata update: change metadata_hash (if UPDATABLE flag set)
β βββ mint Create asset: assign asset_id, owner, creator, flags (permanent)
β βββ burn Destroy asset: remove from tree (if BURNABLE flag set)
βββ flags Asset capability flags (set at mint, immutable)
β βββ TRANSFERABLE Can be transferred (bit 0)
β βββ BURNABLE Can be burned (bit 1)
β βββ UPDATABLE Metadata can change (bit 2)
β βββ LOCKABLE Can be time-locked (bit 3)
β βββ MINTABLE Collection can mint more (bit 4)
βββ collection Collection management
β βββ create Create collection with config
β βββ metadata Collection-level metadata
β βββ supply Collection supply tracking
βββ events Card-specific events
βββ transfer Ownership transfer event
βββ metadata Metadata update event
βββ mint Asset creation event
βββ burn Asset destruction event
See TSP-2 Card reference for the complete specification.
Skills are composable packages that teach tokens new behaviors through the PLUMB hook system. The std.skill module ships 23 official skill implementations with the compiler. Each skill is importable Trident source β developers can use them directly, fork and customize, or deploy modified versions to Atlas.
Three usage modes for any skill:
- Import:
use std.skill.liquidityβ inline the skill code at compile time - Fork: Copy the source, modify it, compile your own version
- Deploy: Publish a compiled skill to the OS's Atlas registry, reference it by content hash or name in token config hooks
std.skill
βββ core Skills most tokens want
β βββ supply_cap Fixed maximum supply
β βββ delegation Authorized third-party operations
β βββ vesting Time-released token distribution
β βββ royalties Creator royalties on Card transfers
β βββ multisig Multi-signature authorization
β βββ timelock Time-delayed operations
βββ financial DeFi capabilities
β βββ liquidity Automated market making (TIDE)
β βββ oracle Price feed integration (COMPASS)
β βββ vault Yield-bearing token wrappers
β βββ lending Collateralized lending
β βββ staking Stake-for-reward mechanisms
β βββ stablecoin Peg maintenance
βββ access Compliance and permissions
β βββ compliance Whitelist/blacklist enforcement
β βββ kyc_gate KYC verification gate
β βββ transfer_limits Per-transaction and periodic limits
β βββ controller_gate Institutional custody controls
β βββ soulbound Non-transferable binding
β βββ fee_on_transfer Automatic fee collection
βββ composition Cross-token interaction
βββ bridging Cross-OS asset bridging
βββ subscription Recurring payment streams
βββ burn_to_redeem Burn one token to receive another
βββ governance Voting and proposal systems
βββ batch Atomic multi-operation bundles
See the Skill Library for detailed specifications of all 23 skills, recipes, and proof composition architecture.
Neural network primitives. Everything is field arithmetic. Everything is provable.
std.nn
βββ layer Neural network layers
β βββ linear Dense layer: y = Wx + b over F_p
β βββ conv1d 1D convolution
β βββ conv2d 2D convolution
β βββ depthwise_conv Depthwise separable convolution
β βββ embedding Token embedding (lookup table)
β βββ positional Positional encoding over F_p
β βββ recurrent GRU/LSTM cells (bounded unroll)
β
βββ attention Transformer components
β βββ scaled_dot_product Core attention: softmax(QK^T/βd)V
β βββ multi_head Multi-head attention
β βββ causal_mask Causal masking for autoregressive models
β βββ flash Memory-efficient attention (chunked)
β βββ cross Cross-attention (encoder-decoder)
β βββ rotary Rotary position embeddings (RoPE) in F_p
β
βββ activation Nonlinear activation functions
β βββ relu ReLU via lookup table
β βββ gelu GELU via lookup table
β βββ silu SiLU/Swish via lookup table
β βββ softmax Softmax via field exp + normalization
β βββ sigmoid Sigmoid via lookup table
β βββ tanh Tanh via lookup table
β βββ tip5_sbox Tip5 S-box as activation (crypto-native)
β βββ custom User-defined lookup table activation
β
βββ norm Normalization layers
β βββ layer_norm LayerNorm: (x - ΞΌ) / Ο in F_p
β βββ batch_norm BatchNorm with running statistics
β βββ rms_norm RMSNorm (simpler, used in LLaMA)
β βββ group_norm GroupNorm
β
βββ loss Loss functions
β βββ cross_entropy Cross-entropy over F_p
β βββ mse Mean squared error
β βββ mae Mean absolute error
β βββ kl_divergence KL divergence
β βββ contrastive Contrastive loss (for embeddings)
β
βββ optim Optimizers (training in F_p)
β βββ sgd Stochastic gradient descent
β βββ adam Adam optimizer over F_p
β βββ rmsprop RMSprop
β βββ schedule Learning rate scheduling
β βββ gradient Gradient computation
β βββ backprop Standard backpropagation
β βββ param_shift Parameter shift rule (for quantum layers)
β βββ finite_diff Finite difference (for non-differentiable layers)
β
βββ model Pre-built model architectures
β βββ mlp Multi-layer perceptron
β βββ cnn Convolutional neural network
β βββ transformer Transformer (encoder, decoder, enc-dec)
β βββ diffusion Diffusion model components
β βββ gnn Graph neural network
β βββ gcn Graph Convolutional Network
β βββ gat Graph Attention Network
β βββ message_pass Generic message passing
β
βββ data Data handling for ML
β βββ dataset Dataset abstraction (bounded iteration)
β βββ batch Batching with padding
β βββ augment Data augmentation (deterministic, provable)
β βββ tokenize Tokenization (BPE, WordPiece) in F_p
β
βββ onnx ONNX interoperability
βββ import ONNX β Trident model
βββ export Trident model β ONNX
βββ ops ONNX operator mappings
βββ supported Operator support matrix
βββ custom Custom operator registration
Zero-knowledge privacy primitives. Not just "ZK proofs" β a complete toolkit for building private applications.
std.private
βββ witness Private data management
β βββ inject Inject private witness (wraps divine())
β βββ constrain Constrain witness values
β βββ range_proof Prove value in range without revealing it
β βββ membership Prove set membership without revealing element
β
βββ identity Identity and credential systems
β βββ credential Anonymous credential issuance and verification
β βββ selective_disclose Reveal only specific attributes
β βββ age_proof Prove age > threshold without revealing DOB
β βββ identity_commit Commit to identity without revealing it
β βββ revocation Credential revocation (via accumulators)
β
βββ transaction Private value transfer
β βββ utxo UTXO-based private transactions
β βββ nullifier Nullifier management (prevent double-spend)
β βββ amount_hiding Hidden transaction amounts
β βββ sender_hiding Hidden sender identity
β βββ receiver_hiding Hidden receiver identity
β βββ script_hiding Hidden lock/type scripts
β
βββ computation Private computation patterns
β βββ blind Blind computation (compute on data you can't see)
β βββ mpc Multi-party computation building blocks
β β βββ secret_share Secret sharing over F_p
β β βββ threshold Threshold schemes
β β βββ garbled Garbled circuit components
β βββ auction Private auction protocols
β β βββ sealed_bid Sealed-bid auction
β β βββ vickrey Second-price auction
β β βββ combinatorial Combinatorial auction
β βββ voting Private voting
β βββ ballot Ballot creation and encryption
β βββ tally Verifiable tallying
β βββ eligibility Voter eligibility proofs
β
βββ data Private data operations
β βββ private_set_ops Private set intersection, union, difference
β βββ private_compare Compare private values (>, <, ==)
β βββ private_aggregate Aggregate private data (sum, mean without revealing individual values)
β βββ private_search Search over private data (index without revealing query)
β
βββ compliance Regulatory compliance with privacy
β βββ audit_trail Auditable but private transaction history
β βββ selective_audit Allow auditor to see specific fields only
β βββ threshold_report Report when aggregate exceeds threshold
β βββ sanctions_check Prove address not on sanctions list (without revealing address)
β
βββ proof Proof management
βββ compose Proof composition (combine multiple proofs)
βββ recursive Recursive proof (proof of proof)
βββ aggregate Aggregate multiple proofs into one
βββ selective Selective disclosure from existing proof
Quantum computing primitives with dual compilation: classical simulation (Triton VM + STARK) and quantum execution (Cirq/hardware).
std.quantum
βββ state Quantum state management
β βββ qstate Qstate<N, D> type (amplitudes in F_{p^2})
β βββ init State initialization (|0β©, uniform, custom)
β βββ normalize State normalization
β βββ fidelity State fidelity computation
β βββ entropy Von Neumann entropy
β βββ partial_trace Partial trace (reduce subsystem)
β
βββ gate Quantum gate library
β βββ pauli Generalized Pauli gates (X, Z for prime dim)
β βββ hadamard Generalized Hadamard (QFT on single qudit)
β βββ phase Phase gates (parametrized)
β βββ rotation Rotation gates (arbitrary axis)
β βββ controlled Controlled gates (arbitrary control values)
β βββ swap SWAP and sqrt-SWAP
β βββ toffoli Generalized Toffoli (multi-controlled)
β βββ custom User-defined unitary (matrix specification)
β
βββ circuit Circuit construction and manipulation
β βββ builder Circuit builder API
β βββ compose Sequential composition
β βββ parallel Parallel composition (tensor product)
β βββ inverse Circuit inversion (adjoint)
β βββ control Add control qudits to existing circuit
β βββ optimize Gate cancellation, commutation, fusion
β βββ depth Circuit depth analysis
β
βββ measure Measurement
β βββ computational Measurement in computational basis
β βββ arbitrary Measurement in arbitrary basis
β βββ partial Measure subset of qudits
β βββ expectation Expectation value of observable
β βββ sample Repeated sampling (divine()-based)
β
βββ algorithm Standard quantum algorithms
β βββ qft Quantum Fourier Transform
β βββ grover Grover's search
β β βββ search Basic search
β β βββ amplitude_amp Amplitude amplification (generalized)
β β βββ counting Quantum counting
β βββ phase_est Quantum Phase Estimation
β βββ walk Quantum walks (bridges std.graph)
β β βββ discrete Discrete-time quantum walk
β β βββ continuous Continuous-time quantum walk
β β βββ search Quantum walk search
β βββ shor Shor's factoring (period finding subroutine)
β βββ hhl HHL linear systems algorithm
β βββ swap_test SWAP test (state comparison)
β
βββ chemistry Quantum chemistry
β βββ hamiltonian Molecular Hamiltonian construction
β β βββ molecular Electronic structure Hamiltonians
β β βββ ising Ising model Hamiltonians
β β βββ hubbard Hubbard model
β βββ ansatz Variational circuit ansatze
β β βββ uccsd Unitary Coupled Cluster
β β βββ hardware_eff Hardware-efficient ansatz
β β βββ adapt ADAPT-VQE ansatz construction
β βββ vqe Variational Quantum Eigensolver
β
βββ optimization Quantum optimization
β βββ qaoa QAOA
β β βββ maxcut MaxCut problem
β β βββ portfolio Portfolio optimization
β β βββ scheduling Job scheduling
β βββ quantum_annealing Simulated quantum annealing (classical sim)
β βββ grover_opt Grover-based optimization
β
βββ error Error models and mitigation
β βββ noise_model Depolarizing, dephasing, amplitude damping
β βββ error_correct Qudit error correction codes
β βββ mitigation Error mitigation techniques
β β βββ zne Zero-noise extrapolation
β β βββ pec Probabilistic error cancellation
β β βββ dd Dynamical decoupling
β βββ tomography State tomography (characterize quantum state)
β
βββ compile Compilation backends
βββ simulate Classical state vector simulation
βββ cirq Google Cirq (qutrit/qudit circuits)
βββ quforge QuForge (GPU-accelerated simulation)
βββ hardware Hardware-specific compilation
βββ trapped_ion Innsbruck trapped-ion native gates
βββ supercond Superconducting transmon native gates
βββ photonic Photonic quantum computing
This is where the real power emerges. Each intersection combines two pillars to create capabilities impossible with either alone.
The intersection of intelligence and privacy. Verifiable machine learning where models and/or data remain secret.
std.nn_private
βββ inference Private inference patterns
β βββ private_model Inference with private weights (model IP protected)
β βββ private_input Inference with private data (user privacy)
β βββ private_both Both model and input private
β βββ selective_reveal Reveal specific intermediate values to auditor
β
βββ training Private training
β βββ private_data Train on data prover can see, verifier can't
β βββ federated Federated learning over F_p
β β βββ aggregate Secure aggregation of gradients
β β βββ differential Differential privacy in F_p
β β βββ verify Verify each participant's contribution
β βββ proof_of_training Prove model trained on claimed data/hyperparams
β βββ proof_of_accuracy Prove model achieves claimed accuracy
β
βββ marketplace Model marketplace primitives
β βββ model_commit Commit to model without revealing weights
β βββ accuracy_proof Prove accuracy on test set (test set public or private)
β βββ inference_service On-chain inference with private weights
β βββ payment Pay-per-inference smart contracts
β βββ licensing Proof of model provenance and licensing
β
βββ fairness Provable model fairness
β βββ demographic_parity Prove equal outcomes across groups
β βββ equalized_odds Prove equal error rates across groups
β βββ feature_exclusion Prove protected features not used
β βββ counterfactual Prove decision unchanged if protected attribute changed
β
βββ robustness Provable model robustness
β βββ adversarial_cert Certify no adversarial example within Ξ΅-ball
β βββ backdoor_detect Prove model free of backdoor triggers
β βββ distribution_shift Detect and prove distribution shift
β
βββ explainability Provable explanations
βββ feature_importance Prove which features drove the decision
βββ attention_map Prove attention distribution (for transformers)
βββ counterfactual Prove minimal input change to flip decision
βββ reasoning_trace Full execution trace as explanation (STARK-native)
The intersection of intelligence and quantum computing. Neural networks that leverage quantum mechanical effects.
std.nn_quantum
βββ encoding Classical data β quantum state
β βββ amplitude Amplitude encoding (exponential compression)
β βββ angle Angle encoding (rotation gates)
β βββ basis Basis encoding (computational basis)
β βββ iqp IQP encoding (instantaneous quantum polynomial)
β βββ kernel Quantum kernel feature map
β
βββ layer Quantum neural network layers
β βββ variational Parametrized rotation + entangling
β βββ strongly_entangling Strongly entangling layers
β βββ random Random quantum circuit layers
β βββ convolution Quantum convolution (periodic structure)
β βββ pooling Quantum pooling (measurement + reduction)
β
βββ model Quantum model architectures
β βββ qnn Pure quantum neural network
β βββ hybrid Hybrid classical-quantum model
β β βββ classical_head Classical input β quantum body β classical output
β β βββ quantum_head Quantum input β classical body
β β βββ interleaved Alternating classical and quantum layers
β βββ qkernel Quantum kernel methods
β β βββ qsvm Quantum support vector machine
β β βββ qgpr Quantum Gaussian process regression
β βββ qgan Quantum generative adversarial network
β βββ qbm Quantum Boltzmann machine
β βββ qtransformer Quantum-enhanced transformer
β βββ quantum_attn Quantum attention mechanism
β βββ quantum_ffn Quantum feed-forward network
β
βββ train Quantum model training
β βββ param_shift Parameter shift rule for gradients
β βββ adjoint Adjoint differentiation
β βββ spsa Simultaneous perturbation stochastic approx
β βββ natural_gradient Quantum natural gradient
β βββ barren_plateau Barren plateau detection and mitigation
β
βββ advantage Quantum advantage analysis
β βββ expressibility Circuit expressibility metrics
β βββ entangling_power Entanglement generation capacity
β βββ classical_shadow Classical shadow tomography for efficiency
β βββ kernel_alignment Quantum vs classical kernel comparison
β
βββ application Domain-specific quantum ML
βββ molecular_property Molecular property prediction
βββ drug_binding Drug-target binding affinity
βββ financial_opt Financial portfolio optimization
βββ graph_classify Graph classification (molecular, social)
βββ anomaly_detect Quantum anomaly detection
The intersection of quantum computing and privacy. Post-quantum protocols, quantum key distribution, quantum-secure computation.
std.quantum_private
βββ qkd Quantum Key Distribution
β βββ bb84 BB84 protocol
β βββ e91 E91 (entanglement-based)
β βββ b92 B92 (simplified)
β βββ sifting Key sifting (matching bases)
β βββ error_est Quantum bit error rate estimation
β βββ privacy_amp Privacy amplification
β
βββ quantum_commit Quantum commitment schemes
β βββ qubit_commit Commitment using quantum states
β βββ string_commit Quantum string commitment
β βββ timed Timed quantum commitment (auto-reveal)
β
βββ quantum_coin Quantum coin flipping
β βββ strong Strong coin flipping
β βββ weak Weak coin flipping
β
βββ quantum_oblivious Quantum oblivious transfer
β βββ one_of_two 1-out-of-2 oblivious transfer
β βββ rabin Rabin oblivious transfer
β
βββ quantum_random Quantum randomness
β βββ qrng Quantum random number generation
β βββ certifiable Certifiable randomness (Bell test + proof)
β βββ beacon Quantum random beacon (on-chain)
β βββ vrf Verifiable random function (quantum-enhanced)
β
βββ pq_crypto Post-quantum classical cryptography
β βββ hash_sig Hash-based signatures (STARK-native)
β βββ lattice Lattice-based constructions
β β βββ kyber Kyber key encapsulation
β β βββ dilithium Dilithium signatures
β βββ code_based Code-based cryptography (McEliece)
β
βββ quantum_mpc Quantum multi-party computation
βββ quantum_secret_share Quantum secret sharing
βββ verifiable_qc Verifiable quantum computation
β βββ blind Blind quantum computing (compute without seeing)
β βββ verified Verified delegated quantum computing
βββ quantum_auction Quantum sealed-bid auction (no-cloning security)
Pre-built application modules that compose foundation, pillars, and intersections.
std.agent
βββ core Agent framework
β βββ perceive Perception: sensor data β features (std.nn)
β βββ reason Reasoning: features β plan (std.nn.attention)
β βββ decide Decision: plan β action (std.nn + std.math.optimization)
β βββ act Action: execute on-chain (std.io)
β βββ prove Proof: entire cycle β STARK
β
βββ policy Policy management
β βββ frozen Frozen policy (weights committed, immutable)
β βββ adaptive Adaptive policy (on-chain learning, proven updates)
β βββ multi_agent Multi-agent coordination (game-theoretic)
β βββ hierarchical Hierarchical policies (meta-policy selects sub-policy)
β
βββ safety Provable agent safety
β βββ constraint Hard constraints on actions (proven in STARK)
β βββ invariant State invariants (never violated)
β βββ budget Resource budgets (gas, value, risk)
β βββ kill_switch Provable shutdown conditions
β
βββ memory Agent memory
β βββ episodic Experience replay (Merkle-authenticated)
β βββ semantic Knowledge base (graph, bridges std.graph)
β βββ working Working memory (bounded, proven)
β
βββ type Agent type specializations
βββ trading DeFi trading agent
βββ keeper Liquidation / maintenance agent
βββ oracle Data oracle agent
βββ governance DAO governance agent
βββ search Knowledge graph search agent (Bostrom)
std.defi
βββ amm Automated market makers
β βββ constant_product xΒ·y = k (Uniswap v2 style)
β βββ concentrated Concentrated liquidity (Uniswap v3 style)
β βββ curve StableSwap curve
β βββ quantum_amm Quantum-optimized liquidity (QAOA pricing)
β
βββ lending Lending protocols
β βββ overcollateral Standard overcollateralized lending
β βββ undercollateral Undercollateralized (requires std.nn credit model)
β βββ liquidation Liquidation logic
β βββ interest Interest rate models over F_p
β
βββ derivatives Derivative instruments
β βββ option Options (Black-Scholes in F_p, or quantum pricing)
β βββ future Futures contracts
β βββ perpetual Perpetual swaps
β βββ exotic Exotic derivatives (quantum Monte Carlo pricing)
β
βββ risk Risk management
β βββ var Value at Risk (std.nn model + std.private)
β βββ stress_test Scenario analysis (proven model execution)
β βββ correlation Correlation analysis (std.math.statistics)
β βββ quantum_risk Quantum-accelerated risk computation
β
βββ compliance DeFi compliance
βββ kyc_private Private KYC (prove identity without revealing it)
βββ aml_check AML screening (private set intersection)
βββ reporting Regulatory reporting (selective disclosure)
βββ audit Auditable private transactions
std.science
βββ chemistry Molecular computation
β βββ molecule Molecular specification
β βββ ground_state Ground state energy (VQE)
β βββ dynamics Molecular dynamics simulation
β βββ binding Binding affinity prediction
β βββ reaction Reaction pathway analysis
β
βββ materials Materials science
β βββ crystal Crystal structure analysis
β βββ band_structure Electronic band structure
β βββ thermal Thermal property computation
β βββ mechanical Mechanical property prediction
β
βββ ecology Ecological modeling
β βββ carbon Carbon absorption modeling
β βββ biodiversity Biodiversity index computation
β βββ population Population dynamics
β βββ network Ecological network analysis (mycorrhizal)
β
βββ climate Climate modeling
β βββ atmospheric Atmospheric chemistry
β βββ ocean Ocean circulation
β βββ land_use Land use change modeling
β
βββ certificate Scientific certificates
βββ carbon_credit Proven carbon credit
βββ biodiversity_token Proven biodiversity assessment
βββ material_spec Proven material specification
βββ drug_candidate Proven pharmaceutical computation
Foundation: 6 modules (field, math, data, graph, crypto, io)
Token: 4 modules (token, coin, card, skill)
Pillars: 3 modules (nn, private, quantum)
Intersections: 3 modules (nn_private, nn_quantum, quantum_private)
Applications: 3 modules (agent, defi, science)
βββββββββββββββββββββββββββββ
Total: 19 modules
Estimated submodules: ~200
Estimated functions: ~2,000
Estimated LoC: ~50,000-100,000
std.agent βββββββΊ std.nn βββββββββββΊ std.field
β β β²
β βΌ β
βββββΊ std.nn_private βββΊ std.private β€
β β β β
β βΌ βΌ β
βββββΊ std.nn_quantum βββΊ std.quantum β€
β β β
β βΌ β
βββββΊ std.quantum_private ββββββββββββ€
β
std.coin ββββββββΊ std.token ββββββββββββββ€
std.card ββββββββΊ std.token β
std.skill.* βββββΊ std.token β
std.token βββββββΊ std.crypto βββββββββββββ€
β
std.defi ββββββββΊ std.coin βββββββββββββββ€
std.card β
β
std.defi ββββββββΊ std.math βββββββββββββββ€
β β
βΌ β
std.science βββββΊ std.data βββββββββββββββ€
β
std.graph ββββββββββββββ€
β
std.crypto βββββββββββββ€
β
std.io βββββββββββββββββ
See Standard Library Design Philosophy for the rationale behind the layer architecture, intersection design, and token infrastructure decisions.