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-7015, which proposes a signature mechanism that allows NFT creators to establish attribution for their work.

This article translates, summarizes, and expands on the proposal below, as discussed in the original article published on March 12, 2024.

I have also written about various other EIPs.

Overview

This Ethereum Improvement Proposal (EIP) addresses creator attribution in the non-fungible token (NFT) standards ERC-721 and ERC-1155.

The proposal aims to provide verifiable evidence of an NFT creator's authorization so that NFT platforms can attribute the work to the correct creator. This approach helps combat fraudulent attribution associated with unauthorized copying and counterfeiting, particularly in digital art and collectibles.

For more on ERC-721, see the following article.

https://chaldene.net/erc721

For more on ERC-1155, see the following article.

https://chaldene.net/erc1155

Overview of the solution

The EIP proposes a mechanism in which an NFT creator hashes the parameters required to create an NFT, such as its metadata and other relevant information, and digitally signs the resulting hash. The signature is generated using the creator's private key and serves as evidence of the NFT's authenticity and the creator's identity at the account level.

  • Hashing NFT metadata
    • The metadata and other required information are converted into a hash using a hash function.
    • The hash protects data integrity by making modifications detectable.
  • Digital signature
    • The creator signs the hash using their private key.
    • The signature provides evidence that the creator authorized the data and that the signed data has not subsequently changed.
  • Verification of the signature and parameters
    • When the NFT contract is deployed on the blockchain, the transaction provides a means of verifying the signed parameters and signature.
    • This allows NFT platforms to identify the creator's account and determine attribution.

Benefits

  • Creator authentication
    • The mechanism allows NFT creators to establish a verifiable attribution claim for their work.
  • Fraud prevention
    • Digital signatures make it significantly harder to pass unauthorized copies or counterfeits off as having been authorized by the creator.
  • Greater transparency
    • The NFT's authenticity and the creator's account can be traced on-chain, improving trust across the market.

Implementation considerations

  • Security
    • Creators must manage their private keys securely.
    • If a private key is compromised, an attacker may be able to impersonate the creator.
  • Usability
    • A user-friendly interface is important so that creators can carry out this process easily.

The proposal represents a step toward greater trust and security for both NFT creators and consumers. Improvements of this kind can help shape the future of digital assets as blockchain technology develops.

Motivation

Existing NFT platforms tend to assume that the wallet deploying the smart contract is the NFT creator. However, attribution may be incorrect when a different wallet submits the deployment transaction. This often happens when using contract wallets or adopting newer deployment strategies in which, for example, the first collector deploys the NFT contract.

The EIP aims to solve this problem by allowing the creator to sign the parameters required for NFT creation while permitting any wallet to submit the deployment transaction. This makes the creator's identity verifiable at the account level without relying on the identity of the transaction sender.

Main problems

  • Incorrect creator attribution

    • Existing systems automatically treat the wallet deploying the smart contract that creates an NFT as its creator.
    • This may result in inaccurate attribution and representation of ownership, particularly when creators publish work through representatives or platforms.
  • Contract wallets and new deployment strategies

    • Contract wallets and strategies such as having the first collector deploy an NFT contract complicate attribution because there is no direct link between the creator and the wallet performing the deployment.

Solution

The proposal provides a way to establish NFT creator attribution by having the creator directly sign the parameters required to create an NFT, such as metadata or a hash of the artwork. Any wallet can then submit the deployment transaction while allowing the creator's account to be verified.

The process involves the following steps.

  1. Creating a signature
    • The creator hashes data containing the parameters required for NFT creation and signs the hash using their private key.
  2. Submitting the transaction
    • Any wallet submits the deployment transaction to the blockchain along with the signed data.
  3. Verification and attribution
    • After the transaction is recorded on the blockchain, the signature is verified using the public key to establish the creator's identity at the account level.
    • This information is used to attribute the NFT accurately.

Benefits

This approach improves creator attribution and addresses misleading assumptions in existing systems. It also helps authenticate NFTs and strengthen trust across the market. Creators can establish clear attribution claims for their work, and consumers can verify whether an NFT was authorized by the account identified as its creator.

Specification

