Code Monkey home page Code Monkey logo

algorand-merkletreegame's Introduction

Merkle Tree Game

Welcome to the Merkle Tree Game, an blockchain-based Algorand game, developed using the PyTeal and Beaker frameworks. ๐Ÿš€

Game Specifications

The Merkle Tree Game involves two main roles: the game creator and the participants. The game creator publishes the root of a Merkle Tree along with its height, challenging participants to discover all the leaves of the tree.

The creator is constrained to generate leaves using a randomness factor $r$, published alongside the Merkle Tree root. The leaf generation follows the formula: $$leaf_i = (num||r)_{num\in[0,100)}$$

The winner is the participant who successfully finds all Merkle Tree leaves and verifies the correctness of the Merkle Tree given a $path$ and a $leaf$. The winner receives an Algo prize, which can be publicly verified even before participating in the game.

The Merkle Tree implementation serves the dual purpose of storing only the root within the smart contract, ensuring efficient verification with logarithmic complexity relative to the number of leaves.

Project Overview

This project was chosen not only for learning the PyTeal language and its syntax but also for exploring how to interface (using sha256) and implement (using a Merkle Tree) cryptographic primitives within an Algorand smart contract. Additionally, it delves into managing payments and transactions within an Algorand smart contract.

Observations and Future Developments

It's crucial to note that, in this context, the game creator has no actual constraints on leaf creation. There is a potential for the creator to generate leaves that do not adhere to the specified form $leaf_i = (num||r)_{num\in[0,100)}$. An interesting future development could involve implementing a zero-knowledge verification mechanism. This would allow publicly verifying that the leaves were created correctly without revealing their actual values. ๐ŸŒฑ๐Ÿ”

algorand-merkletreegame's People

Contributors

pierdemo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.