← Back to home

Clash of Balls

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

Screenshots

Clash of Balls screenshot 1
Clash of Balls screenshot 2
Clash of Balls screenshot 3
Clash of Balls screenshot 4
Clash of Balls screenshot 5
Clash of Balls screenshot 6

Problem Statement

Clash of Ballsis 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.OverviewClash 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 Works1. 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 PredictionsWhen creating a challenge, users can choose 5 + 1 predictions from the following 10 options:Team A wins by 2 or more goals.Points: 3Team B scores in the first half.Points: 2Player X scores at least 1 goal.Points: 2The match ends in a draw.Points: 3Both teams score at least 1 goal.Points: 1Team A scores 3 or more goals.Points: 4Team B concedes fewer than 2 goals.Points: 2Player Y receives a yellow card.Points: 2The match ends with fewer than 3 total goals.Points: 3There are more than 10 corner kicks in the match.Points: 4These 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.

Solution

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

Hackathon

ETHOnline 2024

2024

Prizes

  • 🏆

    Best use of Fhenix Stack2nd place

    Fhenix

  • 🏆

    SportFi Projects1st place

    Chiliz

Contributors