A Fully On-Chain Cricket Game Powered by Zero Knowledge Proof
Prize Pool
ZKnockXI enables users to create and bet on fantasy sports teams in a secure, transparent, and trustless manner, leveraging the power of blockchain technology, decentralised storage solutions, and oracle services.
The Fantasy Sports Betting DApp is built upon the Filecoin network for decentralised storage, the Witness Protocol for proving the existence and integrity of data, and the Sign Protocol for creating and querying attestations. It allows users to select a match, pick and lock their fantasy team, and place bets on their team's performance. The entire process is designed to be secure, tamper-proof, and resistant to Sybil attacks. Additionally, the DApp utilises Chainlink's decentralised oracle network to calculate individual player scores and total team scores.
Through this seamless combination of cutting-edge technologies, our protocol delivers a secure, fair, and transparent fantasy sports experience, setting a new standard for the industry.
ZKnock follows a detailed workflow to ensure the fairness and integrity of the betting process:
Match Selection and Team Formation: Users begin by selecting a match from the available options. They then proceed to pick players and lock their fantasy team composition.
Two-Factor Authentication (2FA) and Sybil Resistance: To enhance security and prevent Sybil attacks, the DApp incorporates two-factor authentication (2FA) and leverages witness and sign attestations. This ensures that only legitimate users can participate in the betting process.
Team Information Storage on Filecoin Lighthouse: Once the user's team is locked, the player IDs and the timestamp of team locking are securely stored on the Filecoin Lighthouse network. The data is encrypted using the user's digital signature, ensuring its integrity and authenticity.
Betting and Squad Hash Generation: After team formation, users can place bets on their fantasy team's performance. The application generates a "squad hash" by combining the Merkle hashes of the team's players (fetched from Filecoin), the timestamp (from Filecoin), and the user's address.
Witness Protocol Integration and Sign Protocol Attestations: The generated squad hash is posted as a leaf hash on the Witness Protocol using the /postLeaf
endpoint. This process creates a proof in the form of a leaf index, which serves as evidence of the squad submission.
The leaf index, along with the user's wallet address and the match ID, forms the indexer for the attestation. This indexer is used to create and query attestations on the Sign Protocol, providing proof of the squad submission and ensuring its legitimacy.
Match Verification and Reward Distribution: After the match concludes, the application verifies the legitimacy of the user's squad by:
/getLeafIndexByHash
endpoint to retrieve the leaf index for the recreated squad hash.Once the verification process is complete, the application utilizes Chainlink's decentralized oracle network to calculate the scores for individual players and the total scores for each team. If the current user is the winner, they can claim the rewards associated with their winning bet.