All pages
Powered by GitBook
1 of 8

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Tutorials

What are NFTs?

NFTs (Non-Fungible Tokens) are a type of digital asset that are stored on a blockchain network and represent unique items or pieces of content. NFTs are typically used to represent things like artwork, music, videos, or other types of creative works, as they allow creators to verify and authenticate the ownership and provenance of their creations.

On the Near Protocol, NFTs are created and managed through smart contracts that are stored on the blockchain. These contracts define the rules and logic for how the NFTs are created, transferred, and managed.

To create an NFT on the Near Protocol, you would first need to create a smart contract that defines the NFT's properties and behaviors. This contract would typically include things like the NFT's name, description, image, and any other relevant metadata.

Once the NFT contract is deployed to the blockchain, you can then use it to mint new NFTs. To mint an NFT, you would typically need to provide some sort of payment, such as Near tokens, in exchange for the new NFT.

Once the NFT is minted, it can be transferred and traded just like any other asset on the blockchain. The unique properties of NFTs, such as their provenance and authenticity, make them particularly valuable for creators and collectors of digital content.

Start with our Tutorials

Minting NFTs

Ownership verification

Wallet integration

Minting NFT on Near Protocol

We will learn how to use this NFT-kit to mint our first NFT on Near Protocol

Setup NFT-Kit

Before we can start with configuring our NFT collection, we need to clone and run the NFT-Kits REST API on our machine.

Installation & Running the Project

Make sure you have a JDK 16 build environment including Gradle installed on your machine

Make sure you have a Node.js and the npm installed on your machine.

  1. Clone the project

2. Change the folder

3. Put the needed by the file under the path: js/.envof the project

4. Run the following command:

4. Run the following command:

5. Open new terminal under the path: waltid-nftkit

6. Make the rest of the

7. Build the project

8. Run the executable

In build/distributions/ you have two archives, a .tar, and a .zip.

Extract the one that is built for your system and run it.

Now we can visit the REST API at the endpoint displayed in the terminal after running the project. In the next section, we will be configuring our NFT collection and deploy the Smart Contract on Near Protocol blockchain

configuration
configuration
git clone https://github.com/walt-id/waltid-nftkit.git
cd waltid-nftkit/js
npm install
npm start
gradle clean build
cd build/distributions/
tar xf waltid-nftkit-1.0.0.tar 
./waltid-nftkit-1.0.0/bin/waltid-nftki

Create Sub-account

Your account can create direct sub accounts of itself, for example, user.near can create sub.user.near.

Create a sub-account

Sub accounts on near help with the organisation of your project , it separates the smart contract address from your main account.

Near Wallet Creation

We will need a Near wallet in order to mint our NFT , creating a wallet is very easy! Here are a few easy steps to get you started

Step 1: Go to testnet.mynearwallet.com and “Create Account”

Click on “Get Started”

Step 2: Choose a Security Method

To protect your account, you’ll have to select an option to secure your NEAR wallet.

Choose from the three security methods mentioned to start your wallet initialization — Secure Passphrase / Ledger Hardware Wallet / Email

Step 3: Fund Your NEAR Wallet

Smart Contract ( Collection )

Before we can mint an NFT, we need to define the collection, of which the NFT will be a part, via the deployment of a smart contract.

Deploying the Contract

Before you mint a new NFT, you need to have an already deployed smart contract or deploy a new one. For this tutorial, we will deploy a new smart contract.

We will deploy the smart contract on the Near testnet. We need to provide the owner and the metadata of smart contract.

Example 1 : Default Contract metadata

Example 2 : Custom Contract metadata

smart contract deployment - default metadata
smart contract deployment - custom metadata

NFT Ownership Verification

NFTs verification enables multiple use cases. The NFT Kit provides numerous approaches to verify the ownership of the NFTs and that the NFTs have customized properties.

1- You can verify that an account owns a particular NFT.

NFT ownership and property verification

2- You can verify that an account owns an NFT in a specific collection.

NFT ownership and property verification

3- You can also verify that an NFT metadata confirms a policy. The policy is implemented using the high-level declarative language called Rego. It is based on open policy agent(OPA).

You need to add new policy:

add new policy
Apply a policy to an NFT metadata

Minting your first NFT

Now, you're able to mint your first NFT. We will use the deployed smart contract in the previous section to mint a new NFT. We also need to provide the token id and the recipient account for the NFT.