Skip to content

@chain-protocol/pvp-sdk

Build games where players wager into a shared pot and your rules decide the split. Connect a sandboxed iframe to the host while the protocol handles escrow and settlement transfers.

Bridge SDK and on-chain interface for building player-vs-player games that embed inside the Chain.wtf host application as sandboxed iframes.

PvP games let players wager against each other into a shared pot. The protocol escrows buy-ins, takes a fee, and asks your game contract how to split the distributable pot when the lobby resolves.

Start from an example with npx @chain-protocol/cli init pvp my-game (bunx with Bun). chain dev pvp runs the SDK simulator in your repository: a dev chain, a VRF node, a minimal PvP host and a simulator page that you can open in several browser tabs as different wallets to play against yourself.