---
eip: 6997
label: ERC-6997
title: ERC-721 with transaction validation step.
status: Review
type: Standards Track
category: ERC
created: 2023-05-07
requires: 721
official: https://eips.ethereum.org/EIPS/eip-6997
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6997.md
canonical: https://eips.huatuo.xyz/eip-6997/
lang: en
tldr: "An ERC-721 extension where owner-initiated transfers and approvals only create pending requests that a separate validator must confirm, so a stolen key alone cannot drain a wallet's NFTs."
tags: [nft, erc721, security, anti-theft]
---

# ERC-6997: ERC-721 with transaction validation step.

> A new validation step for transfer and approve calls, achieving a security step in case of stolen wallet.

**TL;DR:** An ERC-721 extension where owner-initiated transfers and approvals only create pending requests that a separate validator must confirm, so a stolen key alone cannot drain a wallet's NFTs.

## What problem does it solve?

NFT theft usually comes down to one compromised key or one malicious signature: the attacker calls `transferFrom` or `setApprovalForAll` and everything is gone. Keeping NFTs in a cold wallet helps, but makes them awkward to use.

ERC-6997 adds a second factor at the token level. Moving or approving an NFT from the owner's account no longer takes effect immediately; it creates a request that some separate validation system must approve. A thief would need both the owner's key and the validator's.

## How it works

- When the **owner** calls `transferFrom` / `safeTransferFrom`, the contract records a `TransferValidation {from, to, tokenId, valid}` and emits `ValidateTransfer`. Ownership does **not** change yet.
- `approve` / `setApprovalForAll` likewise record an `ApprovalValidation {owner, approve, tokenId, approveAll, valid}` and emit `ValidateApproval`, without granting anything.
- Validating a request performs the transfer or grants the approval, and sets `valid = true`. A request can never be validated twice.
- Transfers made by an **already-approved** account (not the owner) execute immediately, so existing marketplaces that pull NFTs via approvals still work.
- Views: `isValidatorContract()` (returns true), `transferValidation(id)`, `approvalValidation(id)`, `totalTransferValidations()`, `totalApprovalValidations()`.

The standard deliberately does **not** say who validates or how. Examples given: a single validator address connected to a dApp where users review and accept requests, or a per-user chosen validator. It could also be deployed as a wrapper around an existing ERC-721.

## Sample code

Adding a validator role on top of the spec's reference implementation (which exposes internal `_validateTransfer` / `_validateApproval`):

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

import "./ERC6997.sol"; // reference implementation from the EIP

contract GuardedNFT is ERC6997 {
    address public immutable validator;

    constructor(address validator_) ERC6997("Guarded", "GRD") {
        validator = validator_;
    }

    function confirmTransfer(uint256 id) external {
        require(msg.sender == validator, "not validator");
        _validateTransfer(id);   // moves the token, marks valid
    }

    function confirmApproval(uint256 id) external {
        require(msg.sender == validator, "not validator");
        _validateApproval(id);   // grants approve / approveAll
    }
}
```

A dApp for the validator would watch `ValidateTransfer` and `ValidateApproval` events and let the user confirm the legitimate ones.

## Things to know

- Status is **Review**; it may still change.
- Approvals are the escape hatch: once an operator has been validated, its transfers are not checked again. The security of the scheme rests on approvals being validated carefully.
- The validator's own permissions become the critical secret. If it is compromised along with the owner key, the protection is gone.
- Wallets and tools that assume `transferFrom` from the owner moves the token immediately will show confusing results; the transaction succeeds but ownership doesn't change until validation.


---

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