---
eip: 5289
label: ERC-5289
title: Ethereum Notary Interface
status: Review
type: Standards Track
category: ERC
created: 2022-07-16
requires: 165, 5568
official: https://eips.ethereum.org/EIPS/eip-5289
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5289.md
canonical: https://eips.huatuo.xyz/eip-5289/
lang: en
tldr: An on-chain library of legal documents that wallets show to users and record as signed, so a smart contract can require agreement to terms (like an NFT license) before a call succeeds.
tags: [legal, wallet, signature, nft]
---

# ERC-5289: Ethereum Notary Interface

> Allows Smart Contracts to be Legally Binding Off-Chain

**TL;DR:** An on-chain library of legal documents that wallets show to users and record as signed, so a smart contract can require agreement to terms (like an NFT license) before a call succeeds.

## What problem does it solve?

NFTs are often marketed as conveying rights to a work, but in practice most carry no legally meaningful terms at all, and when they do, the license often covers only the first buyer. There is no standard way for a contract to say "you must agree to this document first", or for anyone to later check that a given address agreed to it.

ERC-5289 proposes a "notary" contract that stores links to immutable legal documents and records which addresses have signed them, plus a wallet flow that presents the document to the user before signing.

The spec itself notes that its authors are not lawyers and that it is not legal advice.

## How it works

A **library contract** implements `IERC5289Library` (detectable via [ERC-165](/eip-165/)):

| Function | Purpose |
| --- | --- |
| `legalDocument(documentId)` | Immutable link to the document (IPFS recommended; PDF, HTML, TeX or Markdown) |
| `documentSigned(user, documentId)` | Whether `user` has signed |
| `documentSignedAt(user, documentId)` | When they signed (`uint64` timestamp) |
| `signDocument(signer, documentId)` | Records a signature; must validate and emit `DocumentSigned` or revert |

Documents are identified by a `uint16`, so one library holds up to 65,536 documents.

**Requesting a signature:** a contract that needs agreement reverts with an [ERC-5568](/eip-5568/) wallet signal whose instruction type is `5289` and whose data is `abi.encode(libraryAddress, documentId)`.

**Signing:** a compatible wallet catches that signal, calls `legalDocument`, displays the document, and asks the user to sign or cancel. If they agree, the wallet sends `signDocument`. The user can then retry the original action.

## Sample code

A contract that requires a license to be signed before minting:

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

interface IERC5289Library {
    event DocumentSigned(address indexed signer, uint16 indexed documentId);
    function legalDocument(uint16 documentId) external view returns (string memory);
    function documentSigned(address user, uint16 documentId) external view returns (bool);
    function documentSignedAt(address user, uint16 documentId) external view returns (uint64);
    function signDocument(address signer, uint16 documentId) external;
}

// ERC-5568 signal, see that proposal for the exact definition
error WalletSignal24(uint24 instruction_id, bytes instruction_data);

contract LicensedMint {
    IERC5289Library public immutable library_;
    uint16 public constant LICENSE_ID = 1;

    constructor(IERC5289Library lib) { library_ = lib; }

    function mint() external {
        if (!library_.documentSigned(msg.sender, LICENSE_ID)) {
            revert WalletSignal24(5289, abi.encode(address(library_), LICENSE_ID));
        }
        // ... mint to msg.sender
    }
}
```

## Things to know

- **Status: Review.** It depends on [ERC-5568](/eip-5568/), which is also not final, and on wallets adding support for the signing prompt.
- Whether an on-chain "signature" is legally binding depends on jurisdiction and circumstances; this standard does not settle that question.
- The spec's key security point: someone can always claim their key was stolen. Documents should therefore be **permissive** (granting rights, such as a license to use an image), never **restrictive** (imposing obligations on the signer).
- `signDocument` takes no ECDSA signature by design, to stay compatible with smart-contract accounts.


---

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