# How To Create Digital Assets

## **STEP 1. Register A New Digital Asset Collection**

NFTRegisterCollection transaction enables us to register a new type of digital asset by defining its structure. The structure is defined in the form of a standard JSONSchema (see example below). After the digital asset collection is registered we can create (mine) tokens with the help of NFTCreate transaction type. We need to define:

* asset name
* asset description
* maximum supply (optional)
* jsonSchema - structure of the digital asset
* allowedIssuers - if empty anyone can create/mine a new asset

### How To Use NFTRegisterCollection Transaction

{% embed url="<https://github.com/protokol/examples/blob/develop/packages/examples/src/base/nft-register-collection.ts>" %}
NFT RegisterCollection Runnable Example
{% endembed %}

#### Initialization

```typescript
import { Builders } from "@protokol/nft-base-crypto";
```

#### NFTRegisterCollection - Builder

```typescript
new Builders.NFTRegisterCollectionBuilder()
    .NFTRegisterCollectionAsset({
        name: "FIFA-20-PLAYERS",
        description: "FIFA 2020 Players",
        maximumSupply: 100,
        jsonSchema: {
            properties: {
                name: {
                    type: "string",
                },
                pac: {
                    type: "number",
                },
                sho: {
                    type: "number",
                },
                pas: {
                    type: "number",
                },
                dri: {
                    type: "number",
                },
                def: {
                    type: "number",
                },
                phy: {
                    type: "number",
                },
            },
        },
    })
    .nonce("1")
    .sign("SENDER_PASSPHRASE");
```

## STEP 2. Create New Digital Assets

We can create (mine) new digital assets from the genesis wallet (the wallet that registered the new collection in STEP 1). To create a digital asset we need to comply with the asset type - that is the collection we registered with NFTRegisterCollection transaction. We need to specify:

* collectionId
* token attributes -  need to comply with the registered JSONSchema

After token is created it lives inside the genesis wallet, until it is transferred to a trading address, or to a new owner with the NFTTransfer Transaction.

### How To Use NFTCreate Transaction

{% embed url="<https://github.com/protokol/examples/blob/develop/packages/examples/src/base/nft-create.ts>" %}
NFTCreateAsset Runnable Example
{% endembed %}

#### NFTCreateAsset - Builder

```typescript
new Builders.NFTCreateBuilder()
        .NFTCreateToken({
            collectionId: "c23b4a9e07329861422df43631d7aa72153cabcca3067941b94a69016ae8723b",
            attributes: {
                name: "Kalvin Phillips",
                pac: 90,
                sho: 89,
                pas: 60,
                dri: 57,
                def: 75,
                phy: 87,
            },
        })
        .nonce("1")
        .sign("SENDER_PASSPHRASE");
```

## STEP 3. Transfer Digital Assets

We can transfer multiple owned digital assets. See example below for NFT Transfer Transaction Type.

### How To Use NFTTransfer Transaction

{% embed url="<https://github.com/protokol/examples/blob/develop/packages/examples/src/base/nft-transfer.ts>" %}
NFTTransfer Runnable Example
{% endembed %}

#### NFTTransfer - Builder

```typescript
new Builders.NFTTransferBuilder()
        .NFTTransferAsset({
            recipientId: "RECIPIENT_ADDRESS",
            nftIds: ["7373bbe5524898faec40bfcd12c6161981771f3be6426404208784831f4b0d02"],
        })
        .nonce("1")
        .sign("SENDER_PASSPHRASE");

```

## STEP 4. Burn Digital Assets (optional)

Our NFT plugin set also enables burning capability for digital assets. This is useful with loyalty programs and expiring trading cards or gaming card functionality - where the asset is destroyed when used. Only token owners can burn/destroy a digital asset. Digital asset or usage history is still visible on the blockchain.&#x20;

### How To Use NFTBurn Transaction

{% embed url="<https://github.com/protokol/examples/blob/develop/packages/examples/src/base/nft-burn.ts>" %}
NFTBurn Runnable Example
{% endembed %}

#### NFTBurn - Builder

```typescript
 new Builders.NFTBurnBuilder()
        .NFTBurnAsset({
            nftId: "6f252f11b119e00a5364d37670623d1b6be562f577984c819237ca4668e2897e",
        })
        .nonce("1")
        .sign("SENDER_PASSPHRASE");
```

##


---

# 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.protokol.com/developers/tutorials/crypto-examples.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.
