Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

ERC7795 proposes an extension to EIP5792's wallet_sendCalls that lets dApps specify prerequisites for wallet calls, such as token balances and approvals.

This article translates, summarizes, and expands on the specification below.

I also cover a range of EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

ERC7795 extends the wallet_sendCalls method defined in EIP5792 so that dApps can specify token-related preconditions for wallets.

EIP5792 defines the wallet_sendCalls method, which allows dApps to send a batch of calls to a wallet.

ERC7795 supports balance and allowance requirements for ERC20 tokens.

For more on ERC20, see the following article.

ERC20 explained from the ground up

It also supports ownership and approval requirements for ERC721 tokens (NFTs).

For more on ERC721, see the following article.

ERC721 explained from the ground up

Balance and approval requirements can also be specified for ERC1155 tokens.

For more on ERC1155, see the following article.

https://qiita.com/cardene/items/5c37b0c51e1b9c458c67

These features are implemented through the wallet_sendCalls and wallet_getCapabilities RPC methods.

A key feature of the proposal is that wallets can handle preconditions automatically. When a dApp specifies token requirements, the wallet can prepend the transactions needed to satisfy them, such as approvals or swaps.

ERC7795 defines six capabilities covering ERC20 balances and allowances, ERC721 ownership and approvals, and ERC1155 balances and approvals. Because they use the existing EIP5792 capability discovery mechanism (wallet_getCapabilities), wallets can choose which requirements to support. Multiple capabilities can also be combined, and the design allows new types of requirements to be introduced incrementally.

Overview of ERC7795 capabilities

The original illustration is retained and may contain Japanese labels.

Motivation

The proposal addresses the following problems.

Reduced liquidity when dApps depend on a single network

dApps often operate on just one network, which limits the liquidity they can access directly. Most users hold funds on only a few networks. As the number of networks grows, users are less likely to hold funds on the particular network chosen by the dApp.

No way to communicate the final intent

dApps have no way to communicate the user's final intent to a wallet. They can only request the last action they want the user to perform, in the form of a transaction request. Users must therefore work out which preliminary actions are necessary to satisfy the prerequisites for that final action, such as consolidating funds or exchanging assets. This makes the process cumbersome and significantly degrades the user experience.

How the proposal addresses these problems

ERC7795 allows dApps to specify token preconditions as capabilities in wallet_sendCalls. Wallets can interpret these preconditions and automatically prepend transactions as needed, including bridges, swaps, and approvals, making the process smoother for users.

Specification

List of capabilities

ERC7795 defines six capabilities.

Capability Token standard Description
erc20MinBalance ERC20 Minimum balance requirement
erc20MinAllowance ERC20 Minimum allowance requirement
erc721Ownership ERC721 NFT ownership requirement
erc721Approval ERC721 NFT approval requirement
erc1155MinBalance ERC1155 Minimum balance requirement
erc1155MinAllowance ERC1155 Minimum approval requirement

ERC20

Two capabilities are defined for ERC20 tokens: a minimum balance requirement and a minimum allowance requirement.

erc20MinBalance

This capability specifies a minimum ERC20 token balance. A dApp uses it to tell the wallet that the account must hold at least a specified amount of a particular ERC20 token before the requested calls are executed. The wallet may prepend transactions such as bridges or swaps to satisfy this requirement.

Parameters
Field Type Description
version string Capability version
chainId 0x${string} Chain ID (hexadecimal)
owner 0x${string} Address whose balance is checked
token 0x${string} ERC20 token contract address
minAmount 0x${string} Minimum required balance (hexadecimal)
Example
javascript
{
  "capabilities": {
    "erc20MinBalance": {
      "version": "1.0",
      "chainId": "0x01",
      "owner": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "minAmount": "0x0f4240" // 1,000,000 = 1 USDC (6 decimals)
    }
  }
}

erc20MinAllowance

This capability specifies a minimum ERC20 allowance. A dApp uses it to tell the wallet that a particular address must have at least the specified ERC20 allowance before the requested calls are executed. The wallet may prepend an approve transaction to satisfy this requirement.

Parameters
Field Type Description
version string Capability version
chainId 0x${string} Chain ID (hexadecimal)
owner 0x${string} Address granting the allowance
operator 0x${string} Address of the approved operator
token 0x${string} ERC20 token contract address
minAmount 0x${string} Minimum required allowance (hexadecimal)

This capability does not imply that the owner has a token balance. It only requires the allowance to be at least the specified amount.

Example
javascript
{
  "capabilities": {
    "erc20MinAllowance": {
      "version": "1.0",
      "chainId": "0x01",
      "owner": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "operator": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
      "minAmount": "0x0f4240" // Uniswap Router に USDC を承認
    }
  }
}

