Smart India Hackathon 2026 — Problem Statement 26194 (Student Innovation: Blockchain & Cybersecurity)
"Don't trust the database. Verify the proof."
TRUSTGRID is a sector-agnostic institutional trust infrastructure built around the Trust Object Protocol (TOP). TOP provides a common model for creating, signing, anchoring, verifying, revoking, and auditing digital and physical trust objects.
Instead of putting sensitive information on-chain, TRUSTGRID keeps sensitive data off-chain and anchors cryptographic proofs, provenance, status, and audit references to a tamper-evident blockchain ledger.
The same verification infrastructure is demonstrated across four sectors: academic credentials, pharmaceutical provenance, digital forensic evidence, and critical device integrity.
One trust protocol. Four sectors. One verification engine.
Today, every major economic sector operates an isolated, fragile island of trust:
- Universities maintain opaque academic degree databases susceptible to SQL injection and insider forgery.
- Pharmaceutical and manufacturing supply chains struggle with adulterated batches and counterfeit products injected during distributor transit.
- Law enforcement and judiciaries face digital evidence spoliation challenges where CCTV files or digital records cannot provably demonstrate an unbroken chain of custody.
- Cybersecurity teams struggle to establish tamper-evident cryptographic baselines for critical infrastructure devices and SCADA endpoints.
TRUSTGRID solves this structural vulnerability not by creating four unrelated applications, but by inventing a unified, sector-agnostic protocol: the Trust Object Protocol (TOP).
TRUSTGRID does not claim to invent blockchain-based digital credentials, public key infrastructure (PKI), or hash-linked ledgers. Foundational research, open standards, and sector-specific tools exist across individual verticals:
| Sector | Existing Prior Art / Standards | Scope & Architectural Focus | What They Lack vs. TRUSTGRID TOP |
|---|---|---|---|
| 🎓 Education | Blockcerts (MIT), OpenCerts (GovTech Singapore) | Single-institution academic diplomas, Ethereum / W3C VC JSON-LD schemas. | Confined to academic transcripts. Lacks generic multi-hop provenance graphs, on-chain revocation accumulators, cross-sector composability, and active risk scoring. |
| 📦 Supply Chain | TradeTrust (IMDA Singapore), IBM Food Trust | Electronic Bills of Lading (eBL), EPCIS shipping events, Hyperledger Fabric/Ethereum. | Trade-document or cold-chain specific data structures. Incompatible with identity passports or device integrity baselines. |
| ⚖️ Legal Evidence | OpenAttestation, Guardian Evidence | PDF/document attestation, notarized digital file timestamping. | Point-in-time timestamping without verifiable custodian handover graphs or dynamic spoliation alert engines. |
| 🛡️ Cybersecurity | Sigstore (Linux Foundation), in-toto, SLSA | Software supply chain artifact signing, Rekor transparency log. | Focused on developer binary artifacts (containers, Git commits). Not designed for institutional assets, physical custody, or non-technical verifiable credentials. |
Existing standards are vertical-specific silos: an organization managing university degrees, physical pharmaceuticals, legal evidence, and SCADA infrastructure firmware must currently deploy, operate, and audit four completely separate cryptographic stacks, schemas, and verification clients.
TRUSTGRID introduces the Trust Object Protocol (TOP) as a universal, sector-agnostic institutional abstraction layer:
- Universal Trust Object (TO) Envelope: A single canonical JSON schema (RFC 8785) wrapping identity, payload content hash, dual Ed25519 signatures, Merkle leaf proof, and multi-node consensus endorsements.
- First-Class Provenance Graph: Every Trust Object embeds an immutable, cryptographic chain of custody DAG where each state transition must be counter-signed by the transferring custodian and verified on-chain.
- Cross-Sector Trust Passport: Subjects aggregate credentials across domains into a single portable passport featuring salted attribute commitments for privacy-preserving selective disclosure.
- Deterministic Heuristic Risk Engine: Real-time explainable risk assessment evaluating verification velocity, credential cloning, Sybil DID patterns, and baseline divergence—without black-box ML.
- Decoupled Consensus Substrate: TOP operates identically over a local multi-node consortium prototype (for zero-friction evaluation) and enterprise production backends like Hyperledger Fabric.
TRUSTGRID
│
TRUST OBJECT PROTOCOL (TOP)
│
┌──────────────┼──────────────┐
│ │ │
IDENTITY CRYPTOGRAPHY POLICY
│ │ │
└──────────────┼──────────────┘
│
BLOCKCHAIN TRUST LEDGER (Consortium / Fabric)
│
┌────────┴────────┐
│ │
VERIFICATION PROVENANCE
ENGINE ENGINE
│ │
└────────┬────────┘
│
EXPLAINABLE RISK ENGINE
│
TRUST GRAPH
│
TRUST PASSPORT
│
┌──────────────┼──────────────┐
│ │ │
EDUCATION SUPPLY CHAIN LEGAL
│
CYBERSECURITY
- TOP is the central innovation.
- Blockchain provides the tamper-evident trust substrate.
- The four flagship sectors are real-world validations of the exact same protocol.
Every digital or physical asset registered in TRUSTGRID becomes a tamper-evident, cryptographically verifiable Trust Object:
{
"trustObjectId": "TO-EDU-DEGREE-GENUINE-2024",
"objectType": "CREDENTIAL",
"subjectId": "did:trustgrid:usr:rahul-sharma",
"issuerId": "did:trustgrid:edu:delhi-tech-univ",
"ownerId": "did:trustgrid:usr:rahul-sharma",
"createdAt": "2026-09-07T15:55:00.000Z",
"expiresAt": null,
"contentHash": "e064c5dac4f5219169ae0d09b1b91f8d9094f6a76035f97cc73422061b696176",
"signature": "3Kz...[Ed25519 digital signature]",
"blockchainTxId": "0xaa36adcb54ad8e9b10522e171f689c55b8921b8b795c169797b475ef47aacc79",
"status": "ACTIVE",
"metadata": {
"studentName": "Rahul Sharma",
"degreeName": "Bachelor of Technology in Computer Science & Engineering",
"cgpa": "9.42 / 10.00",
"serialNumber": "DTU-2024-BTECH-0942"
},
"provenance": [
{
"eventId": "EV-001",
"eventType": "CREATION",
"fromDid": "did:trustgrid:edu:delhi-tech-univ",
"toDid": "did:trustgrid:usr:rahul-sharma",
"timestamp": "2026-09-07T15:55:00.000Z",
"signature": "...",
"blockchainTxId": "0xaa36..."
}
],
"version": 1
}When any Trust Object is presented to TRUSTGRID, the exact same verification engine executes:
- Decentralized Identity (DID) Resolution: Resolves issuer DID document and fetches the active Ed25519 public key.
- Canonical Hash Recalculation: Recursively computes the deterministic SHA-256 hash of the presented payload using alphabetical key sorting.
- Cryptographic Signature Verification: Verifies that the issuer's private key signed the original content hash.
- Blockchain Proof Anchor Verification: Audits the ledger for the object's Merkle leaf, block height, and validator notary signature.
- Anti-Tampering Hash Comparison: Compares the recalculated hash with the on-chain registered hash. Any modification flags
TAMPERED. - Revocation & Expiration Status: Checks if a revocation receipt exists on the blockchain ledger or if the validity window has elapsed.
- Provenance Continuity Check: Verifies the cryptographic chain of custody transitions to prevent unauthorized handoffs or counterfeit injection.
-
3-Node Local Consortium Prototype (Current Working State): TRUSTGRID features an inspectable, working 3-node local consortium prototype:
-
Node Alpha (
node-1): Proposer / Leader on port4101 -
Node Beta (
node-2): Validator on port4102 -
Node Gamma (
node-3): Validator on port4103 -
2-of-3 Quorum: Deterministic majority consensus requiring at least 2 valid endorsements before any block is committed (
$Q \ge 2$ ) - Independent Node Processes & Ledgers: Each node runs as an independent process maintaining its own isolated SQLite ledger file and its own Ed25519 identity keypair
- Block Validation & Tamper Rejection: Peer nodes validate candidate block headers, height sequences, and Merkle roots, rejecting any tampered or out-of-sequence proposals
- Offline-Node Tolerance: The cluster maintains operational continuity even when 1 node goes offline
- Synchronization / Catch-Up: Recovering nodes automatically synchronize missing blocks from healthy peers
- Launch nodes individually via
npm run node:1,npm run node:2,npm run node:3, or run the end-to-end consensus demo vianpm run demo:consortium.
-
Node Alpha (
-
Production Deployment Path & Adapter (Hyperledger Fabric): The blockchain substrate is cleanly decoupled through the
BlockchainAdapterinterface. In production enterprise deployments, the application connects to an enterprise Hyperledger Fabric network using Raft crash fault-tolerant ordering and channel-isolated ledgers. The smart contract logic is pre-implemented in Go chaincode (src/core/blockchain/fabric-chaincode/trustgrid_cc.go) and validated with 10 unit tests. -
Consensus Integrity vs. Public Blockchain Overhead: TRUSTGRID is designed for institutional consortia (e.g., Higher Education Consortium, National Pharma Logistics, Inter-Court Judicial Network, National CERT). It deliberately avoids energy-wasting Proof-of-Work or token volatility, employing permissioned deterministic majority endorsement with Ed25519 threshold certificates.
-
Explicit Non-Claims & Engineering Realism:
- No Production Hyperledger Deployment: The current demonstration runs on the working 3-node local consortium prototype; Hyperledger Fabric is the production deployment adapter/roadmap.
- No Fully Decentralized Key Custody: Keypairs for institutions and nodes are managed locally via AES-256-GCM encrypted keystores; enterprise HSM integration is a future production enhancement.
- No Full Decentralized W3C DID Network: DIDs are resolved locally within the consortium using deterministic Ed25519 key registries rather than a global public DID ledger.
- No zk-SNARKs: Privacy-preserving selective disclosure currently utilizes cryptographic salted commitments and SHA-256 attribute blinding; zero-knowledge proofs (Groth16/Circom) are on the future roadmap.
- No Multi-Organization Production Deployment: The current cluster is a multi-node local consortium prototype running across isolated processes on different ports.
Public and consortium blockchains are tamper-evident append-only ledgers. Storing student transcripts, medical specifications, or forensic files directly on-chain violates privacy frameworks (GDPR, India DPDP Act 2023) and creates blockchain bloat:
- Sensitive metadata remains 100% off-chain in encrypted relational stores.
- Only the cryptographic content hash, issuer DID, block timestamp, and status are anchored on-chain.
- Privacy-Aware Trust Passport: Supports selective disclosure architecture where users can cryptographically prove their degree or credential without disclosing GPA, residential coordinates, or financial data.
| Sector | Demonstrated Use Case | What Happens Under Attack | Status Detected |
|---|---|---|---|
| 🎓 Education | Academic Credential Verification | Student name changed from "Rahul" to "Rohan", CGPA falsified from 7.1 to 9.9 | TAMPERED (Content Hash Mismatch) |
| 📦 Supply Chain | Pharmaceutical Product Provenance | Unverified distributor injects counterfeit batch without manufacturer handoff signature | PROVENANCE_MISMATCH (Broken Custody) |
| ⚖️ Legal Evidence | Digital Forensic Evidence Integrity | Video frames edited between 02:14:00 - 02:17:30 | TAMPERED (Spoliation Detected) |
| 🛡️ Cybersecurity | Critical Device Integrity Monitoring | Unauthorized firewall backdoor injected into router firmware | DEVICE_INTEGRITY_COMPROMISED (Critical Baseline Breach) |
Rather than using an opaque LLM chatbot, TRUSTGRID implements an explainable, deterministic 0–100 behavioral anomaly scoring engine that explains the factors contributing to elevated trust risk:
- Duplicate Credential Claim (+30 risk): Same content hash claimed across multiple distinct entity DIDs.
- High Frequency Verification Spike (+20 risk): >6 verification attempts within 15 minutes.
- Content Hash Bit-Flip (+55 risk): Data divergence between off-chain records and on-chain proofs.
- Broken Provenance Gap (+35 risk): Custody transfer not signed by legitimate prior owner.
Outputs human-understandable audit rationales:
Risk: 92/100 — CRITICAL
Reasons:
• Off-chain data content hash does not match on-chain proof (Tampering detected)
• Provenance transition gap: custody transfer was not signed by legitimate prior owner
- Backend: Node.js 24 LTS, TypeScript, Express, native
node:crypto(Ed25519 & SHA-256) - Database: Dual-mode architecture:
- Zero-dependency native SQLite (
node:sqlite) for instant, friction-free local execution - Full PostgreSQL DDL migrations (
schema.sql) anddocker-compose.ymlfor enterprise deployment
- Zero-dependency native SQLite (
- Frontend: React 19, TypeScript, Vite, Vanilla Cyber-Aesthetic CSS (Zero Tailwind dependency for maximum control), Lucide Icons
- Testing: Node.js native test runner (
node:test,tsx)
- Node.js v20+ (Node v24 recommended)
- npm v10+
# 1. Clone or navigate to the repository
cd TRUSTGRID
# 2. Install dependencies (root & client)
npm install
npm --prefix client install
# 3. Seed database with 4 Flagship Scenarios
npm run seed
# 4. Run automated test suite (132 automated test assertions • 0 failed)
npm test
# 5. Launch unified server
npm run build
npm startThe application will start on http://localhost:5000 (serving both the REST API and the React Web UI).
# Runs Express server and Vite client concurrently
npm run dev- Backend API:
http://localhost:5000 - Frontend Dev Server:
http://localhost:3000
docker compose up --build# 1. Run the interactive 3-node consortium consensus and fault tolerance demo
npm run demo:consortium
# 2. (Optional) Run the 3 independent node daemons in separate terminal windows:
npm run node:1 # Node Alpha on port 4101 (Proposer)
npm run node:2 # Node Beta on port 4102 (Validator)
npm run node:3 # Node Gamma on port 4103 (Validator)
# 3. View the live Network Status dashboard:
# Navigate to http://localhost:5000/network or query GET /api/network/status
# 4. Run the 100-iteration cryptographic verification latency benchmark
npm run benchmark================================================================================
TEST VALIDATION: 132 tests • 0 failed | 132 passing | 0 failing | 9 test categories (17 files)
Execution Time: ~5.7s (via npm test / tsx --test --test-concurrency=1 src/tests/*.test.ts)
================================================================================
TRUSTGRID features a comprehensive automated test suite of 132 automated test assertions • 0 failed (132 passing, 0 failing across 9 test categories / 17 test files) covering all protocol invariants, 3-node consortium consensus, live network status and quorum monitoring, tamper detection, sector modules, and cryptographic defenses. Every test executes against authentic cryptographic implementations without mocking the core cryptography or SQLite database engine.
npm testMeasured on full end-to-end cryptographic Trust Object verification pipeline (Ed25519 signature audit + canonical SHA-256 recalculation + Merkle tree proof + explainable risk scoring):
| Benchmark Metric | Verified Result |
|---|---|
| Iterations | 100 |
| Total Test Time | 76.50 ms |
| Throughput | 1307.3 ops/sec |
| Mean Latency | 0.765 ms |
| Median Latency (p50) | 0.658 ms |
| Min Latency | 0.475 ms |
| Max Latency | 3.787 ms |
| 95th Percentile (p95) | 1.286 ms |
| 99th Percentile (p99) | 3.787 ms |
Run locally via:
npm run benchmark| # | Category | Test Count | Key Invariants Verified |
|---|---|---|---|
| 1 | Multi-Node Consensus & Cluster Fault Tolerance | 37 tests | 3-node independent process HTTP consensus, gossip candidate proposals, 2/3 majority consensus ( |
| 2 | Blockchain Integrity & Tamper Detection | 23 tests | Sequential SHA-256 block linking (previousHash), binary Merkle tree recomputation, cross-node divergence detection, and cryptographic spoliation alerts. |
| 3 | Sector Flagship Protocol Validation | 12 tests | Full lifecycle verification across all 4 sectors: Academic degrees (Education), Pharma cold-chain batches (Supply Chain), Digital forensic exhibits (Legal), and SCADA device firmware baselines (Cybersecurity). |
| 4 | Privacy & Cryptographic Selective Disclosure | 12 tests | Salted cryptographic commitments, attribute blinding, selective disclosure numeric predicate proofs (e.g. CGPA |
| 5 | Production Hyperledger Fabric Smart Contract | 10 tests | Enterprise Go chaincode (trustgrid_cc.go) methods, World State read/writes, endorsement policies, and ledger integrity verification. |
| 6 | Decentralized Identity & Encrypted Keystores | 10 tests | Ed25519 signing/verification, RFC 8785 canonical serialization, AES-256-GCM encrypted keystore management, and persistent keypair survival across simulated server restarts. |
| 7 | Risk Engine & Anomaly Detection | 11 tests | Explainable Trust Risk Engine factor scoring (0–100), verification velocity spikes, Sybil cross-DID credential duplication, and SCADA firmware drift detection. |
| 8 | End-to-End System Health & Verification Pipeline | 7 tests | Comprehensive health diagnostics, table schemas, and full TOP lifecycle (Issue → Anchor → Verify Authentic → Tamper → Verify Tampered → Revoke). |
| 9 | Live Consortium Network & Quorum Verification | 10 tests | Live HTTP status polling across ports 4101/4102/4103, 2/3 majority quorum calculation ( |
| TOTAL | All 9 Real Categories | 132 tests | 132 passed, 0 failed, 100% pass rate |
local_consortium_cluster.test.ts(10 tests):- 3 consortium nodes start with independent HTTP listeners and genesis block at height 0
- Node 1 proposes block; peers validate and 2/3 majority consensus commits block across all nodes
- All 3 nodes converge to the exact same block hash at height 1
- Candidate block with invalid height is rejected by validator peers
- Candidate block with broken previousHash link is rejected by validator peers
- Candidate block with tampered transaction merkle root is rejected by validator peers
- Candidate block with corrupted block hash is rejected by validator peers
- Consensus succeeds with 2/3 majority when 1 validator node (Node 3) is offline
- Offline node recovers and synchronizes missing blocks from peers via catchup protocol
- Cluster nodes independently verify 100% valid cryptographic chain integrity after sync
multi_node_consensus.test.ts(15 tests):- Initial cluster state: All 3 nodes have Genesis Block at height 0
- Leader creates valid candidate block proposal with Merkle root
- Validators verify candidate block successfully
- Validator rejects candidate with invalid height
- Validator rejects candidate with invalid previousHash link
- Full PBFT Consensus succeeds with 3/3 votes and commits to all nodes
- Quorum Certificate contains at least 2 valid Ed25519 signatures
- Sequential block production maintains continuous cryptographic chain
- Consensus succeeds with 2/3 quorum when 1 validator (Beta) is OFFLINE
- Consensus succeeds with 2/3 quorum when 1 validator (Gamma) is OFFLINE
- Consensus FAILS when 2 nodes are OFFLINE (Quorum lost: 1 < 2)
- Consensus FAILS when Leader is OFFLINE
- Empty transaction list is rejected by consensus engine
- Multi-transaction block computes combined binary Merkle tree
- Transaction retrieval by ID from committed blocks
node_fault_tolerance.test.ts(12 tests):- Cluster initializes with 3 ONLINE nodes at height 0
- registerProof executes PBFT consensus and anchors proof across cluster
- failNode marks target node as OFFLINE
- Ledger proceeds when Node Beta is OFFLINE (Quorum = Alpha + Gamma)
- Second block anchored while Beta is still down
- Cross-node audit detects that Node Beta is behind / diverged
- recoverNode brings Beta back ONLINE and auto-syncs missing blocks
- Cross-node audit passes after Node Beta recovery
- Network partition prevents isolated node from voting
- syncNode brings partitioned Node Gamma up to cluster height
- Network latency simulation executes successfully without drop
- Revocation anchored via multi-node consensus across all nodes
-
ledger_tamper_detection.test.ts(12 tests):- Baseline verification: All nodes have intact cryptographic chain
- Tamper block hash on Node Beta: detected locally by verifyLocalChainIntegrity
- Cross-node audit immediately detects Node Beta as DIVERGED while Alpha & Gamma are intact
- Quorum remains intact (
$Q = 2 \ge 2$ ) despite Byzantine tampering on Node Beta - New transactions can still be anchored while Node Beta is corrupted
- Self-healing: syncNode repairs tampered Node Beta from healthy peer
- Cross-node audit returns to consistent state after self-healing
- Tampering previousHash breaks chain continuity at exact height
- Tampering transaction payload in local database triggers Merkle leaf mismatch
- Repair Node Gamma brings whole cluster back to 100% integrity
- Direct adapter tamperNode API method updates status and triggers audit diverged flags
- Read-only verification does not mutate ledger data
-
provenance_tampering.test.ts(4 tests):- Provenance Chain Cryptographic Integrity & Tamper Detection Suite initialization
- Unbroken 4-hop certified custody chain verifies as AUTHENTIC
- Broken chain of custody (unauthorized hop) detected as PROVENANCE_MISMATCH
- Forged custody signature detected as PROVENANCE_MISMATCH
-
verification.test.ts(7 tests):- TRUSTGRID TOP Verification Pipeline Tests initialization
- Scenario 1A: Genuine Education Certificate returns AUTHENTIC with trust score >= 90
- Scenario 1B: Tampered Certificate (Rahul -> Rohan) detected as TAMPERED
- Scenario 1C: Revoked Certificate detected as REVOKED with on-chain proof
- Scenario 2: Genuine Product returns AUTHENTIC with 4-hop unbroken provenance
- Scenario 3: Tampered Legal Forensic Evidence detected as TAMPERED
- Consortium Blockchain Ledger Integrity validates all blocks and Merkle roots
sector_deep_dive.test.ts(12 tests):- Education: validateMetadata returns valid for complete degree payload
- Education: validateMetadata rejects missing mandatory attributes
- Education: issueDegree anchors credential on blockchain and populates credentials table
- Supply Chain: validateMetadata validates pharma batch payload
- Supply Chain: validateMetadata rejects batch without batchNumber
- Supply Chain: registerProductBatch anchors product batch with expiration date
- Supply Chain: transferProductCustody anchors certified custody event
- Legal: validateMetadata validates forensic evidence payload
- Legal: registerEvidence anchors tamper-evident forensic exhibit
- Legal: transferEvidenceCustody records chain of custody with jurisdiction verification
- Cybersecurity: registerDeviceBaseline anchors firmware baseline hash on ledger
- Cybersecurity: auditDevice detects firmware drift and logs on-chain alert
passport_disclosure.test.ts(12 tests):- Full disclosure passport returns all plain metadata attributes
- Selective disclosure passport masks sensitive fields and sets degreeVerified flag
- Selective disclosure generates cryptographic salted commitments for attributes
- Disclosed attribute verifies mathematically against commitment and salt
- Tampered attribute value fails cryptographic commitment check
- Forged salt fails cryptographic commitment check
- Numeric credential generates Predicate Proof (e.g. CGPA >= 7.5)
- verifyPredicateProof validates predicate statement without revealing raw GPA score
- verifyPredicateProof rejects if tested value fails predicate threshold
- Reputation trust score starts high for clean active credentials
- Reputation trust score penalizes revoked credentials
- Non-existent DID returns null safely
fabric_contract.test.ts(10 tests):- Production adapter reports transparent connection status & contract readiness
- registerProof writes to Fabric World State with block and Merkle leaf
- verifyProof returns valid when content hash matches World State
- verifyProof flags mismatch as TAMPERED
- verifyProof returns false for non-existent object
- revokeProof transitions status to REVOKED on Fabric ledger
- addProvenanceEvent anchors certified custody handoff on Fabric
- recordSecurityEvent anchors firmware compromise alert on Fabric
- Fabric ledger integrity check validates all block headers and previous hashes
- Fabric Go Chaincode source file (trustgrid_cc.go) exists and contains all required methods
crypto.test.ts(5 tests):- Cryptographic Primitive Suite initialization
- Ed25519 key generation, signing, and verification
- Canonical RFC 8785 JSON deterministic serialization & SHA-256
- AES-256-GCM private key encryption and decryption with authentication tag
- Binary Merkle tree root computation and leaf verification
persistence.test.ts(5 tests):- Persistent Encrypted Keystore & Server Restart Integrity Suite initialization
- Key Persistence: Consortium Notary retains identical keypair across simulated restarts
- Ledger Persistence: Blockchain integrity remains 100% VALID after restart
- Object Persistence: Trust Object created before restart verifies as AUTHENTIC after restart
- Revocation Persistence: Revoked object remains REVOKED after restart
anomaly.test.ts(4 tests):- Anomaly Risk Engine calculates baseline risk score
- Object status penalty scoring
- Verification velocity spike anomaly scoring
- Geolocation impossibility anomaly scoring
duplicate_credential.test.ts(2 tests):- Duplicate Credential Claim & Anomaly Risk Suite initialization
- Identical credential content claimed across multiple subject DIDs triggers DUPLICATE_CREDENTIAL_CLAIM
cybersecurity_e2e.test.ts(5 tests):- SCADA device cryptographic baseline registration
- Firmware hash verification against immutable ledger baseline
- Firmware bit-drift detection triggering CRITICAL security alert
- Immutable security incident anchoring to consortium ledger
- Explainable Risk Engine elevation to High/Critical upon baseline breach
e2e.test.ts(1 test):- Full End-to-End Trust Object Protocol (TOP) Lifecycle (Issue → Anchor → Verify Authentic → Tamper → Verify Tampered → Revoke)
system_health.test.ts(6 tests):- System Health & All 4 Flagship Demo Scenarios Suite initialization
- System Diagnostics: Ledger integrity is valid and all tables are ready
- Scenario 1 (Education): Genuine vs Tampered Certificate
- Scenario 2 (Supply Chain): Genuine vs Counterfeit Batch
- Scenario 3 (Legal Evidence): Genuine vs Tampered Forensics
- Scenario 4 (Cybersecurity): Clean Gateway vs Compromised SCADA Device
network_status.test.ts(10 tests):- All 3 nodes online: Network reports HEALTHY with 3/3 quorum and READY consensus
- One node offline: Network reports DEGRADED with 2/3 nodes online
- Quorum still available with 2 of 3 nodes online (2/3 majority preserved)
- Quorum lost when fewer than 2 nodes are online (e.g. 1/3 available)
- Correct block height reporting across nodes
- Correct node roles assigned: Alpha is PROPOSER, Beta and Gamma are VALIDATORS
- Unreachable/unresponsive node port is handled safely without throwing
- Security: Network Status API does not expose private keys, seeds, or internal secrets
- Real HTTP query to
/api/network/statusdetects running node on port 4102 as ONLINE and unstarted nodes as OFFLINE - Toggling node status via
POST /api/network/nodes/beta/togglesets node OFFLINE dynamically
TRUSTGRID/
├── package.json # Root package script configuration (Node 24+, tsx, vite)
├── tsconfig.json # Server TypeScript configuration
├── Dockerfile # Multi-stage production container build
├── docker-compose.yml # Single-instance Docker Compose orchestration
├── docker-compose.multi-node.yml # 3-Node PBFT containerized cluster orchestration
├── .env.example # Complete configuration reference
├── README.md # Comprehensive project overview
├── docs/
│ ├── ARCHITECTURE_AUDIT.md # Phase 0 baseline audit & v2 architectural roadmap
│ ├── DISTRIBUTED_LEDGER.md # Distributed ledger architecture & node topology
│ ├── CONSENSUS.md # 3-Phase PBFT consensus protocol & quorum math
│ ├── SECURITY.md # Threat model & cryptographic defense-in-depth
│ └── DEMO_SCRIPT.md # SIH 2026 Judge Demonstration Guide
├── src/
│ ├── server.ts # Server entrypoint with auto-seeding
│ ├── app.ts # Express app assembly, audit logging & multi-node router
│ ├── core/
│ │ ├── crypto/ # Ed25519, SHA-256 canonical hash, AES-GCM, Merkle trees
│ │ ├── identity/ # W3C DIDs & encrypted keystore wallet
│ │ ├── trust-object/ # Trust Object Protocol (TOP v2) types & service
│ │ ├── blockchain/
│ │ │ ├── node.ts # LedgerNode class with isolated SQLite & Ed25519 DID
│ │ │ ├── network.ts # PeerNetwork router with latency & partition simulation
│ │ │ ├── consensus.service.ts # 3-Phase PBFT Consensus Engine (Propose/Endorse/Commit)
│ │ │ ├── multi-node-blockchain.adapter.ts # 3-Node cluster manager (Alpha/Beta/Gamma)
│ │ │ ├── consortium-blockchain.adapter.ts # Primary consortium ledger adapter
│ │ │ ├── production-blockchain.adapter.ts # Hyperledger Fabric gateway bridge
│ │ │ └── fabric-chaincode/
│ │ │ ├── trustgrid_cc.go # Production Hyperledger Fabric 2.5 Go Smart Contract
│ │ │ └── go.mod # Go module definition
│ │ ├── verification/ # 5-Step Cryptographic Verification Pipeline + PBFT Check
│ │ ├── provenance/ # Certified multi-party custody handoffs
│ │ ├── revocation/ # On-chain revocation registry
│ │ ├── risk-engine/ # Explainable Trust Risk Engine (0-100)
│ │ ├── trust-graph/ # Cross-sector entity relationship graph
│ │ └── passport/ # Trust Passport with salted commitments & range proofs
│ ├── sectors/ # Sector modules validating TOP
│ │ ├── sector.interface.ts
│ │ ├── education.module.ts # Academic degrees & transcript verification
│ │ ├── supply-chain.module.ts # Pharma batches & cold-chain custody tracking
│ │ ├── legal.module.ts # Tamper-evident forensic evidence & chain of custody
│ │ └── cybersecurity.module.ts # SCADA firmware baselines & on-chain drift alerts
│ ├── database/
│ │ ├── schema.sql # Relational DDL & schema migrations
│ │ ├── db.service.ts # Built-in node:sqlite database service
│ │ └── seed.ts # Idempotent demonstrator seed data
│ ├── api/routes/ # REST endpoints (/api/nodes, /api/network/status, /api/verify, etc.)
│ └── tests/ # 132 Automated Tests (Consensus, Quorum, Fault Tolerance, Tamper, Sectors)
└── client/
├── package.json
├── vite.config.ts # Vite dev server with proxy to port 5000
├── index.html
└── src/
├── App.tsx # Master UI router and cyber layout
├── index.css # Custom dark-mode cybersecurity design system
├── components/
│ ├── Navbar.tsx # Sector navigation, network status & role switcher
│ ├── DemoBanner.tsx # SIH 1-click flagship scenario buttons
│ ├── HeroVerification.tsx # Signature UI with 7-point checklist & hash diff
│ ├── TrustGraphView.tsx # Interactive SVG node-link graph
│ └── TrustPassportCard.tsx # Privacy-preserving passport viewer
├── pages/
│ ├── NetworkStatusPage.tsx # Real-time 3-Node Consortium Health & Quorum Monitor
│ ├── BlockchainExplorerPage.tsx # Multi-Node PBFT Visualizer & Node Control Panel
│ └── ... # Sector & audit views
└── services/api.ts # Frontend REST API client
TRUSTGRID features a comprehensive automated test suite consisting of 132 automated test assertions • 0 failed (132 passing, 0 failing across 9 test categories / 17 test files) executing in ~5.7 seconds.
# Run all verified tests (132 tests • 0 failed)
npm test
# Run interactive 3-node consortium consensus demo
npm run demo:consortium
# Run verification latency benchmark
npm run benchmarkFor the complete categorized breakdown and file-by-file test specifications, see §10. Automated Test Validation & Verification Suite.
- Zero-Knowledge Range Proofs (zk-SNARKs): Integrating Groth16 / Circom circuits to prove age, credentials, or batch expiry without revealing any numerical attributes.
- Cross-Chain State Anchoring: Relaying consortium Merkle state roots onto public networks (Polygon / Ethereum) for public notary anchoring.
- Decentralized Storage Connectors: Optional IPFS / Filecoin pinning for large non-sensitive public assets.
- Hardware Security Module (HSM) Support: Integrating PKCS#11 / AWS KMS / Azure Key Vault for institutional private key signing.
Apache License 2.0. Built for Smart India Hackathon 2026.