# Advanced Minting

## Initial setup and upload

### 1. Organize file and select IPFS provider <a href="#id-11_organize_file_and_select_ipfs_provider" id="id-11_organize_file_and_select_ipfs_provider"></a>

* Create a folder on your PC and give it a name.
* Within that folder, insert the file you want to mint.\
  &#x20;     *Example: Logo.png*
* Create an account on [Pinata](https://app.pinata.cloud/pinmanageror) or download [IPFS Desktop](https://docs.ipfs.io/install/ipfs-desktop/).

### 2. Upload file to IPFS provider <a href="#id-12_upload_file_to_ipfs_provider" id="id-12_upload_file_to_ipfs_provider"></a>

{% hint style="info" %}
Before uploading to IPFS, please be aware there are 2 types of **CID**: <mark style="color:blue;">**CIDv0**</mark> (begins with <mark style="color:orange;">**Qm**</mark>) and <mark style="color:blue;">**CIDv1**</mark> (begins with <mark style="color:orange;">**b**</mark>).

Currently, Loopring supports <mark style="color:blue;">**CIDv0**</mark> (begins with <mark style="color:orange;">**Qm**</mark>) as will be seen in the examples, as well as certain <mark style="color:blue;">**CIDv1**</mark> (begins with <mark style="color:orange;">**b**</mark>) that can be converted to <mark style="color:blue;">**CIDv0**</mark> format. Only <mark style="color:blue;">**CIDv1**</mark> that have the following properties can be converted to <mark style="color:blue;">**CIDv0**</mark>, and thus can be supported in Loopring NFT mint.

> multibase = base58btc\
> multicodec = dag-pb\
> multihash-algorithm = sha2-256\
> multihash-length = 32 (32 bytes, equivalent to 256 bits)

If you want to upload content to IPFS and generate CID for usage in the Advanced Mint flow, please ensure the CID can be supported by Loopring as described above.\
\
You can check CID properties using [this tool](https://cid.ipfs.io/).\
\
In case you do not know how to generate a CID that is supported by Loopring, please use [Pinata](https://app.pinata.cloud/pinmanager) which uses <mark style="color:blue;">**CIDv0**</mark> by default.\
Upload the file you want to mint to Pinata or IPFS Desktop. Do not upload the entire folder.
{% endhint %}

#### Using Piñata

{% tabs %}
{% tab title="Step 1" %}

<figure><img src="/files/A5kEgAA8jjN8JT1jeQPg" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Step 2" %}

<figure><img src="/files/LI4fCYjH3MgfkfZlkhpj" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Step 3" %}

<figure><img src="/files/fFIepxk8NVMTrLY1IUBx" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

#### Using IPFS Desktop

{% tabs %}
{% tab title="Step 1" %}

<figure><img src="/files/St12QbBRmG5VwGSccR6l" alt=""><figcaption><p>Take note of the CID, it will be needed in the next step.</p></figcaption></figure>
{% endtab %}
{% endtabs %}

### 3. Create NFT Metadata file <a href="#id-13_create_nft_metadata_file" id="id-13_create_nft_metadata_file"></a>

* Create a .json file using a text editor such as **Notepad**.

  &#x20;     *Example: metadata.json*

<details>

<summary>metadata.json</summary>

Within this ***metadata.json*** file, copy the following – note that it is case sensitive:

<mark style="color:orange;">{</mark>

<mark style="color:orange;">"description": "Description of your NFT goes here",</mark>

<mark style="color:orange;">"image": "ipfs\://CID of the file goes here",</mark>

<mark style="color:orange;">"name": "Name of the NFT",</mark>

<mark style="color:orange;">"royalty\_percentage": integer between 0 and 10</mark>

<mark style="color:orange;">}</mark><br>

&#x20;     *Example:*

&#x20;     *<mark style="color:orange;">{</mark>*

&#x20;     *<mark style="color:orange;">"description": "Loopring Logo",</mark>*

&#x20;     *<mark style="color:orange;">"image": "ipfs\://QmZBf3Aq1LGNRLGqad2dxojwTA7ddgrMpsHqJCi6jeK6Vh",</mark>*

&#x20;     *<mark style="color:orange;">"name": "Logo",</mark>*

&#x20;     *<mark style="color:orange;">"royalty\_percentage": 10</mark>*

&#x20;     *<mark style="color:orange;">}</mark>*

&#x20;     **JSON Legend:**            &#x20;

<mark style="color:blue;">**description**</mark>: A text string containing a description of your NFT            &#x20;

<mark style="color:blue;">**image**</mark>: A text string containing an image to display for your NFT.            &#x20;

<mark style="color:blue;">**name**</mark>: A text string containing the name or title of your NFT.

<mark style="color:blue;">**royalty\_percentage**</mark>: An integer from 0 - 10 describing the amount of royalty to be collected by the creator each time the NFT is sold.&#x20;

For example, if a creator mints an NFT with a royalty percentage of 10, the creator will receive 10% of the proceeds of every sale. Royalties are distributed to creators at the end of each month. If an NFT is minted with a royalty percentage of 0, no royalties will be collected.

</details>

Save the .json file.

{% hint style="info" %}
If you wish to manually specify an IPFS CID of the NFT's collection\_metadata file, proceed to [4](#14_manual_collection_metadata_specification).

If you will select a collection in the mint GUI, skip to [5](#15_upload_nft_metadata_file).
{% endhint %}

### **4. Manual collection\_metadata specification** <a href="#id-14_manual_collection_metadata_specification" id="id-14_manual_collection_metadata_specification"></a>

* Create a collection\_metadata json file conforming to the specification found in [collection implementation on Loopring](https://desk.zoho.com/portal/loopring/en/kb/articles/collection-implementation-in-loopring-l2.).
* Upload the collection\_metadata json file to Pinata or IPFS Desktop in the same manner as above. Note the CID.
* Add an additional key/value pair to the NFT metadata json file whose key is "`collection_metadata`" and value is the IPFS CID for the collection's metadata file.<br>

*Example:*

&#x20;     *<mark style="color:orange;">{</mark>*

&#x20;     *<mark style="color:orange;">"description": "Loopring Logo",</mark>*

&#x20;     *<mark style="color:orange;">"image": "ipfs\://QmZBf3Aq1LGNRLGqad2dxojwTA7ddgrMpsHqJCi6jeK6Vh",</mark>*

&#x20;     *<mark style="color:orange;">"name": "Logo", "collection\_metadata": "ipfs\://QmbpBgKipbPbiLr3D2ykfiKv6XNerLSmWtoWECnqkStSs4",</mark>*

&#x20;     *<mark style="color:orange;">"royalty\_percentage": 10</mark>*

&#x20;     *<mark style="color:orange;">}</mark>*<br>

\
&#x20;      **JSON Legend*****:***\
&#x20;           **collection\_metadata**: A text string containing an IPFS CID which points to a collection metadata file.<br>

### 5. Upload NFT Metadata file <a href="#id-15_upload_nft_metadata_file" id="id-15_upload_nft_metadata_file"></a>

* Similarly, as the NFT file was uploaded above, upload the NFT metadata .json file to Pinata or IPFS Desktop.

{% tabs %}
{% tab title="Pinata" %}

<figure><img src="/files/kl2gNNLVJLHMrgnMEgzZ" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="IPFS Desktop" %}

<figure><img src="/files/UjnudedTGyp9IpTNRHeV" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
If NFT's metadata does not contain a "`collection_metadata`" key/value pair, proceed to [Method A](/nft/create-nft/advanced-minting/method-a.md).

\
If NFT's metadata does contain a "`collection_metadata`" key/value pair, proceed to [Method B](/nft/create-nft/advanced-minting/method-b.md).\
\
If an NFT is not a member of any collection, proceed to [Method C](/nft/create-nft/advanced-minting/method-c.md).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-dapp.loopring.io/nft/create-nft/advanced-minting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
