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 ERC3440, a proposal for distinguishing original artworks from limited editions represented by ERC721 NFTs.
This article translates, summarizes, and expands on the material linked below.
I have also written about other EIPs.
Overview
ERC3440 proposes extending ERC721 with signatures for NFTs that represent artwork. Artists can distinguish an original piece from its limited-edition prints and associate signature data with each. By recording a signature for each token ID using their own keys, artists can strengthen the evidence of authenticity and provenance.
Motivation
The relationship between NFTs and digital art currently relies on NFT metadata (tokenURI), which may be stored on external servers. This makes it difficult to record the equivalent of an artist's handwritten signature directly on the blockchain.
In the art world, distinguishing an original work from an edition (a reproduction) is common practice. ERC721, however, was designed for general use cases such as real estate deeds and game items rather than specifically for artwork.
ERC3440 seeks to address several issues.
An artist can sign an NFT with their own key, recording evidence of authenticity on-chain. The number of limited editions can be explicitly specified so that buyers can assess the scarcity of the work. A standard for signed NFTs that does not depend on metadata can help establish trust between artists and buyers. Third-party applications can also display signatures and edition information using standardized read functions.
These features can improve the reliability and expressive power of digital art NFTs and strengthen the relationship between artists and their audiences.
Specification
ERC3440 adds artist signatures and edition designation to ERC721 for limited-edition artwork. A conforming contract provides the following functionality:
- Designation of the original NFT
- Setting the maximum number of limited-edition prints
- An artist's signature for each token ID
- Retrieval and verification of information signed by the artist
The proposal uses EIP712 signatures that can be verified on-chain to provide evidence of authenticity and limited issuance.
Interface
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/**
* @dev ERC721 token with editions extension.
*/
abstract contract ERC3440 is ERC721URIStorage {
// eip-712
struct EIP712Domain {
string name;
string version;
uint256 chainId;
address verifyingContract;
}
// Contents of message to be signed
struct Signature {
address verificationAddress; // ensure the artists signs only address(this) for each piece
string artist;
address wallet;
string contents;
}
// type hashes
bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
);
bytes32 constant SIGNATURE_TYPEHASH = keccak256(
"Signature(address verifyAddress,string artist,address wallet, string contents)"
);
bytes32 public DOMAIN_SEPARATOR;
// Optional mapping for signatures
mapping (uint256 => bytes) private _signatures;
// A view to display the artist's address
address public artist;
// A view to display the total number of prints created
uint public editionSupply = 0;
// A view to display which ID is the original copy
uint public originalId = 0;
// A signed token event
event Signed(address indexed from, uint256 indexed tokenId);
/**
* @dev Sets `artist` as the original artist.
* @param `address _artist` the wallet of the signing artist (TODO consider multiple
* signers and contract signers (non-EOA)
*/
function _designateArtist(address _artist) internal virtual {
require(artist == address(0), "ERC721Extensions: the artist has already been set");
// If there is no special designation for the artist, set it.
artist = _artist;
}
/**
* @dev Sets `tokenId as the original print` as the tokenURI of `tokenId`.
* @param `uint256 tokenId` the nft id of the original print
*/
function _designateOriginal(uint256 _tokenId) internal virtual {
require(msg.sender == artist, "ERC721Extensions: only the artist may designate originals");
require(_exists(_tokenId), "ERC721Extensions: Original query for nonexistent token");
require(originalId == 0, "ERC721Extensions: Original print has already been designated as a different Id");
// If there is no special designation for the original, set it.
originalId = _tokenId;
}
/**
* @dev Sets total number printed editions of the original as the tokenURI of `tokenId`.
* @param `uint256 _maxEditionSupply` max supply
*/
function _setLimitedEditions(uint256 _maxEditionSupply) internal virtual {
require(msg.sender == artist, "ERC721Extensions: only the artist may designate max supply");
require(editionSupply == 0, "ERC721Extensions: Max number of prints has already been created");
// If there is no max supply of prints, set it. Leaving supply at 0 indicates there are no prints of the original
editionSupply = _maxEditionSupply;
}
/**
* @dev Creates `tokenIds` representing the printed editions.
* @param `string memory _tokenURI` the metadata attached to each nft
*/
function _createEditions(string memory _tokenURI) internal virtual {
require(msg.sender == artist, "ERC721Extensions: only the artist may create prints");
require(editionSupply > 0, "ERC721Extensions: the edition supply is not set to more than 0");
for(uint i=0; i < editionSupply; i++) {
_mint(msg.sender, i);
_setTokenURI(i, _tokenURI);
}
}
/**
* @dev internal hashing utility
* @param `Signature memory _message` the signature message struct to be signed
* the address of this contract is enforced in the hashing
*/
function _hash(Signature memory _message) internal view returns (bytes32) {
return keccak256(abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
keccak256(abi.encode(
SIGNATURE_TYPEHASH,
address(this),
_message.artist,
_message.wallet,
_message.contents
))
));
}
/**
* @dev Signs a `tokenId` representing a print.
* @param `uint256 _tokenId` id of the NFT being signed
* @param `Signature memory _message` the signed message
* @param `bytes memory _signature` signature bytes created off-chain
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Signed} event.
*/
function _signEdition(uint256 _tokenId, Signature memory _message, bytes memory _signature) internal virtual {
require(msg.sender == artist, "ERC721Extensions: only the artist may sign their work");
require(_signatures[_tokenId].length == 0, "ERC721Extensions: this token is already signed");
bytes32 digest = hash(_message);
address recovered = ECDSA.recover(digest, _signature);
require(recovered == artist, "ERC721Extensions: artist signature mismatch");
_signatures[_tokenId] = _signature;
emit Signed(artist, _tokenId);
}
/**
* @dev displays a signature from the artist.
* @param `uint256 _tokenId` NFT id to verify isSigned
* @returns `bytes` gets the signature stored on the token
*/
function getSignature(uint256 _tokenId) external view virtual returns (bytes memory) {
require(_signatures[_tokenId].length != 0, "ERC721Extensions: no signature exists for this Id");
return _signatures[_tokenId];
}
/**
* @dev returns `true` if the message is signed by the artist.
* @param `Signature memory _message` the message signed by an artist and published elsewhere
* @param `bytes memory _signature` the signature on the message
* @param `uint _tokenId` id of the token to be verified as being signed
* @returns `bool` true if signed by artist
* The artist may broadcast signature out of band that will verify on the nft
*/
function isSigned(Signature memory _message, bytes memory _signature, uint _tokenId) external view virtual returns (bool) {
bytes32 messageHash = hash(_message);
address _artist = ECDSA.recover(messageHash, _signature);
return (_artist == artist && _equals(_signatures[_tokenId], _signature));
}
/**
* @dev Utility function that checks if two `bytes memory` variables are equal. This is done using hashing,
* which is much more gas efficient then comparing each byte individually.
* Equality means that:
* - 'self.length == other.length'
* - For 'n' in '[0, self.length)', 'self[n] == other[n]'
*/
function _equals(bytes memory _self, bytes memory _other) internal pure returns (bool equal) {
if (_self.length != _other.length) {
return false;
}
uint addr;
uint addr2;
uint len = _self.length;
assembly {
addr := add(_self, /*BYTES_HEADER_SIZE*/32)
addr2 := add(_other, /*BYTES_HEADER_SIZE*/32)
}
assembly {
equal := eq(keccak256(addr, len), keccak256(addr2, len))
}
}
}Structs
EIP712Domain
struct EIP712Domain {
string name;
string version;
uint256 chainId;
address verifyingContract;
}Defines the domain information for an EIP712 signature. The struct identifies the signing domain and restricts the scope and meaning of the signature according to EIP712.
For more on EIP712, see the following article.
[EIP712] Understanding Typed Structured Data Hashing and Signing
Parameters
name- Domain name.
version- Domain version.
chainId- Chain ID (the blockchain identifier).
verifyingContract- Address of the contract responsible for verifying the signature.
Signature
struct Signature {
address verificationAddress;
string artist;
address wallet;
string contents;
}Stores the information signed by the artist. It contains the details used to sign a work, including the artist's name, signing wallet, and message contents.
Parameters
verificationAddress- Address of the contract to which the signature applies.
artist- Artist's name.
wallet- Artist's wallet address.
contents- Contents of the message being signed.
Constants, Variables, and Mappings
EIP712DOMAIN_TYPEHASH
bytes32 constant EIP712DOMAIN_TYPEHASHThe type hash of the EIP712Domain struct. This constant hashes the struct definition required for EIP712 signing.
SIGNATURE_TYPEHASH
bytes32 constant SIGNATURE_TYPEHASHThe type hash of the Signature struct. It hashes the definition of the struct being signed and is used for EIP712 signing.
DOMAIN_SEPARATOR
bytes32 public DOMAIN_SEPARATOR;The domain identifier for EIP712 signatures. This is a hash of the signing domain used during signature verification.
_signatures
mapping (uint256 => bytes) private _signatures;A mapping that stores signature information associated with each NFT. It records the artist's signature (of type bytes) for each token ID and is used to check whether a token has been signed and to verify the signature.
Parameters
uint256- Token ID.
bytes- Signature data.
artist
address public artist;The artist's wallet address. It identifies the artist responsible for the NFTs and their signatures, giving that address an administrative role.
editionSupply
uint public editionSupply = 0;The total number of limited editions to issue. It represents the intended maximum number of NFTs issued as prints.
originalId
uint public originalId = 0;The token ID of the original NFT. The design intends the ID representing the original work to be designated once.
Events
Signed
event Signed(address indexed from, uint256 indexed tokenId);An event indicating that an NFT has been signed. It is emitted when the artist signs a particular token ID.
Parameters
from- Address of the artist who signed the NFT.
tokenId- Token ID being signed.
Functions
_designateArtist
function _designateArtist(address _artist) internal virtualDesignates the artist. It sets the artist's wallet address in the contract only if an artist has not already been designated.
Arguments
_artist- Wallet address of the artist who will sign the works.
_designateOriginal
function _designateOriginal(uint256 _tokenId) internal virtualDesignates the original NFT. The artist can designate a token ID from their NFTs as the original, with the intended restriction that this happens only once.
Arguments
_tokenId- ID of the NFT to designate as the original artwork.
_setLimitedEditions
function _setLimitedEditions(uint256 _maxEditionSupply) internal virtualSets the total number of limited-edition prints. It specifies the maximum number of reproductions to issue, with the intended restriction that the value cannot be reset once established.
Arguments
_maxEditionSupply- Maximum supply of limited editions.
_createEditions
function _createEditions(string memory _tokenURI) internal virtualIssues the limited-edition NFTs. It mints NFTs to the artist's address according to the previously configured supply and assigns identical metadata to each token.
Arguments
_tokenURI- Shared metadata URI for each limited-edition NFT.
_hash
function _hash(Signature memory _message) internal view returns (bytes32)Calculates the digest of the message being signed. It generates a hash from the Signature struct using the intended EIP712 format.
Arguments
_message- Signature information to hash.
Return value
bytes32- The calculated digest.
_signEdition
function _signEdition(uint256 _tokenId, Signature memory _message, bytes memory _signature) internal virtualRegisters a signature for an NFT. It verifies the Signature data and signature bytes provided by the artist and stores the signature for the NFT if verification succeeds.
Arguments
_tokenId- ID of the NFT being signed.
_message- Contents of the signed message.
_signature- Actual signature data (a byte sequence).
getSignature
function getSignature(uint256 _tokenId) external view virtual returns (bytes memory)Retrieves the signature registered for the specified NFT. External callers can obtain the signature bytes of an NFT that has already been signed.
Arguments
_tokenId- ID of the NFT whose signature is requested.
Return value
bytes- Signature data.
isSigned
function isSigned(Signature memory _message, bytes memory _signature, uint _tokenId) external view virtual returns (bool)Verifies a signature. It checks whether the externally supplied signature matches the one registered for the NFT and was signed by the artist.
Arguments
_message- Signed message contents to verify.
_signature- Signature bytes to verify.
_tokenId- ID of the NFT being verified.
Return value
booltrueif the signature is from the artist and matches the stored signature; otherwise,false.
_equals
function _equals(bytes memory _self, bytes memory _other) internal pure returns (bool equal)Determines whether two bytes values are equal. It compares the hashes of the two byte arrays to check for equality, providing a gas-efficient alternative to comparing individual bytes.
Arguments
_self- Signature data to compare.
_other- The other signature data.
Return value
booltrueif the values match exactly; otherwise,false.
hash
bytes32 digest = hash(_message);Note: the implementation does not define a hash function. It appears to refer to _hash instead (_hash(_message) is defined in the code). The discussion here therefore treats it as the _hash function.
Additional Notes
One important role of NFTs is to visibly express the uniqueness of digital artwork. Provenance is central to the art world, and ERC3440 provides a way to associate that provenance more closely with an NFT.
By explicitly signing a token, an artist can record on-chain evidence that the work carries the artist's endorsement, rather than merely linking to an image. This reinforces the association between the artist and the work and gives collectors and fans a basis for assessing authenticity.
As long as the artist retains their private key, they can also provide further evidence in the future that the same signature was associated with a previously issued NFT. This supports continued verification of authenticity over time.
Reference Implementation
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC3440.sol";
/**
* @dev ERC721 token with editions extension.
*/
contract ArtToken is ERC3440 {
/**
* @dev Sets `address artist` as the original artist to the account deploying the NFT.
*/
constructor (
string memory _name,
string memory _symbol,
uint _numberOfEditions,
string memory tokenURI,
uint _originalId
) ERC721(_name, _symbol) {
_designateArtist(msg.sender);
_setLimitedEditions(_numberOfEditions);
_createEditions(tokenURI);
_designateOriginal(_originalId);
DOMAIN_SEPARATOR = keccak256(abi.encode(
EIP712DOMAIN_TYPEHASH,
keccak256(bytes("Artist's Editions")),
keccak256(bytes("1")),
1,
address(this)
));
}
/**
* @dev Signs a `tokenId` representing a print.
*/
function sign(uint256 _tokenId, Signature memory _message, bytes memory _signature) public {
_signEdition(_tokenId, _message, _signature);
}
}Security
ERC3440 allows the artist to perform several important actions:
- Designating the original work (originalId)
- Setting the maximum supply of limited editions (editionSupply)
- Issuing the NFTs for each edition
- Specifying the artwork link through
tokenURI - Providing evidence of uniqueness through signatures
If these settings could be changed repeatedly, several problems could arise:
- The authenticity of an original already sold could be called into question.
- The artist could increase the edition size after the fact, reducing its value.
- Replacing a signature later could undermine the consistency of the work's provenance.
To prevent these problems, ERC3440 intends to impose the following safeguards:
- The original artwork can be designated only once.
- The limited-edition supply can be set only once.
- Each edition NFT can be signed only once.
The proposal recommends handling initialization in the contract's constructor (a special function executed once at deployment) so that the relevant settings are established at initialization and protected against subsequent changes, preserving the uniqueness and reliability of the NFTs.
Citation
Nathan Ginnever (@nginnever), "ERC-3440: ERC-721 Editions Standard [DRAFT]," Ethereum Improvement Proposals, no. 3440, April 2021. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-3440.
Conclusion
This article covered ERC3440, a proposal for distinguishing original NFTs from limited editions in the ERC721 format.
If you have questions, feel free to contact me via Twitter DM.
I also publish material on the following platforms:



