Overview of Visa's experimental solution: How to pay for gas fees on the chain through Visa Card?

By Mert Ozbay, Mustafa Bedawala and Catherine Gu

Translation: Huohuo, vernacular blockchain

Blockchain technology has seen widespread adoption in recent years, and while it has the potential to shape the future of money movement, blockchain transactions introduce a high level of complexity not found in traditional payment methods. Blockchain transactions utilize a decentralized network where multiple participants verify and record each transaction. They involve self-custodial wallets, private keys, gas fees — all elements that don’t apply to traditional payment methods. To transact using a blockchain like Ethereum, consumers must maintain a balance in the blockchain's native token (such as ETH) to pay for using the network, known as "gas".

Visa is good at facilitating transactions involving different currencies. For example, users can travel to another country without worrying about obtaining foreign currency in advance, because the same Visa card allows you to make purchases both domestically and abroad. However, this level of simplicity and convenience does not exist in the crypto world. Consumers transacting on Ethereum find themselves constantly managing their ETH balances to pay gas fees, a burdensome process that distracts them from the main blockchain activity. When the complexity of blockchain transactions is compared to the simplicity of fiat-based payment transactions supported by the Visa network, it is clear that improvement is needed. The remaining questions are:

Figure 1 - Visa's network

Overview of Visa’s experimental solution: How to pay gas fees on the chain through Visa Card?

Visa's web image description

Recognizing this challenge, we explored how to simplify blockchain transactions by allowing users to pay for on-chain gas directly in fiat currency via card payments. In this case, users may no longer need to hold blockchain-specific native tokens just to pay Gas fees. This potential solution would leverage ethereum's ERC-4337 standard and payments master contract to enable users to pay for gas directly with their Visa cards.

We believe this innovative and flexible approach can help simplify the entry point for new cryptocurrency users and enhance the experience for existing users. In this paper, we delve into the existing challenges of blockchain transactions, highlight the need for a more flexible approach, and walk through our experiments.

1. Questions

One of the major hurdles in the crypto world is the complex process of paying for transactions or operations on the blockchain. Every operation, whether it's a simple token transfer or a more complex interaction with a smart contract, incurs a cost called a "gas" fee. This represents the amount of computation required to perform the operation. As far as Ethereum is concerned, the gas fee must be paid with the native Token ETH of the blockchain.

Although stablecoins such as USDC can be used for transactions, users still need to maintain a separate ETH balance to pay for Gas fees on Ethereum. This often leads users to complex and sometimes expensive methods. Some rely on on-ramp services to convert fiat currencies into native tokens like ETH, while others buy ETH on centralized cryptocurrency exchanges and transfer it to their wallets. However, both strategies require additional steps and lack the simplicity and immediacy that users are accustomed to in traditional financial transactions. In addition, these methods expose users to the risk of cryptocurrency exchange rate fluctuations, as they need to continuously purchase ETH even when using different cryptocurrencies or stablecoins for payment transactions.

Figure 2 – Entry process: Obtain Token for self-custodial wallet

Overview of Visa’s experimental solution: How to pay gas fees on the chain through Visa Card?

On-ramp process image description

For example, let's consider Alex, a user who wants to participate in a DeFi project that requires her to mint new tokens. To do this, she decides to use an ingress service to convert fiat currency into ETH. Alex carefully plans and purchases a specific amount of ETH based on the current Gas fee and the expected cost of the minting process. However, gas fees on the Ethereum network can fluctuate rapidly. If the fee drops significantly when Alex mints, she will overpay for gas and may end up with leftover ETH that she didn't intend to buy. Conversely, if the gas fee unexpectedly rises after Alex gets ETH, she may not have enough funds to cover the increased fee, resulting in underpayment. Figure 2 illustrates the on-ramp process when a user purchases cryptocurrency through an on-ramp provider.

Figure 3 – Obtaining Token through a centralized trading platform

Overview of Visa’s experimental solution: How to pay gas fees on the chain through Visa Card?

Obtain Token through the centralized trading platform

In addition, for users like Alex, acquiring native tokens such as ETH usually involves transferring assets from centralized exchanges. This requires depositing fiat currency into an exchange, purchasing the necessary tokens, and transferring them to a personal wallet to obtain enough ETH to cover gas fees. However, this approach also carries the risk of overpaying or underpaying due to fluctuations in ETH value and gas fees.

Also, it can be huge and challenging for individuals who are less tech-savvy and want to participate in blockchain transactions. For those unfamiliar with cryptocurrency exchanges and the intricacies of buying and bridging tokens, this process can be a barrier to entry. It's like the cumbersome and unfriendly method of exchanging cash into different currencies when traveling to different countries. Figure 3 illustrates the bridge process when a user purchases cryptocurrency through a cryptocurrency exchange and transfers it to a wallet.

2. Solution

Building on our previously described work “Rethinking Digital Transactions Through Account Abstraction”² Our Crypto Protocols, Visa Innovation Center and Visa Research teams hosted an internal hackathon where we took the opportunity to explore the master of payments under ERC-4337 . The result of this collaboration is a proposed solution process that demonstrates how to enable users to pay their on-chain gas bills in fiat currency via a card on file. The proposed solution leverages ethereum's ERC-4337 standard and payments master contract to allow Visa cardholders to pay their gas fees directly. We believe this innovative and adaptable approach can help simplify the onboarding process for new cryptocurrency users and improve the experience for current users.

Figure 4 – Simplified user interaction with the Paymaster implementation

Overview of Visa’s experimental solution: How to pay gas fees on the chain through Visa Card?

Simplified user interaction image description

In this proposed solution, we again put the teller at the heart of the process. Paymaster is a special type of smart contract account that can provide gas fees for user contract accounts (think of it as a user-centric smart contract). The solution we propose eliminates the need for users to hold native blockchain Tokens or continuously participate in bridging Tokens just to pay Gas fees.

