Using the Gaming SDK from Oasis Labs
Oasis Labs just released an all-new Oasis Gaming SDK — a new tool that helps developers easily build and deploy turn-based and collectible blockchain games with built-in confidentiality.
Using confidential smart contracts, the SDK gives developers the tools to add confidentiality to any game and prevent game users from gaining info they shouldn’t have — peeking at others’ cards, predicting a card before it’s dealt, or seeing others’ moves before they’re ready. More generally, blockchain games also allow users to retain ownership of the things they win in any game — whether it’s kittens, collectible cards, or chips — and take them to other games in the future.
To see how the Gaming SDK works in action, get started by playing our retro versions of Poker, Battleship and Connect Four now. We’ve designed these all in a 16-bit design in a nod to the early days of gaming. We’re also making the source code for these games public so you can easily get started building your own.
More on the Gaming SDK
Gaming development that’s faster and easier
Blockchain games can be difficult to build. There are a number of dependencies with multi-player games in particular. To help avoid this complexity the SDK includes a number of pre-built functionalities that include:
- Game flow management to track turns and update game state on the blockchain. We’ve designed an optimistic execution model, meaning that when a user makes a move it is executed in the browser while the transaction processes on the blockchain.
- Network transport to send updates to each player as the game progresses. This includes state synchronization to ensure when the game state changes, the SDK updates the browser view for each player.
- Integration with web frameworks to make it easy to build a web UI for your game.
- Developer mode allowing you to debug the game engine and smart contracts in the browser. This is useful for testing and means you don’t have to worry about smart contract deployment until you’re ready to publish your game.
Using confidential smart contracts to prevent cheating
One risk of deploying online games is the the possibility that someone may try to hack your game and cheat — looking at players’ cards to inform their own bets or altering the moves of another player altogether. This is particularly risky for developers when the stakes of a game are high (think: online competitions and bets).
Confidential smart contracts are a great fit for blockchain games because they enable provably fair gameplay. Using smart contracts ensures players can’t circumvent the game rules, while confidentiality ensures the game’s sensitive data remains private. For example, a poker game built with confidential smart contracts can guarantee that players are able view only their own cards, and no one (including Oasis nodes) can cheat by viewing other players’ cards or looking at the deck beforehand.
By using confidential smart contracts the Oasis Gaming SDK seeks to enable gaming environments that prevent cheating and ensure players can’t see each other’s moves before they’re ready.
Get inspiration at the Oasis Arcade
To give you some examples of how the SDK can be used in practice, we developed three turn-by-turn games — Poker, Battleship, and Connect Four. They’re all retro-themed in a nod to the early days of gaming.
Deploy your game today
Games developed using the Oasis Gaming SDK are fully functional: they can be deployed to the Oasis Devnet and played live between users immediately. To help you get started we provide several example games built with the SDK including Poker, Tic-Tac-Toe, Connect Four, and Battleship. You can follow our tutorial to see how easy it is to build or you can develop an entirely new game yourself.
- Oasis Arcade
- Gaming SDK documentation and sample code
- Details on the Digital Hackathon
- Office Hours Registration
For questions about Oasis Labs email us at [email protected] and we’ll get back to you ASAP.