---
eip: 5453
label: ERC-5453
title: Endorsement - Permit for Any Functions
status: Last Call
type: Standards Track
category: ERC
created: 2022-08-12
requires: 165, 712, 1271, 5750
official: https://eips.ethereum.org/EIPS/eip-5453
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5453.md
canonical: https://eips.huatuo.xyz/eip-5453/
lang: en
tldr: "A generic \"permit for any function\": callers attach one or more EIP-712 signed endorsements in a trailing `extraData` argument, enabling gasless approvals, sponsored calls and multi-sig thresholds in a single transaction."
tags: [signature, permit, eip712, multisig, meta-transactions]
---

# ERC-5453: Endorsement - Permit for Any Functions

> A general protocol for approving function calls in the same transaction relying on ERC-5750.

**TL;DR:** A generic "permit for any function": callers attach one or more EIP-712 signed endorsements in a trailing `extraData` argument, enabling gasless approvals, sponsored calls and multi-sig thresholds in a single transaction.

## What problem does it solve?

[ERC-2612](/eip-2612/) lets an ERC-20 holder approve spending with an off-chain signature, and [ERC-4494](/eip-4494/) does the same for ERC-721. But each covers only one action (approval for transfer) and one signer, and the usual flow still needs a `permit` call followed by the real call.

Many situations need more: a second party's approval, someone else paying the gas, an M-of-N multisig, or a vote gathered from several signers. ERC-5453 defines one way to attach signed approvals to *any* function and check them in the same transaction.

## How it works

It builds on [ERC-5750](/eip-5750/), which reserves a final `bytes extraData` parameter on a method for extensions. To be endorsable, a method's `extraData` decodes to:

```solidity
struct GeneralExtensionDataStruct {
    bytes32 erc5453MagicWord;   // keccak256("ERC5453-ENDORSEMENT")
    uint256 erc5453Type;        // 1 = single endorser, 2 = multiple endorsers
    uint256 nonce;
    uint256 validSince;         // inclusive
    uint256 validBy;            // inclusive
    bytes   endorsementPayload; // abi.encode(SingleEndorsementData) or (SingleEndorsementData[])
}

struct SingleEndorsementData {
    address endorserAddress;
    bytes   sig;                // 65-byte signature
}
```

What each endorser signs:

1. **Function hash**: `keccak256(abi.encodePacked(keccak256(bytes("function name(type1 p1,...)")), packedParams))`, which binds the signature to a specific function and arguments.
2. **Validity digest**: an [EIP-712](/eip-712/) typed hash of `ValidityBound(bytes32 functionParamStructHash,uint256 validSince,uint256 validBy,uint256 nonce)`.

The contract recomputes the digest and accepts an endorsement if `ecrecover` returns `endorserAddress`, or if `endorserAddress` is a contract and its [ERC-1271](/eip-1271/) `isValidSignature` returns the magic value. With type 2, the method may require a threshold number of valid endorsements.

`validSince`/`validBy` can be block numbers or timestamps; the implementer should document which.

## Sample code

An endorsable mint, following the spec's reference `EndorsableERC721` (the `onlyEndorsed` modifier and `_computeFunctionParamHash` come from the reference abstract contract `AERC5453Endorsible`):

```solidity
pragma solidity ^0.8.9;

contract EndorsableERC721 is ERC721, AERC5453Endorsible {
    function mint(address _to, uint256 _tokenId, bytes calldata _extraData)
        external
        onlyEndorsed(
            _computeFunctionParamHash(
                "function mint(address _to,uint256 _tokenId)",
                abi.encode(_to, _tokenId)
            ),
            _extraData
        )
    {
        _mint(_to, _tokenId);
    }
}
```

Building `extraData` for a single endorser off-chain (ethers v6):

```ts
import { AbiCoder, keccak256, toUtf8Bytes } from "ethers";

const coder = AbiCoder.defaultAbiCoder();
const MAGIC = keccak256(toUtf8Bytes("ERC5453-ENDORSEMENT"));

const payload = coder.encode(["tuple(address,bytes)"], [[endorser, signature]]);
const extraData = coder.encode(
  ["tuple(bytes32,uint256,uint256,uint256,uint256,bytes)"],
  [[MAGIC, 1n, nonce, validSince, validBy, payload]],
);
await nft.mint(to, tokenId, extraData);
```

## Things to know

- **Status: Last Call.** The deadline in the spec has passed, but it had not been moved to Final.
- Endorsements are public once broadcast. Nonces and validity windows narrow replay risk but the spec warns they do not remove it, for example across chains or similar contracts. Include the chain and contract in your EIP-712 domain.
- The spec highlights phishing: a user can be tricked into signing an endorsement whose data happens to match a different target application.
- Functions such as ERC-20's `transfer` have no `extraData` slot; using this standard with them requires a wrapper or upgrade.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-5453
