BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

How to snap up NFT with the method of scientists?

星球君的朋友们
Odaily资深作者
2022-02-14 11:30
This article is about 5056 words, reading the full article takes about 8 minutes
Scientists rush to buy NFT, which is to use various means to make their own transaction TX be packaged by miners before others, and complete NFT mint before it is sold out.
AI Summary
Expand
Scientists rush to buy NFT, which is to use various means to make their own transaction TX be packaged by miners before others, and complete NFT mint before it is sold out.

Original source: Mirror

Original source: Mirror

first level title

NFT purchase process

To put it simply, the purchase process is the interaction between your wallet and the NFT contract. Transfer 0.176ETH from your wallet to the contract. After calling the mint method of the contract, two NFT tokens are generated, and the tokens are transferred to your wallet. You get this NFT .

For the content of NFT contracts, please refer to the following articles:first level title

Detailed explanation of the NFT purchase process

image description

NFT purchase process

1. Click the Mint button

Everyone logs in to the project website, connects their wallets on Chrome, and clicks the mint button. The JavaScript code on the web page generates raw transaction data based on the mint price of the project, contract address, etc., mainly including the following key fields

nonce: nonce, 

gasLimit: '21000', 

maxFeePerGas: '300', 

maxPriorityFeePerGas: '10', 

to: '0x198478f870d97d62d640368d111b979d7ca3c38f', 

value: '176000000000000000', 

data: '0xa0712d680000000000000000000000

 000000000000000000000000000000000000000002'

  • gasLimit– The maximum amount of Gas that a transaction can consume. unit gwei

  • to – Receiving address (here is the contract address of NFT, the transaction will execute the contract code)

  • nonce – Used to track the total number of trades executed by the account

  • value – The amount of transfer ETH (in WEI, here is 0.176 ETH to buy NFT)

  • data– Interact with the contract, schedule the mint function, and the number of mint is 2

    Function: mint(uint256 tokenQuantity)

    MethodID: 0xa0712d68

    [0]: 00000000000000000000000000000

    00000000000000000000000000000000002

  • maxPriorityFeePerGas- the maximum amount of gas to include as a miner tip

  • maxFeePerGas- the maximum amount of gas that is willing to pay for the transaction

2. TX signature

The web page code interacts with Metamask, and a window will pop up to let you confirm the transaction. After clicking Confirm, Metamask will use your wallet private key to sign to ensure that the transaction is authorized by you, and the subsequent Ethereum network will verify it.

3. Send TX to node for verification

The transaction TX is sent by Metamask to Metamask's Ethereum node (default configuration), and the node verifies the TX to ensure that the transaction is not counterfeited.

4. Broadcast TX to the Ethereum network

The transaction TX is sent to the adjacent nodes of the Ethereum network, and then broadcast to the adjacent nodes. At this time, your transaction can be viewed on etherscan.io, and the status is pending.

5. Miner node receives TX

image description

Txpool code flow (borrowed from the txpool diagram of the Ethereum source code analysis)

TxpoolThe data sources mainly come from:

Submit locally, that is, the transaction submitted by the third-party application by calling the RPC service of the local Ethereum node;

remote synchronization, refers to synchronizing the transaction data of other Ethereum nodes to the local node through the form of broadcast synchronization;

Txpool is divided into two queues, Queue and Pending. First, the newly received TX will be judged based on the rules and placed in the Queue queue, and then the Pending queue will be added to wait for mining to add new blocks.

The main rules are as follows:

1) Prioritize TX with high Gasprice

2) Local TX priority processing, too remote synchronization

3) Each node will set a minimum Gasprice, and remote TXs below this value will be discarded

The TX in Pending is acquired and verified by the Miner module for mining; after successful mining, it is written into the block and broadcasted. The miner takes away the transaction is a copy, and the TX in the Txpool does not decrease. TX is deleted from Txpool only after it is written into the chain.

The TX whose Gas is too low will be stuck in the Txpool and cannot be processed. It is necessary to increase the Gas to allow it to be processed.

Detailed code analysis can refer totxpool of Ethereum source code analysis

GasWar: When a hot transaction occurs, everyone can be prioritized for their own TX and compete to increase the Gas fee

6. The miner's block TX is packaged

Miners start mining after selecting TX, and then find a block solution and broadcast it to the Ethereum network.

7. The block is verified

After being verified by other miner nodes, the block is officially uploaded to the chain, and our TX results can be viewed on etherscan.io.

8. TX state synchronization

The relevant status is returned locally and can be queried on Metamask.

first level title

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 and passed to the EVM, and the EVM will generate a Contract object based on the Message for subsequent execution. The mint function is called based on the input of the Data we transferred into the contract.

See the EVM introduction for details and refer to the following documents:

first level title

NFT pre-sale and public sale

The pre-sale can only be purchased for specific users, and the public sale means that everyone can snap up it.

There are two main technical questions to be answered here:

1. How to limit specific wallets to mint?

first level title

Whitelist mechanism

Whitelists are now generally implemented using Merkle trees. Simply put, all whitelist wallet addresses are used as leaf nodes of the Merkle tree to generate a Root hash. In the contract, only the Root hash value needs to be stored. When the mint function is called, the JS code of the webpage generates a proof based on the wallet address (the hash of the upper-level parent node of the address), and the contract can verify whether the address belongs to the white list.

Take the C01 contract as an example:0x6fd053bff10512d743fa36c859e49351a4920df6