ERC721

Two capabilities are defined for ERC721 tokens (NFTs): an ownership requirement and an approval requirement.

erc721Ownership

This capability specifies an ERC721 token (NFT) ownership requirement. A dApp uses it to tell the wallet that the account must own a particular NFT before the requested calls are executed. The wallet may prepend a transaction, such as an NFT purchase, to satisfy the requirement.

Parameters
Field Type Description
version string Capability version
chainId 0x${string} Chain ID (hexadecimal)
owner 0x${string} Owner address
token 0x${string} ERC721 token contract address
tokenId 0x${string} Required token ID (hexadecimal)
Example
javascript
{
  "capabilities": {
    "erc721Ownership": {
      "version": "1.0",
      "chainId": "0x01",
      "owner": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "token": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
      "tokenId": "0x10" // BAYC #16 の所有権が必要
    }
  }
}

erc721Approval

This capability specifies an ERC721 token (NFT) approval requirement. A dApp uses it to tell the wallet that a particular operator must be approved for an NFT before the requested calls are executed.

As described in the original article, this capability specifies an approval requirement rather than a separate ownership requirement.

Parameters
Field Type Description
version string Capability version
chainId 0x${string} Chain ID (hexadecimal)
owner 0x${string} Address granting approval
operator 0x${string} Address of the approved operator
token 0x${string} ERC721 token contract address
tokenId 0x${string} ID of the token requiring approval (hexadecimal)
Example
javascript
{
  "capabilities": {
    "erc721Approval": {
      "version": "1.0",
      "chainId": "0x01",
      "owner": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "operator": "0x00000000006c3852cbEf3e08E8dF289169EdE581",
      "token": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
      "tokenId": "0x10" // OpenSea Seaport に BAYC #16 を承認
    }
  }
}

ERC1155

Two capabilities are defined for ERC1155 tokens: a minimum balance requirement and a minimum approval requirement.

erc1155MinBalance

This capability specifies a minimum ERC1155 token balance. A dApp uses it to tell the wallet that the account must hold at least a specified amount of a particular ERC1155 token before the requested calls are executed.

Parameters
Field Type Description
version string Capability version
chainId 0x${string} Chain ID (hexadecimal)
owner 0x${string} Address whose balance is checked
token 0x${string} ERC1155 token contract address
tokenId 0x${string} Token ID (hexadecimal)
minAmount 0x${string} Minimum required balance (hexadecimal)
Example
javascript
{
  "capabilities": {
    "erc1155MinBalance": {
      "version": "1.0",
      "chainId": "0x01",
      "owner": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "token": "0x631998e91476da5b870d741192fc5cbc55f5a52e",
      "tokenId": "0x10",
      "minAmount": "0x0f4240" // Token ID 16 の残高が指定量以上必要
    }
  }
}

erc1155MinAllowance

This capability specifies a minimum ERC1155 approval requirement. A dApp uses it to tell the wallet that approval for an ERC1155 token must be granted to a particular address before the requested calls are executed.

This capability does not imply that the owner has a token balance. As described in the original article, it only requires approval of at least the specified amount.

Parameters
Field Type Description
version string Capability version
chainId 0x${string} Chain ID (hexadecimal)
owner 0x${string} Address granting approval
operator 0x${string} Address of the approved operator
token 0x${string} ERC1155 token contract address
tokenId 0x${string} Token ID (hexadecimal)
minAmount 0x${string} Minimum required allowance (hexadecimal)
Example
javascript
{
  "capabilities": {
    "erc1155MinAllowance": {
      "version": "1.0",
      "chainId": "0x01",
      "owner": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "operator": "0x00000000006c3852cbEf3e08E8dF289169EdE581",
      "token": "0x631998e91476da5b870d741192fc5cbc55f5a52e",
      "tokenId": "0x10",
      "minAmount": "0x0f4240" // OpenSea Seaport に承認
    }
  }
}

Additional details

Complete example

Here is a complete example of wallet_sendCalls combining multiple capabilities.

javascript
{
  "method": "wallet_sendCalls",
  "params": [{
    "version": "1.0",
    "from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
    "calls": [
      {
        "to": "0xDeFiProtocol",
        "data": "0x...",
        "value": "0x0",
        "chainId": "0x01"
      }
    ],
    "capabilities": {
      "erc20MinBalance": {
        "version": "1.0",
        "chainId": "0x01",
        "owner": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "minAmount": "0x5F5E100"
      },
      "erc20MinAllowance": {
        "version": "1.0",
        "chainId": "0x01",
        "owner": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "operator": "0xDeFiProtocol",
        "minAmount": "0x5F5E100"
      }
    }
  }]
}

