Transaction Management

Transaction Management Overview

One of the biggest pain points when building games that implement blockchain technologies is handling transactions at scale.

In simple terms, transactions are updates to data on the blockchain. Within the context of games, transactions are used for things like increasing a player's game currency balance, giving players items, enabling players to craft items and spend currency, and so much more.

When you want to build frictionless blockchain games that support gasless transactions, this adds even more complexity.

MetaFab has developed a vast set of internal infrastructure that can handle 10,000+ transactions per second, per game. This includes automated systems for gasless and non-gasless transactions, all handled under the hood when you or your players directly or indirectly interact with MetaFab APIs.

For example, when a player wants to spend some of their game currency, your game client likely implements a currency transfer API request on behalf of your player using their access token and wallet decrypt key. This triggers a transaction to be submitted to the blockchain network under the hood by MetaFab's infrastructure on behalf of your players wallet - this is true for both managed and external player wallets. Now, multiply these types of interactions by 1,000's of times per second in a large scale game. Building the infrastructure to handle this is a massive lift for any team, we've solved it, proven it at scale and provide it to you for free without any setup or configuration required.

Given the complexities of building similar systems to handle your player transactions at scale, here's just a few reasons to use MetaFab's automatic systems instead of building your own:

  • Save many months of building and testing complex systems at scale.
  • Leave the domain expertise to the experts and focus on building a great game without having to solve deep, low-level blockchain engineering problems.
  • Use a system that "just works". You make API requests to various API endpoints through our REST API or SDKs, and MetaFab automatically handles any associated transactions under the hood on behalf of your game and players.
  • MetaFab's transaction systems encapsulate and handle a wide variety of edge cases like nonce collisions, retry logic, static dry runs, and much more. The net result of all of this is a system that is predictable, resilient and reliable.

Some of the standout pieces of our transaction management infrastructure includes:

  • Automated Retries: If for any reason your underlying transaction tied to a MetaFab API request were to fail, our automated retry systems will immediately recognize the cause of failure, adjust transaction parameters and reattempt your transaction without you needing to resubmit your API request. This typically happens at sub-second speed without any noticeable API request delays or response indications. Our retry systems implement a number of advanced algorithms that result in you never needing to think about or manage complicated transaction retry logic.

  • Automated Prioritization: Depending on any given blockchain's network congestion, transactions by default can be slow and take a frustrating amount of time to confirm and update on-chain state. To solve this, MetaFab has a variety of automated transaction prioritization algorithms that will adjust the various parameters of your to-be submitted transactions. This includes automatic adjustment of things like gas price, prioritization fees where relevant, various RPC level options, and more. Ultimately this means 99% of the time you can expect your transactions to be confirmed and succeed as fast as possible.

  • Automated Nonce Management: When building your own systems and handling transactions at scale, especially gasless transactions to remove player friction, you will run into nonce collision issues. Nonce collisions in parallelized systems are very common and very frustrating. MetaFab implements automated smart nonce handling under the hood, internal fan-out type systems for processing gasless transactions and nonce adjustment of retries when necessary. With MetaFab, you don't ever have to worry about nonce collisions at any scale, our systems will automatically handle all transaction level nonce logic, retries and adjustments where necessary.

  • Gasless Systems: Gasless transactions are transactions submitted to a blockchain's network where the originating address of the transaction does not pay the gas fee. In the case of MetaFab, you - the game developer - cover the transaction fees for your players through our systems. Depending on the blockchain you're building on, such as Polygon, these fees can be as low as < $0.001 per transaction. This can be thought of synonymously to paying server fees for the backend of a traditional game. This type of system allows you to offer your players a way to interact, spend, earn and play your game without needing to deal with frustrating wallet management, getting tokens from exchanges, and more. This is one of MetaFab's multiple systems that result in the complete removal of all blockchain related friction from your game.

  • Scalability: MetaFab's transaction systems, including our gasless transaction systems, have been stress tested and proven in both real-games and stringent test environments. Our transaction systems are designed to handle upwards of 10,000+ transactions per second for any given game. This transaction per second rate is built on elastic systems that can automatically scale as necessary for any usage spikes as well.