Juodžekas [ˈjuːoˑd͡ʒɛkɐs] is a decentralized, trustless Blackjack game. It uses zkShuffle (Mental Poker) and optional smart contracts to ensure fair play and verifiable card dealing.
This is a Rust workspace consisting of multiple components:
contracts/juodzekas: CosmWasm smart contract (deployed to Xion testnet-2)clients/tui: A terminal-based user interface for playing the gameclients/dealer: A simple daemon for automatically dealing cards against a smart contractpackages/zk-shuffle: ZK-based card shuffling using Mental Pokerpackages/blackjack: Shared blackjack game logic and rules
- Rust (1.89.0 or later)
- Cargo
- C++ toolchain and GMP library (for rapidsnark native library):
- Linux:
# Ubuntu/Debian sudo apt install build-essential cmake libgmp-dev # Fedora/RHEL sudo dnf install gcc gcc-c++ cmake gmp-devel
- macOS:
xcode-select --install brew install gmp
- Windows: Visual Studio Build Tools with C++ support
- Linux:
This project uses git submodules for external dependencies (circomlib). Clone with:
git clone --recursive <repository-url>Or if already cloned:
git submodule update --init --recursiveSee SUBMODULES.md for more details.
To compile and test the smart contract:
# Compile the contract
cargo build -p juodzekas
# Run contract tests
cargo test -p juodzekasThe TUI client is a terminal application built with ratatui.
To run the TUI client:
cargo run -p juodzekas-tui- Choose game mode: [F]ast, [T]rustless, or [C]ontract (on-chain)
- Select number of spots (1-8 hands to play simultaneously)
- Use arrow keys or letter keys to play
For contract mode, build with --features wallet and see clients/tui/README.md for wallet setup.
For detailed controls and features, see clients/tui/README.md.
- Formatting:
cargo fmt - Linting:
cargo clippy
The project includes the ZK circuits required for trustless card games, located in the circuits/ directory. These circuits are based on the zkShuffle protocol and implement Mental Poker techniques using BabyJubJub and ElGamal.
See circuits/README.md for more details.