Skip to content

trusts-stack-network/trust-stack-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Trust Stack Network

Trust Stack Network (TSN)

Post-quantum privacy blockchain
Plonky3 STARKs • ML-DSA-65 • Poseidon2 • Shielded Transactions

Version Rust Tests Testnet License

WebsiteWhitepaperWhitepaper PDFDocsBlogExplorerDiscordNetwork Simulation


What is TSN?

Trust Stack Network is a Layer 1 blockchain designed from the ground up for privacy and post-quantum security. Every transaction is shielded by default using zero-knowledge proofs, and all cryptographic primitives are quantum-resistant — protecting funds against both classical and future quantum adversaries.

Key Features

Feature Description
Plonky3 STARKs Next-gen AIR-based zero-knowledge proofs — no trusted setup, truly post-quantum
ML-DSA-65 (FIPS 204) NIST post-quantum digital signatures for all transactions and blocks
SLH-DSA (FIPS 205) Stateless hash-based signatures as secondary post-quantum layer
Poseidon2 ZK-friendly hash function over the Goldilocks field, 3x faster than Poseidon
Shielded Transactions Amounts and addresses hidden by default via ZK commitments and nullifiers
UTXO Model Bitcoin-inspired unspent transaction outputs with privacy
MIK Consensus Mining Identity Key — Proof of Work with anti-Sybil protection
Kademlia DHT Decentralized peer discovery with gossip-based block propagation

Security Model

TSN is designed to be fully quantum-safe — not just signatures, but the entire transaction privacy stack:

Attack Vector Protection
Forge signatures ML-DSA-65 (NIST PQ standard)
Break ZK proofs Plonky3 STARKs (hash-based, no elliptic curves)
Crack commitments Poseidon over Goldilocks field
Brute force hashes Poseidon2 (256-bit security)
Sybil mining MIK identity bound to blockchain

Mining Identity Key (MIK)

Every miner must register a Mining Identity Key before mining:

  • Derived from their ML-DSA-65 public key: MIK_ID = SHA-256("TSN_MIK_ID_v1" || pubkey || block_height)
  • One active MIK per public key — prevents Sybil attacks
  • Lifecycle: registration → activation delay (10 blocks) → active → optional expiry/revocation
  • Block signatures verified against the miner's registered MIK

Architecture

┌──────────────────────────────────────────────────────────────────────┐
│                           TSN Node v0.4.0                            │
├──────────────┬──────────────┬──────────────┬─────────────────────────┤
│    Core      │    Crypto    │  Consensus   │        Network          │
│  Block       │  Poseidon2   │  PoW Mining  │  P2P Protocol           │
│  Transaction │  ML-DSA-65   │  MIK Anti-   │  Kademlia DHT           │
│  UTXO State  │  Plonky3 ZK  │    Sybil     │  Gossip & Sync          │
│  Validation  │  SLH-DSA     │  Difficulty   │  Rate Limiting          │
│              │  Nullifiers  │    Adjust    │  Anti-Eclipse            │
├──────────────┴──────────────┴──────────────┴─────────────────────────┤
│  Storage (SledDB)  │  Wallet (Shielded ZK)  │  RPC (REST + JSON-RPC) │
├────────────────────┼────────────────────────┼────────────────────────┤
│  Explorer          │  Faucet (Testnet)      │  Metrics & Health      │
└────────────────────┴────────────────────────┴────────────────────────┘

Cryptography Stack

Layer Primitive Standard Purpose
Signatures ML-DSA-65 FIPS 204 Transaction & block signing
Backup Signatures SLH-DSA (SPHINCS+) FIPS 205 Stateless hash-based fallback
ZK Proofs Plonky3 STARKs (AIR) Shielded transaction validity
Hash Function Poseidon2 PoW mining, Merkle trees, commitments
Field Goldilocks p = 2⁶⁴ - 2³² + 1 ZK-friendly arithmetic
Encryption ChaCha20-Poly1305 RFC 8439 Note payload encryption

Signature Sizes

Parameter ML-DSA-65
Public Key 1,952 bytes
Secret Key 4,032 bytes
Signature 3,309 bytes

Commitment Scheme

Note Commitment = Poseidon(domain=1, value, pk_hash, randomness)
Nullifier       = Poseidon(domain=3, nullifier_key, commitment, position)
Merkle Node     = Poseidon(domain=5, left, right)

Node Types

TSN supports 4 distinct node roles, selectable via --role at startup:

Miner Node (--role miner)

Full node that validates, stores the entire blockchain, relays transactions/blocks, and mines new blocks. Miners must register a Mining Identity Key (MIK) before participating. They earn 85% of the block reward (42.5 TSN per block). This is the default role.

Relay Node (--role relay)

Full node that stores the complete chain and relays blocks/transactions to peers, but does not mine. Relays are the backbone of the network — they ensure fast block propagation via gossip protocol and serve snapshots to new nodes joining via fast-sync. They earn from the 8% relay reward pool distributed proportionally to uptime and bandwidth contributed.

Prover Node (--role prover)

Specialized node that generates Plonky3 zero-knowledge proofs on demand for wallets and light clients that lack the computational power to prove transactions locally. Provers expose a /prover/prove endpoint and earn proving fees paid by users per transaction. Ideal for GPU-equipped servers.

Light Client (--role light)

Minimal node that does not store the full chain — it syncs only block headers and verifies transactions using ZK proofs. Designed for mobile wallets and resource-constrained devices. Light clients connect to relay/miner nodes to submit transactions and fetch Merkle witnesses.

Type Stores Full Chain Mines Relays Proves Reward
Miner 85% block reward
Relay 8% relay pool
Prover Proving fees
Light Client

Network

