Understanding Minting

We've discussed token contracts and briefly what it means to "mint" a new token. When we refer to minting a token:

we mean first to create a new contract on the Ethereum blockchain and then add a new entry (token) within that contract that represents and is potentially tied to an asset, either digital or tangible. Cargo provides a means of storing and securing a digital file tied to this token. Remember, a token is an entry noted in our contract represented by an identifier.

Cargo uses ERC-721 token contracts. We've extended these contracts to include some additional functionality to support the Cargo platform. One major addition is the sell method and the batch mint method. The sell method allows for easy selling by calling a method on the token contract. The batch mint method allows you to create up to 2^255 tokens at one time. Batch minting is available on when creating Cargo Token V2 contracts. While the sell method is included in both version one and two. Cargo Token V1

When creating a Cargo Token V1 contract you can limit the number of tokens that can be created within that contract. The limited token functionality ensures that only a set amount of tokens representing could ever be created.

The ERC-721 specification has an optional metadata extension. The metadata extension adds a token URI to the token which links to a publicly accessible JSON file that contains additional meta data about the token including the name, description, and a preview image. Cargo also includes a metadata object within the JSON file in which you can add additional arbitrary data. You can add metadata through the Cargo dashboard when creating a token, or by using Cargo JS when creating a token.

When minting a token through Cargo you can upload files that will be tied to the token you are minting. Cargo securely stores these files in an encrypted storage space. These files can only be downloaded by the owner of the token. Cargo provides an endpoint to download the files by providing a signature along with the token contract address and the token ID. If your signature matches the account that owns the token Cargo will return signed URLs which will allow you to download the file(s). These URLs will expire after five minutes. You can use Cargo JS to obtain the URLs after sending a signed message.

Batch minting

Cargo provides access to the Cargo Token V2 contract which is an ERC-721 contract with a batch mint extension. With these contracts you can create 2^255 tokens at one time. These contracts adhere to the ERC-721 specification and include the metadata and enumeration extension. Cargo handles metadata for you and allows you to customize this metadata at the time of token creation. The enumeration extension allows you to loop through tokens one by one. By default metadata returned from a batch minted token will include an "edition" corresponds to that tokens sequential token ID. You can create Cargo Token V2 contracts through the Cargo dashboard, or the Cargo JS, the Cargo's JavaScript library.

Restricted content

Cargo doesn't allow sexually explicit, or violent images to be tokenized on the platform. If you feel like you receive a message about this in error when tokenizing an asset please email contact@cargo.build.