Technical
Last updated
Last updated
If you possess technical expertise, you can delve into the source code of NFTWord. It's well documented, and comprehensive explanations accompany the functions. Furthermore, you will find detailed descriptions of the functionalities available here, which you can peruse.
If you only need how to use this ability for your own tokens, Read On-chaining Token
Since on-chaining image is very expensive in the Ethereum blockchain, we needed to use the best way to do it. You can choose one of JPG, PNG, or SVG files for the NFT image.
But which one can be a cheaper option? Let's compare:
So seams no one are cheap and not possible to use. But how about if we compress them. Let's compare:
OK, now it's better. We chose PNG images that are more compatible and have a good size when compressed with the PNG Crush algorithm.
But we guess it wasn't cheap enough. So, we found an assembly way to compress images over 200 times. That is the result:
It's correct, We have a high quality PNG image with only 0.5KB.
After this result, we defined all images with the same header and EOF (52bytes), so we removed them from files, and they will added to it in the contract on the fly, and we don't need to pay gas for that.
So now the final result for this example NFT image is 532 bytes, which means it can be stored on the blockchain with below 500K gas use. It's about 4~5 times a simple transfer price.
Final images result:
File type: PNG Image size: 500bytes ~ 1200 bytes Color Depth: 8 bits per channel (2 bytes) Dismissions: 960x960 pixels Chunk Type: IHDR Compression Method: Deflate Compression Level: 200 times
Storing seven traits for each NFT in the blockchain requires at least seven storage slots, which consumes about 100,000 gas. This amount will be added to the gas used for storing the image.
Thanks to Chiru Labs and their method for storing multiple data on one slot, we designed a method for storing traits so that all, along with the ID token, is stored on a single uint256 slot.
WTF is this? Storing all NFT traits is almost gas free and you don't pay for that.
In THIS LINK, you will find an on-chaining transaction with 418K gas usage to prove these descriptions.
Marketplaces get the token metadata by calling tokenURI
as an Ethereum NFT standard. Normally, it will return an off-chain URL containing JSON metadata of the token.
When you make a token on-chain, its metadata will transfer to the Blockchain, and the token JSON will be created in the contract. This token no longer needs to open an off-chain link to see the metadata.
When you make your token on-chain, URI in NFT marketplaces is still reflected off-chain URI. It's because the setMetadata function may used with prohibited parameters, so they will be public once the manager approves its data. It's designed so the data is confirmed; it becomes immutable and public.
Currently, the manager is a dApp for verifying metadata, but we have designed the functionality so that if the community votes to remove the collection manager, we can make token owners responsible for verifying and freezing the submitted metadata.
The app automatically performs verification and freezing during off-peak hours of Ethereum network to ensure that the locking transaction does not encounter any failures.
NFT Rentals works the same way as any other rental company in the real world. Suppose you want to have a luxury car temporarily for some days. Instead of buying a new car, the best cost-efficient way is to rent the car for the required number of days and return it to the owner without fail once your period is complete.
Thanks to the introduction of ERC-4907, the roles of owner and renter are now separated with an expiration date, which means the leaseholder’s privileges expire automatically without any further on-chain operations.
NFTWord tokens have rental ability, and you can rent your properties in marketplaces like double.one
The token owner may want to airdrop one of the NFT tokens as a gift or prize in a campaign. The Airdrop feature in the collection will provide this capability.
The token owner can specify that the recipient's address should have a maximum number of NFTWord tokens. Additionally, a record will be kept in the Ethereum log as proof of the airdrop.