Cardano Game Engine Wallet is an integrated light wallet and off-chain SDK for the Godot engine and Cardano blockchain. The project is currently a work-in-progress.
This project was publicly funded by the Cardano community in round 10 of Project Catalyst. Thank you for your support!
The project currently consists of a small demo that showcases two features:
- Generating / importing a wallet by entering a seed-phrase
- Transferring ADA to an arbitrary Cardano address.
At the momment, the demo runs on the preview testnet and was tested on Linux and Windows x86-64 PCs.
-
Godot Engine 4.2: The demo runs on version 4.2 of the Godot engine, which you can download at the official website.
-
A wallet with funds in the Cardano preview testnet: You can use any wallet you like, as long as it supports the preview testnet. Take note of the seed-phrase of your wallet. To get test ADA (tADA), use the Cardano testnet faucet.
-
A Blockfrost token: Our demo uses Blockfrost as a provider for querying the blockchain and submitting transactions. You will need a Blockfrost account and a preview testnet token.
First, clone the repository and enter the top directory.
$ git clone https://github.com/mlabs-haskell/godot-cardano.git
$ cd godot-cardano
Download godot-cardano.zip
from the releases page, unzip it and copy the addons
folder into the demo
folder of the repo.
$ curl https://github.com/mlabs-haskell/godot-cardano/releases/download/release-.../godot-cardano.zip -O godot-cardano.zip
$ unzip godot-cardano.zip -o demo
Inside the demo
folder, create a "preview_token.txt" file with your Blockfrost preview token.
$ echo "<YOUR TOKEN>" > demo/preview_token.txt
Open the Godot editor. You will be greeted by the Project Manager. Import and open the project located in the demo
folder.
You should now have the Godot editor window with the project loaded. Press the button for running the current scene (or press F5
).
The demo consists of two forms:
- A form for filling in the wallet's mnemonic phrase
- A form for transferring ADA to an arbitrary address
The two forms must be filled in sequence.
-
First fill in the seed phrase of the wallet specified in the Pre-requisites section.
-
Click on "Set wallet". If the wallet is loaded correctly, the demo should inform you of the amount of UTxOs found in the address associated to that wallet (as well as the amount of funds in it).
-
Set the recipient address of the transaction (you may use the address of your wallet if you want).
-
Fill in the amount of lovelace to send. A reminder that lovelace is the smallest unit of ADA currency: 1 ADA = 1,000,000 lovelace. You should send at least 969,750. This is the smallest value a UTxO may have in Cardano, any less will trigger a runtime error.
-
Click on "Send ADA". This will use the Blockfrost backend to submit the transaction to the Cardano blockchain.
At this point the demo is over. The demo will not inform you of the success of the transaction, but you may use any tool to confirm that a transaction occurred between your wallet and the recipient.
For instance, here we use Cardanoscan (Preview) to monitor the wallet address and confirm that a transaction occurred:
Check our milestones here!
You may also read our Proof Of Achievement / Research report written for the milestone as well. This document discusses our work and rationale for the technical decisions we have made.
Development is supported on linux. On other platforms, use a virtual machine or WSL. To get started, clone the repo and enter it.
Install Nix and enable flakes, or do it in one step with the Determinate nix installer.
$ nix build .#godot-cardano
$ nix build .#demo
$ nix run .#steam-run result/bin/demo
Before running the tests, ensure that test/preview_token.txt
is populated
with a valid Blockfrost preview key, and that test/seed_phrase.txt
is
populated with a valid 24-word seed phrase and the address is funded with
testnet ADA from the faucet. Alternatively, your seed phrase can be set via the
TESTNET_SEED_PHRASE
environment variable. The address used will be the
default address in most light wallets, as well as in the demo app provided with
this project. Once these are set, run the test suite:
Run integration test on preview network.
$ nix run .#preview-integration-test
Enter development shell with all dependencies in PATH and addons linked. A list of useful commands is displayed.
$ nix develop
🔨 Welcome to godot-cardano devshell
[[general commands]]
cardano-cli - The Cardano command-line interface
...
Here are some useful workflows inside the development shell:
$ cd libcsl_godot
$ cargo build
$ ls target/debug/libcsl_godot.so
$ ls -la ../addons/@mlabs-haskell/godot-cardano/bin/
$ cd demo
$ echo "<your bockfrost preview token>" > preview_token.txt
$ godot4 --editor
With the demo
or test
project open, the Godot editor should automatically reload the gdextension after cargo build
.
$ cd demo
$ godot4 --headless --export-debug "Linux/X11" out/demo project.godot
$ steam-run out/demo
$ cd test
$ godot4 --headless --script addons/gut/gut_cmdln.gd
$ overmind start -D
$ private-testnet-fund-ada
$ echo $PRIVATE_TESTNET_PAYMENT_ADDRESS
$ echo $PRIVATE_TESTNET_PAYMENT_VKEY
$ echo $PRIVATE_TESTNET_PAYMENT_SKEY
$ overmind quit