Layer 8 of the Mathematical Defense Layer (MDL) for Trinity Protocol
"Mathematically Proven. Hardware Protected."
Trinity Shield™ is a production-ready Rust implementation of hardware-isolated security for multi-chain consensus validators. It provides three integrated defense layers running inside Intel SGX/AMD SEV trusted execution environments.
┌─────────────────────────────────────────────────────────────┐
│ TRINITY SHIELD™ │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
│ │ PERIMETER SHIELD│ │APPLICATION SHIELD│ │ DATA SHIELD │ │
│ │ │ │ │ │ │ │
│ │ • Rate Limiting │ │ • Auth (Multi- │ │ • AES-256- │ │
│ │ • DDoS Protect │ │ chain sigs) │ │ GCM Enc │ │
│ │ • IP Filtering │ │ • Authorization │ │ • Key Seal │ │
│ │ • Request Valid │ │ • Input Valid │ │ • Integrity │ │
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ CONSENSUS ENGINE │
│ 2-of-3 Multi-Chain Consensus (Lean-Proven) │
├─────────────────────────────────────────────────────────────┤
│ ATTESTATION SERVICE │
│ SGX Remote Attestation (DCAP/EPID) │
└─────────────────────────────────────────────────────────────┘
- Rate Limiting: Token bucket algorithm with per-source tracking
- DDoS Protection: Circuit breaker pattern with exponential backoff
- IP Filtering: Allowlist/blocklist with CIDR support
- Request Validation: Size limits, injection detection, format validation
- Multi-Chain Authentication: Ed25519 (Solana), Secp256k1 (Arbitrum), Dilithium5 (TON)
- Role-Based Authorization: Capability tokens with expiry
- Session Management: Secure session handling with timeouts
- Input Validation: Schema validation, address format checking
- Encryption: AES-256-GCM and ChaCha20-Poly1305
- Key Sealing: Hardware-bound keys (MRENCLAVE/MRSIGNER policy)
- Integrity: Merkle proofs and HMAC verification
- Key Management: Rotation, wrapping, and hierarchical derivation
- 2-of-3 Voting: Byzantine fault-tolerant consensus
- Lean-Proven Rules: Operations validated against formal proofs
- Multi-Chain: Arbitrum (security), Solana (monitoring), TON (recovery)
- Replay Protection: Nonce tracking and operation timeouts
- Remote Attestation: SGX quote generation and verification
- DCAP Support: Local verification without Intel dependency
- Quote Caching: Automatic refresh before expiry
cargo build --releasecargo build --release --features sgx --target x86_64-fortanix-unknown-sgxcargo build --release --features simulationuse trinity_shield::{TrinityShield, ShieldConfig, ChainId};
// Create shield for Arbitrum validator
let config = ShieldConfig::for_chain(ChainId::Arbitrum);
let shield = TrinityShield::new(config)?;
// Process incoming request
let validated = shield.process_request(&request_bytes, &source)?;
// Sign a consensus vote
let signed_vote = shield.sign_vote(&operation)?;
// Generate attestation for on-chain verification
let attestation = shield.generate_attestation()?;Trinity Shield operates on a zero-trust model:
- Defense in Depth: Three independent security layers
- Hardware Isolation: Keys sealed to SGX enclave
- Fail-Secure: All failures default to rejection
- Audit Trail: All operations logged (without sensitive data)
- Quantum Resistance: TON chain uses ML-KEM-1024 and Dilithium-5
Trinity Shield's consensus rules are formally verified using Lean 4:
- 58 of 78 theorems proven (74% complete)
- Operation validation rules match Lean specifications
- Continuous verification in CI pipeline
See TRINITY_SHIELD_LEAN_INTEGRATION.md for details.
Run benchmarks:
cargo bench --features stdExpected performance on modern hardware:
- SHA-256 (1KB): ~150 MB/s
- AES-256-GCM (1KB): ~1 GB/s (with AES-NI)
- Rate limiter check: ~5M ops/sec
- Signature verification: ~15K ops/sec
# Unit tests
cargo test
# With coverage
cargo tarpaulin --out HtmlMIT License - See LICENSE
| Contract | Address | Status |
|---|---|---|
| TrinityShieldVerifierV2 | 0x5E1EE00E5DFa54488AC5052C747B97c7564872F9 |
V2.2 (Active) |
| TrinityShieldVerifier | 0x2971c0c3139F89808F87b2445e53E5Fb83b6A002 |
DEPRECATED |
| TrinityConsensusVerifier | 0x59396D58Fa856025bD5249E342729d5550Be151C |
Active |
Explorer: View V2.2 on Arbiscan
Note: TrinityShieldVerifier V1 is deprecated. Use TrinityShieldVerifierV2 for all new integrations.
- Attestation Validity: 24 hours
- Max Quote Age: 10 minutes
- Approved Enclaves: v1.0.0, v1.0.1-arbitrum, v1.0.1-solana, v1.0.1-ton
See TRINITY_SHIELD_ROADMAP.md for development phases:
- Phase 1 ✅ Foundation (SGX enclave, attestation library)
- Phase 2 ✅ Integration (deployment, configuration)
- Phase 3 🔄 Production (hardware, security audit)
- Phase 4 📋 Expansion (AMD SEV, community validators)
- Website: https://chronosvault.org
- Documentation: https://docs.chronosvault.org
- GitHub: https://github.com/Chronos-Vault/trinity-shield
- Contact: chronosvault@chronosvault.org
Trinity Shield™ is part of the Trinity Protocol by ChronosVault.