Technology Architecture

Mesh Relationship Entanglement (MRE)

Traditional blockchains process transactions in sequential blocks, creating inevitable throughput ceilings. Even with larger blocks or faster block times, sequential processing limits scalability. Meshchain replaces this linear architecture with a directed acyclic graph (DAG) where transactions form a mesh of dependencies.

How MRE Works

Each transaction references previous transactions through their outputs (mUTXOs). These references create dependency relationships called "entanglements." Unlike a blockchain where all transactions must wait for the previous block, MRE allows independent transactions to process in parallel.

Mathematical Foundation: For transactions t₁ and t₂, an entanglement relation E(t₁, t₂) exists when transaction t₂ consumes an output created by t₁. The entanglement depth d(t) is the minimum path length from any genesis transaction to t, with a required minimum of d ≥ 3 for security.
Parallel Processing

Multiple committees can validate different transactions simultaneously when those transactions don't share dependencies. A payment from Alice to Bob can process in parallel with a payment from Charlie to Diana, as long as they consume different mUTXOs.

  • Transactions route to committees based on sender address (H1 header)
  • Each committee processes independently without cross-coordination
  • Throughput scales O(log n) as committees are added
  • No global lock or serialization bottleneck
Scaling Mathematics

With k committees, maximum throughput follows: T_max = k × (1/t_consensus) × η, where t_consensus is consensus time (13-14ms empirically) and η ≈ 0.8 accounts for coordination overhead. For 100 committees with 13ms consensus: T_max ≈ 100 × 76.9 × 0.8 ≈ 6,152 TPS per committee scaling group, with multiple groups operating in parallel.

Entangled Committee Protocol (ECP)

The Entangled Committee Protocol provides Byzantine Fault Tolerant consensus with empirically validated 13-14ms finality. Unlike proof-of-work mining or proof-of-stake that can be reorganized, ECP provides deterministic finality: once a transaction receives sufficient committee votes, it cannot be reversed.

Byzantine Fault Tolerance

For a committee of size n, the system tolerates up to f = ⌊(n-1)/3⌋ malicious nodes. A transaction requires ⌈(2n+1)/3⌉ votes to finalize. With an 8-member committee, at most 2 nodes can be Byzantine while still reaching consensus with 6+ votes.

Committee Size Max Byzantine Nodes Required Votes
8 members 2 (25%) 6 votes
16 members 5 (31%) 11 votes
32 members 10 (31%) 22 votes
Fair Selection Algorithm

Committee members are selected using a performance-based algorithm rather than stake-weighted selection. This prevents "whale domination" where large stakeholders control consensus.

Selection score: Score = 0.5 × Reputation + 0.3 × Uptime + 0.2 × Random(epoch)

  • Reputation (50%): Past performance, blocks proposed, votes cast
  • Uptime (30%): Network availability and reliability
  • Randomness (20%): Deterministic randomness using epoch seed

All committee nodes stake the same 5-gram amount. Performance matters more than stake size, creating equal opportunity for consistent operators.

Backup Proposer Architecture

Each committee maintains exactly 3 backup proposers with full state synchronization. If the primary proposer fails health checks (missed heartbeats), a backup automatically promotes to primary within 2 heartbeat intervals plus consensus timeout. This eliminates single points of failure.

Lightweight Voting

Committee votes are approximately 200 bytes each, containing:

  • Transaction ID being voted on
  • Proposer address (prevents vote replay across proposers)
  • Session nonce (prevents vote replay across transactions)
  • Vote decision (approve/reject)
  • Recoverable ECDSA signature (65 bytes)

This compact format enables rapid vote collection over the Committee Channel, contributing to the 13-14ms consensus time.

mUTXO State Model

The Mesh Unspent Transaction Output model extends Bitcoin's UTXO concept with multi-currency support and complete provenance tracking. Each mUTXO represents a specific amount of a specific currency owned by a specific address, with full ancestry back to the genesis transactions.

Structure

An mUTXO contains:

  • Transaction ID: The transaction that created this output
  • Output Index: Position within the creating transaction (0-based)
  • Recipient Address: Who can spend this output
  • Currency Code: Which currency (e.g., meshau79, meshusd)
  • Amount: Value in nano units
  • Entanglement Depth: Distance from genesis transactions
Multi-Currency Native Support

Unlike token standards that exist as smart contracts (ERC-20, SPL), Meshchain treats multiple currencies as protocol-level features. A single transaction can consume mUTXOs in different currencies and produce outputs in different currencies, enabling atomic multi-currency swaps.

