Skip to content

Liejox/Guess-Lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ GuessLab โ€” Darkpool Prediction Market on Aptos

Private. Fair. Gamified On-Chain Predictions.

๐ŸŒ Live Demo: https://guess-lab.vercel.app/

GuessLab is a next-generation prediction market built on the Aptos blockchain, designed for fairness, privacy, and fun. Unlike traditional platforms where bets are public, GuessLab uses a Darkpool Commitโ€“Reveal System to keep predictions hidden until the reveal phase โ€” eliminating manipulation and copy-trading.

Built for the Build on Aptos Hackathon (IBW).

๐ŸŒ‘ Why GuessLab?

Existing Aptos prediction platforms (like Panana) expose user bets publicly:

โŒ Anyone can see your bet
โŒ Whales manipulate markets
โŒ No privacy
โŒ No game mechanics

GuessLab fixes all of this with:

๐Ÿ”ฅ Darkpool Prediction Logic

  • Private commitments (hashed bets)
  • Anonymous positions during commit phase
  • Zero-knowledge-style privacy without heavy ZK
  • Fair reveal for everyone at the same time

๐ŸŽฎ Photon Gamification

  • XP rewards
  • PAT token rewards
  • User progression
  • Embedded wallet support
  • Event-based reward triggers

๐Ÿ“ˆ Pyth Oracle Crypto Resolution

  • Real-time BTC/ETH price feeds
  • Automated resolution for crypto markets

๐Ÿง  Architecture Overview

๐ŸŸฃ Move Smart Contract (Aptos)

Contract Address: 0xce3ebc6f453c5152f10be089a252c3703764daa0a0edb17c653f3a4820e134b3

Core on-chain logic includes:

โœ” Features

  • init_registry()
  • create_market()
  • commit_bet()
  • reveal_bet()
  • close_commit_phase()
  • resolve_market()
  • claim_reward()
  • Strong commitโ€“reveal hashing
  • AptosCoin escrow system
  • Per-user commitment storage

๐Ÿ”’ Darkpool Logic

Commitments are stored as secure SHA-256 hashes:

hash(user_addr | market_id | side | amount | salt)

No observer can guess:

  • โœ” Bet side
  • โœ” Bet amount
  • โœ” User strategy

This is GuessLab's core innovation.

๐ŸŽจ Frontend (Next.js + TypeScript)

โœ” Features

  • Real Petra Wallet integration
  • Full devnet connectivity
  • Create/Commit/Reveal/Resolve/Claim flows
  • Market timers
  • Private commit UI
  • Photon reward triggers
  • Pyth price display for crypto markets

Pages

  • / โ†’ Market list
  • /create โ†’ Create Market
  • /market/[id] โ†’ Commit/Reveal/Resolve
  • /profile โ†’ Photon XP display (coming soon)

๐Ÿ’Ž Photon Integration (XP + PAT Tokens)

GuessLab integrates Photon's identity & reward engine.

Rewards Triggered:

  • Commit โ†’ XP (unrewarded event)
  • Reveal โ†’ PAT tokens (rewarded event)
  • Resolve โ†’ Achievement XP
  • Completion streaks โ†’ Level rewards

Photon makes GuessLab sticky, competitive, and fun.

๐Ÿ“ก Pyth Oracle Integration

Used for crypto markets to guarantee fairness.

Capabilities:

  • Live BTC/ETH feeds
  • Check market condition at reveal end
  • Automatically set winner side
  • Eliminates admin bias

This makes GuessLab trustless, not just decentralized.

๐Ÿ“ฆ Tech Stack

Layer Technologies
Frontend Next.js, TypeScript, Tailwind, ShadCN
Smart Contract Move (Aptos)
Wallet Petra Wallet Adapter
Oracle Pyth Aptos SDK
Gamification Photon API
Network Aptos Devnet

๐Ÿ›  Setup Instructions

1. Clone repo

git clone https://github.com/Liejox/Guess-Lab.git
cd Guess-Lab

2. Install dependencies

npm install

3. Configure env

Create .env.local:

NEXT_PUBLIC_NETWORK=devnet
NEXT_PUBLIC_CONTRACT_ADDRESS=0xce3ebc6f453c5152f10be089a252c3703764daa0a0edb17c653f3a4820e134b3
NEXT_PUBLIC_PHOTON_API_URL=https://stage-api.getstan.app
NEXT_PUBLIC_PHOTON_API_KEY=YOUR_KEY

4. Start frontend

npm run dev

5. Deploy Move contract

aptos move publish --profile pred_market

๐ŸŽฏ User Flow

Step 1 โ€” Create Market
Admin sets question + commit/reveal windows.

Step 2 โ€” Commit Phase (Darkpool)
Users commit hashed predictions, completely private.

Step 3 โ€” Reveal Phase
Users reveal actual bet + salt.
Market updates public totals.

Step 4 โ€” Resolution
Admin or Pyth oracle resolves.

Step 5 โ€” Claim Rewards
Winners receive payouts based on proportional stake.

Step 6 โ€” Photon XP Rewards
Gamified progression, streaks, and PAT tokens.

๐Ÿ† Why GuessLab Beats Panana

Feature Panana GuessLab
Bet Privacy โŒ Public โœ… Darkpool Commit
Commitโ€“Reveal โŒ No โœ… Yes
Whale Manipulation โŒ Possible โœ… Impossible
Oracle Support โŒ Limited โœ… Pyth Price Feeds
Gamification โŒ None โœ… Photon XP + PAT
Fairness Medium Very High

๐Ÿš€ Roadmap

  • ZK predictions (future upgrade)
  • Social prediction rooms
  • Group prediction pools
  • Daily XP challenges
  • On-chain leaderboards
  • Multi-chain expansion

๐Ÿ”— Links


Built with โค๏ธ on Aptos blockchain for IBW Hackathon

About

GuessLab is a private darkpool prediction market built on Aptos. Using a commit-reveal scheme, all bets remain hidden until resolution, ensuring absolute fairness and zero front-running.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors