Gaming + Aptos: why and how?
Increase engagement, retention, and revenue
Overview
This guide covers the benefits of using the Aptos blockchain and using Shinami for your infrastructure needs. It then provides a high-level overview of the key integration flows. Finally, it summarizes the developer resources to help you get started building.
Why add how to add Web3 elements to your game?
For a rich discussion of this, along with guidance on creating a plan to do so, see our Adding Web3 elements to your game: why and how? guide.
Why use Aptos + Shinami?
The Aptos blockchain was designed from the ground up to support the needs of large scale, highly-performant games. And with Aptos Gamestack, an all-in-one platform for Web3 game development - with payment support, SDKs, and more - you know Aptos is a blockchain that's serious about gaming.
Shinami is the Aptos ecosystem's leading developer platform, offering all that games need to deliver on the promise of Web3 gaming.
Safety first
When you think "blockchain," you might also think "security hacks that steal people's money". Aptos was built to guard against this. The code that runs on the Aptos blockchain is built using Aptos Move, a programming language designed for writing safe code that's easy to verify the correctness of.
Dynamic and composable on-chain assets
NFTs on Aptos can be dynamic, meaning you can upgrade them for a player as they spend more time in your game or meet achievements. They can be composable, meaning that an NFT owned by a player can itself own an NFT - for example, a hero the player owns can be equipped with a sword. Dynamic, composable NFTs allow for countless possibilities to evolve and enhance your players' NFTs - and thus game experience - as they accomplish in-game tasks.
Low latency and predictably low fees.
Aptos is highly scalable and allows for parallel execution of transactions, as compared to the one-at-a-time processing of older blockchains like Ethereum. This allows for transactions to have the sub-second speeds needed to give your players the smooth, uninterrupted experience they demand.
The Aptos architecture also allows for predictable, very cheap transaction fees (as opposed to the huge spikes in transaction fees you see when a big NFT project launch on Ethereum).
Web3 apps with a Web2 UX. Powered by Shinami.
Shinami is the leading developer platform for apps on Aptos. We offer a world-class Node Service for reading and writing to the blockchain, with low-latency and high-availability. We provide both app-controlled and user-controlled wallet infrastructure, both of which let you abstract away friction like signing popups, requiring players to download a wallet application, and other UX hurdles that would turn Web2 gamers away. Finally, games use Shinami's Gas Station to sponsor the gas fee for their users' transactions and offer a seamless, free-to-play experience. This means that when a player earns or updates an NFT representing a game asset, they don't have to go through a long KYC process to buy APT for the small gas fee.
High-level technical overview
How to create a Web3 wallet for a user
There are two main options here, both shown the in the image below:
- Use a Shinami Invisible Wallet. This is a backend wallet that your app manages in the following way: whenever a user creates an account in your game - using whatever account creation and login flow you already have or want to have - your app creates two additional pieces of data you store in your database for the user. These two things are a Shinami wallet id and a Shinami wallet secret. Then, you app will use the id and secret as a sort of username and password in its API requests to Shinami to create and perform operations with the user's wallet.
- Use an Aptos Keyless wallet. This is a frontend (including mobile app) wallet that works specifically with social sign in with Google, Apple, etc (full list of options is what's show as supported on Mainnet here . Each time the user logs in, you'll ask a pepper service for a pepper (like a special password the wallet needs to work), and a prover service for a zkProof (a fancy mathematical proof that you use to write to the blockchain with the wallet). These services are currently run by Aptos Labs and easily execute behind the scenes if you use their SDK.
For a more complete discussion of Shinami's wallet services, see our high-level guide. For more on Aptos Keyless, see here.

How to read and update a player's NFT on chain
Diagram

Summary of steps
- When a player logs in, you lookup the objects that player owns and present them to the player (you can also store a copy of these in your database). At this point in our example, your player has a character with no weapon.
- Once the user defeats a boss in the game, they earn a sword to enhance their character's attack power. Your backend makes a request to mint a sword NFT and assign it to the player's character. Now, the player owns a character who owns a sword. All the better to keep playing and take on the next boss!
Developer resources
Aptos Move game and transaction code
Prior to integrating with Shinami, you should create and deploy Aptos Move smart contracts to manage your on-chain assets (characters, items, etc.) and game logic. In addition to performing reads, you'll write transactions that interact with your on-chain assets and smart contracts (using the Aptos Labs Aptos SDK for this is recommended).
Shinami services to power your game
Shinami has all the services games need to deliver on the promise of Web3 gaming. We also have SDKs so you can get started quickly. Key services are:
- Node Service: enterprise-grade infrastructure to read from and write to the Aptos blockchain. Use this to mint, read, and update NFTs, as well as deploy and update your game's smart contracts.
- Gas Station: sponsor the gas fees for transactions involving your users' wallets for a seamless, free-to-play experience.
- Wallet Services - abstract away signing popups, seed phrases, and other web3 friction for a smooth UX
- Invisible Wallet: app-controlled, backend wallets under the shared custody of your app and Shinami. Both parties must cooperate in order to obtain a valid signature. Uses your app's existing authentication.
Other technologies and tools you might use
- Aptos Keyless: an OpenID-based login flow where the end user just signs into, for example, their Google account. Endpoints for the related zkProofs and peppers are managed by Aptos labs, but all of our services are fully compatible with these wallets. We have a guide to show you how to integrate Keyless wallets with our services.
- Aptos Labs Unity SDK
- OpenDive AptosKit Swift SDK
Updated 2 days ago