The NFT Creator Attribution extension proposed by this EIP allows ERC-721 and ERC-1155 compliant contracts to emit a standard event identifying the NFT creator when the contract is created. This event records creator attribution on-chain so that it can be verified.

Precomputing contract addresses

One important property used by this proposal is that a contract's address can be calculated before it is deployed.

In Ethereum, a contract address for a conventional creation transaction is derived from the deploying account (an externally owned account, or EOA, in the example described here) and its transaction count (nonce). This allows NFT creators to know the address of the contract associated with their work in advance and use that address as part of the signed message.

Contract deployment

The specification can be used to attribute the creator correctly whether the NFT contract is deployed through another contract (a factory) or an externally owned account (EOA). This gives NFT creators flexibility in how they deploy their work while preserving accurate and transparent attribution information.

Implementation

  1. Defining the event

    • An ERC-721 or ERC-1155 compliant contract can implement the extension to emit an event identifying the NFT creator when the contract is created.
    • The event makes creator information publicly available and records it permanently when the contract is deployed on the blockchain.
  2. Creator signature

    • Taking advantage of the ability to precompute the contract address, the creator signs the information required to deploy the contract and provides it as part of the deployment process.
    • This allows the creator to receive attribution regardless of how the contract is deployed.

The extension gives NFT creators greater control over attribution for their work and provides a standardized way to address creator attribution problems. This is an important step toward more transparent and trustworthy NFTs.

Signature mechanism

The EIP proposes a signature mechanism for establishing NFT creator attribution. It relies on the creator granting consent through an EIP-712 compatible message.

EIP-712 is a standard for securely signing typed messages on Ethereum. All signatures required by this proposal must cover all defined fields, and the structure being signed may include arbitrary data defining how tokens are created. The structure must be hashed in an EIP-712 compatible format using an appropriate EIP-712 domain.

For more on EIP-712, see the following article.

[EIP-712] Understanding Typed Structured Data Hashing and Signing

Example signature mechanism

The example in the proposal introduces a struct called TokenCreation. It contains the fields metadataUri (the metadata URI), price (the price), and nonce (a number that ensures uniqueness), which are needed when creating a token.

This struct is an example of how to define concrete parameters for NFT creation. Encoding the struct as a structHash and signing it provides evidence that the creator authorized the token's creation.

Benefits of EIP-712

  • Typed messages
    • By using typed data, EIP-712 makes the contents of a signed message explicit and enables safer transactions.
  • User comprehension
    • A clear data structure makes it easier for users to understand what they are signing.
  • Security
    • EIP-712 domains and typed messages help mitigate security risks such as phishing.

Implications for implementation

By adopting this signature mechanism, NFT creators can provide verifiable evidence that they consented to NFT creation and its associated conditions, such as the metadata URI and price. The information is recorded on-chain in a verifiable form, helping establish NFT authenticity and creator attribution.

This contributes to greater trust and transparency in NFT markets.

ts
// example struct that can be encoded in `structHash`; defines that a token can be created with a metadataUri and price:

struct TokenCreation {
  string metadataUri;
  uint256 price;
  uint256 nonce;
}

Signature verification

The EIP requires a signature verification process to establish NFT creator attribution. The deployed NFT contract performs verification, and the event emitted by the NFT contract during the deployment transaction provides the information needed for platforms to verify the attribution.

The event contains all the fields necessary to reconstruct the signed digest and verify that the signature corresponds to the specified creator. The event is named CreatorAttribution and contains the following fields.

  • structHash
    • A hash of the information required to deploy the NFT contract, such as its name, symbol, or administrator.
    • This corresponds to the value of hashStruct as defined by the EIP-712 hashStruct specification.
  • domainName
    • The domain name of the contract used for EIP-712 signature verification.
  • version
    • The version of the contract used for EIP-712 signature verification.
  • creator
    • The creator's account.
  • signature
    • The creator's signature.

The event is defined as follows.

solidity
event CreatorAttribution(
  bytes32 structHash,
  string domainName,
  string version,
  address creator,
  bytes signature
);

