Case Study: Registering a Derivative of Ippy
A Case Study showing how PiPi, a generative pfp project, registers derivatives of Story’s official Ippy mascot.
PiPi is a free generative pfp project on Story that lets you mint derivative artworks of Ippy, Story’s official mascot. Ippy has Non-Commercial Social Remixing (NCSR) terms attached, which means anyone can use it or create derivative works as long as it’s not used commercially and proper attribution is shown.
Original Ippy
View the original Ippy mascot on our explorer.
PiPi Derivative
View a derviative PiPi on our explorer.
View PiPi Contract
View the PiPi contract source code.
When a PiPi is linked as a derivative of Ippy, it automatically inherits the same license terms (NCSR) and is linked in its ancestry graph, which you can see directly on our explorer:
In the bottom right, you can see Ippy is the root IP of this PiPi.
In the following tutorial, you will learn how exactly these PiPi images were properly registered as derivatives of the official Ippy IP.
Prerequisites
There are a few steps you have to complete before you can start the tutorial.
- Complete the Setup Your Own Project
1. Setup Metadata
Before we register our new PiPi IP, we need to set up its metadata. There are two types of metadata:
- NFT Metadata
- IP Metadata
Using this PiPi as an example, here is what the NFT & IP metadata should be:
Once you have metadata written, you can upload them to IPFS and will later set it when minting our NFT.
2. Minting an NFT
When you want to register an IP on Story, you must first mint an NFT. This NFT represents the ownership over the IP Asset.
Here is part of the _mintNFT
function in the PiPi.sol
contract:
As you can see, the user calls whitelistMint
which then calls _mintNFT
after checking if the user is on a whitelist. On line 16, we are then minting a new NFT to the contract.
Why do we mint an NFT to the contract and not the user?
We later have to register the IP as a derivative of Ippy. Only the owner (the address holding the NFT) can register an IP as a derivative of another. So, we will mint the NFT to the contract => contract registers NFT as IP and then later as a derivative of Ippy => transfer NFT to the user.
3. Registering NFT as IP
Once we have minted a new NFT, we can register it as IP. On line 18 above, it calls a _registerAsIPAsset
function:
All this is doing is calling the register
function on the IP Asset Registry, which creates a new IP Asset in our protocol, and returns an ipId
.
4. Set Metadata on IP
Now that we have registered a new IP Asset, we can take our metadata from before and set it on the NFT & IP with the CoreMetadataModule.sol
. As described here, we need to set 4 params:
nftMetadataHash
nftMetadataURI
ipMetadataHash
ipMetadataURI
5. Register as Derivative
Now that we have minted an NFT, registered it as IP, and set proper metadata, we can register it as a derivative of Ippy. The PiPi.sol
contract uses registerDerivativeForToken
to handle this:
This function calls registerDerivative
in the Licensing Module, with:
ipId
: the newipId
we got in step 3parentIpIds
: an array that contains Ippy’sipId
, which is0xB1D831271A68Db5c18c8F0B69327446f7C8D0A42
licenseTermsIds
: an array containing1
, which is the license term ID of Non-Commercial Social Remixing (NCSR). This means the derivative can use Ippy for free but not commercialize itlicenseTemplate
: the address ofPILicenseTemplate
, found in Deployed Smart ContractsroyaltyContext
: just set to zero addressmaxMintingFee
,maxRts
, andmaxRevenueShare
can be set to 0. They don’t do anything because the license terms are non-commercial.
6. Transfer NFT
Now that the contract has handled registering the IP as a derivative, it transfers the NFT to the user to have ownership over the PiPi IP:
7. Done!
Congratulations, you registered a derivative of the official Ippy IP!