project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Clash of Balls

1v1 Football Prediction Battle on Chiliz with encrypted predictions via FHE and Farcaster Composer Actions.

Clash of Balls

Created At

ETHOnline 2024

Winner of

Fhenix - Best use of Fhenix Stack 2nd place

Chiliz - SportFi Projects 1st place

Project Description

Clash of Balls is a decentralized 1v1 football prediction battle on Chiliz where users can make encrypted predictions using Fully Homomorphic Encryption (FHENIX). The app is built on Warpcast using Farcaster Composer Actions and Farcaster Frames. The project is built with Chainlink Functions Decentralized Oracle, Hyperlane, Fhenix, and Arbitrum. This project is developed for the ETHGlobal Online 2024 Hackathon.

Overview

Clash of Balls allows users to create and accept football prediction challenges using Chiliz (CHZ). The game is designed to be secure, transparent, and decentralized, offering users a unique way to engage with football fixtures and their favorite teams.

How It Works

1. Challenge Creation:

  • Select an upcoming football fixture.
  • Choose 5 predictions from the provided list and 1 additional prediction as a tie-breaker.
  • Choose a bet amount in Chiliz (CHZ).
  • Encrypt your selections using Fully Homomorphic Encryption (FHE).
  • Submit the encrypted challenge and bet amount on-chain via Warpcast using Farcaster Composer Actions.
  • Post the challenge as a cast on Warpcast.

2. Challenge Acceptance:

  • Any user can view the open challenges on Warpcast.
  • To accept a challenge, the user selects the same predictions and sends the required CHZ to confirm the game.
  • The user then replies to the challenge cast with a "challenge accepted" cast.

3. Betting & Rewards:

  • Each player bets a certain amount of CHZ (e.g., 10 CHZ).
  • The winner receives 80% of the total pool (e.g., 16 CHZ), with the remaining 20% (e.g., 4 CHZ) used to cover game fees.
  • Fee discounts are available based on Fan token holdings:
  • 5% discount if one player holds more Fan tokens of their team than the other.
  • 10% discount if one player holds more Fan tokens of both teams.

4. Game Result and Reward Distribution:

  • Chainlink Functions fetch the game results and post them on-chain.
  • Fhenix computes the points based on the predictions and reveals the winner on the Chiliz chain.
  • Rewards are automatically distributed based on the outcome.

Possible Predictions

When creating a challenge, users can choose 5 + 1 predictions from the following 10 options:

  1. Team A wins by 2 or more goals.
    Points: 3

  2. Team B scores in the first half.
    Points: 2

  3. Player X scores at least 1 goal.
    Points: 2

  4. The match ends in a draw.
    Points: 3

  5. Both teams score at least 1 goal.
    Points: 1

  6. Team A scores 3 or more goals.
    Points: 4

  7. Team B concedes fewer than 2 goals.
    Points: 2

  8. Player Y receives a yellow card.
    Points: 2

  9. The match ends with fewer than 3 total goals.
    Points: 3

  10. There are more than 10 corner kicks in the match.
    Points: 4

These predictions allow users to engage with the game in a strategic way, choosing outcomes they believe are likely while balancing the potential points they can earn.

How it's Made

  1. 1v1 Challenges: Create or accept open challenges based on upcoming football fixtures.
  2. Predictions: Choose 5 predictions from a predefined list of 10, plus 1 additional prediction for tie-breaking.
  3. Betting: Bet using CHZ, with dynamic fee discounts based on Fan token holdings.
  4. Fully Homomorphic Encryption: Securely encrypt your predictions and place them on-chain.
  5. Decentralized Oracle: Use Chainlink Functions to fetch and post match results on-chain.
  6. Cross-Chain Communication: Hyperlane connects Chiliz, Fhenix, and Arbitrum to ensure seamless gameplay and computation.
background image mobile

Join the mailing list

Get the latest news and updates