From a user perspective, the solution is attractive due to its simplicity and ease of adoption, as shown in Figure 4. For example, let's go back to Alex, who has a self-hosted wallet. With our proposed solution, Alex can use her Visa card to pay gas fees and participate in DeFi projects that require her to mint new Tokens. In doing so, Visa helps handle the complex process behind the scenes, making it easy for Alex to choose her Visa card to pay for gas. This proposed solution brings simplicity and a better experience to users like Alex who are looking for a more streamlined and accessible way to participate in blockchain transactions.

3. Our experiment

The role of the teller is to abstract away the complexities of the gas fee mechanism while providing an alternative means of financing the fee. Our experimental implementation does this by accepting gas payments from users off-chain for Visa cards and paying the equivalent amount on-chain on behalf of the user. The user-side gas fee experience is as simple as ordinary card payment. Users can choose to use such a payer when sending user actions. User actions are like regular blockchain interactions in that they specify what the user wants to do on the blockchain. But unlike transactions, user operations do not need to be signed by externally owned accounts, and can be directly verified and executed by smart contract accounts.

The setup we implemented to enable off-chain gas payments is centered around verifying the Paymaster. Verifying payers is a smart contract that delegates all necessary checks and sources of information to off-chain components. The on-chain payment master smart contract can then use the data and approvals provided by the off-chain components to authorize and pay gas fees.

The way this information is reliably transmitted from the off-chain service to the payment master contract is through public-key cryptography: the key is used by the off-chain web service to generate a digital signature to send with the information. The payer smart contract can in turn use the corresponding public key to verify the signature, thereby verifying the authenticity of the message. In our experiments, we used the verified Paymaster smart contract sample provided by the ERC-4337 core team.

Figure 5 – Technical workflow for transactions using Paymaster and Visa cards

Overview of Visa’s experimental solution: How to pay gas fees on the chain through Visa Card?

Image illustration of transactions using Paymaster and Visa cards

As shown in Figure 5, in our implementation, when a user intends to initiate an operation through the blockchain, the wallet first generates a user operation request, which contains information about the operation they are trying to perform (i.e. call data) and the maximum processing cost Operational (i.e. parameters related to gas fees). More specifically, the parameter specifying the gas limit determines the maximum amount of computation the operation should budget, while the gas fee determines the cost per compute unit.

Instead of sending the user action request to the blockchain immediately, the wallet first sends the user action along with the Visa card credentials to the Paymaster web service (step 2 in Figure 5). The web service will use the gas fee information to calculate the appropriate fee to charge the user in fiat currency, and based on the card credentials provided, the card issuer can choose to authorize the card payment. For the payment acceptance solution for web services, we used Visa's own web resources. Cybersource provides developers with the necessary SDKs and APIs to enable merchants to accept digital payments.

In our experiment, after the payment is processed by Cybersource, the network service will generate digital signature and gas fee information (step 3) for the relevant data in the user's operation (including call data). It also determines the time frame for which the signature is valid. Specifying the time window is important because the value of ETH and other native tokens is dynamic on Ethereum and other EVM chains. If no precautions are taken, a user can take advantage of the lack of synchronization between the two parts of the payer, pay off-chain in fiat currency when ETH costs are low, then use signatures when the price is higher, and let the payer contract bear the burden cost difference. The web service sends the digital signature back to the wallet. In addition to this, any changes made by the wallet to the relevant parameters of the user's operations will result in a mismatch with the digital signature, and verification of the Paymaster smart contract will detect the discrepancy.

The wallet receives the digital signature and time window from the web service, and attaches this information along with the on-chain address of the payment master contract as the payment master parameter for user operations. Now, when all parts of the user action are complete, the wallet will be able to sign and send it to the blockchain (step 4). On the blockchain, as part of the user operation processing flow defined by the ERC-4337 standard, the payment master contract will receive user operation data, which should include a digital signature from the payment master web service. If there is anything wrong with the provided data (incorrect signature, invalid time window, etc.), the payment master contract is designed to throw an error and not pay the gas fee. If the verification signature is correct, it means that the web service received the card payment to enable the processing cost of this user action. The payment master contract will not throw any errors and will process the cost and the user action will be executed (step 5).

Figure 6 - Code Snippet - Verify Paymaster Digital Signature Verification

Overview of Visa’s experimental solution: How to pay gas fees on the chain through Visa Card?

code snippet image description

When building our experiments, we used Stackup's userop.js library to build, sign, and send user actions with our wallet. To publish these user actions to the blockchain, as well as supplementary functionality such as estimating gas costs, we use Stackup's bundler as our provider. For testing purposes, we deployed a verified teller via the Ethereum Goerli testnet and successfully sent user actions via off-chain gas fee payments.

4. Reduce friction on the blockchain

The intricacies of blockchain-based transactions have been a significant barrier for many users, creating a challenging learning curve and increasing user friction. However, our experiments aim to provide a promising approach to substantially address these challenges. By leveraging the innovative concept of payers, combined with account abstraction and the ERC-4337 standard, we explore the potential to redefine the process of blockchain-based transactions.

The account abstraction allows developers to design new processes that help reduce the friction of exchanging various assets. Our experiments show that developers can leverage existing payment infrastructure to implement the solution. Merchants or decentralized applications (dApps) can run their own Paymaster solution to help improve customer experience by accepting gas fee payments using Visa cards. Alternatively, existing wallet and Paymaster service providers may offer card-based gas fee payment options for general use along with other Paymaster products.

The realization of this potential solution helps lay the groundwork for a more accessible and user-friendly approach to digital transactions.

View Original
  • Reward
  • Comment
  • Share
Comment
No comments