Example Transaction: Alice sends 100 meshusd to Bob and receives 150 meshsgd from Bob in a single atomic transaction. Either both sides complete or neither does—no settlement risk.
Validation Benefits

The mUTXO model enables several validation optimizations:

  • Parallel Validation: Transactions with disjoint mUTXO sets validate simultaneously
  • Balance Verification: Per-currency balance checks prevent overspending
  • Double-Spend Prevention: Consumed mUTXOs are immediately marked, reuse attempts fail
  • Complete Audit Trail: Every unit of currency traceable from genesis
Automated UTXO Consolidation

To prevent fragmentation (many small mUTXOs), the transaction processor intentionally includes excess small inputs when constructing transactions. The change output consolidates these into a larger mUTXO, gradually optimizing the UTXO set over time without user intervention.

QUIPU Serialization Protocol

QUIPU (Quick Payload Unified) is a custom deterministic binary serialization format designed specifically for distributed ledger consensus. It achieves 46% faster performance with 12% smaller size compared to FlatBuffers while guaranteeing 100% deterministic encoding.

Why Custom Serialization?

Distributed ledger consensus requires that identical data structures always produce identical byte sequences, even after database storage and reconstruction. Many general-purpose serialization formats (JSON, MessagePack) don't guarantee this. QUIPU was designed to ensure signature verification works correctly after data passes through the database.

Wire Format

Structure: [Magic:2][Version:1][Fields...][End:1]

  • Magic bytes: [0x51][0x50] (ASCII "QP")
  • Version: 0x01 for standard QUIPU
  • Fields: Type-length-value encoding
  • End marker: 0xFF
Type System
Type Code Size
Bool 0x01 1 byte
U64 0x05 8 bytes (little-endian)
Address24 0x10 24 bytes (MeshAddress)
Hash32 0x12 32 bytes (SHA3-256)
Signature65 0x14 65 bytes (ECDSA with recovery)
String 0x21 Length prefix + UTF-8 data
Performance

Rust Implementation (Backend):

  • Encoding: 2.0-3.5 GB/s
  • Decoding: 3.0-4.2 GB/s
  • Zero-copy deserialization
  • 50,000+ transactions/second

TypeScript Implementation (Frontend):

  • Encoding: 800MB-1.2 GB/s (V8 engine)
  • Decoding: 1.0-1.5 GB/s
  • 2-5% size overhead for typical transactions
Extended Type System

QUIPU supports specialized types for financial and distributed ledger applications:

Category Types Use Cases
Temporal Timestamp (0x19), Duration (0x1A) Transaction timing with nanosecond precision and timezone handling
Algebraic Enum (0x29), Tuple (0x2A), Result (0x2B) Complex data structures for smart contracts and transaction states
Extended Primitives I8-I128, U8-U128, F32, F64 Precision arithmetic for financial calculations
Cryptographic PublicKey33, PrivateKey32, Uuid, Decimal128 High-precision currency values and key management
Layered Architecture

QUIPU separates transport and application layers. The transport layer handles automatic encoding, efficient network propagation, and direct storage. The application layer provides native data types for business logic, allowing developers to work with high-level constructs while QUIPU handles serialization details.

This separation improves performance by avoiding redundant conversions, increases code clarity by removing manual encoding logic, and provides flexibility to optimize transport independently from application code.

QuipuExtractor

For high-throughput validation, QUIPU includes QuipuExtractor, a component that accesses sub-structures without deserializing entire messages. This single-pass extraction with zero-copy access is particularly useful in committee consensus where validators need to verify specific fields rather than process complete transactions.

  • Extract specific fields without full deserialization
  • Zero-copy access reduces memory allocation
  • Schema-aware navigation of composite structures
  • Optimized for validation pipelines
Schema Registry

QUIPU maintains a schema registry system with defined ID ranges for different message categories. Core schemas (0x30-0x3F) handle fundamental types, while extended schemas (0x40-0x4F) support detailed structures for specialized applications. This registry ensures cross-language compatibility through canonical field ordering, allowing messages serialized in Rust to be correctly read by TypeScript clients and vice versa.

Pre-Encoded Data Optimization

Committee consensus benefits from pre-encoded data handling. When a transaction reaches the committee, validators can embed the already-encoded QUIPU payload directly without re-encoding. This zero-copy propagation reduces committee consensus latency by 30-40%, particularly during peak transaction volumes when every millisecond counts.

Security Architecture

Cryptographic Foundations

