← Back to home

Tagged Contracts

Solidity

Contract Tags is like Docker tags, but for blockchain contracts. We want to make it easy to tell what kind of license a contract uses and who's responsible.

Screenshots

Tagged Contracts screenshot 1
Tagged Contracts screenshot 2
Tagged Contracts screenshot 3
Tagged Contracts screenshot 4
Tagged Contracts screenshot 5

Problem Statement

Tagged Contractsimagines a composable metadata layer where free-form information can be stored on the blockchain in a consistent way that is easy for developers and users alike.Think: Docker tags, for smart contracts, yet with a link to more info.Tags are special data structures that contracts can inherit from, making it easy for developers to "bless" a contract as a tag. Furthermore, we show an example of how a contract can be deployed to describe a tag and complete the link back to the original contract by allowing contracts to purchase licenses for the tag.Contracts set tags like:setTag("license:cc0", "0x0221a85835DD42D82385146406c534A1f4Af5E6D"); // reference to more info setTag("author:lorem-labs"); // simple tag setTag("Example"); // simpler tag :), stored as lowercaseWe then expose a common interface for retrieving tags and showing them as a JSON representation.

Solution

This project is mostly Solidity and tooling via Hardhat.The dApp has ethers and SvelteKit.It was re-factored down many times, (although not enough time!) in an effort to make the interface as clean as possible and easy for a developer to use.The initial motivating use case is to provide a uniform way to add license information to NFTs to help answer questions like "What rights do I have if I own this NFT?".There have beennumerousattemptstostandardizeand clarify licensing rights for NFTs, however there remains a lack of consensus on how to locate the license for an NFT.We are inspired by conversationswe have hadwith the Creative Commons organization, as well as existing work such as theRoyalties RegistryandEIP-2981which we implemented when we created our own NFT,Kevin the Balloon.Incidentally, the termblessedis inspired by Perl'sblessed refererentswhich is inspirational for this design too.We also imagine that applications like Etherscan could use our tagging feature to display the properties of contracts instead of requiringmanual configuration of labels.

Hackathon

ETHOnline 2022

2022

Contributors