Off-Chain Minting

What is Off-Chain Minting?

Minting ERC721 on-chain has become increasingly expensive as Ethereum and gas prices rose. A traditional ERC721 minting costs today between 100 000 to 200 000 gas per asset. These prices are prohibitively expensive for many use-cases. StarkEx solves this!

Step 1: The application Sends a Minting Request

Off-chain minting is a StarkEx operation enabling the off-chain creation of assets. It consists of assigning a new assetId and an amount that describes the asset to a specific StarkKey .

This asset is created off-chain and does not have yet an on-chain representation. The assetId is encoded in a compressed form called the Minting Blob which is required in order to withdraw on-chain. The assetId definition is specified here. Notice that the Minting Blob is not stored on-chain and should be received out of band.

Step 2: Minting Request Validity Checks

To ensure that StarkEx cannot create any arbitrary assetId (for instance, minting a large amount of ETH), off-chain minting can only create a mintable assetId if it respects the following conditions:

  • The operation does not overwrite an existing Vault

  • Bit 251 of the assetId must be 1

Technically, the operation is defined as the change from an empty account to an account containing an StarkKey, a mintable assetId and an amount.

Notice that there is no restriction on the operator's ability to remint an asset.

Step 3: Withdraw And Mint

To be fully non-custodial, a mintable asset must be paired with an on-chain contract that the asset will be minted at. At Withdraw, the user is required to call withdrawAndMint and provide the mintingBlob for the asset contract to create the token.