Meshchain uses industry-standard cryptographic primitives:

  • Elliptic Curve: secp256k1 (same as Bitcoin)
  • Hash Function: SHA3-256 (Keccak)
  • Signature Scheme: ECDSA with public key recovery
  • Address Encoding: Bech32m with checksums
Address Derivation

Addresses are derived from public keys using SHA3-256 hash, taking the first 20 bytes and encoding with Bech32m. Prefixes indicate address type:

  • mc1: Standard user addresses
  • sc1: Smart contract addresses
  • cm1: System addresses (cannot be transaction senders)

Address collision probability: 2⁻¹⁶⁰ (160-bit address space).

Multi-Layer Fraud Detection

Transactions pass through three validation tiers:

Tier 0 (ACP Structure): Validates Account Change Package structure, proposer signature, and committee vote count. Failed validation = immediate rejection without further processing.

Tier 1 (TXR Authenticity): Validates transaction receipt signatures, sender authorization, and transaction integrity. Checks that all required signatures are present and valid.

Tier 2 (5-Generation Lineage): Validates entanglement depth, checks ancestry from genesis transactions, ensures minimum depth requirement (d ≥ 3). This prevents fabricated transaction chains.

Double-Spend Prevention

Multiple mechanisms prevent double-spending:

  • Each mUTXO can only be consumed once (atomic consumption)
  • Consumed mUTXOs are immediately marked in the database
  • Byzantine Fault Tolerant consensus requires 2/3+ committee approval
  • Reuse attempts are cryptographically detectable and rejected
Sybil Attack Resistance

The protocol resists Sybil attacks through multiple mechanisms:

  • Committee Stake: 5-gram requirement for consensus participation
  • Connection Limits: Maximum 1 connection per peer (prevents multiplication)
  • Rate Limiting: Per-node request frequency caps (10 tx/min, 100 queries/min)
  • Reputation System: Five-tier tracking with automatic banning for abuse
  • Economic Reality: Running nodes costs bandwidth/compute with no direct revenue
Reentrancy Protection

The mUTXO model eliminates reentrancy vulnerabilities that plague account-based systems:

  • No shared state between contracts
  • Atomic state transitions finalize before new operations
  • State changes cannot be recursively triggered
  • Circular dependency detection at the protocol level

Smart Contracts Platform

The Mesh Contracts Platform (MCP) provides smart contract execution with two deployment models: native contracts written in Rust and custom contracts compiled to WebAssembly.

Native Contracts

Pre-compiled contracts for common financial operations:

  • MeshEscrow: Trustless escrow with multi-signature support
  • MeshDrip: Token vesting and scheduled releases
  • MeshDEX: Decentralized exchange with atomic swaps
  • MeshToken: Enhanced token functionality beyond base protocol
WebAssembly Execution

Custom contracts compile to WebAssembly for deterministic execution:

  • Write contracts in Rust, C++, or any language targeting WASM
  • Deterministic execution environment (no system calls, no time functions)
  • Gas metering for resource control
  • Memory isolation between contract executions
Gas System

Gas fees are dynamically calculated based on network load and converted to MeshGold:

gas_fee_nano = gas_used × gas_price_per_unit

The gas price adjusts with network load: when utilization exceeds 80%, prices increase exponentially to prevent congestion. Below 60% utilization, prices remain at the base level.

Token Rules System

Tokens can be configured with programmable rules that execute automatically:

Transfer Restrictions: Amount limits, daily quotas, address whitelists/blacklists, time locks

Economic Rules: Tax collection, burn mechanisms, fee redistribution

Temporal Controls: Cliff periods, linear vesting schedules, scheduled releases

Network Features: Trust score requirements, entanglement depth validation

State Management

Smart contracts maintain state through the mUTXO model:

  • Contract state stored in mUTXOs owned by contract address (sc1 prefix)
  • State changes create new mUTXOs, consuming old ones atomically
  • Parallel execution possible for contracts with disjoint mUTXO sets
  • Complete state history traceable through mUTXO ancestry

Performance Validation

The theoretical performance model has been validated through production infrastructure testing with 30+ nodes. All metrics are empirically measured, not projected.

Component Measurement Test Configuration
BFT Consensus 13-14ms 8-member committee, 10,000+ transactions
Network Propagation <5 seconds (100%) Complete network (90% in <1 second)
Committee Formation 47 seconds 30-node network from cold start
Node Synchronization 10 minutes (operational) New node to validator status
QUIPU Encoding 2.0-3.5 GB/s Rust backend implementation

These measurements demonstrate that Meshchain achieves the performance characteristics needed for enterprise stablecoin infrastructure: sub-second finality, predictable costs, and unlimited horizontal scaling potential.