Visa, one of the world’s largest payment processors, continues to use Ethereum for their crypto research

they published a proof of concept that allows users to pay gas fees using credit cards by leveraging Account Abstraction (ERC4337).

Here’s how it all works

First off, I want to give a shoutout to the Visa crypto team. You can find their official thread here: https://twitter.com/digitalmustafa/status/1689741716084215809.

I’m going to dive more into the specifics of how it works.

Full report here: https://usa.visa.com/solutions/crypto/paying-blockchain-gas-fees-with-card.html.

We’re excited to share our experimental solution on Paying Onchain Gas Fees with a Visa Card

At @Visa, we’ve been exploring ways to simplify blockchain transactions

Imagine paying for gas fees as easily as buying coffee with your card!

But how did we get here?

الصورة

I’ve talked a bit about AA in the past, but it consists of a couple big features:
– Users send userOps which are intents that are executed by smart contract wallets
– Paymasters can be used in the userOp flow to sponsor txns
– Bundlers bulk process userOps and extract MEV

For this Visa report, we’re going to be looking at the first two points.

The goal of their experiment was to figure out a way for users to pay for transactions using only a Visa card. Users won’t have to deal with exchanges, transfer funds, or figure out how many tokens to buy.

The user starts by selecting their Visa card as the payment method to cover gas fees. This will initiate a request to Visa’s backend which determines how much fiat currency is required, charge the user, and generates a signature confirming the payment.

The user’s wallet then constructs a userOp with this signature and sends it off to an ERC4337 bundler. The bundler will submit this userOp to the EntryPoint contract and validate the signature and payload.

Here’s an overview of the ERC4337 flow:

الصورة

The payload contains a time range in which the userOp is valid. This is to prevent users from creating userOps when gas prices are low and then using them when prices are high. If they were able to do this, Visa would lose a fair amount of money in covering gas fees.

The signature validation is done here: https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/VerifyingPaymaster.sol#L72.

The timestamp validation is done here (on the EntryPoint contract): https://etherscan.io/address/0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789#code#F1#L492.

After validating the userOp, the smart contract wallet will execute the operation. Visa’s experiment involved a smart contract wallet sending 0.01 ETH to another address.

You can find the txn hash here: https://goerli.etherscan.io/tx/0x9ed49bdeafdedb301bbb6f191d5dd5e8b21125d50bae473c4d1a5eba8efd3344.

Notice how some ETH gets sent back to the caller (bundler) of the contract in this txn – this is the bundler getting refunded the gas costs by the paymaster.

The user paid Visa, and the Visa paymaster contract paid for the gas fees (via a deposit in the EntryPoint contract.

الصورة

The innovation in this experiment was buildling a Visa backend that can accept card payments and generate a signature that could be used to prove to the Visa paymaster that your txn should be paid for.

The rest of the flow is all standard account abstraction implementation.

In summary – Visa was able to build a proof of concept that allows users to pay for blockchain txns using a credit card. This innovation was made possible by ERC4337 (Account Abstraction).

This makes interacting with dApps much simpler and easier for users.

Leave a Reply

Your email address will not be published. Required fields are marked *