当前位置:网站首页>NFT transaction principle analysis (1)
NFT transaction principle analysis (1)
2022-06-26 15:44:00 【NFT practitioner】
NFT Transaction process analysis
You will click... From the official website of the project party mint Button , Open the end-to-end interaction process from the browser to the Ethernet network in detail :

1、 Click on Mint Button
Please log on to the project website ,Chrome Connect your wallet on the , And then click mint Button . Webpage JavaScript The code is project-based mint Price , Contract address, etc raw transaction data , It mainly includes the following key fields


2、TX Signature
Web page code and Metamask Interaction , A window will pop up for you to confirm this transaction . Click ok ,Metamask Will use your wallet private key to sign , To ensure that this transaction is authorized by you , The subsequent Ethereum network will be verified .
3、 send out TX To node verification
transaction TX By Metamask Send to Metamask The Ethereum of node( The default configuration ),node Yes TX check , Ensure that the transaction is not counterfeited .
4、 radio broadcast TX To Ethereum network
transaction TX Sent to neighboring nodes of the Ethereum network , And then broadcast to adjacent contacts . At this time, your transaction can be in etherscan.io You can see , Status is pending state .
5、 The miners node Received TX
The miners node It will be synchronized tx Put them all together Txpool/Mempool place , This place is the key to many things , It needs to be expanded :

Txpool The data source of is mainly from :
Local submission , That is, the third-party application calls the local Ethereum node's RPC Transactions submitted by the service ;
Remote synchronization , It's in the form of broadcast synchronization , Synchronize the transaction data of other Ethereum nodes to the local node ;
Txpool It's a hit Queue and Pending Two queues , First of all, newly received TX It will be judged based on rules and then put into Queue This line , Then add Pending Queue waiting for mining to add new blocks .
The main rules are as follows :
1) priority Gasprice high TX
2) Local TX priority , Too remote synchronization
3) Each node will set the minimum Gasprice, Remote below this value TX Will be discarded
Pending Medium TX, By Miner Module gets and validates , For mining ; After successful mining, it is written into the block and broadcast .Miner Take away the deal is copy ,Txpool Medium TX Does not reduce .TX It was written into the chain before it started Txpool Delete .
Gas Too low TX, Will be stuck all the time Txpool Not dealt with , Need can improve Gas Let it be handled .
GasWar: When a hot transaction occurs , Everyone for their own TX Can be prioritized , Strive to improve Gas Fei's scene
6、 The miner pulled out a piece TX Packed
Miners choose TX And then began to mine , Find another block Solution Then broadcast to Ethereum network .
7、 The output block is verified
After verification of other miner nodes , The block is officially linked , We TX The result can be in etherscan.io You can see .
8、TX State synchronization
Relevant status returns to local , Can be in Metamask Found on .
Reference documents :
Life Cycle of an Ethereum Transaction
Transaction lifecycle on the Ethereum blockchain
The Influence Factors on Ethereum Transaction Fees
How the contract is executed
Simply put, the transaction we send will be converted into a Message Object to EVM, and EVM Will be based on Message Generate a Contract Object for subsequent execution . Based on the Data Converted into a contract input call mint function .
NFT Pre sale and public sale
Pre sale can only be purchased for specific users , Public sale means that everyone can rush to buy .
Here we need to answer two technical questions :
1、 How to restrict certain wallets to mint?
2、 How to switch between pre-sale and public sale ?
White list mechanism
The white list is now commonly implemented using the Merkel tree , Simply put, all white list wallet addresses are used as leaf nodes of Merkel tree , Generate a Root hash. You only need to store... In the contract Root hash value , Calling mint Function when the web page JS The code is generated based on the wallet address proof( Parent node of address hash), The contract can verify whether the address belongs to the white list .
With C01 For example :0x6fd053bff10512d743fa36c859e49351a4920df6

At the time of pre-sale and public sale SetRoot to update hash(C01 Both sales are in the form of white list , Public sales shall be conducted by means of capital verification lottery )

Sales status switching
There are two common ways :1) By judging the time point in the contract , such as 2022-01-01 18:00 UTC Start public sale 2) Judge by state , And set the status variable in the contract , For example XRC For example , Judge Status.PublicSale state , This is in the call contract SetStatus Set it up

边栏推荐
- Unable to download Plug-in after idea local agent
- selenium chrome 禁用js 禁用图片
- 评价——TOPSIS
- Seurat to h5ad summary
- [CEPH] cephfs internal implementation (I): Concept -- undigested
- selenium将元素保存为图片
- Utilisation d'abortcontroller
- Inaccurate data accuracy in ETL process
- 「干货」NFT 上中下游产业链全景分析
- Is it safe to open a stock account through the account opening link of the broker manager? Or is it safe to open an account in a securities company?
猜你喜欢
![[CEPH] Lock Notes of cephfs](/img/9a/b68e7b07b1187794c0dbed36eea749.png)
[CEPH] Lock Notes of cephfs

A blog to thoroughly master the theory and practice of particle filter (PF) (matlab version)

效率超级加倍!pycharm十个小技巧就是这么神

Binding method of multiple sub control signal slots under QT

el-dialog拖拽,边界问题完全修正,网上版本的bug修复

【文件】VFS四大struct:file、dentry、inode、super_block 是什么?区别?关系?--编辑中

【ceph】CephFS 内部实现(四):MDS是如何启动的?--未消化

svg环绕地球动画js特效

# 粒子滤波 PF——三维匀速运动CV目标跟踪(粒子滤波VS扩展卡尔曼滤波)
![[graduation season · advanced technology Er] what is a wechat applet, which will help you open the door of the applet](/img/c8/f3f31a8e53c5918abc719603811cc7.png)
[graduation season · advanced technology Er] what is a wechat applet, which will help you open the door of the applet
随机推荐
Function: crypto JS encryption and decryption
音视频学习(二)——帧率、码流和分辨率
[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction
[tcapulusdb knowledge base] Introduction to tcapulusdb general documents
Don't remove custom line breaks on reformat
通过券商经理的开户链接开股票账户安全吗?还是去证券公司开户安全?
手机上怎么开户?在线开户安全么?
JS events
[tcapulusdb knowledge base] tcapulusdb operation and maintenance doc introduction
[tcapulusdb knowledge base] Introduction to tcapulusdb data structure
【SNMP】snmp trap 介绍、安装、命令|Trap的发送与接收代码实现
SQLite loads CSV files and performs data analysis
Database - sequence
JS handwritten bind, apply, call
Auto Sharding Policy will apply Data Sharding policy as it failed to apply file Sharding Policy
Comparative analysis of restcloud ETL and kettle
NFT 平台安全指南(1)
面试高频 | 你追我赶的Flink双流join
Selenium chrome disable JS disable pictures
Keil4 opens the single-chip microcomputer project to a blank, and the problem of 100% program blocking of cpu4 is solved