Build games for chain.wtf, from solo wagers against the house to multiplayer battles for a shared pot. Pick an SDK, spin up a simulator, and start dealing.
Docs for building iframe games compatible with Chain protocol and that run inside the Chain.wtf host application.
Start a game
Section titled “Start a game”For a casino game, prefer the Slot Engine or the Graph Engine to a contract of your own. An engine game needs no Solidity, only its frontend is reviewed, and it joins the offering as soon as it deploys.
Create a game from an example with the chain command, then play it in the SDK simulator:
npx @chain-protocol/cli init casino my-gamenpx @chain-protocol/cli init pvp my-gameWith Bun, use bunx instead of npx. Getting Started walks through a
casino game from an empty directory to a played round, and the
PvP Local Simulator page does the same for a PvP game.
To add an SDK to an existing project, install it with the CLI at the same version:
npm install @chain-protocol/casino-sdk # or @chain-protocol/pvp-sdknpm install --save-dev @chain-protocol/cliWith Bun, run bun add @chain-protocol/casino-sdk and bun add --dev @chain-protocol/cli.
Package entry points
Section titled “Package entry points”- Casino:
@chain-protocol/casino-sdk,@chain-protocol/casino-sdk/guest,@chain-protocol/casino-sdk/contracts/*,@chain-protocol/casino-sdk/slot-engineand@chain-protocol/casino-sdk/graph-engine. - PvP:
@chain-protocol/pvp-sdk,@chain-protocol/pvp-sdk/guest,@chain-protocol/pvp-sdk/liveness,@chain-protocol/pvp-sdk/spectatorand@chain-protocol/pvp-sdk/contracts/*.
./host, ./simulator and ./conformance are internal to both SDKs. They serve the Chain.wtf
host, chain dev and game-verify, sit outside semver and can change in any release.