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
.Associated Docs:
license.registerPILTerms
main.ts
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.
main.ts
3. Attach License Terms
Now that we have created terms and have the associatedlicenseTermsId
, we can attach them to an existing IP Asset like so:
Associated Docs:
license.attachLicenseTerms
main.ts