Register an IP Asset in TypeScript

This section demonstrates how to register an IP Asset using the TypeScript SDK. There are generally two methods of IP registration:

  1. Register an existing NFT as an IP Asset
  2. Create an NFT and register it as an IP Asset in one transaction


  • Setup the client object.

Register an Existing NFT as an IP Asset

You can register your NFT as an IP Asset by simply calling client.ipAsset.register() and passing in the token's contract address and token ID, like so:

ℹ️ If the provided tokenId from the tokenContract has already been registered, the response object will contain the ipId of the existing IP Asset and an undefined txHash.

import { toHex } from 'viem';

const response = await client.ipAsset.register({
  nftContract: "0xd516482bef63Ff19Ed40E4C6C2e626ccE04e19ED", // your NFT contract address
  tokenId: "12", // your NFT token ID
  metadata: {
    metadataURI: 'test-uri', // uri of IP metadata
    metadataHash: toHex('test-metadata-hash', { size: 32 }), // hash of IP metadata
    nftMetadataHash: toHex('test-nft-metadata-hash', { size: 32 }), // hash of NFT metadata
  txOptions: { waitForTransaction: true }

console.log(`Root IPA created at transaction hash ${response.txHash}, IPA ID: ${response.ipId}`);
export type RegisterRequest = {
  nftContract: string;
  tokenId: string;
  txOptions?: TxOptions;
  deadline?: string | number | bigint;
  metadata?: {
    metadataURI?: string;
    metadataHash?: Hex;
    nftMetadataHash?: Hex;
export type RegisterIpResponse = {
  txHash?: string;
  ipId?: string;

Setting waitForTransaction: true in the transaction options will return the ipId of the newly registered IP asset.

After we run the above code, the console output will look like:

Root IPA created at transaction hash 0xa3e1caa7c2124b1550d459abc739291cb1be77ac73b99c097707878ac4ef57ae,
IPA ID: 0x4c1f8c1035a8cE379dd4ed666758Fb29696CF721

Create an NFT and Register it as an IP Asset

You can follow the Mint and Register recipe to see how you would first mint an NFT and then register it as an IP Asset normally.

You can also try the experimental mintAndRegisterIpAssetWithPilTerms function provided by the SPG here.