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

Blocks and Balls

A dynamic Web3 two-player card game where you compete against an AI opponent with seamless on-chain gameplay. Enjoy minimal transactions, secure randomness, and transparent AI actions powered by Trusted Execution Environments (TEE).

Blocks and Balls

Created At

ETHGlobal Bangkok

Winner of

Blockscout - Blockscout Explorer Big Pool Prize

Prize Pool

Chiliz - SportFi Projects 1st place

Coinbase Developer Platform - CDP SDK Pool Prize

Prize Pool

Inco Network - Best gaming application on Inco

Pyth Network - Pyth Entropy Pool Prize

Prize Pool

Project Description

This project appears to be a blockchain-based decentralized application (dApp) designed to integrate smart contracts, wallets, and randomness for a game or platform. Here's a detailed breakdown of the workflow and project components based on the diagrams provided:

  1. User Side Integration Dynamic and WalletConnect: These provide the connection between the user and the blockchain. WalletConnect is a widely-used protocol allowing users to interact with dApps securely from their wallets. Dynamic likely refers to a specific feature or service for seamless user access. Smart Session (facilitated by Biconomy): This ensures that users' interactions with the dApp are efficient and cost-effective. Biconomy simplifies transactions by enabling gasless interactions and reducing blockchain complexity for the end user.
  2. AI Agent Layer TEE (Trusted Execution Environment) and Phala: TEE ensures secure computations and data privacy. Phala is a blockchain-based service specializing in confidential smart contracts, ensuring that AI agents can operate securely and efficiently without exposing sensitive data. MPC Wallet: Multi-Party Computation (MPC) Wallets allow secure wallet interactions where keys are split into multiple parts, adding a layer of security in transaction signing and approval.
  3. Contracts and Blockchain Layer Contracts (Smart Contracts): The backbone of the platform, the contracts are hosted on multiple blockchains, such as: Chiliz (possibly for sports or fan token integrations). Base, Scroll, Polygon, Mantle, and Flow (diverse blockchain ecosystems to maximize scalability, low fees, and developer flexibility). Hyperlane: This is a cross-chain messaging protocol that facilitates communication between different blockchain networks. INCO: Likely refers to a backend system or additional service for managing specific in-game or platform processes.
  4. Game-Specific Mechanics Random Deck and Randomness: The "Random Deck" appears to involve generating and managing randomized game components (e.g., cards). This randomness is achieved through: Pyth Entropy: A mechanism that uses encrypted seeds and randomness generation to ensure fairness in game outcomes. Make Move: This contract likely handles the logic for player actions in the game. Draw Card: Specifically tailored to handle in-game card drawing, leveraging Pyth and Flow to ensure randomness and transparency.
  5. Additional Features Blockscout: A blockchain explorer that provides transparency and allows users to verify transactions and contract interactions on the respective blockchains. Encrypted Seed and Pyth Entropy: This combination ensures tamper-proof randomness, crucial for trust in games involving chance (e.g., card draws or randomized deck generation).

How it's Made

  1. Core Technologies Blockchain Framework Ethereum-Compatible Chains: The project integrates with multiple blockchains like Polygon, Scroll, Base, and Mantle. These Ethereum Layer 2 solutions offer scalability, reduced transaction costs, and compatibility with Ethereum’s ecosystem. Flow Blockchain: Specifically designed for gaming and collectibles, Flow ensures high transaction throughput and user-friendly interactions, making it a natural fit for gaming mechanics like "Draw Card." Chiliz: Focused on fan engagement, it could be used for tokenized assets or in-game currencies. Cross-Chain Communication (Hyperlane): Hyperlane connects these disparate chains for cross-chain messaging, allowing seamless asset and data transfer between blockchains. It eliminates the need to silo assets or data within a single blockchain. Randomness (Pyth Entropy): Pyth Network supplies real-time off-chain data like randomness. This is achieved through encrypted seeds and cryptographic methods, ensuring that randomness used in-game (e.g., "Random Deck" or "Draw Card") cannot be manipulated. How It Works: A trusted off-chain source generates entropy, which is fed into the blockchain. Using encrypted seeds and verifiable random functions (VRFs), randomness is incorporated into the game smart contracts.
  2. Wallet and Session Management Wallet Integration: WalletConnect: Acts as a bridge between users’ wallets and the dApp. It enables secure and decentralized login sessions. MPC Wallet (Multi-Party Computation): Used to secure private keys by splitting them into multiple components stored across different devices or servers. This adds a layer of fault tolerance and security. Benefit: No single point of failure; the wallet can be used collaboratively while keeping keys secure. Smart Session: Powered by Biconomy: Handles gasless transactions and simplifies blockchain interactions, allowing users to transact without needing to hold cryptocurrency in their wallets. This improves user onboarding and reduces friction.
  3. AI Agent Integration Phala Network: Used to power the AI agent layer. Phala specializes in confidential computing using TEE (Trusted Execution Environment), which ensures sensitive computations like decision-making or personalized logic are secure and private. TEE: Allows secure execution of AI-driven logic outside the blockchain while maintaining trust. For example, the AI could calculate optimal game strategies, process user data, or recommend moves securely.
  4. Game Mechanics via Smart Contracts Core Contracts: Make Move: Contains game logic for players' actions. This ensures fairness and immutability by leveraging smart contracts. Draw Card: Manages randomness using Pyth Entropy and records the outcome on-chain, allowing players to verify its fairness. Random Deck: Creates randomized decks for gameplay, leveraging encrypted seeds to prevent tampering. INCO Layer: Likely a middleware or orchestration layer that manages game state transitions and communication with smart contracts.
  5. User Experience Layer Dynamic UI: Likely built using React.js or Vue.js for the front end, given the need for a responsive, user-friendly gaming interface. API Layer: Backend APIs (possibly using Node.js or Go) integrate with the blockchain for efficient read/write operations and communication with partner technologies like Pyth and Biconomy. Blockscout Integration: Provides transparency and debugging tools for developers and users to view transactions and contract interactions.
  6. Notable Hacks and Innovations Gasless Transactions: Using Biconomy for gasless interactions is a game-changer. It removes one of the biggest pain points for users—having to acquire crypto to pay gas fees. Multi-Chain Randomness: The project’s use of Pyth Entropy for verifiable randomness is unique, as it leverages off-chain and on-chain resources for tamper-proof random number generation. By combining multiple blockchains, the randomness process is robust against potential single-chain vulnerabilities. Cross-Chain Architecture: The integration of Hyperlane allows assets and logic to move across different blockchains seamlessly, which is challenging but vital for scalability. MPC Wallet: Innovatively secures user wallets while enabling multi-user or multi-device workflows, ensuring secure interactions for gamers and admins alike. Partner Technologies and Their Benefits Biconomy: Simplifies blockchain interactions and gasless transactions, reducing onboarding friction for non-crypto users. Hyperlane: Handles the complexities of cross-chain communication, enabling the platform to offer seamless multi-chain experiences. Phala: Brings the AI layer to life with confidential computing capabilities. Pyth: Ensures fair gameplay with a secure and reliable randomness source. Flow Blockchain: Streamlines game-specific use cases with high throughput and developer-friendly tools. Conclusion This project showcases a sophisticated blend of blockchain, AI, and cryptographic technologies to create a fair, decentralized, and scalable gaming ecosystem. By leveraging partner technologies and innovative solutions like MPC Wallets, gasless sessions, and cross-chain interoperability, the project achieves a frictionless user experience while maintaining decentralization and trust.
background image mobile

Join the mailing list

Get the latest news and updates