A fully private implementation of Blackjack running on the Aztec Network. Players can enjoy classic blackjack gameplay with complete transaction privacy, including betting, hitting, standing, splitting, and insurance options.
- Private betting with ERC20 tokens
- Classic blackjack gameplay mechanics
- Double down functionality
- Split hands
- Insurance bets
- Fully private game state
- React-based UI with Tailwind styling
- Node.js (v18+)
- Yarn
- Aztec CLI
- Clone the repository:
git clone https://github.com/yourusername/aztec-blackjack.git
cd aztec-blackjack- Install dependencies:
yarn install- Start the Aztec Sandbox (in a separate terminal):
- Make sure the versions of the sandbox, nargo.toml and aztec.js are the same
aztec start --sandbox- Compile the Noir contracts and generate artifacts:
yarn compile && yarn codegen- Start the development server:
yarn devThe app will be available at http://localhost:8080
Run the full test suite (both Noir and TypeScript tests):
yarn testRun only the Noir contract tests:
cd src/circuits
aztec testRun only the TypeScript integration tests:
yarn test:node/src/circuits/- Noir smart contracts/src/circuits/src/main.nr- Main blackjack contract/src/circuits/src/notes/- Note implementations for cards and values/src/circuits/src/helpers/- Helper functions for game logic
/src/pages/- React components/src/components/- Reusable UI components/src/contexts/- React context providers/test/- Integration tests
- Place a bet using supported ERC20 tokens
- Receive two cards and view the dealer's up card
- Choose to:
- Hit (take another card)
- Stand (keep current hand)
- Double Down (double bet and take one card)
- Split (if you have matching cards)
- Take Insurance (if dealer shows an Ace)
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to your branch
- Open a Pull Request
MIT