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.

In the bottom right, you can see Ippy is the root IP of this PiPi.
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
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:
PiPi.sol
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:
PiPi.sol
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 theCoreMetadataModule.sol
. As described here, we need to set 4 params:
nftMetadataHash
nftMetadataURI
ipMetadataHash
ipMetadataURI
PiPi.sol
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. ThePiPi.sol
contract uses registerDerivativeForToken
to handle this:
PiPi.sol
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:PiPi.sol