科技隨筆
科技隨筆

| 科技閱讀 | 程式語言 | 理財規劃 | 工具推薦 | 音樂盛宴 | 生活雜談 | 科技隨筆中,不只有科技! 在這裡,我會隨筆記下科技閱讀、程式語言、理財規劃、音樂饗宴以及生活雜談等等內容。 邀請您在過程中與我一同分享也一同成長。 讓我們在人生的旅途中不斷學習,努力成為更棒的人吧~ 在其他平臺關注我: https://linkby.tw/itechnote.co

[Dragon Boat Festival] Six essential knowledge for NFT issuance | Smart Contract Development Plan #5

In this NFT development, I hope that readers can complete your NFT works with as little code as possible when implementing, and this article can be used as a warm-up. Some of the tools and little knowledge I have come to are roughly divided into six themes after sorting out...

Dragon Boat Festival NFT is open for reservations!

2022 quickly came to Q2. In January, I wrote about how to issue ERC-20 tokens. Finally, I actually issued my own "IT Coin (ITC)" on the Polygon main network and airdropped it to reader.

With the start of the new project, Tech Essay Open Tech Coin holders preemptively fill in the form to make an appointment to receive a free NFT airdrop, the form URL:
https://forms.gle/kEfQW7JPfbE3CGdX6

It doesn’t matter if you don’t have the tech coins that were airdropped before. If there are still places left, I will open a new form next week for non-holders to fill out!

For more details, see previous articles:
【Airdrop Rewards】Technology Essay Readers Feedback | Dragon Boat Festival NFT Distribution Appointment

Six things you need to know to develop an NFT

In this NFT development, I hope that readers can use as little code as possible to complete your NFT works during implementation, and this article can be used as a warm-up. Some tools and little knowledge that need to be used, if there are some places that are not clear or there are errors, please leave a message to me below, which will also facilitate me to make some adjustments in the follow-up articles. :

1. ERC Token Protocol
2. Smart Contracts, Solidity and Remix
3. Ethereum Rinkeby Testnet
4. Openzeppelin
5. IPFS Interstellar File System
6. OpenSea and Meta data

Please pay special attention! Since some things in this article will need to be connected to external URLs, I will type out the URLs. These sites will never ask you to enter any wallet private keys or mnemonics, or ask you to pay first. To use, remember to check the URL before operation, so as not to accidentally fall into a scam or phishing website.

1. ERC Token Protocol

The earliest NFT appeared on Ethereum, and this development also adopts the token protocol standard of Ethereum. If you are still unclear about what ERC or EIP are, you can refer to the previous article:
[Blockchain knowledge] Quickly understand Ethereum's ERC and EIP

Then, if you can understand the standards of the three Ethereum token protocols, ERC-20, ERC-721, and ERC-1155, and know the differences between them, you will have a better understanding of what the general tokens have in common with the NFTs we often hear. What is the difference between them? If you are too lazy to find resources on the Internet, you can also refer to the previous articles:
【Blockchain knowledge】One article to understand what is NFT and token | ERC-20 ERC-721 ERC-1155

This time we will use the ERC-1155 protocol to develop NFTs. If you want to ask why we use ERC-1155 instead of ERC-721 or ERC-20, it is because I just want to issue a picture token as a gift for the Dragon Boat Festival. The airdrop is distributed to readers as a souvenir, so the NFT issued this time is actually just one type. If you choose to use ERC-1155 for it, you can directly cast multiple identical NFTs to the same ID during casting. If there are fewer things on the chain, the consumption of handling fees will also decrease!

2. Smart Contracts, Solidity and Remix

