От идеи создания NFT до опустошения Candy Machine
Давным давно в 2020 г. когда я только познавал мир крипты и параллельно торговал на фондовом рынке, я состоял в открытой группе где сидели как и трейдера с стажем, так и такие новички как и я.
В данной группе мне сказали что создавай своё комьюнити, или хотя-бы найди пару человек что-бы иметь больше информации, распределять обязанности. В тот момент я видел свое комьюнити так:
Два-три человека сидят, отбирают стаки для торговли внутри дня, каждому отведено определенной сектор или же, по своим скринерам.
За пару часов до начала торговой сессии все созваниваются и обсуждают какие стаки торговать, а какие нет.
Ну и ходил я с этой идеей очень долго. Потом, когда я уже погрузился с головой в крипту понял что без команды ты никто (Только если ты не торгуешь внутри дня), ведь когда ты понимаешь что хочешь зарабатывать в крипте то ты должен как минимум знать «все» , и захватывать все сферы
Ну а далее время шло и я все продумывал как же организовать это всё
И когда я уже более менее стал стоять на своих двух я понял что лучшего времени не будет, и без каких либо уменний в рисовании и знаний программирования (Хотя я уже изучал Python, и HTML но до конца я так и не дошёл — поэтому базовые знания были) я приступил к реализации проекта…
Зима 2021 — 2022 г.
Возможно вы застали то время, когда стреляли почти-что все коллекции НФТ, многие тогда фармили WL и после чего лутали десятки иксов, и многие коллекции предлагали держателем доступ в DAO, но это было сложно назвать DAO ведь в большинстве случаев вы получали неликвидную НФТ, и грустное комьюнити которое пришло флипануть данную коллекцию, и не более. (Но есть и те кто реализовал все на высшем уровне — их можно пересчитать на пальцах)
В таких DAO люди не получали право голоса где всех просто ставили в известность постфактум
И тогда уже зародилась идея создание своей коллекции, конечно хотелось заскамить кого-то но я понимал что лучше сделать все правильно и красиво, и не залутать десятки тысяч вечно зеленых, а собрать комьюнити. На тот момент в паблике было всего-лишь 150-500 человек и я понимал что если сейчас это все делать то
- Не наберу свою аудиторию
- Выпаду из рынка на месяц, и пропущу всю активность с НФТ
Поэтому я стал просто искать инфу как создать свою коллекцию, и готовится к создание коллекции.
Данная НФТ дает доступ в наше закрытое DAO
В апреле 2022 года — я уже начал делать исходники для коллекции
- Это были бейджи, которые я перерисовывал в Photoshop неделями, но так и не зашло мне это
- Потом я вспомнил про коллекцию Portals — их коллекция в виде банковской карты, и начал кидать исходники, но тоже понял что это не то что я хотел увидеть
- Персонажи, сначала начал с идеи персонажа, первые на ум пришли нинзя, но они за один день отвалились, и тут я увидел его странное сушество, немного посидев в Photoshop я отрисовал первого Гуманоида
Сложность была в моих кривых руках, и все что я не рисовал выходило мягко сказать говном, и в один прекрасный день родился мой первый Гуманоид
Конечно в первом варианте он был убожеством, но уже с отрисованным телом, если у него оно вообще есть)
И далее на основе этого тела я отрисовал
Humanoid — 11 разных гуманоидов, 7 из них похожие по форме, 4 залитых градиентом, и эксклюзив 9 отрисованные полностью с нуля — т.е без генерации
Background — 17 фонов скаченных из интернета с бесплатной лицензией, но не все фоны были скачаны, многие это просто градиент, и один это первая сгенерированная коллекция в размытом виде
Eyes — 5 обычных глаз, и одни в виде Thug очков
Teeth — 6 видов зубов, которые в день генерации нфт в основную сеть были перерисованными ибо они не попадали под гуманоида
Вот так и появились исходники для генерации моей первой НФТ коллекции
Выше вы уже узнали что данная коллекция рисовалась в Photoshop
Все исходники были в формате 2000х2000
Сначала сохранял гуманоидов, а после каждый отдельный атрибут, и далее стал вопрос о генерации нфт с метаданными
Прочитав документации по Ethereum и Solana выбор пал на Solana.
Узнал что все можно сделать без каких-либо знаний, я приступил к генерации нфт.
В данном случае я использовал Hashlips Art Engine — это открытый исходник для генерации нфт
Прочитав их инструкцию я сделал все по шагам, и первая коллекция сгенерирована!
- Linux — но не обязательно, можно все сделать и в Windows — для удобного редактирования кода
И библиотеки для генерации колекции
Видео гайды есть на этом youtube канале
Ну тут все просто
- Быстрота блокчейна
- Дешевые комиссии
- Не требуется создавать Смарт контракты как в Ethereum
Деплой коллекции происходил через Metaplex
Что мне для этого понадобилось?
-
— Для создания кошелька — Основной инструмент деплоя нфт коллекции
Тут все так-же было по детальной инструкции
Да на заметку, опустошать Candy Machine надо после того как: Все НФТ были отчеканены, и не раньше!
Первый анонс своей коллекции был сделан 03.06.2022 в данном посте , т.е от создания первого гуманоида — 16.05 прошло 17 дней!
И уже 03.06 был создан сайт для минта — исходник лежит на github
Сайт был создан очень быстро, был взят исходник, сделал сверху удобное меню, добавил кривой блок с информацией, и в тот же день были отчеканены первые WL НФТ
Далее, я протестировал сайт, он работал нормально, только вот столкнулся с проблемой в виде минта для WL, я создал обычный токен, и данный сайт все не как не хотел брать 1 токен, а брал 0.000000001, перерыв все я понял что проблема была в сайте.
Решил я данную проблему созданием нового WL токена только уже в виде НФТ, и о чудо он берёт 1 нфт и соляну для минта
Определился с датой минта — 07.06.2022, я отправил свою коллекцию в НФТ календари, по итогу только один календарь разместил мою коллекцию.
NFTCALENDAR, а условия разрешения были очень простыми — поставить их баннер у себя на сайте, и сделать превью для своей коллекции
Я сразу ожидал что будет отчеканено не более 5-10 шт.
— Но вы спросите зачем такая большая коллекция?
А ответ будет простым — просто захотел, ибо дальше данная NFT возможно будет сжигаться, для разного рода наград.
В первый час отчеканили почти все кто хотел, далее я просто ждал окончания минта — 08.06.2022.
В день окончания также были отчеканены 1-2 НФТ.
После окончания минта, я сминтил остальные нфт, и принялся за финальные действия…
Коллекция сминчена на 100%, иду подписывать все нфт, и столкнулся с проблемой соль в тот момент не очень быстро работала, и две подряд транзакции у меня идут с фейл, хотя если бы я сразу все чекнул в Exploler то я бы не потратил много времени на эту ошибку
Далее я выдохнув, что это не ошибка и пошёл листится на все маркетплейсы
OpenSea — самый лучший маркетплейс, листинг моментальный
Magic Eden — тут возникла проблема, хотя я так и нечего не понял — Команда отклонила ваш листинг) — но в конце концов коллекция на Magic Eden
Ну и далее я опустошаю Candy Machine на которой лежало 0.2 SOL, и всё данная коллекция была официально запушена
How to Mint an NFT on Solana Using Candy Machine
Minting an NFT on Solana can be quite a tedious task, even with the ease of use provided by Candy Machine. However, since the Solana blockchain is singular, its main goal is to scale the blockchain for global adoption.
Today, we will be taking you on a step-by-step guide towards everything you need to know about minting an NFT on Solana through the utilization of Candy Machine.

