Visa releases experimental solution: Paying on-chain gas fees via Visa cards

Visa releases experimental solution: Paying on-chain gas fees via Visa cards

In recent years, blockchain technology has been widely adopted, and while it has the potential to shape the future flow of money, blockchain transactions also bring a higher degree of complexity that traditional payment methods do not have. Blockchain transactions use a decentralized network where multiple participants in the network verify and record each transaction. Blockchain transactions involve self-hosted wallets, private keys, gas fees - all elements that are not applicable to traditional payment methods. To conduct transactions using a blockchain like Ethereum, consumers must maintain a certain amount of balance in the blockchain's native token (such as ETH) to pay for the cost of using the network, known as "gas fees." What if sending a blockchain transaction using a self-hosted wallet was as easy for users as using a credit card to pay for a cup of coffee? For self-hosted wallets, the user experience on blockchains has not yet reached the same ease of use. For example, while Ethereum supports push payments, it does not natively support pull payments, such as automatic payments. To address this problem, in our article "Automatic Payments for Self-Hosted Wallets" last year we explored and demonstrated how to set up pull payments for self-hosted wallets using account abstraction.

Visa excels at facilitating transactions involving different currencies. For example, users can travel to another country without having to worry about preparing foreign currency ahead of time, as the same Visa card allows you to make purchases both domestically and internationally. However, such simplicity does not exist in the crypto world. Consumers transacting on Ethereum find themselves constantly managing their ETH balances to pay for gas fees, which is a cumbersome task that distracts them from important blockchain activities. After comparing the complexity of blockchain transactions to the simplicity of fiat payment transactions supported by the Visa network, it is clear that blockchain transactions need improvement. The question that remains is: how can we help bridge this gap and make blockchain transactions simpler and more convenient?

(Figure 1: Visa Network)

Recognizing this challenge, we explored an option for simplifying blockchain transactions by allowing users to pay on-chain gas fees directly in fiat currency via bank card payments. In this case, users may no longer need to hold the native token of a specific blockchain just to pay for gas fees. This potential solution would leverage Ethereum's ERC-4337 standard and the paymaster contract to enable users to pay gas fees directly with a Visa card. We believe this innovative and flexible approach can help simplify the entry point for new crypto users and enhance the experience for existing users. In this article, we will delve into the existing challenges of blockchain transactions, highlight the need for a more flexible approach, and introduce you to our experiments.

1. Problem

One of the main obstacles in the crypto world is the complex process of paying for blockchain transactions or operations. Each operation, whether it is a simple token transfer or a more complex interaction with a smart contract, incurs a cost called "gas fee". Gas fee represents the amount of computation required to perform the operation. In the case of Ethereum, gas fees must be paid using the blockchain's native token ETH.

Although stablecoins like USDC can be used for transactions, users still need to maintain a certain balance of ETH separately to pay Ethereum gas fees. This often leads users to adopt complex and sometimes expensive methods. Some rely on deposit services to convert fiat currency into native tokens like ETH, while others buy ETH on centralized crypto exchanges and then 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 fluctuations of cryptocurrency exchange rates because they need to continuously purchase ETH even if different cryptocurrencies or stablecoins are used in payment transactions.

(Figure 2: Deposit process: Get tokens for self-custodial wallet)

For example, Alex is a user who wants to participate in a decentralized finance (DeFi) project that requires her to mint new tokens. In order to do so, she decides to use a funding service to exchange her fiat currency for ETH. Alex carefully plans and purchases a certain amount of ETH based on the current gas fees and the expected cost of the mining process. However, gas fees on the Ethereum network can fluctuate rapidly. If fees drop significantly during the period when Alex is minting coins, she will pay too much gas fees and may end up holding an ETH balance that she did not intend to purchase. Conversely, if gas fees unexpectedly increase after Alex obtains ETH, she may not have enough funds to pay the increased fees, resulting in an underpayment. This unpredictability and the requirement to estimate and manage gas fees adds complexity and inconvenience for users like Alex. Figure 2 illustrates the funding process for users to purchase cryptocurrencies through a funding service provider.

