DarkGuardians detects risky IPFS content using a blockchain-first policy, AI classification, and ZK-backed reporting.
This README is the single source of truth for running the project and doing a live demo.
- Checks CID reputation from Sepolia first.
- If CID is already stored on-chain, returns result immediately (no AI re-scan).
- If CID is new, runs realtime backend pipeline:
- AI scan
- AI decision (
blockorallow) for immediate frontend action - ZK proof generation
- CID hash map update
- on-chain submission for future lookups
engine.py: AI scan engine.circuits/generate_proofs.js: ZK proof generation.scripts/updateCidHashes.js: updates extension CID-hash map.whisperguard-blockchain/scripts/realtimePipelineServer.js: realtime API backend.whisperguard-extension/: browser extension (content + background + popup).
- Node.js 18+ (Node 20+ recommended)
- Python 3.10+
- npm
- Sepolia credentials in
whisperguard-blockchain/.env
Expected env values in whisperguard-blockchain/.env:
SEPOLIA_RPC=<your_rpc_url>
PRIVATE_KEY=<your_wallet_private_key>Run these from repository root:
pip install -r requirements.txt
npm install --prefix circuits
npm install --prefix whisperguard-blockchain
npm install --prefix whisperguard-extensionFrom repository root:
node whisperguard-blockchain/scripts/realtimePipelineServer.jsExpected log:
Realtime pipeline server listening at http://127.0.0.1:8787
If server does not start:
- If port is already used, stop old process or reuse existing server.
- Verify with:
Invoke-RestMethod -Method Get -Uri "http://127.0.0.1:8787/health"- Open Chrome/Edge extensions page.
- Enable Developer Mode.
- Load unpacked extension from
whisperguard-extension. - Reload extension after code changes.
Frontend behavior:
- For stored CID: immediate blockchain verdict.
- For new CID: shows realtime status, decides block/allow once AI result arrives.
- Backend continues proof + blockchain storage asynchronously.
Base URL:
http://127.0.0.1:8787
- Method:
GET - URL:
/health
- Method:
POST - URL:
/evaluate - Body:
{
"cid": "bafkreiahcebggvpoaetkf34dwqgjs36edagngk7iji2xewv66ebxzqsiui",
"waitMs": 12000
}Behavior of /evaluate:
- If CID exists on-chain:
- Returns
source: "blockchain" - Returns immediate
decision: "block" | "allow"
- Returns
- If CID is new:
- Starts/reuses backend job
- Waits up to
waitMsfor AI decision - Returns:
source: "ai"withdecisionwhen AI is ready, orsource: "pipeline"+decision: "pending"withjobId
- Method:
GET - URL:
/jobs/{jobId}
Shows stages:
queuedscanningai_decisionproofmappingsubmittingcompletedorfailed
Compile contracts:
npm --prefix whisperguard-blockchain run compileOne-off full flow for a CID (manual script path):
Set-Location whisperguard-blockchain
$env:CID="<cid>"
npx hardhat run scripts/fullFlow.js --network sepolia- CID hash mapping is read from
whisperguard-extension/cidHashes.json. - Keep realtime API running during extension demo.
- Stored CIDs are always blockchain-first and skip AI re-check.