Minting ERC-721 on-chain has become increasingly expensive as Ethereum and gas prices have risen. A traditional ERC-721 minting costs today between 100,000 to 200,000 gas per asset. These prices are prohibitively expensive for many use cases. Off-chain minting solves this problem.
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
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. For the
assetId definition, see starkex-specific-concepts.adoc#mintable-erc721 in StarkEx Specific Concepts.
The Minting Blob is not stored on-chain and should be received out of band.
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
Bit 251 of the
assetIdmust 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.
The operator cannot remint the same asset.
To be fully non-custodial, a mintable asset must be paired with an on-chain contract in which the asset will be minted. When your user withdraws from off-chain to on-chain, your application is required to do the following:
mintingBlobto enable the asset contract to create the token.