(Figure 3: Obtaining tokens through centralized exchanges)

Furthermore, for users like Alex, obtaining native tokens like ETH typically requires transferring assets from centralized exchanges. This requires depositing fiat currency into an exchange, purchasing the necessary tokens, and then transferring them to a personal wallet to obtain enough ETH to pay for gas fees. However, due to the volatility of ETH value and gas fees, this method also carries the risk of overpaying or underpaying. Furthermore, for individuals who are not very tech-savvy and wish to engage in blockchain transactions, this can be an insurmountable challenge. For those who are not familiar with cryptocurrency exchanges and the complexity of purchasing and bridging tokens, this process is a barrier to entry into the crypto world. It is like exchanging cash for different currencies when traveling between different countries, which is cumbersome and unfriendly. Figure 3 illustrates the bridging process for users to purchase cryptocurrency through a cryptocurrency exchange and transfer it to their wallet.

2. Solution

During an internal hackathon between our Crypto Protocols, Visa Innovation Center, and Visa Research teams, we took the opportunity to explore paymasters in the context of the ERC-4337 standard. The result of this collaborative effort is a proposed solution flow that demonstrates how users can pay on-chain gas fees in fiat through a card management profile system. This proposed solution leverages Ethereum’s ERC-4337 standard and the paymaster contract to allow Visa cardholders to pay their gas fees directly. We believe this innovative and adaptive approach can help ease the onboarding process for new crypto users and improve the experience for current users.

(Figure 4: Simplified user interaction with Paymaster deployment)

In this solution proposal, we again put the paymaster at the heart of the process. A paymaster is a special type of smart contract account that can sponsor gas fees for user contract accounts (think of it as a user-centric smart contract). Our proposed solution frees users from the need to hold native blockchain tokens or constantly bridge tokens just to pay for 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 take Alex again, who owns a self-custodial wallet. With our proposed solution, Alex can use her Visa card to pay for gas fees and participate in a DeFi project that requires her to mint new tokens. In this way, Visa helps handle the complex process behind the scenes, allowing Alex to effortlessly choose to use her Visa card to pay for gas fees. This solution brings simplicity and a better experience to users like Alex who are looking for a more streamlined and easy-to-use way to conduct blockchain transactions.

3. Our Experiment

The role of Paymaster is to abstract away the complexity of the gas fee mechanism while providing an alternative to the fees. Our experiment achieves this by accepting gas fees paid offline by users from Visa cards and paying the equivalent on-chain fees on their behalf. The gas fee experience on the user side is as simple as a normal credit card payment. Users can choose to use such a paymaster when sending a User Operation. User Operations are similar to regular blockchain interactions, they specify the actions that users want to perform on the blockchain. But unlike transactions, User Operations do not need to be signed by external accounts and can be directly verified and executed by smart contract accounts.

The setup we deployed to enable off-chain gas payment capabilities is centered around the Verifying Paymaster. The Verifying Paymaster is a smart contract that delegates all necessary checks and information sources to an off-chain component. The on-chain paymaster smart contract can then use the data and approvals provided by this off-chain component to authorize and pay gas fees. The way to reliably transmit this information from the off-chain service to the paymaster contract is through public key cryptography: the off-chain web service uses a secret key to generate a digital signature and send it along with the information. The Paymaster smart contract can in turn use the corresponding public key to verify the signature, and therefore the authenticity of the information. For our experiments, we used the sample Verifying Paymaster smart contract provided by the ERC-4337 core team.

(Figure 5: Technical flow of transactions using Paymaster and Visa cards)

As shown in Figure 5, in our implementation, when a user intends to initiate a blockchain operation, the wallet first generates a User Operation request, which contains information about the operation they are trying to perform (i.e., the call data) and the maximum processing cost of the operation (i.e., parameters related to gas fees). More specifically, the maximum computational budget for the operation is determined by the parameter that specifies the gas limit, and the cost of each computational unit is determined by the gas fee.

