project screenshot 1
project screenshot 2
project screenshot 3

opinion-market

Simple prediction market. It tries to gather user opinion using vanila prediction market.

opinion-market

Created At

ETHOnline 2024

Project Description

Encrypted Prediction Markets on Fhenix Decentralized betting platform using Fully Homomorphic Encryption (FHE) on the Fhenix network. Key Features

Privacy-preserving betting with FHE Decentralized market creation Binary outcome betting (support/oppose) Automated settlement and fair payout distribution ERC20 token integration for bets

Tech Stack

Solidity 0.8.24 Fhenix Protocol's FHE.sol Hardhat deployment Fhenix Testnet

Process

Deploy market with question and expiry Users place encrypted bets Settlement triggered post-expiry Outcome determined via decrypted totals Winners claim proportional payouts

How it's Made

Smart Contract (Solidity 0.8.24):

Implements market logic, betting, and settlement Uses OpenZeppelin for ERC20 interactions and safety checks

Fully Homomorphic Encryption (FHE):

Leverages Fhenix Protocol's FHE.sol for encrypted operations Keeps individual bets and votes private on-chain

Custom ERC20 Token:

Used for placing bets and distributing winnings

Hardhat Development Environment:

Compilation, testing, and deployment management Custom scripts for deployment and contract verification

Fhenix Testnet Deployment:

Targets Fhenix network for FHE capabilities Ethers.js for contract interactions

Encrypted Data Structures:

Uses euint128 for encrypted integers Custom structs combine encrypted and decrypted data

Automated Market Settlement:

Time-based expiration trigger Decrypts totals only at settlement for fair resolution

This implementation showcases advanced cryptographic techniques in DeFi, enabling private, tamper-resistant prediction markets on blockchain.

background image mobile

Join the mailing list

Get the latest news and updates