Key Points:
- You will be required to install a lot of prerequisites prior to beginning this process and familiarity with CLI tools is required.
- You will be utilizing Candy Machine, where you will essentially fork the repository.
- By the end of this, you will be fully able to set up a project and mint your own Solana NFT.
- Make sure to re-read this guide over again once more if you feel like you need additional information, as there will be a lot of coding involved.
Install the following Programs to create your NFTs
Prior to using the Candy Machine and prior to minting any NFTs on your machine, you will be required to download some software first.
This includes the following programs:
-
(version 14.17.6)
NodeJs is essentially developed as a means of building scalable network applications. It is primarily used for non-blocking, event-driven servers, and is primarily used for traditional websites and back-end API services due to the fact that it is single-threaded. It was designed with real-time, push-based architecture.
Docker is essentially a software network specifically designed for building, running, and managing containers within servers and the cloud. It is fully open-source, and enables developers to package applications within containers, which standardizes executable components that combine application source-code with the operating system libraries and dependencies that are required to run code within any environment.
Yarn caches every package that it downloads so that it never needs to download it again in the future and even parallelizes operations as a means of maximizing resource utilization, which in turn leads to faster install times. It is the standard for fast, reliable, and secure dependency management.
The Solana CLI is essentially this collection of different commands for every single action that a user might want to take within the Solana Tool Suite. It enables users to view a list of all of the possible commands through running Solana — help, and they can even zoom in within a particular command with ease.
Metaplex CLI is a command-line interface for the creation and management of non-fungible tokens on the Solana blockchain through the utilization of Metaplex programs. Candy Machine is essentially this tool that utilizes the Metaplex CLI as a means of generating an NFT, linking a picture and relevant metadata to the NFT token, and even setting up a fair auction.
Phantom Wallet is a digital wallet specifically developed for Decentralized Finance (DeFI) which aims to make it easy as well as secure to store, send, receive, collect and swap tokens within the Solana blockchain network. Its main function is to allow users to instantly swap Solana-based tokens directly from within their wallets.
Remember to save the public key and the seed in your important documents after creating the wallet, and remember that you should never share your 12-word seed.