An EIP-712 signature requires the chainId parameter, but it is omitted from the event because it can be inferred from transaction data. Likewise, the verifyingContract parameter used for signature verification is omitted because it must match the transaction log's emitter field. The emitter must be the token contract.

Platforms can verify the validity of creator attribution by reconstructing the signed digest from the emitted parameters and recovering the signer from the signature. The recovered signer must match the creator emitted in the event.

If a CreatorAttribution event exists and the signature is verified successfully, attribution must be given to the creator rather than the account that submitted the transaction.

The system aims to ensure that creators receive proper attribution for their work and to improve transparency and trust in NFT markets.

Reference implementation

ts
pragma solidity 0.8.20;
import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/interfaces/IERC1271.sol";

abstract contract ERC7015 is EIP712 {
  error Invalid_Signature();
  event CreatorAttribution(
    bytes32 structHash,
    string domainName,
    string version,
    address creator,
    bytes signature
  );

  /// @notice Define magic value to verify smart contract signatures (ERC1271).
  bytes4 internal constant MAGIC_VALUE =
    bytes4(keccak256("isValidSignature(bytes32,bytes)"));

  function _validateSignature(
    bytes32 structHash,
    address creator,
    bytes memory signature
  ) internal {
    if (!_isValid(structHash, creator, signature)) revert Invalid_Signature();
    emit CreatorAttribution(structHash, "ERC7015", "1", creator, signature);
  }

  function _isValid(
    bytes32 structHash,
    address signer,
    bytes memory signature
  ) internal view returns (bool) {
    require(signer != address(0), "cannot validate");

    bytes32 digest = _hashTypedDataV4(structHash);

    // if smart contract is the signer, verify using ERC-1271 smart-contract
    /// signature verification method
    if (signer.code.length != 0) {
      try IERC1271(signer).isValidSignature(digest, signature) returns (
        bytes4 magicValue
      ) {
        return MAGIC_VALUE == magicValue;
      } catch {
        return false;
      }
    }

    // otherwise, recover signer and validate that it matches the expected
    // signer
    address recoveredSigner = ECDSA.recover(digest, signature);
    return recoveredSigner == signer;
  }
}

_validateSignature

javascript
function _validateSignature(
  bytes32 structHash,
  address creator,
  bytes memory signature
) internal {
  if (!_isValid(structHash, creator, signature)) revert Invalid_Signature();
  emit CreatorAttribution(structHash, "ERC7015", "1", creator, signature);
}

Overview

Verifies whether a signature is valid and emits a CreatorAttribution event if it is.

Details

This internal function verifies whether the supplied structHash, creator, and signature form a valid signature. If the signature is invalid, the function reverts with the Invalid_Signature error.

If the signature is valid, it emits a CreatorAttribution event to record NFT creator attribution. By supplying a signature for their work, creators can provide evidence of their claim to authorship.

Arguments

  • structHash
    • Hashed information for the NFT contract being deployed.
  • creator
    • The creator's account address.
  • signature
    • The creator's signature.

_isValid

javascript
function _isValid(
  bytes32 structHash,
  address signer,
  bytes memory signature
) internal view returns (bool) {
  require(signer != address(0), "cannot validate");

  bytes32 digest = _hashTypedDataV4(structHash);

  if (signer.code.length != 0) {
    try IERC1271(signer).isValidSignature(digest, signature) returns (
      bytes4 magicValue
    ) {
      return MAGIC_VALUE == magicValue;
    } catch {
      return false;
    }
  }

  address recoveredSigner = ECDSA.recover(digest, signature);
  return recoveredSigner == signer;
}

Overview

Verifies whether a supplied signature was made by the specified signer.

Details

This function verifies whether the signature associated with the supplied structHash and signature was authorized by the specified signer.

If the signer is a smart contract, it uses the ERC-1271 isValidSignature method to verify the signature. Otherwise, it uses ECDSA.recover to recover the signer from the signature and checks whether that signer matches the expected signer.

It returns true if the signature is valid and false otherwise.

For more on ERC-1271, see the following article.

[ERC-1271] Understanding Contract-Based Signature Verification

Arguments

  • structHash
    • The hash of the struct being signed.
  • signer
    • The account address of the expected signer.
  • signature
    • The signature to verify.

