♠️
RACE Protocol
NFT PresaleDiscord
  • ❤️Official Docs & Links
  • ⏳Progress Overview
  • RACE Protocol
    • 🏗️System Architecture
      • Components
      • On-chain Accounts
      • Synchronization
      • Randomization
      • Payment
    • 🎲Game Development
      • Game Handler
      • Effect
      • Event Handling
      • Race API
        • Arweave Integration
      • Race JS SDK
        • Installation and Setup
        • Key Components
          • AppClient
          • SubClient
          • Events
          • Game Context
          • Decryption Cache
        • Advanced Features
          • Getting Revealed Knowledge
          • Exiting and Detaching
          • Submitting Messages
          • Sub-game Interaction
        • Best Practices
        • API Reference
        • Troubleshooting
    • 🧪Testing
      • Race Test Kit
      • Unit Testing
      • Integration Testing
      • Additional Considerations
    • 🧱Modules & Features
      • Encryption Methods
      • Command-line Tools
      • Configuration Options
      • Blockchain Transport Implementations
    • 📃Smart Contract
      • Solana Program
    • 🔦Examples and Use Cases
      • Draw Card Game
      • Raffle Game
      • Other Examples
  • RACE Games
    • ♠️RACE Poker app
      • 🎮Start playing in minutes
        • 💰Cash and sit-n-go
        • 🏆Tournaments
      • 🎨Workshop
        • 🏆Create cash games
        • 🏨Create tourneys
      • 💡Concept introduction
      • 🏗️System architecture
      • 👾Game Flow
      • 🎲Cards shuffling
      • ☎️Communication
      • 🔐Key sharing/decryption
      • 💱Cash flow structure
    • ⚡Solfast
      • 🎲Game modes
  • RACE RESEARCH
    • 👾No-Code Development
      • Brainstorming
      • Implementation Approach
      • Project Status
    • 0️⃣Zero-Knowledge Proofs
      • Brainstorming
      • Integration steps
        • Verifiable Randomness Generation
        • Private Game State Updates
        • Verifiable Settlements
        • Private Player Actions
      • Project Status
    • 🛡️Security Audit Report
      • Executive summary
        • Introduction to Race Protocol
        • Audit Methodology
      • Findings
        • Smart Contract Security
        • WebAssembly Security
        • Client-side Security (Race SDK)
        • Server-side Security
        • Randomization and Encryption
        • On-chain Account Management
        • Synchronization Mechanisms
        • Payment Handling
      • Recommendations
      • Conclusion
  • RACE DAO
    • 😎About
    • 🫂Community
    • 🖼️NFT Collection [!]
Powered by GitBook
On this page
  • To do list:
  • Benefits:
  • Challenges:
  • Conclusion:
  1. RACE RESEARCH
  2. Zero-Knowledge Proofs
  3. Integration steps

Verifiable Randomness Generation

This section further researches specific steps, benefits and challenges for the brainstormed ideas

To do list:

  1. Design the Zero-Knowledge Proof System:

    1. Define the statement to be proven: In this case, the statement is that the Transactor & Validator servers have correctly shuffled the encrypted identifiers of the possible outcomes according to the mental poker algorithm.

    2. Choose a suitable zero-knowledge proof scheme: 01js offers various proof schemes, such as Groth16 and Plonk. The choice will depend on factors like proof size, verification time, and the complexity of the statement to be proven.

    3. Develop the prover and verifier algorithms: These algorithms will be implemented in the Transactor server and client applications, respectively. The prover generates the zero-knowledge proof, and the verifier checks its validity.

  2. Modify the Servers:

    1. Integrate 01js library: Add the 01js library to the Transactor/Validator server's dependencies.

    2. Generate the proof during shuffling: After the Transactor and Validators shuffle the encrypted identifiers, they use 01js to generate a zero-knowledge proof of the correct shuffling.

    3. Broadcast the proof: Along with the shuffled identifiers, the servers broadcast the zero-knowledge proofs to all connected clients and validator servers.

  3. Modify the Client Applications:

    1. Integrate 01js library: Add the 01js library to the Race SDK or directly into the client application code.

    2. Verify the proof upon receiving: When the client receives the shuffled identifiers and the proof from the servers, it uses 01js to verify the proof's validity. This ensures that the shuffling was done correctly without revealing the secret keys or the order of the outcomes.

  4. Adapt the Game Handler (Optional):

    1. If necessary, modify the game handler within the WASM bundle to handle the zero-knowledge proof verification. This may involve exposing a function that allows the client application to pass the proof to the game handler for additional verification.

Benefits:

  • Enhanced Verifiability: Players can independently verify the correctness of the shuffling process, increasing trust and transparency in the game.

  • Reduced Trust in the Transactor: Players do not need to blindly trust the Transactor server, as they can verify the integrity of the randomness generation through the zero-knowledge proof. Though same is achieved in the existing implementation, Zero-Knowledge would provide an extra level of verification.

  • Improved Security: The use of zero-knowledge proofs adds an extra layer of security to the randomization process, making it more difficult for malicious actors to manipulate the outcome.

Challenges:

  • Performance Overhead: Generating and verifying zero-knowledge proofs can be computationally expensive, especially on resource-constrained devices like mobile phones. Careful optimization and selection of proof schemes will be necessary to ensure acceptable performance.

  • Increased Complexity: Adding zero-knowledge proofs to the protocol increases the overall complexity of the system. Developers need to carefully design and implement the proof system and integrate it seamlessly into the existing architecture.

Conclusion:

Despite the challenges, integrating 01js and zero-knowledge proofs into Race Protocol has the potential to significantly enhance the verifiability, trustlessness, and security of the randomness generation process. This would further strengthen the core principles of Race Protocol and provide a more robust and trustworthy foundation for building blockchain games.

PreviousIntegration stepsNextPrivate Game State Updates

Last updated 1 year ago

0️⃣