Note that once you are in the wallet, you have to change Solana’s mannet to Devnet. This is due to the fact that if you want to operate within the Mainnet, you will need to spend real SOL tokens. However, you can also fund your wallet with fictional SOL, which has no value, so using it would have no effect, as a means of testing out this procedure for free prior to fully utilizing it within the mainnet.

In order for you to be able to do this, you will need to scroll down until you come across this menu:

Here, you can select the Devnet option. Note that you will need to send some SOL tokens within your phantom wallet initially as a means of avoiding any issues when you are finally ready to mint on the mainnet. After you have completed this, you can begin your coding journey.
- Deep familiarity with CLI tools
CLI is short for command-line interface and is a text-based user interface (UI) used as a means of running programs, managing computer files, and even interacting with a computer. These command-line interfaces are also called console user interfaces or even character user interfaces. They can be utilized to use command-line tools, such as scripts, programs, and libraries created with a unique purpose.
Please ensure that you complete all of these software requirements prior to engaging with the process of minting an NFT on Solana through the utilization of Candy Machine.
What is Candy Machine?
To truly understand how you can complete this process fully, you will first need to be aware of what exactly Candy Machine is. This is essentially software built to utilize the Metaplex CLI, through which it generates an NFT.
Through utilizing it, you can essentially link a picture and relevant metadata to the NFT token, after which you can set a fair auction.
Forking the Repository
Within this next category, you will essentially be given a choice of utilizing two different types of repositories. One of them is built by the candy-machine mainneters, and the other one is developed by a community member and provides specific benefits. However, to keep things as simple as possible, for the time being, we will be using the second repository. If you feel confident in your Metaplex knowledge, then you can deviate from this path as well.
In order for you to be able to fork this repository, you will need to go to the community member’s repo and fork it by clicking the fork button at the top of the page.

After you have it forked, you will need to clone it.
To do this, enter the following code:

Once this project has been successfully forked from your end, you will be able to begin the setup of the overall project.
How to setup project: Step-by-Step Guide
Once you have successfully gotten a hold of all of the required code within the previous step, you will now be able to open a folder known as the “solana-candy-factory” folder in the code editor you feel comfortable with using.
The next step will involve installing the dependencies. Start by running the following command

After installing the dependencies, you will want to start the Postgres database in Docker, which will essentially hold the NFTs prior to them being deployed within the network.
How to run the Candy Machine: Step-by-Step Guide

This will essentially enable your database to allow Strapi, a headless CMS which can hold all of the NFT information you throw its way, through which you can connect to the docker container.
Then we need to move on to the NFT manager. Here, you are able to use a headless CMS as a means of uploading and managing all of your NFTs before they get minted.
Here, you will need to run the following command.

Here, first, create a free Strapi account and log in, after which you can quickly navigate to:

Ensure that you create a user by clicking on the tab:

