Jeton is a decentralized poker platform designed to ensure fairness and transparency in online poker games. Built on the Aptos blockchain, Jeton eliminates the need for players to trust a central authority by leveraging zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) and Elgamal encryption. These cryptographic techniques guarantee that the cards are shuffled, encrypted, and dealt fairly without revealing any information to players or the platform itself.
The platform utilizes Elgamal encryption on the JubJub elliptic curve to securely encrypt cards and zk-SNARK circuits to verify both the shuffle and decryption processes. Each player participates in shuffling the deck and generating decryption shares, ensuring no individual player or entity can manipulate the outcome. Smart contracts on the Aptos blockchain handle the game logic and verify cryptographic proofs, providing a fully decentralized and tamper-proof environment for online poker.
For a more detailed explanation of the algorithms, security considerations, and cryptographic methods used in Jeton, you can read the full project overview.
This Turborepo includes the following packages/apps:
web
: the web application of the jeton protocol, implemented in Next.js@jeton/zk-deck
: a package containing Move, TypeScript, and Circom code, for implementing zero knowledge based playing decks@jeton/smart-contracts
: a Move package responsible for on chain game logic@jeton/ts-sdk
:@jeton/ui
: a React component library shared byweb
application@jeton/tailwindcss-config
:@jeton/typescript-config
:tsconfig.json
s used throughout the monorepo Each package/app is 100% TypeScript.
This repo has some additional tools setuped:
- TurboRepo for running monorepo tasks
- TypeScript for static type checking
- Biome for code linting and formatting
Make sure you have the correct versions of Node.js and npm installed:
- Node.js: v20.16 or later
- npm: v10.8 or later
You can use NVM to install the required version of node and npm.
Also you need rustc and cargo install. It is recommended to use rustup to install them.
After that you need to also install circom using:
cargo install --git https://github.com/iden3/circom.git --tag v2.1.9
To get started, first clone the repository:
git clone https://github.com/JetonDAO/jeton.git
cd jeton
To build all apps and packages, run the following command:
cd jeton
npm run build
🚫 Avoid Adding packages directly inside your package
To add a npm package pkg
use the following command:
cd jeton
npm install --workspace=<YOUR PROJECT/WORKSPACE> [--save|--save-dev] pkg
For example:
cd jeton
npm install --workspace=apps/web --save-dev @cloudflare/next-on-pages
To lint all apps and packages, run the following command:
cd jeton
npm run check
To run the linter and automatically fix problems run:
cd jeton
npm run fix
To develop all apps and packages, run the following command:
cd jeton
npm run dev
To develop only the web app, run the following command:
cd jeton
npm run dev-web
Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:
cd jeton
npx turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
npx turbo link