Skip to content

Account abstraction for FOCGs

Account abstraction for web3 games

When we talk about mass adoption for web3 games, we usually need to talk about account abstraction. It’s hard to scale when your players need to learn what blockchain technology is to start playing.

Account abstraction makes games more user-friendly by managing the web3 stuff on the smart contract level and not on externally-owned user wallet level, obfuscating the entry barrier of having to deal with technical details of setting up and using your own web3 wallet.

There is a lot of excitement in the air about how account abstraction is going to usher the next billion users onto web3. “Account abstraction” in this context means ERC-4337. And ERC-4337 is amazing. It’s amazing because it improves privacy and it’s censorship resistant. If you need privacy or protection from censorship, you should definitely opt into ERC-4337 account abstraction. As a user.

But if you are creating a fully on-chain game and your main goals are to 

  1. make it easier to play the game by providing gas for player transactions
  2. not kill your players with a thousand confirmation windows

avoid that kool-aid!

We came to the conclusion that creating a custom account abstraction as an upgradeable EIP-2535 Diamond proxy contract is the best alternative to use in our FOCG. And it’s better for other FOCGs because: that way you only pay for players’ gas with no potential ERC-4337 infrastructure fees; players can choose between a web3 wallet or just their emails for signing up. You can also continue to optimize the on-chain behavior of the account system even after it goes live, without a fork.

The two main differences from ERC-4337 style account abstraction:

1) We made a single multi-tenant smart contract that performs game actions for all users of the system.

2) It’s not censorship resistant, while the game itself is. Use ERC-4337 accounts to play. We just won’t be paying for their execution.

Our account abstraction works for our game because the order of player moves doesn’t matter  and it amortizes the gas cost over both players; it supports the management of playing the game with any NFT (for when we decide to allow that); It contains batch methods which allow us to cut down on the costs of execution. 

If you were to customize account abstraction, what changes would be important for your game?