Parameter Value
Default Port 8333
Block Reward 50 TSN
Target Block Time 10 seconds
Difficulty Adjustment Every 10 blocks
Coin Decimals 9 (1 TSN = 10⁹ base units)
Max Spends per Tx 10
Max Outputs per Tx 4
Peer Discovery Kademlia DHT
Block Propagation Gossip protocol

Testnet

The private testnet is live with 5 nodes across Europe:

Node Address
seed-1 seed1.tsnchain.com:9333
seed-2 seed2.tsnchain.com:9333
seed-3 seed3.tsnchain.com:9333
seed-4 seed4.tsnchain.com:9333

Synchronization & Anti-Fork System

TSN implements a robust synchronization protocol designed for fast onboarding of new nodes and resilience against chain forks:

Fast-Sync Protocol (v0.4.0)

New nodes can join the network in minutes instead of hours by downloading a compressed state snapshot from any peer:

┌─────────────┐     GET /snapshot/info      ┌─────────────┐
│  New Node   │ ──────────────────────────>  │  Seed Node  │
│             │     GET /snapshot/download   │             │
│  --fast-sync│ <────────────────────────── │  (gzip)     │
│             │                              │             │
│  Load state │     GET /blocks?from=N       │             │
│  Sync rest  │ ──────────────────────────>  │             │
└─────────────┘                              └─────────────┘
  1. New node requests a gzip-compressed state snapshot from a peer
  2. Loads the snapshot directly into memory (V2 Goldilocks Merkle tree)
  3. Syncs only the missing blocks since the snapshot height
  4. Ready to mine in under 5 minutes (vs. 2+ hours full replay)

Heaviest Chain Fork Choice

TSN uses cumulative proof-of-work (sum of all block difficulties) to select the canonical chain — not simply the longest chain. This prevents low-difficulty spam attacks and mirrors Bitcoin Core's proven approach.

Anti-Fork Protections

Protection Description
Heaviest chain rule Fork choice based on cumulative work, not height
MAX_REORG_DEPTH = 100 Hard limit — no reorg deeper than 100 blocks regardless of work
Checkpoint finality Every 100 blocks, a checkpoint is created — no reorg beyond it
Anti-Fork Sync Gate Miners must be within 2 blocks of network tip to submit blocks
Genesis hash verification All nodes verify the genesis block hash at startup
Dual Merkle trees V1 (BN254) + V2 (Goldilocks) trees for state integrity

API Overview

Each TSN node exposes a REST API:

Endpoint Description
GET /chain/info Blockchain height, latest hash
GET /block/:hash Get block by hash
GET /block/height/:n Get block by height
POST /tx/v2 Submit shielded V2 transaction
GET /mempool View pending transactions
GET /peers List connected peers
POST /nullifiers/check Verify spent nullifiers
GET /witness/v2/position/:n Get Merkle witness for ZK proof
POST /faucet/claim Claim testnet tokens
GET /sync/status Node sync progress
GET /explorer Built-in block explorer
GET /wallet Built-in web wallet

Codebase

  • 81,000+ lines of Rust
  • 766 unit tests across 99 test executables
  • 270+ source files across 20+ modules
  • 694 commits of active development
  • 5 nodes running on private testnet
  • Written in Rust 2021 edition

Roadmap

Phase 1 — Foundations ✅

Core blockchain engine: blocks, transactions, UTXO, Poseidon2 hashing, ML-DSA-65 signatures, Proof of Work consensus with MIK anti-Sybil, P2P networking with Kademlia DHT, SledDB storage, shielded wallet, JSON-RPC API, block explorer, and testnet faucet.

Phase 2 — Advanced Features ✅

Multi-role nodes ✅ (Miner, Relay, Prover, Light Client with --role CLI flag), Plonky3 STARK migration ✅ (Halo2 removed, AIR-based proofs via p3-uni-stark), browser-based WASM prover ✅ (plonky3-wasm crate), enhanced shielded wallet with viewing keys ✅ (export/import viewing keys, watch-only wallets), and hardened fast-sync with multi-peer snapshot verification.

Phase 3 — Smart Contracts

zkVM (zero-knowledge virtual machine) for executing smart contracts inside ZK proofs. Multi-asset UTXO support, TSN-20 token standard, and Ethereum bridge via light client verification.

Phase 4 — Launch

┌──────────────────────────────────────────────────────────────────┐
│                                                                  │
│  APRIL 2026          MAY — JULY 2026            Q3 2026          │
│  ───────────         ──────────────────         ────────         │
│                                                                  │
│  ┌──────────┐        ┌──────────────────┐       ┌────────────┐  │
│  │ PRIVATE  │───────>│   INCENTIVIZED   │──────>│  MAINNET   │  │
│  │ TESTNET  │        │  PUBLIC TESTNET  │       │  LAUNCH    │  │
│  └──────────┘        └──────────────────┘       └────────────┘  │
│                                                                  │
│  • 5 internal nodes   • Open to everyone        • Genesis block  │
│  • Stress testing     • Bug bounty program      • Fair launch    │
│  • Bug hunting        • Node operator rewards   • No premine     │
│  • Core validation    • Smart contract testing  • Full privacy   │
│  • ZK proof testing   • Security audit          • zkVM live      │
│                       • 2-3 months duration                      │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘

Phase 5 — Post-Mainnet

Gold-backed stablecoin ZST (1 ZST = 1g gold) as an independent Layer 2, with decentralized oracle price feeds and 150% over-collateralization in TSN.

Links

License

Proprietary — source code is not yet public. Open-source release planned for mainnet.

About

Post-quantum privacy blockchain — Plonky2 STARKs · ML-DSA-65 · Poseidon2 · Shielded Transactions · 81k+ lines of Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors