# NRC-20 Core Standards

NRC-20 is a new type of token standard on NEAR inspired by Bitcoin BRC-20.
All interactions with the NRC-20 protocol are stored on-chain. However, the blockchain itself won't validate the data. Instead an indexer is used to order and finalize the transactions.

# Operations

Currently there are 3 kinds of operations:

  • deploy: Deploy a new token under NRC-20 protocol.
  • mint: Mint a specific token that has already been deployed.
  • transfer: Transfer a NRC-20 token to another account.

# How to interact with NRC-20

NRC-20 protocol saves the data on NEAR blockchain through function call arguments. To be specific, one needs to call the inscribe function of the contract inscription.near and encode the message payload in JSON as function call arguments. This function call action will be recorded by the blockchain so that later it can be queried or indexed.

# Message payload specification

The JSON payload mentioned above allows a user to specify which kind of operation he wants to perform together with the arguments of that operation.

Required keys in the payload are:

  • p: Protocol name, must be nrc-20
  • op: Operation name, could be one of deploy, mint, transfer
  • tick: Token ticker name, which token you are trying to interact with
    • Note that ticker name must be of length 3 to 8 and contains alphanumeric characters only
    • Ticker name is case insensitive, that means NEAT and neat stands for the same token

Operation specific keys in the payload:

  • deploy
    • max: Max supply amount
    • lim: Amount limit that can be minted in one call. No limit if not provided, which means any amount can be minted.
    • dec: The decimals of the token. Decimals will be 0 if not provided.
  • mint
    • amt: Amount to mint
  • transfer
    • to: Receiver account ID
    • amt: Amount to transfer

# Examples

# Deploy NRC-20

Deploy NEAT token with 42,000,000 max supply (with 8 decimals). Max limit for a single mint operation is 1 NEAT (with 8 decimals).

{
    "p": "nrc-20",              // required
    "op": "deploy",             // required
    "tick": "neat",             // required
    "max": "4200000000000000",  // required
    "lim": "100000000",         // optional, no limit if not provided
    "dec": 8                    // optional, 0 if not provided
}

# Mint NRC-20

Mint 1 NEAT (with 8 decimals)

{
    "p": "nrc-20",              // required
    "op": "mint",               // required
    "tick": "neat",             // required
    "amt": "100000000"          // required
}

# Transfer NRC-20

Transfer 2 NEAT (with 8 decimals) to bob.near

{
    "p": "nrc-20",              // required
    "op": "transfer",           // required
    "tick": "neat",             // required
    "to": "bob.near",           // required
    "amt": "200000000"          // required
}