Mint

Learn how to mint assets directly to your Arc application.

With support for ERC-20, ERC-721, and ERC-1155 tokens, the mint operation enables applications to generate new tokens directly on the Arc platform. These tokens can then be utilized for other platform operations or withdrawn to Ethereum.

The Arc Bridge, scheduled to be released as part of the public testnet, will allow for withdrawals to any EVM compatible chain (eg. Arbitrum, BNB Chain, Polygon).

As Ethereum and gas prices have risen, the cost of minting tokens on-chain has increased, making it prohibitively expensive for many use cases. Arc offloads a portion of the computational work of minting to the off-chain application, but the end result is the same: the proof that a particular token mint has been minted and is owned by a particular user address is published on Ethereum.

Following is the typical process for minting an asset on Arc:

  1. Deploy smart contract on L1: There must be a existing mintable token smart contract deployed on the on Ethereum L1. The contracts are available here.

  2. Register the asset in Arc: The mintable asset must be whitelisted in the Arc platform. Please contact our team to get your asset whitelisted.

  3. Enable the asset in your application: You must enable the asset in your application prior to performing any operations in Arc.

  4. Minting on Arc: Send a mint request to the Arc API. The platform supports both individual and batch minting of assets.

  5. Withdraw to L1: When the owner of a minted asset decides that they want to withdraw this token to L1, the asset will be automatically minted on the L1 to match the withdrawal request.

Mint endpoint

You can issue multiple mints for any mintable asset type supported by Arc to multiple different users. To retrieve a list of supported mintable assets, you can filter the available assets by asset type at the /api/v1/assets endpoint, as shown here.

To mint a new asset, you should refer to the following endpoint:

If successful, this endpoint will return the vaults updated by the minting operation.

Mint ERC-20 tokens

Minting of ERC-20 tokens will be enabled upon the release of StarkEx V5.

The ERC-20 minting operation enables applications to generate new fungible tokens and distribute them directly to users. To illustrate the process of minting tokens for a particular ERC-20 token, let's consider an example:

A player in a game has completed a quest and should be rewarded with 1,000 units of the game's fungible currency. Since the currency is not a particularly valuable item, the game's developers have decided to distribute the rewards using the Validium DA mode.

  • Used ID: 2c4a230c-5085-4924-a3e1-25fb4fc5965b

  • Asset ID: 9179b887-04ef-4ce5-ab3a-b5bbd39ea3c8

To mint the reward tokens, the following request should be sent to the Arc API:

curl -i -X POST \
  https://api.onarc.io/api/v1/mint \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "users": [
      {
        "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
        "mints": [
          {
            "mintingBlob": "",
            "assetId": "9179b887-04ef-4ce5-ab3a-b5bbd39ea3c8",
            "amount": 1000,
            "dataAvailabilityMode": "validium"
          }
        ]
      }
    ]
  }'

Mint ERC-721 tokens

The ERC-721 minting operation enables applications to generate new non-fungible tokens (ie. NFTs) and distribute them directly to users. To illustrate the process of minting a particular ERC-721 token, let's consider an example:

A public leaderboard on an exchange ranks traders by their platform's PNL. Monthly, the number one user on the leaderboard receives a badge that can be used as a profile picture on social media. The identification number 1337 uniquely identifies the March 2023 badge. The developers have decided to distribute these items using the ZK-Rollup DA mode because they are extremely prestigious.

  • Used ID: 2c4a230c-5085-4924-a3e1-25fb4fc5965b

  • Asset ID: 50ffc67-2ddf-47ea-92b3-c9bd382874a2

To mint the March 2023, the following request should be sent to the Arc API:

curl -i -X POST \
  https://api.onarc.io/api/v1/mint \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "users": [
      {
        "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
        "mints": [
          {
            "mintingBlob": "'$(echo -n '1337' | xxd -p)'",
            "assetId": "e50ffc67-2ddf-47ea-92b3-c9bd382874a2",
            "amount": 1,
            "dataAvailabilityMode": "zk-rollup"
          }
        ]
      }
    ]
  }'

Mint ERC-1155 tokens

Minting of ERC-1155 tokens will be enabled upon the release of StarkEx V5.

The ERC-1155 minting operation enables applications to generate multiple fungible tokens using the same asset ID and and distribute them directly to users. To illustrate the process of minting multiple tokens for a particular ERC-1155 asset, let's consider an example:

A trading card game sells packs that players can purchase with in-game currency, with each pack containing four random cards of varying rarity. A user who purchased a pack received three common cards and one rare card. Two duplicate common cards were present. The game ID of the duplicate cards is 42, that of the other common card is 222, and that of the rare card is 1337. Due to their greater value, game developers have determined that all rare cards should be minted with the ZK-Rollup DA mode, while common cards should be minted with Validium.

  • Used ID: 984c9dd1-82ba-4af6-b3c3-b3fa70513315

  • Asset ID: 50ffc67-2ddf-47ea-92b3-c9bd382874a2

To mint the cards, the following request should be sent to the Arc API:

curl -i -X POST \
  https://api.onarc.io/api/mint \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \888]
  -d '{
    "users": [
      {
        "userId": "984c9dd1-82ba-4af6-b3c3-b3fa70513315",
        "mints": [
          {
            "mintingBlob": "'$(echo -n '42' | xxd -p)'",
            "assetId": "e50ffc67-2ddf-47ea-92b3-c9bd382874a2",
            "amount": 2,
            "dataAvailabilityMode": "validium"
          },
          {
            "mintingBlob": "'$(echo -n '222' | xxd -p)'",
            "assetId": "e50ffc67-2ddf-47ea-92b3-c9bd382874a2",
            "amount": 1,
            "dataAvailabilityMode": "validium"
          },
          {
            "mintingBlob": "'$(echo -n '1337' | xxd -p)'",
            "assetId": "e50ffc67-2ddf-47ea-92b3-c9bd382874a2",
            "amount": 1,
            "dataAvailabilityMode": "zk-rollup"
          }
        ]
      },
    ]
  }'

Last updated