Docs
Contents

Quickstart

About 15 minutes, on the testnet beta: create a player key, deposit shielded testnet ZEC (TAZ), flip coins against the house in the MagicBlock rollup, and withdraw back to your Zcash wallet. Everything runs from one script, ../web/examples/quickstart.ts, using the TypeScript client in ../web/src/.

Prefer clicking? The same flow is on the pages at https://zol.cash/play.html.

You need

cd web
npm install

1. A player key

npx vite-node examples/quickstart.ts new

This creates a random session key and saves its seed in zol-session.json (mode 600). The key is your identity in the app: it signs your deposit memo and every action on your balance. Keep the file; whoever holds it holds your balance.

2. Deposit

npx vite-node examples/quickstart.ts deposit utest1…your-address…

The script:

  1. reads the app from an operator (GET /v1/apps/{app}: network, vault, denominations, tip),
  2. builds a memo naming your key and your payout address, signed by your key,
  3. registers it with all three operators (POST /v1/apps/{app}/intents), which return your session address, a receiver of the app's vault unique to you,
  4. prints a ZIP 321 link:
pay exactly 0.01 TAZ with this link (any Zcash testnet wallet):

zcash:utest1s4c7…?amount=0.01&memo=Wk9MMTpX…

session address: utest1s4c7…
registered with 3 of 3 operators

Open the link in your wallet (or paste the address, amount and memo) and send. The address you passed is now fixed as your payout address for this app.

3. Wait for the credit

npx vite-node examples/quickstart.ts status
deposit 0.01 TAZ: seen, 2 confirmations
balance: none yet

After 1 Zcash block (usually 1–2 minutes) two operators attest the deposit and it is credited:

deposit 0.01 TAZ: credited, 3 confirmations
balance: 0.00997 TAZ

The 0.3% entry fee is gone; the rest is your balance on the ledger.

4. Play in the rollup

npx vite-node examples/quickstart.ts flip 3
flip 1: you won
flip 2: the house won
flip 3: you won
table closed; balance 0.010967 TAZ

What happened:

  1. One Solana transaction (built by the house, signed by you, co-signed and paid by the house) created a table, seated you and the house with up to 10 stakes each (join_rounds), and moved the pot and the table into the MagicBlock rollup.
  2. Each flip was a free rollup transaction signed by your key. MagicBlock's VRF picked the winner in under a second, and the program moved one stake (0.000997 TAZ) between seats.
  3. Closing: the table returned to Solana, and its return action paid your seat into your balance.

5. Withdraw

npx vite-node examples/quickstart.ts withdraw

Your key signs request_exit and settle; the operators then pay your balance, less the 0.3% exit fee and a 0.0002 TAZ network fee, to your payout address in a single shielded transaction (a few minutes). Check your wallet.