Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype Hydra chess game on testnets #1237

Closed
6 of 7 tasks
ghost opened this issue Jan 8, 2024 · 3 comments
Closed
6 of 7 tasks

Prototype Hydra chess game on testnets #1237

ghost opened this issue Jan 8, 2024 · 3 comments
Labels
app An application or tool built on top of Hydra Head green 💚 Low complexity or well understood feature 💬 feature A feature on our roadmap

Comments

@ghost
Copy link

ghost commented Jan 8, 2024

Why

  • We want to "eat our own dog food", eg. use the technology we are building on a daily basis in order to:
    • Test our own stuff
    • Improve the overall user experience, even though developers can tolerate more complex UIs than the average user
    • Experience running an app/system
  • Games where plays are run in a Hydra head with only results/leaderboards being kept on L1 seem a good use case for Hydra Head protocol
  • Chess being a well-known deterministic game, with simple rules, few players, easy to build interface, is a good candidate
  • Yet it's also challenging to provide a great UX so that it's fast and easy to setup a game
  • We want to improve the DX for people wanting to build stuff on top of Hydra, this app will be a "reference DApp", something we can point people at and refer to when improving Hydra

What

  • The application should be easy to install even for users unfamiliar with cardano-node and hydra-node

    • Having a short and sweet README.md on a dedicated repository (e.g. hydra-chess) could be a good goal post here.
    • Users can build the hydra-chess on their machines or download pre-built binaries when/if available
  • Two users can play a Chess game using Cardano on any public testnet

    • They run the hydra-chess application locally selecting which public network to run on which provides some command-line interface
    • Users are guided to through the full life-cycle of the game
  • The user journey of the this guided chess experience covers:

    • exchange connectivity information provided by the interface and use that to configure known peers
    • initialise a new head
    • start a new game once the head is opened
    • play game using some simple interface and board display
    • see the result of the game
    • start and play one or more other games in the head
    • close the head once they don't want to play anymore
    • have the game(s) results be reflected on L1
  • The UI provided is terminal user interface (TUI) with no specific need for scriptability

  • Out of scope: Fancy graphical user interfaces or an exposed API

  • Out of scope: Security is not the main concern at this stage, so non-validating scripts (about game logic or elo rating) are acceptable

Non-functional requirements:

  • OS support limited to Linux/Mac OS
  • Users should have a good knowledge on their machine and network configuration (eg. be able to tweak firewall to let other people connect to their node)

How

  • Provide a wrapping application managing all the tools needed: Hydra node, cardano-node, perhaps even a small wallet
    • Configuration and data is handled through XDG directories
    • This could be further improved by packaging the whole set of needed binaries in a single native package to offer users a native installer experience ➡️ Simple installation packages for Hydra node #1107
  • Player can start playing by minting a token on L1 and consuming it for starting a game
    • There's a dedicated minting policy which is used to mint a token for some specific pubkeyhash, and is packed with a UTxO holding some ADAs to be able to pay for collateral inside the head
    • Inside the Head, the token is locked to a script named elo-script with intention this will control changes in ELO ratings following conclusion of a game
  • Provide a way to configure peers
  • Write a smart contract ensuring all moves are legal
  • Separate more cleanly UI code from backend code and expose a proper API
  • Provide a command-line user interface covering the complete life-cycle of one or more games with another player
  • Code is available under cardano-scaling organisation with enough instructions to get started
@ghost ghost assigned rezabaram and ghost Jan 8, 2024
@ghost
Copy link
Author

ghost commented Jan 9, 2024

@rezabaram and I were able to play a game to completion, running on our own machines 🎉

Image

@ch1bo ch1bo added 💭 idea An idea or feature request 💬 feature A feature on our roadmap and removed 💭 idea An idea or feature request labels Jan 9, 2024
@ch1bo ch1bo added app An application or tool built on top of Hydra Head green 💚 Low complexity or well understood feature labels Jan 9, 2024
@ch1bo ch1bo moved this to Now in Hydra Head Roadmap Jan 16, 2024
@ch1bo
Copy link
Collaborator

ch1bo commented Jan 17, 2024

A dedicated repository has been set up and equipped with instructions in a README.md: https://github.com/cardano-scaling/hydra-chess/tree/eb786daf5204e1c807fde10cdbbe237041fa439c

@ch1bo
Copy link
Collaborator

ch1bo commented Jan 17, 2024

@abailly-iohk Reviewed instructions and overall look fine, only suggestion: cardano-scaling/hydra-chess#1

@ch1bo ch1bo closed this as completed Jan 22, 2024
@github-project-automation github-project-automation bot moved this from Now to Done in Hydra Head Roadmap Jan 22, 2024
@ch1bo ch1bo unassigned rezabaram and ghost Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app An application or tool built on top of Hydra Head green 💚 Low complexity or well understood feature 💬 feature A feature on our roadmap
Projects
None yet
Development

No branches or pull requests

2 participants