We have already talked about these three things when we developed ERC-20. If you can, go back and look at the parts mentioned in the previous article. The article link is:
[New Year's Plan] Red Packet Coins for Chinese New Year | Smart Contract Development Plan #1

But here I still write a little lazy bag and take it with me.

The code we write will need to be put into operation on the blockchain after development. The code running on the blockchain is called "smart contract", just like a smart vending machine. But once it's online, it can serve anyone.

Solidity is a programming language born for writing smart contracts. With Solidity, we can write applications with business logic and automatically run these services on the Ethereum Virtual Machine (EVM) after compilation. For procedural people, although the logic is similar to other programming languages when learning Solidity, they need to learn more about business knowledge, otherwise they will not be able to fully understand the code!

If you want to see the latest version of Solidity and other detailed official documents, you can refer to the website: https://docs.soliditylang.org/

Remix is an online Solidity programming language editing environment provided by Ethereum to developers. The website is: https://remix.ethereum.org/

All of our program development and deployment code to the blockchain will be operated through Remix, which can save a lot of things in installing the environment on your own computer, greatly reduce the threshold for developing smart contracts, and allow some novice readers to When actually implementing it, it is easier to have the experience of "writing a program for the first time to create a product".

3. Ethereum Rinkeby Testnet

This part can also refer to the first article on the development of ERC-20 before, and the link will be attached at the bottom for extended reading.

The testnet we used at that time was the "Kovan Testnet", this time we will switch to another testnet called the "Rinkeby Testnet", well... if you ask me about the differences between the different testnets, I actually Don't know much about it either, but sure enough they can both spawn and execute Ethereum Virtual Machine (EVM) compatible smart contracts on it, so I think if you're going to continue using the Kovan testnet as well, in theory you should There won't be any difference.

Open the setting method of all test networks in Metamask: the upper right corner sticker → Settings → Advanced → Show test networks.

Link to claim free ether on the Rinkeby testnet: https://faucets.chain.link/rinkeby

4. Openzeppelin

For developers who want to develop smart contract functions such as DeFi and Dapp, using OpenZeppelin's open source tools will be a good start. It is an open source smart contract function library, just like a toolbox, the functions we may use are developed first, and we can achieve the desired functions as long as we use the right tools, and because the program The code is open for everyone to use, which means that countless people have checked the code. Although it is still not completely guaranteed that the code is correct, it will be relatively safe to use.

In fact, Openzeppelin is a company. Their main business is probably to provide tools to make it easier for developers to develop and manage smart contracts and to provide audits on the security of smart contract code. You can see on the official website that some of them have participated in some famous projects. Project development or assistance in auditing, such as Brave browser, Compound lending platform, the official website URL is: https://openzeppelin.com/

This time, we will use Openzeepelin's library to develop NFTs to minimize the code that needs to be written. It can give people who haven't written procedural a little bit of a feeling that they are doing program development. It should be quite interesting! They also have authoring documentation to make it easier for developers to develop smart contracts, the documentation URL is: https://docs.openzeppelin.com/contracts/

5. IPFS Interstellar File System

The IPFS interstellar file system is a decentralized file storage system. Similar to using cloud services, you don't know where your files are stored, but the difference from cloud services is that cloud services usually require super-large The data center is used to store data, so it can be regarded as centralized storage, while IPFS is decentralized storage. Your data will be stored in many different nodes. The advantage is that the data is not easy to lose, but the disadvantage is that it is not easy to lose It may take a long time to read the data used.

Does this have anything to do with the fact that we are going to develop NFTs?

If you have seen the size of the picture in the file manager, you should know that a picture is just a few MB, and the data space will be tens of thousands of times more than the text. If we want to transfer the picture to the blockchain, it will cost a lot of money It is a very unrealistic move. Now the mainstream NFT projects almost always save the pictures to the cloud and then copy the URLs and put them on the blockchain. However, if there is a personal website or some centralized It is very likely that the data cannot be read because the service is stopped or attacked. Then we cannot guarantee that the pictures corresponding to this NFT website will disappear in the next five or ten years. If IPFS is used to store pictures, Since the data will generate a unique hash value when it is stored, and it will be stored in the miners' hard disks, compared to centralized or private storage, the storage method stored in IPFS will not worry about the loss of pictures.

6. OpenSea and Metadata

OpenSea is currently the world's largest second-hand NFT trading market. If you want to make the NFT you mint to display some of the content you want on OpenSea, you can refer to the official Metadata specification, and look at us in this way. If you are interested, you can check the data and try to understand it first, and it will be mentioned in subsequent articles. !

Here is the official document URL of OpenSea about Metadata:https://docs.opensea.io/docs/metadata-standards

And the official website of OpenSea: https://opensea.io/

a

The above is roughly the content we will use to develop NFT this time. I roughly cut it into six major points, and some more basic content, such as: how to apply for a Metamask wallet, how to add a switch testnet, and go to the faucet to receive a free testnet Ether, etc., you can go back to the previous article to see this part.

In the next article, we will upload pictures to IPFS step by step, and then issue our own unique NFT. You can prepare a picture you want to send first, so stay tuned!

Further reading

Article 1: [New Year's Plan] Red Packet Coins for Chinese New Year | Smart Contract Development Plan #1
Previous: [The Final Chapter of the New Year's Plan] The Big Cut Leek Coin | Smart Contract Development Plan #4


Finally, thank you for taking time out of your busy schedule to take the time to read my articles. If you still like these content, I hope to get your follow-up and small sponsorship support, which will give me more motivation to continue writing, and welcome to click This link finds me on other platforms .

See you next time o((>ω< ))o~

Original link ITechNote technology essay

CC BY-NC-ND 2.0

Like my work?
Don't forget to support or like, so I know you are with me..

Loading...
Loading...

Comment