Attach Terms to an IPA
Learn how to Attach License Terms to an IP Asset in TypeScript.
This section demonstrates how to attach License Terms to an IP Asset. By attaching terms, users can publicly mint License Tokens (the on-chain “license”) with those terms from the IP.
Prerequisites
There are a few steps you have to complete before you can start the tutorial.
- Complete the TypeScript SDK Setup
1. Before We Start
We should mention that you do not need an existing IP Asset to attach terms to it. There are two functions you can use that allow you to register IP + create terms + attach terms in the same function:
2. Register License Terms
In order to attach terms to an IP Asset, let’s first create them!
License Terms are a configurable set of values that define restrictions on licenses minted from your IP that have those terms. For example, “If you mint this license, you must share 50% of your revenue with me.” You can view the full set of terms in PIL Terms.
If License Terms already exist on our protocol for the identical set of parameters you intend to create, it is unnecessary to create it again and the function will simply return the existing licenseTermsId
and an undefined txHash
. License Terms are protocol-wide, so you can use existing License Terms by its licenseTermsId
.
Below is a code example showing how to create new terms:
Associated Docs: license.registerPILTerms
2a. PIL Flavors
As you see above, you have to choose between a lot of terms.
We have convenience functions to help you register new terms. We have created PIL Flavors, which are pre-configured popular combinations of License Terms to help you decide what terms to use. You can view those PIL Flavors and then register terms using the following convenience functions:
Non-Commercial Social Remixing
Free remixing with attribution. No commercialization.
Commercial Use
Pay to use the license with attribution, but don’t have to share revenue.
Commercial Remix
Pay to use the license with attribution and pay % of revenue earned.
Creative Commons Attribution
Free remixing and commercial use with attribution.
3. Attach License Terms
Now that we have created terms and have the associated licenseTermsId
, we can attach them to an existing IP Asset like so:
Associated Docs: license.attachLicenseTerms
3a. Create Terms + Attach
It’s worth mentioning that you can create terms + attach terms all in the same step with the the registerPilTermsAndAttach function. Whatever is easiest for you!
And, like we mentioned at the beginning, there are two functions you can use that allow you to register IP + create terms + attach terms in the same function:
4. Mint a License
Now that we have attached License Terms to our IP, the next step is minting a License Token, which we’ll go over on the next page.