Update the hash through SetRoot during the pre-sale and public sale (C01 uses a whitelist method for both sales, and the public sale uses a capital verification lottery method)

first level title

Using Merkle Trees for NFT Whitelists

Sales status switch

first level title

How scientists are snapping up NFTs

Scientists use programs to snap up NFT, which means using various means to make their own transaction TX be packaged by miners before others, and complete NFT mint before it is sold out. At the same time, scientists are all pursuing perfection. The most perfect result is of course that their TX appears in the first block that meets the public sale status, that is,Grab Block0

image description

Block0 in two scenarios

The methods used by scientists can be summarized in the following three points:

1. Lower information acquisition delay

Similar to financial quantitative transactions, funds expect lower latency between their servers and exchanges. The blockchain is similar. For example, everyone in CEX will access the server of the centralized exchange nearby. The transactions of NFT mint and DeFi take place in the Ethereum network. Everyone pursues a faster Ethereum Node or a network connected to a large mining pool, so as to monitor the pending TX of the Txpool faster and obtain the required information to allow the program to execute in a timely manner.

2. The transaction path is shorter

1) After looking directly at the TX interaction process above, the scientist's choice must directly interact with the NFT contract through the program.

2) By deploying your own contract on the chain, you can interact with the NFT contract through the private contract. Although private contracts require external TX triggers, contracts can be purchased in batches, which is especially suitable for NFTs that do not limit the number of mint. (Now more and more NFTs restrict the caller to be a contract)

3. Submit transactions in batches

first level title

contractmint

An example of contract snap-up, after YOKAI's public sale. Scientists snapped up a total of 750 mints using private contracts. See TX for details.

first level title

Artifact Flashbots

For a detailed explanation of Flashbots, see Mr. Wei’s wonderful introduction and official documents

Flashbots: How to withdraw assets or interact with contracts from wallets without ETH

There are several benefits of using Flashbots:

1) You can package TX in batches and submit together, and you can independently control the order of packaging TX. 2) The TX submitted by Flashbots will not appear in Txpool, it will be seen by everyone after appearing on the chain. This provides the privacy of TX, so many DeFi quantitative trading platforms advertise their access to Flashbots. (I personally think this is only temporary. With the widespread use of Flashbots, the TX submitted by Flashbots will still be monitored)

3) Gas fee will not be charged if the Flashbots mint fails

Flashbots snapped up Let's take the public sale of Lengtu XRC as an example:

Boss Yi tweeted that the public sale will not be public sale by scientists, but the result is inblock=14020984Block0 solves the battle, and all scientists are reserved.

The setStatus TX sent by the project party was monitored in TXpool at 14020982

Then some scientists packaged setStatus TX and their own mint tx with flashbots and sent them to miners. Here the scientist puts setStatus TX first, although it has a low Gas, and ranks its own mint tx behind, and finally tx enters the chain at block 984.

Flashbots packagingfirst level title

burn block

To put it simply, it is to send tx non-stop. The more mint you send, the higher the probability of success. If you are lucky, you may be squeezed into Block0. The problem with this solution is that it will consume a lot of Gas fees, which is a rich and willful way of playing. Block burning generally considers the start time, each Tx interval, the number of sending times, gas costs, etc. This is generally considered by everyone based on the project time, monitoring pending tx, and the speed of block generation on the chain.

first level titlewallet

How to defend against scientists

With the emergence of panic buying by scientists, more and more projects have begun to use various methods to prevent scientists from panic buying. The essence of these methods is to restrict scientists from directly calling the contract mint, so that the people selected by the project party can mint

1. Only sold through the whitelist

The whitelist mechanism is used for all project sales, so that the project party can filter out those who really appreciate the project through rules.

But if there are rules, there are countermeasures. Level + number of invitees, there are chatbots and studios that raise accounts and sell invitations; when creating art, Taobao finds people to paint; now it has developed to invite people to Discord for a limited time; let everyone guess riddles and do tasks, etc. Various ways to play.

The project party is fighting wits and courage with studios who racked their brains and whitelisted, and ordinary NFT players are also played around by various rules.

2. The public sale adopts the method of capital verification lottery

For example, when NFT is sold to the public, a certain amount of ETH is required to verify the wallet in advance, and then the winning list will be given through the system lottery. However, many project parties are unwilling to implement a 1:1 lottery system in order to save trouble. In the end, the public sale list was greatly oversold, and everyone rushed to buy it.

3. Signature verification mint on the server side

first level title

How will NFT develop in the future

People who have passed the white list feel that the NFT industry is very unhealthy now, but the NFT industry is still in its early stages, and if there is a problem, there will be someone in the market who will definitely come out to solve the problem.

The sale of NFT needs to be public, notarized and transparent. I personally think that the solution can still be based on two familiar scenarios in real life:

1. For the issuance of new shares, the exchange will conduct account transaction time, capital verification and other thresholds, and then lottery lottery for sale.

2. Jingdong Moutai is snapped up, and the Jingdong platform conducts account authentication and guarantees the fairness of the snap-up, etc.

Both of these scenarios ensure fairness through the authority of the platform, but there should be new solutions based on blockchain contracts in web3 to achieve similar functions, just like the various trading protocols in the DeFi market now, which may be implemented in the near future The NFT sale agreement appears to provide a fair, notarized and transparent sale model. I am still learning and thinking about how to do it specifically, and I welcome your guidance and discussion.

Original link

Original link

NFT
Welcome to Join Odaily Official Community