Metaplay
Metaplay offers an innovative betting experience that streamlines the process for players by removing friction points commonly associated with blockchain gaming, such as wallet pop-ups and gas fees. This user-friendly approach leverages meta transactions and session keys to create a more seamless gaming experience. Let's break down how Metaplay works:
Technical Flow
Session Wallet Creation: When a player opts into Metaplay©, a session wallet is created to facilitate their interactions. The frontend of the platform checks for an existing session private key in the browser’s localStorage. If it finds one, it uses that key to access the corresponding session wallet.
Session Wallet Generation: In the absence of a stored key, the frontend generates a new session wallet using Ethers.js, a library that ensures the random creation of a secure private key. This new key is then stored in the player's browser localStorage.
Persistent Gaming Experience: Storing the session key locally allows the player to consistently use Metaplay© across different browser tabs and sessions without repetitive pop-ups or confirmations.
Trusted Forwarder Role: A trusted forwarder, likely a server or smart contract, acts as a middleman. It takes signed requests from the session wallet and forwards them to the blockchain, using meta transactions.
Gas Abstraction: Meta transactions facilitate what is known as 'gas abstraction.' This means that the gas fees for transactions can be paid using the same ERC-20 token that players are betting with, rather than requiring a separate transaction with Ether.
Enhanced User Experience: By combining meta transactions with session keys, Metaplay© eliminates the need for players to confirm each bet with their wallets. It essentially creates a "confirmationless" betting experience, significantly enhancing the user interface and removing one of the biggest hurdles players face when interacting with blockchain-based games.
Local Key Deletion: Players have full control over their session wallet and can delete the session key from their browser’s localStorage whenever they choose, providing an additional layer of control and security.
The architecture of Metaplay© is designed to streamline the betting process, making it more akin to traditional online gaming experiences while maintaining the security and transparency benefits of blockchain technology.