Dmint Guide
Comprehensive Guide on the NFT Dmint Process for NFT Project Initiators.
Last updated
Comprehensive Guide on the NFT Dmint Process for NFT Project Initiators.
Last updated
Mint | The process of creating content on a blockchain. It typically involves generating and recording new items on the blockchain. |
---|---|
This tutorial is designed to help project owners quickly understand how to onboard their DMint NFT collection onto the Atomicals protocol. In the Atomicals protocol, NFT collections are referred to as 'containers', which is roughly equivalent to 'NFT collection.'
The process can be broadly divided into four main blocks:
Prepare all data for the collection.
Configure the container.
Validate the NFT item.
Mint the NFT item.
As a project owner, your focus should be on steps 1, 2, and 3.
💰 Before each step, there is a ⛓️ icon indicating that the operation is on-chain, requiring gas consumption.
Gather data for all NFTs (A1, A2......AN).
Prepare the dmint data for the collection (B).
Collect other metadata for the collection (C).
Use the command-line tool to locally create a new wallet for isolating all container operations and avoiding confusion.
⛓️ Mint the container.
⛓️ Use the collection data (B) to configure dmint.
⛓️ Configure other metadata (C).
⛓️ Seal the container after confirming all information. (Final step! Final step!)
With existing item data and the container already on-chain with configured dmint, independently use NFT data (A) to validate whether the item matches the container.
The container is sealed; you can retrieve the mint status of individual items and the list of items already minted.
⛓️ Download NFT data (A) and locally mint using the official command-line tool.
📌 For your convenience in distinguishing between different files, we have marked them with uppercase English labels. Please pay attention to the corresponding files at each step. Using incorrect files may result in unexpected on-chain data.
From the outlined steps above, it is evident that project owners do not need to upload each NFT individually to the blockchain. Users are responsible for verifying and bearing the gas costs during the Mint process.
The following operations are based on version 0.1.46 of the atomicals-js command-line tool (@aa34095c). The tool version may be updated periodically, so before proceeding, please check whether your local CLI is the latest or an available version. For installation and configuration, please refer to: https://github.com/atomicals/atomicals-js#install. If you have any questions about a specific command, use -h
when entering the command to get help content.
💡 To avoid errors and unexpected discrepancies during the operation, it is recommended to test the entire process on the testnet before any actions on the mainnet.
❗ When transferring to a specified address in each step, ensure that you only transfer the same amount of sats, as the tool does not support change and will consume the entire UTXO.
❗ Each step that includes content with `#container-name` represents the container name, and it must start with `#`. Otherwise, some commands may identify it as a different type of Atomicals.💰 For each command in the steps with `--satsbyte`, please fill in the value based on the on-chain gas situation.
Prepare a folder containing all the original NFT files (images). It is recommended to pre-change the file names (e.g., "number.png" to "1234.png") to reduce the possibility and complexity of later data modifications. File names only support digits, English, and hyphens (-****
), and cannot start with a hyphen. The maximum length is 64 characters.
Run a command to generate processed data for all NFTs. After completion, a new folder will be generated.
The generated folder is named "output-folder" with a timestamp, containing individual item-*.json files for each NFT. Please note that the data generated at this point only includes the mainHash
and data
fields. If necessary, you can specify bitworkc
/bitworkr
in the args
, and after modification, users will be required to use the declared bitwork during minting.
Run the following command to generate dmint data. Replace path/to/folder
with the path to the folder generated in step 2, and mintHeight
with the starting block height for minting (a suggested value is 0
, meaning minting can occur immediately after deployment). After completion, a new "dmint-timestamp.json" file will be added to the folder, and all processed data for NFTs will be updated.
❗ Each time you run **`prepare-dmint`**, a new **`dmint-timestamp.json`** file will be generated, instead of modifying the old one. Please be cautious not to use incorrect data for subsequent operations.
You can modify the bitwork rules for dmint. In the rules
, p
represents the Pattern, allowing you to use regular expressions to specify different bitworkc
. Please refer to available resources on regular expressions for rule composition. In the example below, for instance:
In that case, the rule 1$
signifies that the bitworkc
for items ending with 1
(e.g., test1
) should be 890a
, while other items (e.g., test
) should have 7baf
as their bitworkc
. Rules are ordered from the most specific (minimum subset) to the most general (full set).
❗ If you have individually set `bitworkc`/`bitworkr` for an item, you need to manually declare the corresponding pattern and rule in the `rules`. Otherwise, there will be conflicts between them and the base rules, making minting impossible after formal closure and deployment. The tool does not provide any prompts for this, so exercise caution when making modifications.
If you modify item data, ensure that you re-run the command from step 4 each time after making changes to regenerate the data.
Copy a metadata dmint-metadata.json
from template/containers/dmint-collection-general-dmint-metadata.json
in the tool directory or https://github.com/atomicals/atomicals-js/blob/master/templates/containers/dmint-collection-general-metadata.json, and adjust it according to your content.
❗ You can refer to the [official documentation](https://docs.atomicals.xyz/collection-containers#collection-format-recommended) to write this section, but please do not declare `attrs` and `items` as they are incorrect content for dmint and will lead to the inability to seal the container.
⛓️ Mint the specified container. If you want to specify a different receiving address, replace "yourWalletAddress" with the corresponding wallet address.
⛓️ Enable the dmint status for the container using the previously generated "dmint-timestamp.json." Replace "dmint-json-path.json" with the file path of data B [generated in step 2 - Prepare Collection Data].
❗ You need to wait for 4 block confirmations (turning into verified status) after completing “Configure Container - Step 1”. You can check the container status at https://wizz.cash/explorer by entering the revealTxid.
⛓️ Upload the resources for the container cover by renaming the file to "logo.png" (preferably in PNG, JPG, or SVG format), then run the following command.
After completion, concatenate the filename and the output dataId
as: atom:btc:dat:{dataId}/logo.png
. Fill in the image field in the metadata file C [generated in step 7 of Prepare Collection Data] with this value.
⛓️ After modifying metadata C, set it for the container.
Execute the command to seal the container.
❗ This operation is **IRREVERSIBLE**! Before closing, please complete the item validation in [Validate NFT Item]. Ensure that all items have been validated and are correct.
Due to the uniqueness of Merkle verification, there's no need to upload each NFT in advance. It's sufficient to verify whether they match the container. In different states or lifecycles of the container, you can use various methods to validate the effectiveness of NFT items.
To validate whether a specific item is effective, you need the container's name, the item's name, and the JSON file generated in step 2 of Prepare Collection Data (replace path/to/item-3.json
with the file path of the item).
The result will return the following content. If proof_valid
is true
, it means the validation is successful. If applicable_rule
returns the complete rule, it indicates that the rule configuration is correct:
❗ It is recommended to validate each item to ensure the effectiveness of all data.
After the container is released, users can mint the corresponding NFT using the command-line tool, provided they have access to the json file for the item.
The container is already sealed, and users can now begin minting. In the case where some items have already been minted:
get-container-item
Use get-container-items
to query minted items (limit
specifies the number of entries, suggested value is 10
; offset
indicates the starting point for the query, suggested value is 0
).
Dmint
"Decentralized Mint", indicating a decentralized minting operation.
Container
A collection or a set of items.
Bitwork
The difficulty of minting. The rules for bitwork can be found in the https://docs.atomicals.xyz/bitwork-mining.
Timestamp
A continuous 10 or 13-digit number used to represent time.