当前位置:网站首页>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

边栏推荐
- 【TcaplusDB知识库】TcaplusDB常规单据介绍
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction
- svg野人动画代码
- Seurat转h5ad总结
- Mr. Du said that the website was updated with illustrations
- 2022北京石景山区专精特新中小企业申报流程,补贴10-20万
- Summary of students' learning career (2022)
- 【leetcode】701. Insert operation in binary search tree
- Why are encoder and decoder structures often used in image segmentation tasks?
- Database - integrity constraints
猜你喜欢
![[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

如何配置使用新的单线激光雷达

High frequency interview 𞓜 Flink Shuangliu join
![[file] VFS four structs: file, dentry, inode and super_ What is a block? difference? Relationship-- Editing](/img/b6/d288065747425863b9af95ec6fd554.png)
[file] VFS four structs: file, dentry, inode and super_ What is a block? difference? Relationship-- Editing

IDEA本地代理后,无法下载插件

Inaccurate data accuracy in ETL process
![[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction

Unable to download Plug-in after idea local agent

Analysis of ble packet capturing debugging information

Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
随机推荐
【leetcode】701. 二叉搜索树中的插入操作
Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
Reflection modification final
el-dialog拖拽,边界问题完全修正,网上版本的bug修复
NFT 平台安全指南(1)
HW安全响应
评价——模糊综合评价
【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
Binding method of multiple sub control signal slots under QT
【leetcode】331. Verifying the preorder serialization of a binary tree
Secure JSON protocol
Inaccurate data accuracy in ETL process
【leetcode】48.旋转图像
通过券商经理的开户链接开股票账户安全吗?还是去证券公司开户安全?
Evaluate:huggingface评价指标模块入门详细介绍
Seurat转h5ad总结
Use of abortcontroller
【微信小程序】事件绑定,你搞懂了吗?
Super double efficiency! Pycharm ten tips
【问题解决】新版webots纹理等资源文件加载/下载时间过长