Return value

  • bool
    • true if the signature is valid, and false otherwise.

Additional considerations

This EIP aims to standardize creator attribution so that platforms can verify attribution without relying on implicit assumptions.

Establishing a creator attribution standard makes it possible to retain accurate on-chain creator information while accommodating the complexities of contract deployment. This approach provides a more reliable and transparent way to identify NFT creators, fostering trust among participants in the NFT ecosystem.

ERC-5375 also attempts to solve a similar problem. Although off-chain data improves backward compatibility, ensuring accurate and immutable creator attribution is essential for NFTs. A standardized on-chain approach to creator attribution offers stronger guarantees of reliability and security.

For more on ERC-5375, see the following article.

[ERC-5375] Understanding How NFT Creator Information and Proofs Are Stored

Unlike this proposal, ERC-5375 does not readily support specifying a creator for all tokens in an NFT collection, a common practice in newer use cases.

Both this proposal and ERC-5375 share similar limitations when attribution is based on an address.

The standard defines a protocol for verifying that a particular address provided consent. It does not, however, guarantee that the address corresponds to the expected creator. Establishing a link between an address and the entity behind it is beyond the scope of the document.

In short, this EIP standardizes on-chain creator attribution to make attribution verification more reliable and transparent. Creators can assert attribution for their work, while NFT marketplaces and platforms can more easily manage creator information accurately and present it to users.

Proving the direct connection between an address and the actual creator remains outside the scope of the standard and may require additional verification on a case-by-case basis.

Compatibility

The standard proposed by this EIP requires a specific event, CreatorAttribution, to be emitted during the NFT contract deployment transaction.

This event identifies the NFT creator and records creator attribution information on-chain. It includes information about the creator and the creator's signature, making attribution verifiable.

Because of this requirement, previously deployed NFTs cannot implement the standard retroactively. The deployment transaction itself must include the emission of the CreatorAttribution event. Existing NFTs have already been deployed on the blockchain, and their deployment transactions have already completed, so this event cannot be added to those transactions afterward.

This limitation means the standard applies only to newly deployed NFTs and NFT collections created in the future. Applying this standard's attribution mechanism to existing NFT collections or artwork would require an approach such as redeploying the NFT.

This is an important consideration for NFT creators. The standard is expected to encourage adoption by new projects and collections seeking more transparent and verifiable creator attribution.

Security

One potential attack against this EIP is to trick a creator into unintentionally signing a creator attribution consent message. This is a serious concern because it increases the risk of fraudulent attribution or claims over the creator's work and rights.

To mitigate this risk, creators must verify that all signature fields correspond to the intended values before signing.

How the attack works

An attacker may attempt to misappropriate a creator's digital identity or rights relating to their work by persuading the creator to sign an apparently legitimate but malicious message or transaction.

Obtaining such a signature could allow an attacker to issue NFTs in the creator's name or make fraudulent creator attribution claims relating to existing NFTs. As described in the compatibility section, the standard itself does not allow a previously recorded deployment event to be modified.

Countermeasures

Creators can protect themselves against this kind of attack by taking the following precautions.

  • Check the signature fields

    • Before signing, verify that all fields are appropriate and contain only the necessary information.
    • In particular, check that NFT creation information, such as the metadata URI and price, is correct.
  • Use trusted tools

    • Use trusted wallets and contract platforms during the signing process.
    • These platforms generally provide security features to help identify fraudulent transactions and messages.
  • Verify the message contents

    • Take advantage of formats such as EIP-712, which present message contents in a human-readable form, to double-check that the data being signed is correct.

These measures help creators protect their digital assets and identity. Careful review during signing and verification of the information presented are essential to preventing unintended signatures.

Citation

Carlos Flores (@strollinghome), "ERC-7015: NFT Creator Attribution [DRAFT]," Ethereum Improvement Proposals, no. 7015, May 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7015.

Final thoughts

This article examined ERC-7015, which proposes a signature mechanism for NFT creators to establish attribution for their work.

If you have questions, feel free to send me a direct message on Twitter.

Twitter @cardene777

I also publish content on other platforms.

https://chaldene.net/