With all of that done, you will need to fill the following fields:
- Username: User1
- Password: User1234
- Email: [email protected]
- Confirmed: Ensure that this is set to ON
- Role: Authenticated
Once all of this has been completed from your end, you will now be able to save your newly created user.
We can now move on towards the NFT collection creation process.
Go to the “Collections” tab and create a new collection. Here, you will find two fields, Name and Family.
Here, make sure that your name is “Collection_Selected_Name”, and the Family will be “The_Collection_Family_Name”, You can save the collection and move to the “NFTs” tab to create individual NFTs.
Here, you will need to format specific information, such as the Name, Symbol, Description, Seller fee basis points, image, Animation URL, External URL, Traits, Properties, and Content. It is within the Content tab that you upload your image, however, ensure that the image is in .png format. After you fill out all of this information, you will finally be able to mint your NFT.
Once all of this has been successfully completed, you will now be able to deploy the Candy Machine.
Now, due to the specific setup of the framework, this will only take a few moments and a few commands to truly finalize.
First, ensure that all of the funds within the NFTs generated are going to you through the utilization of this command:

Here, you will be asked to paste in your correct address, and all you have to do is paste your Solana address here. Furthermore, you can put the % of royalties you will make off of future sales of the artwork, which is a reference to the Seller_fee_basis_poinsts field.
You can move on towards generating the NFT data through the following command:

Here, you will be asked if you want to shuffle which will randomize the order in which the NFTs will be minted. If you’re doing a 10K NFT set, this might be a solid option for you.
Once the previous command has been compiled, you will see two files within the nft-manager/nfts-sources folder, 0.json, and 0.png.
You can run this command, and accept all of the default values by pressing on the “Enter” key:

Once the program is up, all you have to do now is simply interact with it. To set up the website, you will need to run this command:

After this, you will see a website at:

You can connect your wallet, and click on the “Mint” button.
If things went according to plan, the NFT should appear within your Phantom Wallet.
How to run a Solana Node?
You can run a Solana node with any node connection on the Solana Network. Through the utilization of NOWNodes, you can easily create your account and get any API for instant access to many blockchain networks, which do include Solana.
How to use Solana block explorer
NOWNodes allows you to access the SOL explorer for free. To begin, you will need to create a free account, after which you will be able to get a free blockchain API key. You will then need to click on the corresponding “GET FREE API-KEY” button located on the main page in order to get started.