This example specifies two preconditions.

  • The USDC balance must be at least 100.
  • The USDC allowance granted to the DeFi protocol must be at least 100.

Wallet behavior

The wallet processes the specified capabilities as follows.

sequenceDiagram
    participant dApp
    participant Wallet
    participant Blockchain

    dApp->>Wallet: wallet_sendCalls (with capabilities)
    Wallet->>Wallet: 前提条件を確認
    alt 前提条件が満たされていない場合
        Wallet->>Wallet: 必要なトランザクションを生成
        Wallet->>Blockchain: 前提条件を満たすTx
    end
    Wallet->>Blockchain: 元のcallsを実行
    Blockchain-->>Wallet: 結果
    Wallet-->>dApp: レスポンス

The original sequence diagram retains its Japanese labels.

The diagram illustrates how a wallet processes a request when a dApp specifies capabilities in wallet_sendCalls.

  1. The dApp sends a wallet_sendCalls request with capabilities to the wallet.
  2. The wallet checks the specified preconditions, such as balance and approval requirements.
  3. If the preconditions are not met, the wallet automatically generates the necessary transactions, such as swaps, bridges, or approve calls.
  4. It executes the transactions that satisfy the preconditions before executing the original calls.
  5. Once all transactions are complete, it returns the result to the dApp.

The dApp no longer has to manage the complex transaction ordering itself; the wallet can determine how best to satisfy the preconditions.

Checking capability support

Use the wallet_getCapabilities method to determine whether the wallet supports these capabilities.

javascript
{
  "method": "wallet_getCapabilities",
  "params": ["0xUserAddress"]
}

An example response is shown below.

javascript
{
  "0x1": {
    "erc20MinBalance": { "supported": true, "versions": ["1.0"] },
    "erc20MinAllowance": { "supported": true, "versions": ["1.0"] },
    "erc721Ownership": { "supported": true, "versions": ["1.0"] },
    "erc721Approval": { "supported": true, "versions": ["1.0"] },
    "erc1155MinBalance": { "supported": true, "versions": ["1.0"] },
    "erc1155MinAllowance": { "supported": true, "versions": ["1.0"] }
  }
}

Compatibility

Relationship to EIP5792

ERC7795 relates to the following standards.

Standard Relationship Notes
EIP5792 Extension Implemented as capabilities for wallet_sendCalls
ERC20 Supported token standard Balance and allowance requirements can be specified
ERC721 Supported token standard Ownership and approval requirements can be specified
ERC1155 Supported token standard Balance and approval requirements can be specified

Use cases

The proposal describes two concrete use cases.

Marketplace purchase using a bridge with an EOA wallet

Suppose a user wants to buy an ERC721 token on chain A but only has funds on chain B. The dApp uses wallet_sendCalls to specify the funding requirements on chain A as capabilities alongside the marketplace transaction. The EOA wallet prompts the user to sign the transactions needed to satisfy the preconditions, such as a bridge transaction, and ensures they are completed before executing the main transaction.

Marketplace purchase using a bridge with an EOA wallet

Bridging, swapping, and paying with a smart contract wallet

Suppose a dApp requires a payment in token Z on chain B, but the user only holds token Y on chain A. The dApp specifies the token Z balance requirement on chain B as a capability alongside the payment transaction. The smart contract wallet asks the user to sign all the required transactions (bridge, swap, and payment) at once and executes them in the correct order. The signed transactions can be sent to bundlers at the same time, allowing the operation to complete even if the wallet disconnects.

Bridging, swapping, and paying with a smart contract wallet

Backward compatibility

Because ERC7795 uses the EIP5792 capability system, the original article describes a fallback in which wallets that do not support these capabilities ignore them and process the request as an ordinary wallet_sendCalls request.

Security

The following security considerations warrant particular attention.

Excessive approvals

A dApp may request an allowance larger than it needs.

Wallets should clearly show the requested allowance and allow users to adjust it where appropriate. Requests for unlimited approval (type(uint256).max) require particular care.

Malicious dApps

A malicious dApp may specify preconditions designed to target the user's assets.

Wallets should display the details of the transactions they intend to execute to meet the preconditions and obtain explicit user approval.

Transaction ordering manipulation

Front-running attacks may occur between the transactions that satisfy the preconditions and the original calls.

Wallets should use atomic execution (batched transactions) whenever possible.

Wallet developers need to obtain clear user consent for transactions that are executed automatically to satisfy preconditions.

References

Closing notes

This article has covered how ERC7795 lets dApps specify token preconditions for wallets.

If you have questions about the proposal, feel free to contact me by direct message on Twitter.

Twitter @cardene777

I also publish on the following platforms.