fedejinich/bitvmx_pkmn_bttl
A Bitcoin-Pokemon game using BitVMX
This project is a simple Bitcoin-Pokemon game created to showcase BitVMX, a protocol that enables verifying arbitrary computations on Bitcoin. In this game, players choose a Pokemon to battle against Charizard. If their Pokemon wins, they can validate the result using BitVMX and claim locked Bitcoin funds.
You can read more about the game in the following article and more about BitVMX here.
NOTE: the first article is based on the regtest
branch, while master
branch corresponds to the second part of the article where we run the game on Mutinynet.
bitvmx_protocol
submodule must point bitvmx_pkmn_bttl
branch.
├── bitvmx_protocol/ # BitVMX (submodule)
├── build_scripts/ # Scripts to build the project
├── engine/ # Pokemon battle engine (submodule)
├── game_runs/ # Detailed data about game runs for each environment (mutinynet and regtest)
├── pkmn_bttl/ # The game
├── init.sh # Initialization script
├── img.jpg
└── README.md
init.sh
./init.sh
This script clones the right submodules and creates the necessary folders.
Running the game involves setting up a BitVMX environment and acting as a prover that tries to compute the right output. To do that you can follow the next steps:
build.sh
INPUT and build the Pokemon program by running the build script./build_scripts/build.sh
prover
and verifier
docker services.bitvmx_protocol/
docker compose up prover-backend
docker compose up verifier-backend
build_scripts/setup_mutiny.py
.http://0.0.0.0:8081/docs#/v1
setup/
endpoint with the generated parametersfunding_tx_id
and funding_index
input/
with the setup_uuid
generated in the previous step.next_step
with the same setup_uuid
to verify the game (program).bitvmx_protocol/../execution_trace_generation_service.py
to try different challenge scenarios.