Once you enter your email and submit, you will receive the key in a few seconds. WIth the API key, you can start using the SOL block explorer right away.
Conclusion
Hopefully, now you have a heightened level of understanding as to how minting an NFT on Solana actually works, and how you can utilize Candy Machine as a means of doing so.
If you have completed all of the aforementioned steps successfully in the Devnet, then you can switch back to the mainnet, after which you will be able to see all of your NFTs in your collectibles tab on your wallet.
The main reason as to why you might want to use NOWNodes as a means of connecting to the Solana block explorer is due to the fact that we offer a fast and reliable collection, over 40 block explorers within a single location and have gained a high level of trust within the industry.
Candy machine nft как пользоваться
Получайте прибыль на торговле криптовалютами на Binance и Bybit. Индикатор успешно зарекомендовала себя, как на падающем, так и на растущем рынке.
Возможности нашего индикатора:
- Определение направления трендов и расчет даты разворота тренда
- Расчет оптимального времени входа и выхода из сделки
- Определение стоп-лоссов
- Разные стратегии торговли: лонг, шорт, скальпинг
- Скальпинг с моментальным определением потенционо прибыльных точек входа и выхода
- и многое другое
Забудьте про бесплатные индикаторы на TradingView. Они все не приносят никакой прибыли, а одни только убытки!
Стоимость индикатора составляет 199$ в месяц. Есть бесплатная пробная версия 1 месяц (активируется при установке).
В бесплатной версии индикатора отсутствует подключение по API к биржам. Торговля возможна только вручную через ваши биржевые аккаунты.
Интерфейс программы интуитивно понятный. Есть обучающие материалы для начала торговли.
Платные подписчики получают доступ к приватному телеграмм чату, где уже собралось более 800 профессиональных трейдеров, которые готовы прийти на помощь и поделиться своим опытом.
Что такое Candy Machine NFT?
Candy Machine, разработанный Metaplex Studios, представляет собой программу для продажи NFT на блокчейне Solana. Используя интерфейс командной строки Metaplex (CLI), пользователи могут генерировать NFT и настраивать аукционы.
Отличия между Candy Machine v1 и v2
Candy Machine v2 предлагает ряд улучшений по сравнению с предыдущей версией. Он вводит непредсказуемый индекс монетизации, настройки Captcha для ограничения атак ботов, возможность создания белых списков для предварительной продажи и эксклюзивного монетизации, а также поддержку больших коллекций и скрытых выпусков.
Как использовать Candy Machine NFT?
Для успешного использования Candy Machine NFT следует выполнить следующие шаги:
- Установите необходимые инструменты и настройте кошелек Solana.
- Настройте Candy Machine, подготовьте ваши NFT.
- Разверните Candy Machine, начните монетизацию токенов и подпишите монетизацию.
- Настройте веб-сайт для продажи ваших NFT.
Candy Machine и Metaplex
Metaplex Protocol Candy Machine является ведущей программой для монетизации и распределения NFT на Solana. Это позволяет создателям безопасно и настраиваемо приводить свои цифровые активы на блокчейн.
Candy Machine Settings
On this page, we’re going to dig into all the settings available on a Candy Machine. We will focus on settings that affect the Candy Machine itself and the NFTs it generates rather than the settings that affect the minting process known as Guards. We will tackle the latter in dedicated pages.
The authority
One of the most important pieces of information when creating accounts on Solana is the wallet that is allowed to manage them, known as the Authority. Thus, when creating a new Candy Machine, you will need to provide the address of the authority that will, later on, be able to update it, insert items to it, delete it, etc.
There is an additional authority specifically for the minting process called the Mint Authority. When a Candy Machine is created without a Candy Guard, this authority is the only wallet that is allowed to mint from the Candy Machine. No one else can mint. However, in practice, this mint authority is set to the address of a Candy Guard which controls the minting process based on some preconfigured sets of rules known as guards.
It is important to note that, when using our SDKs, Candy Machines will always be created with an associated Candy Guard by default so you do not need to worry about this mint authority.
JavaScript — Umi library (recommended)
When creating a new Candy Machine, the authority will default to the Umi identity. You may explicitly set this authority by providing a valid signer to the authority property.
When using the JS SDK, the authority of a Candy Machine will always default to the current identity. You may explicitly set this authority by providing a valid signer to the authority property.
Settings shared by all NFTs
A big chunk of the Candy Machine settings is used to define the NFTs that will be minted from them. This is because many of the NFT attributes will be the same for all minted NFTs. Therefore, instead of having to repeat these attributes every time we load an item in the Candy Machine, we set them up once on the Candy Machine settings.
Note that the only attributes that can distinguish one minted NFT from another are the Name of the NFT and the URI pointing to its JSON metadata. See Inserting Items for more information.
Here is the list of attributes shared between all minted NFTs.
- Seller Fee Basis Points: The secondary sale royalties that should be set on minted NFTs in basis points. For instance 250 means 2.50% royalties.
- Symbol: The symbol to use on minted NFTs — e.g. "MYPROJECT". This can be any text up to 10 characters and can be made optional by providing an empty text.
- Max Edition Supply: The maximum number of editions that can be printed from the minted NFTs. For most use cases, you will want to set this to 0 to prevent minted NFTs to be printed multiple times. Note that you cannot set this to null which means unlimited editions are not supported in Candy Machines.
- Is Mutable: Whether the minted NFTs should be mutable or not. We recommend setting this to true unless you have a specific reason. You can always make NFTs immutable in the future but you cannot make immutable NFTs mutable ever again.
- Creators: A list of creators that should be set on minted NFTs. It includes their address and their shares of the royalties in percent — i.e. 5 is 5% . Note that the Candy Machine address will always be set as the first creator of all minted NFTs and will automatically be verified. This makes it possible for anyone to verify that an NFT was minted from a trusted Candy Machine. All other provided creators will be set after that and will need to be verified manually by these creators.
- Token Standard: The token standard to use on minted NFTs. So far only two token standards are supported: "NonFungible)" and "ProgrammableNonFungible". Note that this is only available for Candy Machines whose account version is 2 and above.
- Rule Set: If a candy machine uses the "ProgrammableNonFungible" token standard, it can provide an explicit rule set that will be assigned to every minted programmable NFT. If no rule set is provided, it will default to using the rule set on the collection NFT, if any. Otherwise programmable NFTs will be minted without a rule set. Note that this is only available for Candy Machines whose account version is 2 and above.
JavaScript — Umi library (recommended)
From the attributes listed above, only the sellerFeeBasisPoints , creators and tokenStandard attributes are required. The other attributes have the following default values:
- symbol defaults to an empty string — i.e. minted NFTs don’t use symbols.
- maxEditionSupply defaults to zero — i.e. minted NFTs are not printable.
- isMutable defaults to true .
You may explicitly provide any of these attributes like so.
The JS SDK is only compatible with Candy Machine V3 accounts whose account version is 1. That means, it does not support minting programmable NFTs and it is not compatible with Candy Machines created with the latest version of Sugar.
You may consider using the Umi library instead which supports all account versions of Candy Machine V3. Alternatively, you may downgrade you Sugar version to 2.0.0 or use the Solita-generated library.
See Programmable NFTs for more details.
When creating a Candy Machine, only the sellerFeeBasisPoints attribute is required out of the attributes listed above. The other attributes have the following default values:
- symbol defaults to an empty string — i.e. minted NFTs don’t use symbols.
- maxEditionSupply defaults to zero — i.e. minted NFTs are not printable.
- isMutable defaults to true .
- creators defaults to the current identity with 100% of the shares.
You may explicitly provide any of these attributes like so.
Metaplex Certified Collections
Each Candy Machine must be associated with a special NFT known as a Metaplex Certified Collection (MCC). This Collection NFT enables minted NFTs to be grouped together and for that information to be verified on-chain.
To ensure no one else can use your Collection NFT on their Candy Machine, the Collection's Update Authority is required to sign any transaction that changes the Collection on a Candy Machine. As a result, the Candy Machine can safely verify the Collection of all minted NFTs automatically.
JavaScript — Umi library (recommended)
When creating a new candy machine or when updating its collection NFT, you will need to provide the following attributes:
- collectionMint : The address of the mint account of the Collection NFT.
- collectionUpdateAuthority : The update authority of the Collection NFT as a signer.
Here’s an example.
When creating a new Candy Machine or updating the collection of a Candy Machine, you will need to provide the collection attribute as an object containing the following properties:
- address : The address of the mint account of the Collection NFT.
- updateAuthority : The update authority of the Collection NFT as a signer.
Here’s an example.
Item Settings
Candy Machine settings also contain information regarding the items that are or will be loaded inside it. The Items Available attribute falls in that category and stores the maximum amount of NFTs that will be minted from the Candy Machine.
JavaScript — Umi library (recommended)
When creating a new Candy Machine, the itemsAvailable attribute is required and may be a number or a native bigint for large integers.
When creating a new Candy Machine, the itemsAvailable attribute is required and must be passed like so.
On top of the Items Available attribute, two other attributes define how items are loaded in the Candy Machine. You must choose exactly one of these attributes and leave the other one empty. These attributes are:
- The Config Line Settings.
- The Hidden Settings.
Note that once a Candy Machine is created using one of these two modes, it cannot be updated to use the other mode. Additionally, when Config Line Settings are used, it is no longer possible to update the Items Available attribute.
Let’s go through both of them in a bit more detail.
Config Line Settings
The Config Line Settings attribute allows us to describe the items that are or will be inserted inside our Candy Machine. It enables us to keep the size of the Candy Machine to a minimum by providing exact lengths for the Names and URIs of our items as well as providing some shared prefixes to reduce that length. The Config Line Settings attribute is an object containing the following properties:
- Name Prefix: A name prefix shared by all inserted items. This prefix can have a maximum of 32 characters.
- Name Length: The maximum length for the name of each inserted item excluding the name prefix.
- URI Prefix: A URI prefix shared by all inserted items. This prefix can have a maximum of 200 characters.
- URI Length: The maximum length for the URI of each inserted item excluding the URI prefix.
- Is Sequential: Indicates whether to mint NFTs sequentially — true — or in random order — false . We recommend setting this to false to prevent buyers from predicting which NFT will be minted next. Note that our SDKs will default to using Config Line Settings with Is Sequential set to false when creating new Candy Machines.
To understand these Name and URI properties a bit better, let’s go through an example. Say you want to create a Candy Machine with the following characteristics:
- It contains 1000 items.
- The name of each item is “My NFT Project #X” where X is the item’s index starting from 1.
- Each item’s JSON metadata has been uploaded to Arweave so their URIs start with “https://arweave.net/” and finish with a unique identifier with a maximum length of 43 characters.
In this example, without prefixes, we would end up with:
- Name Length = 20. 16 characters for “My NFT Project #” and 4 characters for the highest number which is “1000”.
- URI Length = 63. 20 characters for “https://arweave.net/” and 43 characters for the unique identifier.
When inserting 1000 items, that’s a total of 83’000 characters that will be required just for storing items. However, if we use prefixes, we can significantly reduce the space needed to create our Candy Machine and, therefore, the cost of creating it on the blockchain.
- Name Prefix = “My NFT Project #”
- Name Length = 4
- URI Prefix = “https://arweave.net/”
- URI Length = 43
With 1000 items, we now only need 47’000 characters to store our items.
But that’s not it! You may use two special variables within your name or URI prefixes to reduce that size even further. These variables are:
- $ID$ : This will be replaced by the index of the item starting at 0.
- $ID+1$ : This will be replaced by the index of the item starting at 1.
In our above example, we could leverage the $ID+1$ variable for the name prefix so we wouldn’t need to insert it on every item. We end up with the following Config Line Settings:
- Name Prefix = “My NFT Project #$ID+1$”
- Name Length = 0
- URI Prefix = “https://arweave.net/”
- URI Length = 43
That’s right, our name length is now zero and we’ve reduced the characters needed down to 43’000 characters.
JavaScript — Umi library (recommended)
When using Umi, you can use the some and none helper functions to tell the library whether to use Config Line Settings or Hidden Settings via the configLineSettings and hiddenSettings attributes respectively. Only one of these settings must be used, thus, one of them must be configured and the other one must be set to none() .
Here’s a code snippet showing how you can set up the above example using the Umi library.
When using the JS SDK, both Config Line Settings and Hidden Settings live under the same object attribute called itemSettings . It contains a type property used to distinguish the two modes. This ensures exactly one of these settings is used on a Candy Machine.
- When type is equal to "configLines" , Config Line Settings are used.
- When type is equal to "hidden" , Hidden Settings are used.
Here’s a code snippet showing how you can set up the above example using the SDK.
Hidden Settings
Another way of preparing items is by using Hidden Settings. This is a completely different approach than Config Line Settings as, using Hidden Settings, you do not need to insert any items to the Candy Machine as every single minted NFT will share the same name and the same URI. You might be wondering: why would someone want to do that? The reason for that is to create a hide-and-reveal NFT drop that reveals all NFTs after they have been minted. So how does that work?
- First, the creator configures the name and the URI of every minted NFTs using the Hidden Settings. The URI usually points to a “teaser” JSON metadata that makes it clear that a reveal is about to happen.
- Then, buyers mint all these NFTs with the same URI and therefore the same “teaser” JSON metadata.
- Finally, when all NFTs have been minted, the creator updates the URI of every single minted NFT to point to the real URI which is specific to that NFT.
The issue with that last step is that it allows creators to mess with which buyer gets which NFTs. To avoid that and allow buyers to verify the mapping between NFTs and JSON metadata was not tampered with, the Hidden Settings contains a Hash property which should be filled with a 32-character hash of the file that maps NFT indices with their real JSON metadata. That way, after the reveal, the creator can make that file public and buyers and verify that its hash corresponds to the hash provided in the Hidden Settings.
Therefore, we end up with the following properties on the Hidden Settings attribute:
- Name: The “hidden” name for all minted NFTs. This can have a maximum of 32 characters.
- URI: The “hidden” URI for all minted NFTs. This can have a maximum of 200 characters.
- Hash: The 32-character hash of the file that maps NFT indices with their real JSON metadata allowing buyers to verify it was not tampered with.
Note that, just like for the prefixes of the Config Line Settings, special variables can be used for the Name and URI of the Hidden Settings. As a reminder, these variables are:
- $ID$ : This will be replaced by the index of the minted NFT starting at 0.
- $ID+1$ : This will be replaced by the index of the minted NFT starting at 1.
Also note that, since we are not inserting any item to the Candy Machine, Hidden Settings make it possible to create very large drops. The only caveat is that there is a need for an off-chain process to update the name and URI of each NFT after the mint.
JavaScript — Umi library (recommended)
When using Umi, you can use the some and none helper functions to tell the library whether to use Config Line Settings or Hidden Settings via the configLineSettings and hiddenSettings attributes respectively. Only one of these settings must be used, thus, one of them must be configured and the other one must be set to none() .
Here’s a code snippet showing how you can set up the above example using the Umi library.