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.

This article examines ERC-7410, which allows an ERC-20 spender to reduce its own token allowance.

This article translates, summarizes, and supplements the material linked below.

I have also covered other EIPs.

Overview

ERC-20 defines a standard interface for fungible tokens on Ethereum. It includes basic operations such as transfers and balance queries, as well as an allowance mechanism.

An allowance lets a token owner authorize another address, known as a spender, to spend or transfer up to a specified amount of the owner's tokens.

ERC-7410 proposes adding a function called decreaseAllowanceBySpender to ERC-20.

This function allows a spender to reduce or completely revoke an allowance granted to it without requiring the owner's intervention.

Suppose a token owner authorizes an address to spend 100 tokens, but the address no longer requires the full allowance.

Using decreaseAllowanceBySpender, the spender can reduce its own allowance to 50 tokens or revoke it entirely by reducing it to zero.

This gives participants more flexibility in managing allowances. Reducing unnecessary approvals can limit exposure to misuse and avoids requiring the token owner to initiate every such reduction.

See the following article for ERC-20.

https://chaldene.net/erc20

Motivation

ERC-20 allows a token owner to authorize another address, the spender, to spend tokens on the owner's behalf.

Conventionally, proactively reducing an allowance without spending the owner's tokens requires the owner to submit an approval update.

This can be inconvenient when the token owner is a treasury wallet or a multisignature wallet. Reducing a previously granted allowance may involve collecting signatures or completing a time-consuming approval process.

The proposal enables the spender to reduce or revoke its own allowance. This provides an additional way to reduce exposure to potential future compromises and avoids requiring a new owner-side authorization process for every reduction.

The proposal gives spenders greater control over the allowances granted to them while reducing administrative overhead for token owners. Its objective is to improve both the security and usability of ERC-20 allowance management.

Specification

A contract implementing the proposal must implement the IERC7410 interface.

Interface

ts
pragma solidity ^0.8.0;

/**
 * @title IERC-7410 Update Allowance By Spender Extension
 * Note: the ERC-165 identifier for this interface is 0x12860fba
 */
interface IERC7410 is IERC20 {

    /**
     * @notice Decreases any allowance by `owner` address for caller.
     * Emits an {IERC20-Approval} event.
     *
     * Requirements:
     * - when `subtractedValue` is equal or higher than current allowance of spender the new allowance is set to 0.
     * Nullification also MUST be reflected for current allowance being type(uint256).max.
     */
    function decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external;

}

The IERC7410 interface extends ERC-20 functionality by adding a mechanism for a spender to reduce an allowance granted by a token owner.

The decreaseAllowanceBySpender Function

This function allows the caller, acting as the spender, to reduce its allowance from a specified token owner.

The arguments are the owner's address and subtractedValue, the amount by which to reduce the allowance.

An ERC-20 Approval event must be emitted following the update.

If subtractedValue is greater than or equal to the current allowance, the new allowance must be set to zero.

This revocation behavior also applies when the current allowance is the maximum value, type(uint256).max.

Function Visibility

The decreaseAllowanceBySpender function must be implemented as public or external, allowing it to be invoked externally.

Emitting Events

A successful call must emit the Approval event, making the updated allowance observable through blockchain logs.

The supportsInterface Method

The interface identifier for IERC7410 is 0x12860fba.

The contract's interface-detection method must return true for this identifier when it supports the interface.

This extension makes allowance management more flexible by allowing a spender to relinquish unnecessary permissions without depending on the owner's immediate availability.

Additional Notes

Introducing decreaseAllowanceBySpender

  • Purpose
    • Allows a spender to reduce or revoke an allowance granted to it.
    • Gives the spender direct control over relinquishing its existing authorization.
  • Design rationale
    • Providing this control aims to support safer and more flexible token management.

Requirements for subtractedValue

  • Partial reduction
    • When subtractedValue is smaller than the current allowance, the allowance is reduced by that amount.
  • Full revocation
    • When subtractedValue equals or exceeds the current allowance, the new allowance is set to zero.

The latter rule enables revocation without arithmetic underflow. The Japanese source also describes a requirement that the subtracted amount be smaller than the allowance; that statement applies to partial reductions, not to full revocation under the rule described above.

Naming Consistency

The function name follows familiar ERC-20 allowance-management terminology, making its purpose easier for developers to understand.

Design Rationale

The extension aims to improve security and operational flexibility. Allowing a spender to reduce its own permissions can reduce unnecessary authorization and administrative friction.

Retaining consistent terminology also makes the feature easier to integrate alongside existing ERC-20 functionality.

Compatibility

The extension is designed to remain compatible with ERC-20.

Implementation

The reference implementation is available below.

https://eips.ethereum.org/assets/eip-7410/ERC7410.sol

Security

Spenders should carefully consider the amount by which they reduce an allowance granted by an owner.

When a token owner grants a spender permission to use tokens, this ERC allows the spender to reduce the allowance itself without the owner's intervention.

Relevant considerations include:

  • Security
    • Excessive allowances can increase exposure if a spender account or contract is compromised.
    • Keeping permissions limited to the amount needed and reducing unused allowances can mitigate that exposure.
  • Efficiency
    • Spenders should consider their legitimate future token usage before reducing an allowance.
    • Reducing it excessively may interrupt authorized operations and require the owner to grant a new allowance.
  • Transparency and accountability
    • Allowance changes are recorded on-chain and observable through the emitted event.
    • This makes authorization changes easier for participants and monitoring applications to track.

A spender should balance its operational requirements against the security benefits of reducing unnecessary permissions. The mechanism does not guarantee protection if a compromised spender refuses to relinquish its allowance.

Citation

Mohammad Zakeri Rad (@zakrad), Adam Boudjemaa (@aboudjem), Mohamad Hammoud (@mohamadhammoud), "ERC-7410: ERC-20 Update Allowance By Spender [DRAFT]," Ethereum Improvement Proposals, no. 7410, July 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7410.

Conclusion

ERC-7410 extends ERC-20 with a mechanism enabling spenders to reduce or revoke their own allowances.

If you have questions, feel free to contact me on Twitter.

Twitter @cardene777

I also publish articles on the following platforms.

https://chaldene.net/