All projects

DeepFakeMarket

A decentralized prediction market where users wager on media authenticity, resolved automatically via Chainlink CRE and open-source Hugging Face AI models.

Prediction Markets World

What it is

DeepFakeMarket solves the oracle problem for subjective, real-world visual media. While standard smart contracts cannot process images or run complex AI inference, this project utilizes the Chainlink Runtime Environment (CRE) as an off-chain orchestrator. When a user creates a market with a media URL, an event is emitted. The off-chain CRE workflow (workflow.ts) listens for this trigger, fetches the media, and passes it to a Hugging Face deep learning classification model (dima806/deepfake_vs_real_image_detection). The workflow processes the AI's predictions and securely executes an on-chain transaction to the resolveMarket() function, acting as a trustless, decentralized judge to settle the prediction market.

How it Works

Solidity, Foundry, TypeScript, Node.js, Ethers.js, Hugging Face Inference API, Next.js , are the stacks used .
DeepFakeMarket consists of three core pillars:

  1. Smart Contracts (Solidity/Foundry): The DeepFakeMarket.sol contract handles the prediction pools, user wagers, and payouts. Crucially, the resolveMarket() function is secured by an onlyOracle modifier, ensuring only the Chainlink CRE workflow can trigger the settlement.
  2. Chainlink CRE Workflow (TypeScript/Node.js): The off-chain oracle logic lives in workflow.ts. It uses an event listener to detect when a new market is created. It then uses axios to fetch the media buffer, sends it to a Hugging Face deep learning classification model (dima806/deepfake_vs_real_image_detection), parses the AI's confidence scores, and securely broadcasts the definitive settlement transaction back to the smart contract using ethers.js.
  3. Frontend (Next.js/Wagmi): A sleek web UI built with Next.js 14 and Tailwind CSS, utilizing Wagmi and RainbowKit for seamless wallet connection and contract interaction

Links

Created by

  • Debanjan Maji