Creating Seamless Onboarding for Web3
Head of Meta Platform Team, KS (KyuSang) Lee, Ph.D., outlines METAPIXEL’s technical approach to web3 onboarding
One of the key goals of METAPIXEL is to smoothly deliver the value of web3 games to the masses. The key value proposition of web3 games is securing their users’ time and money spent in game, that is, digital sovereignty for user’s game assets.
However, some of the essential features of web3 needed to enable user sovereignty present significant barriers for web2 users. Currently, it’s exceedingly difficult for ordinary users to enter the web3 realm, as they need to become familiar with a flood of new terms, concepts, and practices. This is why METAPIXEL is committed to providing users the advantages of web3 while maintaining the ease of use of web2.
One of the inherent aspects of web3 that make it especially difficult for web2 users to onboard is gas fees for transactions on the blockchain. While regular web2 online services are seen as free to interact with (assuming you ignore the fact you pay your internet provider for service), the concept of gas, wherein users have to pay a fee whenever a transaction occurs on-chain, can be an alien concept. Even if they accept the concept, the process of paying gas fees is still a burden and a common pain point. Not to mention new users often struggle with challenging UX design, transaction signing, and network congestion.
In short, gas fees and the related experience as a whole can leave newcomers with a bad impression of web3 games.
This is why I decided to address the gas fee issue in METAPIXEL’s first technical article here on Medium. Here, I would like to speak about how the METAPIXEL team perceives this issue and the solutions we’re working on.
Gas Fees
In order to make a transaction happen on the blockchain (e.g. sending 10 APT to Lucas), a corresponding gas fee must be paid when submitting the transaction. This fee is used as a toll (computation, network, storage, etc.) for the transaction to be executed and recorded on the blockchain. In the case of some blockchains, the fee is returned to validators and ecosystem participants that operate blockchain nodes, thus enabling the network to operate. In addition, as a desirable side effect, charging gas fees mitigates the motivation of malicious users to carry out attacks that generate a great number of transactions within a short time span, such as DDoS (Distributed Denial of Service) attacks.
However, for regular web2 users, gas fees create a huge entry barrier for web3 services. Ideally, users would be educated about why a fee is required to complete an on-chain transaction in the first place. However, the biggest challenge is the fact that users need to pay for gas with the native tokens of whichever blockchain they’re transacting on. Purchasing tokens from an exchange (e.g. CEX, or Centralized Exchanges) and transferring them to one’s own wallet is a real hassle.
Gas fees can hinder access to services, even for web3 users who are already familiar with blockchain. Recently, to celebrate the title announcement of METAPIXEL’s first game, Gran Saga: Unlimited (GSU), we opened an event on the Galxe platform where people could complete missions and claim an On-chain Achievement Token (OAT) in return.
Even though the OAT itself was free to claim, many users faced difficulties claiming theirs because the Aptos network requires gas fees to be paid in APT (the native token of the Aptos blockchain), and users had to possess at least 0.02APT in their wallets to carry out the transaction on Galxe. Interestingly, this is the maximum amount of gas that can be charged on Aptos.
In short, these innate barriers make it hard for users to access web3 services, and unless they have a strong motivation driving them in web3, it can completely dissuade them.
As this is an issue prevalent across web3, METAPIXEL is not the only project trying to solve this problem. Several web3 ecosystems, such as Ethereum (meta-transactions), Solana (octane), and 1inch Network, are already trying to get rid of barriers caused by gas fees by actively conducting related research. While I will not cover the pros and cons of each technology in this article, I would like to emphasize that METAPIXEL is researching and discussing ways to maximize user experience on the foundations of the existing development ecosystem on Aptos as well.
Gas Fees on Aptos
Fortunately, gas fees on Aptos are very cheap. Below are the records of gas fees, taken at random times during one day on Aptos Explorer. They range between $0.0067 USD to $0.08 USD per transaction, which is very low compared to Ethereum, for just one comparison. However, no matter how cheap it is, unless there is absolutely 0 gas required, the barrier still exists for users because they have to purchase some quantity of APT in order to use any service.
Seamless Onboarding — Proxy Gas Fee Payment Service
METAPIXEL’s goal is to let users make use of web3 services without being aware of blockchain gas fees, i.e. seamless onboarding.
In designing a seamless web3 onboarding experience, we’re developing multiple technical concepts. One is a proxy gas fee payment service, meaning users who don’t own any of the blockchain’s native token will be able to pay for gas by proxy with other digital assets such as in-game currencies or items without ever realizing they’re paying a gas fee. Users who are already familiar with web3 and own the native token of the blockchain, e.g. APT, can still use it to pay for gas if they wish.
In addition to this, gas payment-free blockchain transactions for users can be generated for designated transactions, such as special event NFT claims where METAPIXEL will effectively subsidize gas fee costs. This is achievable because in these cases METAPIXEL pays the blockchain gas fee on behalf of users. Below is a screenshot of a test transaction, where METAPIXEL pays for the gas instead of the user, so in essence the user experiences a gas-free transaction.
Put simply, users can perform blockchain transactions without acquiring native tokens. Users may not even notice it was a blockchain transaction!
METAPIXEL will still require certain conditions to be fulfilled to make a transaction gas-free or payable through other methods such as in-game currencies. If we do not, it could open the door to attempts to attack or exploit the network by generating unlimited transactions.
Now, let’s take a deep dive into how we tried to solve the gas fee problem.
Multi-agent Transactions
There are a few prerequisites for proxy gas fee payment on METAPIXEL’s side. First, a transaction has to be created that requests the network to let METAPIXEL pay instead of the user. This transaction includes information about the transaction the user wants to make (e.g. “send 10 APT to Lucas”) and information about the proxy gas payment itself (i.e. that this is a transaction where METAPIXEL wants to carry out the gas payment instead of the user). In order to make this work, we use a Multi-agent Transaction as defined by Aptos. (Definition)
Multi-agent transactions leverage Move’s signer type to allow an arbitrary number of atomic actions in one single transaction across multiple on-chain accounts. This can make atomic swaps, K-of-N approvals, and any arbitrary atomic action between two or more on-chain entities complete in a single transaction. Making these complex interactions indivisible improves both security and performance. An even wider range of composable patterns and use cases are possible when combining multi-agent transactions with multi-signature support in a single account.
Remote-signing procedure
Transactions containing gas fee payment information require both the signature of the user and of METAPIXEL, who would be subsidizing the gas fee payment. First, the user makes a request for proxy gas fee payment to the METAPIXEL server via the METAPIXEL wallet. At this time, the server delivers information about the account that will be charged with the fee. This information includes the account address and the sequence number of the account. (reference)
Subsequently, the request, including the desired transaction by the user and previously received information, is signed and submitted to the METAPIXEL server. The METAPIXEL server performs a rigorous validation process, and if the request is valid, it is signed and submitted to the Aptos network.
Inside Move Smart Contracts
Transactions submitted to the Aptos Network will interact with the smart contract created by METAPIXEL. The code below shows an excerpt from example code where METAPIXEL pays the gas fee for the user (code line 5) and receives a certain type of asset in return, and eventually carries out the transfer requested by the user. The code checks whether there is a preset fee (line 9–10) and collects the fee (line 11). Afterwards, it includes code that withdraws the type of asset that the user wants to transfer and deposits it to the receiver (line 13–15).
In the case of Figure 3, CoinType is set to APT and the payment fee is set to 0. Here, APT can be sent without receiving a gas fee from the user. METAPIXEL is the one who pays the fee.
This code will be published on mainnet and released as open source prior to the official launch of METAPIXEL’s service, benefiting not just our users but the entire Aptos ecosystem.
As can be seen in the code above, asset transfer or asset management follows the existing Aptos standard. Therefore, METAPIXEL’s proxy gas fee payment can be easily provided for previously issued Aptos assets by using our smart contract.
Remaining Challenges — Performance
A multiple payer key management structure is one approach that deals with this issue and enables parallel execution. The performance of the fee payment service measured on one local PC (12-Core, 3.70 GHz) in a laboratory environment was measured at about 100 TPS and latency within 2 seconds. More specifically, we configured the local Aptos network, fee payment server, and transaction generator all under a WSL (Windows Sub Linux) environment. We also observed that CPU-intensive processes, such as transaction signing and validation, are bigger bottlenecks for throughput than RAM and network speed.
Rather than focusing on specific numbers, what we wanted to prove through the lab environment test was whether our fee payment service has a structure that enables 1) parallel execution and 2) scaling out/up.
As shown in the figure below, parallel execution is made possible by utilizing multiple payer accounts, and it is easy to scale out. It’s important to note that in order to scale out, it is essential not only to allocate and revocate payer accounts in a secure manner, but also to process transactions in a stateless way. We plan to model the transaction volume that is expected to occur on the service, prepare measures for dynamic scaling out, and optimize HW/SW before the official launch.
Summary
Creating an enjoyable and accessible user experience is one of METAPIXEL’s ultimate goals. I believe a seamless onboarding process, including our proxy gas fee payment solution, will enable the mass adoption of web3 for games, and the tech team of METAPIXEL will continue researching how we can make web3 easy for users.
In a future tech article, I will share how GSU players will be able to acquire and trade NFT assets with each other seamlessly without interacting with wallets during gameplay.
About KS (KyuSang) Lee
KS (KyuSang) Lee, Ph.D. is the Head of Meta Platform Team at METAPIXEL. KS Lee is a principal engineer with extensive experience working in the network and communication technology and ICT industries. His areas of expertise include blockchain technology, network protocols and systems, distributed systems, network design, and multiple programming languages.
KS Lee earned his Doctor of Philosophy (Ph.D.) focused in Electrical and Electronics Engineering from Korea Advanced Institute of Science and Technology in 2013. He then spent time as a postdoc researcher and developer at the NASA Ames Research Center, before spending nearly 8 years at Samsung SDS including 5 years in the Blockchain Research Lab (1.5 years as Lab Leader).
Now, he’s applying his industry-leading knowledge and experience towards making METAPIXEL’s web3 platform truly best-in-class.
Official Links
METAPIXEL Website: METAPIXEL: the Complete Gaming Metaverse
METAPIXEL Discord: discord.gg/metapixel
METAPIXEL Twitter: METAPIXEL (@Metapixel) / Twitter
NPIXEL Site: 엔픽셀 — NPIXEL