Original author: Visa, Andrew Beams, Catherine Gu

Original translation: PANews, Jordan

 

As blockchain adoption continues to increase, people are increasingly demanding products with superior user experience and support for real-world use cases. Visa already offers customers (especially younger customers) convenient automatic deductions and recurring automatic payments, but blockchains like Ethereum still seem to have difficulty implementing this feature. Ethereum is the blockchain network with the largest payment volume, and for some types of on-chain digital wallets, it is still a "big project" to automatically withdraw payments from user accounts on a regular basis.

In response to this, Visa proposed the concept of account abstraction, and used it to explore how to use smart contracts to achieve automated programmable payments, and demonstrated how to write smart contracts for self-hosted wallets that support automatic withdrawal of funds.

 

Use Case Scenario

 

Consider a scenario: suppose today is February 25th, and Alice is going on vacation to the Alps. She will return on March 10th, but she must pay her mortgage, cable TV, and utility bills by the 5th of each month. The problem is that she does not have enough money to pay before her vacation, but she will have enough money when she gets her salary on March 1st. Now the question is, how can Alice enjoy her vacation without defaulting on payments?

Yes, the answer is - automatic deduction. In fact, if Alice has a bank account, automatic deduction is a very simple process. Just associate the deduction account with the Visa card. However, on the blockchain, it is not so simple to perform such an operation. However, as a new technology, it is worth exploring the blockchain smart contract solution for the above scenario.

Before we get into the topic, let's first understand the concept of Ethereum accounts. Currently, there are two types of accounts on the Ethereum network:

1. Externally Owned Accounts, often referred to as “User Accounts”

2. Contract Accounts, often referred to as “smart contracts”

User accounts controlled by private keys can send transactions, and smart contracts require associated code to execute, but smart contracts cannot "initiate transactions themselves" because transactions must always originate from user accounts and be signed by users. These transactions include: simple token transfers between user accounts on the Ethereum blockchain, or triggering a series of more complex transactions that perform many different operations through smart contracts.

 

So, how do you automate payments on the Ethereum blockchain?

 

Let's review Alice's situation.

Assume Alice has a user account on the Ethereum blockchain and deposits her salary into the account to pay her mortgage, cable bill, and utility bills. Today, in order to pay her bills, a transaction must be initiated to transfer tokens from her "externally owned account" to the recipient's user account.

In more detail, Alice's "externally owned account" has a secret key that only she knows, and only she can use this private key to generate the Elliptic Curve Digital Signature Algorithm (ECDSA) signature, which is essential for creating a valid transaction. However, if Alice is away on vacation, who will generate this signature and create the fee payment transaction?

There is currently a solution, which is for Alice to use a custodial wallet, that is, to let a third party control Alice's private key. In other words, Alice trusts a third party to protect her funds and send funds to a designated account when she wants to trade or send funds to a designated account. The advantage of doing this is that Alice can use the fund custodian to generate the signature required to create a transaction for scheduled automatic payments, but the disadvantage is that she must fully trust this third party.

So, what if Alice doesn’t want to use a custodial wallet because she’s worried about the risk, but instead uses a self-custodial wallet and arranges automatic payments? Next, let’s introduce another concept - Account Abstraction.

 

What is account abstraction?

 

Account abstraction is a proposal that attempts to merge user accounts and smart contracts into a new Ethereum account type by making them run like smart contracts. In the future, account abstraction will allow us to design a simple solution for automatic payments and have greater flexibility in the process of verifying transactions on the chain, such as:

1. Multi-owner accounts can be enabled through multi-signature verification.

2. Allow the use of post-quantum signatures to verify transactions.

3. Allow a so-called public account where anyone can make transactions by completely eliminating signature verification.

Essentially, account abstraction allows programmable validity to verify and confirm any blockchain transaction. Transactions based on the Ethereum protocol do not have to be completely hard-coded based on validity conditions, but some conditions can be written into the account smart contract in a "customized" way.

More importantly, account abstraction supports automatic payments, since validity rules can be set that no longer include signature verification. Let’s take a look at how to implement this.

 

Delegable Accounts - Using Account Abstraction to Implement Automatic Payments on Ethereum

 

Visa’s Ethereum automatic payment solution is to use the concept of account abstraction and create a new type of account contract - delegated account. The main idea is to expand the programmable validity rules of transactions to include pre-approved permission lists. In simple terms, account abstraction can delegate automatic payment operations initiated by user accounts to pre-approved automatic payment smart contracts.

First, merchants need to deploy the AutoPay smart contract. When a user with a delegated account visits the merchant’s website, they will see a request to approve the AutoPay — similar to a bill accepted by Visa. At this point, the user can see that the AutoPay contract will act on their behalf, with the ability to set parameters that the user needs, such as only charging the user once a month, or charging a maximum amount that cannot exceed a set amount, etc. Most importantly, because it is a smart contract, the user can be confident that the AutoPay contract will not be executed in any other way.

If the user agrees to approve the automatic payment, the wallet will add the address of the automatic payment contract to the list of allowed contracts for the user's delegated accounts.

Next, the merchant triggers the payment by calling the charge function of the automatic payment contract. The automatic payment contract will trigger the user's account to initiate a push payment transaction, which will be a valid transaction because it has been pre-added to the allowed list.

In addition to recurring payments, this solution can also meet other different applications in the real world. In the future, Visa's entrusted account solution can even be expanded to services such as third-party account recovery.

 

Implementing Account Abstraction on StarkNet

 

Since Ethereum does not yet support account abstraction, Visa has implemented a delegated account solution on StarkNet, a Layer 2 blockchain built on top of the Ethereum blockchain to increase transaction throughput and other features to improve the underlying blockchain settlement layer capabilities, developed by crypto startup StarkWare. StarkNet's account model is what Visa currently calls account abstraction, which checks whether a transaction comes from a given address.

For concrete accounts, if someone sends tokens to a user's account, the token contract is interacted with, and the token contract checks if the identity (key) used to sign the transaction for this transfer is recorded as the current owner of the token. For abstract accounts, if someone sends tokens to your account, the token contract is also interacted with, and the token contract checks if the identity (contract) used to make this transfer is recorded as the current owner of the token. For abstract accounts, it is who (the address) is performing the transaction, not how (the signature) the transaction is performed.

With the StarkNet account model, Visa is able to implement a delegated account solution to enable automated payment capabilities for self-hosted wallets.

 

in conclusion

 

As one of the world’s largest payment networks, Visa is actively exploring innovative smart contract solutions to advance programmable currency and payments.

Automatic payment is one of the core functions that the existing blockchain infrastructure lacks, but the concept of account abstraction can provide automatic recurring payment functions for self-hosted wallets, and even introduce other real-world applications beyond automatic payment into the blockchain, thereby creating a better user experience for traditional and emerging payment channels.