Introducing ERC721H: A New Standard for Programmable NFT Hooks

TLDR

  • ERC721H is an implementation of IERC721 that introduces "Hooks", bringing additional flexibility and control to creators and collections.

  • The Cre8ors contract will be a hybrid ERC721ACH with ownership of an ERC6551 smart wallet.

  • We collaborated with external security consultants to verify the solidity of our approach.

  • We advocate for the community to embrace this implementation to maximize creator ownership of their collections onchain IP.

CONTEXT

Building on the innovations of ERC721A (2022), which introduced significant gas savings for minting multiple NFTs in a single transaction. And then ERC721C (2023), which introduced enforceable on-chain programmable royalties, we are excited to present our latest advancement in the Non-Fungible Token (NFT) realm, ERC721H (hooks). Our vision is to push creativity to the edges and empower projects to have the option to create & expand their imagination onchain. ERC721H leverages the power of "Hooks" to bring additional flexibility and control to creators. The core objective of this standard is to maximize the creative ownership projects have of their collections. It’s fully composable with ERC721A & ERC721C in ERC721H.

PROBLEM

The primary shortcomings of the original ERC721 standard has been a lack of consistent and flexible interaction mechanisms between NFTs and other contracts, leading to constrained functionality and innovation potential.  At Cre8ors, we’re working on pushing creativity to the edges while protecting creators’ ability to manage how their IP is used, exchanged and represented onchain.

Creators have been limited to a set of options defined for cryptokitties’ original ERC721. As creativity expands, our technological interfaces need to adapt to expand the onchain canvas to fit our imaginations.

SOLUTION

The ERC721H standard seeks to address these limitations by introducing the concept of hooks that can be attached to any base ERC721 event. The hooks are programmed to execute functions or trigger events in linked contracts, thereby opening a new world of complex interactions and integrations.

USE CASES

ERC721H provides an array of potentials to make NFTs more interactive and versatile, hence expanding their functionality beyond mere digital assets. NFTs could potentially interact with DeFi contracts, social tokens, governance systems, subscription services, and even IoT devices. From conditional royalties to access control, to game mechanics, the possibilities are endless. Some examples of how we plan to leverage hooks are:

  • Subscriptions

  • Staking

  • IP Distribution & Management

HOW IT STARTED

Zora decoupled the metadata from the ERC721. With IMetadataRenderer & the setMetadataRenderer method, creators can update the base tokenURI module in a standard ERC721 contract with anything they can imagine.

This was the first step towards modularization of ERC721. Decoupling all aspects of the contract. Keeping the base contract simple. Push creativity to the edges. Give creators the keys to choose their level of customization. Give developers the infrastructure to experiment with new ideas with safe fallbacks following the shared, IMetadataRenderer, interface.

IMetadataRenderer
IMetadataRenderer

HOW ITS GOING

The ERC721H standard operates similarly to the original ERC721, but it introduces the possibility of adding custom behavior to all core ERC721 functions. A developer could inherit the ERC721H contract just like they would if they were using OpenZeppelin, customize it to their needs and deploy their ERC721H collection. The addition of hooks is performed using the virtual setMethodHook function, which can be called either in the constructor or after deployment. The hooks are easily adjustable to match the evolving requirements of the NFT collection over time.

With ERC721H, all base ERC721 methods now come with the following methods:

  • beforeMethodHook - Hook firing before an ERC721 event.

  • afterMethodHook - Hook firing after an ERC721 event.

  • useMethodOverrideHook - determines whether to override base ERC721 event.

  • methodOverrideHook - Hook to override an ERC721 event.

  • methodHook - stores the Hook contract interface.

  • setMethodHook - ability for creators to update hooks.

A brief code example showing the implementation of the ERC721H standard is as follows:

import {ERC721H} from "../../contracts/erc721h/ERC721H.sol"; 

contract ERC721HCollection is ERC721H { 

  constructor() ERC721H("Name of My Collection", "SYMBOL") {
    setBalanceOfHook(myBalanceOfHookInterface); 
    setApproveHook(myApproveHookInterface);    
    setSafeTransferFromHook(mySafeTransferFromHookAddress); 
  } 
}

The hooks are custom smart contracts that implement a specific interface IHook defined by the ERC721H standard. The hook functions will be executed every time an NFT is minted, transferred, or burned, offering unlimited possibilities to add custom logic or trigger other contracts.

DECENTRALIZATION

Inherent to ERC721H's design, the programmable hooks provide flexibility in shaping the degree of centralization or decentralization as needed. By linking a hook's activation to specific wallets - be it an individual, corporate, multisig, or an entire DAO of smart wallets - creators can define the range and extent of decentralization. This modular approach ensures that the control parameters are adaptable to the specific contract's governance structure and progression, thereby promoting a balance between autonomy and collective participation.

Getting Started with ERC721H

We believe that the ERC721H standard has the potential to significantly contribute to the innovation and growth of the NFT ecosystem by fostering creative management of IP. We encourage developers and creators to explore our comprehensive guides, examples, and resources available on our GitHub repository.

INNOVATE OR DIE

Times are changing. The bull run is over and with it went the old standards. What worked before should not be interpreted as what will work today. Our core mission at Cre8ors is to unlock the creative potential and financial freedom for our members and ERC721H is a small example of how we plan on delivering innovative technology to our community that constantly moves the web3 space forward.

Disclaimer*: The details and mechanisms provided in this article are preliminary and subject to changes and improvements based on ongoing development and community feedback. Kindly refer to our GitHub repository for the latest and most accurate information.*

The Cre8ors mint is on August 8@8AM ET. See you there.

Subscribe to sweetman.eth
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.