Instead of sending the User Operation request to the blockchain immediately, the wallet first sends the User Operation 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 cost to charge the user in fiat currency, and based on the provided Visa card credentials, the card issuer can choose to authorize the use of a Visa card for payment. For the payment receiving solution of the web service, we used Visa's own Cybersource. Cybersource provides developers with the necessary SDK and API to enable merchants to receive digital payments.

In our experiment, after processing the payment through Cybersource, the web service generates a digital signature for the relevant data in the User Operation, including the call data and gas fee information (step 3). It also determines the time range in which the signature is valid. Specifying a time window is important because the value of ETH and other native tokens fluctuates on Ethereum and other EVM chains. Without precautions, a user can exploit the lack of synchronization between the two parts of the paymaster and make an off-chain payment in fiat currency when ETH costs less, then use the signature when ETH costs more and have the paymaster contract bear the cost difference. The web service sends the digital signature back to the wallet. Beyond this point, any changes made by the wallet to the relevant parameters of the User Operation will result in a mismatch with the digital signature, and the Verifying Paymaster smart contract will detect this deviation.

The wallet receives the digital signature and time window from the web service and appends this information (along with the on-chain address of the paymaster contract) as the paymaster parameter of the User Operation. Now, when all parts of the User Operation are complete, the wallet will be able to sign it 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 paymaster contract will receive the User Operation data, which should include the digital signature from the paymaster web service. If there are any errors in the data provided (wrong signature, invalid time window, etc.), the paymaster contract will report an error and will not pay the gas fee. If the verification signature is correct, it means that the web service received the payment from the Visa card to enable the processing cost of this User Operation. The Paymaster contract will not report an error and will process the cost and the User Operation will also be executed (step 5).

(Figure 6: A piece of code - Verifying Paymaster digital signature verification)

When we built our experiment, we used Stackup's userop.js library to build, sign, and send User Operations. In order to publish these User Operations to the blockchain, and for supplementary features such as estimating gas fees, we used Stackup's Bundler as our provider. For testing purposes, we deployed our Verifying Paymaster on the Ethereum Goerli testnet and were able to successfully send User Operations using off-chain gas fee payment methods.

4. Reduce friction on the blockchain

The complexity of blockchain transactions is a significant stumbling block for many users, creating a challenging learning curve and increasing user friction. However, our experiment aims to provide a promising approach to substantially address these challenges. By leveraging the innovative concept of paymaster, combined with account abstraction and the ERC-4337 standard, we explore a possibility that can redefine the process of blockchain transactions.

Account abstraction allows developers to design new flows that help reduce friction in various value exchanges. Our experiments show that developers can implement this solution using existing payment infrastructure. Merchants or decentralized applications (dApps) can run their own paymaster solutions to help improve the customer experience by accepting Visa cards for gas payments. Alternatively, existing wallet and paymaster service providers can offer Visa-based gas payments as a universal option, along with other payment service options. Implementing this potential solution helps lay the foundation for a more accessible and user-friendly approach to digital transactions.

<<:  What should we do if a blockchain project fails to repay investors after issuing coins?

>>:  US exchange Bittrex settles with SEC for $24 million fine

Recommend

Is a person with a wide mouth good-tempered?

Generally speaking, appearance reflects the heart...

What does the split love line mean?

The emotional line is also called the love line. ...

These 4 facial features often cheat. Who is most likely to cheat?

Nowadays, many people like to try new things, and...

The facial features of men after cheating

The facial features of men after cheating News ab...

What does a mole on a woman's arm mean?

Traditional Chinese physiognomy believes that mol...

Palmistry of a good man to marry

As the saying goes, it is better to marry well th...

What does a woman with horizontal lines on her nose look like?

The nose bridge is the pillar of a person. A high...

Walking posture reveals personality and fortune

Walking posture reveals personality and fortune 1...

What do older leftover women look like? Which women will become leftover women?

No girl wants to be an older leftover woman, but ...

Can you tell how long a person will live by looking at their ears?

Some people can live very long, while others are r...

What does a mole on a woman's left waist mean?

Everyone has moles on their body, and moles in di...