The Explanation
Let’s say you generate an image using AI. Without adding a proper license to your image, others could use it freely. In this tutorial, you will learn how to add a license to your DALL·E 2 AI-Generated image so that if others want to use it, they must properly license it from you. In order to register that IP on Story, you first need to mint an NFT to represent that IP, and then register that NFT on Story, turning it into an IP Asset.0. Before you Start
There are a few steps you have to complete before you can start the tutorial.- You will need to install Node.js and npm. If you’ve coded before, you likely have these.
- Add your Story Network Testnet wallet’s private key to
.env
file:
.env
- Go to Pinata and create a new API key. Add the JWT to your
.env
file:
.env
- Go to OpenAI and create a new API key. Add the new key to your
.env
file:
OpenAI CreditsIn order to generate an image, you’ll need OpenAI credits. If you just created an account, you will probably have a free trial that will give you a few credits to start with.
.env
- Add your preferred RPC URL to your
.env
file. You can just use the public default one we provide:
.env
- Install the dependencies:
Terminal
1. Generate an Image
In amain.ts
file, add the following code to generate an image:
main.ts
2. Set up your Story Config
In autils.ts
file, add the following code to set up your Story Config:
Associated docs: TypeScript SDK Setup
utils.ts
3. Set up your IP Metadata
View the IPA Metadata Standard and construct your metadata for your IP. Back in themain.ts
file, properly format your metadata as shown below:
main.ts
4. Set up your NFT Metadata
The NFT Metadata follows the ERC-721 Metadata Standard.main.ts