A modular, multi-agent prediction and drift detection system using Ethereum smart contracts, entropy analysis, and agentic simulation.
The wia-cid-core project provides a comprehensive framework for decentralized prediction validation and behavioral analysis using Ethereum smart contracts and multi-agent simulations. It enables agents to submit and resolve predictions on-chain, while off-chain components log events, analyze prediction confidence and entropy drift, and simulate diverse agent personas to test system robustness.
- Solidity Smart Contracts: The
PredictionValidation.solcontract on the Ethereum Sepolia testnet manages prediction submissions and resolutions. - CID Agents: Node.js-based agents simulating different prediction personas, submitting predictions and interacting with the contract.
- Python Prediction Agent: A Python script for submitting and optionally resolving predictions.
- Event Loggers: Components that listen to contract events, log them to JSON files, and upload logs to IPFS for decentralized archival.
- Analytics Scripts: Tools analyzing prediction confidence distributions and entropy drift to detect anomalies and emergent patterns.
graph TD
A[wia-cid-core] --> B[contracts/]
A --> C[agents/]
A --> D[scripts/]
A --> E[test/]
A --> F[docs/]
A --> G[hardhat.config.js]
A --> H[package.json]
A --> I[.env.example]
A --> J[README.md]
B --> B1[PredictionValidation.sol]
C --> C1[cid/]
C --> C2[loggers/]
C --> C3[analytics/]
C --> C4[utils/]
C --> C5[prediction_agent.py]
C --> C6[run.js]
C --> C7[README.md]
D --> D1[deploy.js]
E --> E1[PredictionValidation.test.js]
subgraph agents/
direction TB
C1[cid/]
C2[loggers/]
C3[analytics/]
C4[utils/]
C5[prediction_agent.py]
C6[run.js]
C7[README.md]
end
style A fill:#f9f,stroke:#333,stroke-width:2px
- Node.js (v20.x or later recommended)
- npm (comes with Node.js)
- Python 3.x
- pip (comes with Python)
-
Clone the repository:
git clone <repository-url> cd wia-cid-core
-
Install Node.js dependencies:
npm install
-
Install Python dependencies:
pip install web3 python-dotenv
-
Copy
.env.exampleto.envin the project root:cp .env.example .env
-
Edit
.envto fill in the required variables:SEPOLIA_URL: RPC endpoint for Sepolia testnet (e.g., Infura URL)SEPOLIA_PRIVATE_KEY: Private key for your walletWALLET_ADDRESS: Your Ethereum wallet addressCONTRACT_ADDRESS: Address of the deployedPredictionValidationcontractW3_SPACE_DIDandW3_REGISTERED_EMAIL: For web3.storage IPFS uploads
Compile and deploy the smart contract to Sepolia:
npx hardhat compile
npx hardhat run scripts/deploy.js --network sepoliaUpdate the CONTRACT_ADDRESS in your .env file with the deployed contract address.
To enable IPFS logging, install and configure the web3.storage CLI as described in the agents README.
Run a CID agent with a specified persona:
node agents/run.js --persona <PersonaName>Available personas:
ObfuscatorContrarianOverconfidentEntropyBomber
python agents/prediction_agent.pyModify the script to customize prediction details.
Continuously listen for contract events and log them:
node agents/loggers/EventPoller.jsConsider using pm2 or nodemon for process management.
node agents/loggers/logToIPFS.jsRun manually or schedule periodically.
Perform entropy drift analysis:
node agents/analytics/driftDetector_v2.jsRun the full test suite for the smart contracts:
npx hardhat test© 2025 Wallet Intelligence Agency / Counterintelligence Division