In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
In order to solve the problem of how blockchain miners dig and trade through seven steps, this article introduces in detail the corresponding analysis and solutions, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Have you ever thought about how the blockchain mining process works, or how your transaction is confirmed and added to the blockchain? Well, me, too. Since I couldn't find any clear article explaining the process step by step, I decided to study it in depth and write my own guide. Here's how blockchain trading goes from your wallet to the blockchain in seven steps.
Step 1
Users log off transactions from their wallet application and try to send some encrypted coin or token from them to someone else.
Step 2
The transaction is broadcast by the wallet application and is now waiting for the miner to receive it on the appropriate block chain. As long as it is not excavated, it will wander in the "unconfirmed trading pool". This pool is a collection of transactions waiting to be processed on the network. These unconfirmed transactions are not usually collected in a giant pool, but are more common in small, segmented local pools.
Step 3
Miners on the network (sometimes called nodes, but not exactly the same! Select a transaction from these pools and "block" it. Except for some metadata, a block is basically a collection of transactions (at this point, it is still an unconfirmed transaction). Each miner builds his or her own block, but multiple miners can choose the same deal to include in their block.
Example: two miners, miner An and miner B. Both miner An and miner B can decide to include Trading X in their blocks. The block has the largest big data size. In the bitcoin chunk chain, the maximum size of the block is the data of the largest 1MB. However, before adding a deal to its block, the small business needs to check whether the deal is eligible to execute based on the blockchain history. If the sender's wallet balance has sufficient funds based on the existing block chain history, the transaction is considered valid and can be added to the block. Miners usually give priority to trading with high transaction fees because it will give them a higher return.
Step 4
By selecting a transaction and adding it to its block, the miner creates a transaction block. To add this transaction block to the blockchain (so that all other nodes and miners register the transaction), the block first needs to be signed. This signature is created by solving very complex mathematical problems unique to each transaction block. Each block has different mathematical problems, which means that each miner will deal with different problems specific to the blocks they build, but all of these problems are equally difficult to solve. In order to solve this mathematical problem, a lot of computing power is needed (and therefore a lot of electricity). This is a process called mining.
Mining aka hash (workload proof algorithm)
When trying to add a block to a block chain, the mathematical problem for each miner is to find the hash output (also known as a signature) of the data in his or her block, which starts with a certain amount of consecutive zeros. Doesn't that sound complicated? But it's not that hard. Let me try to explain it to you in a simple way.
Before we move on, it's important to solve what the hash function is. Don't worry, I won't go into too many technical details. Hash function is just a difficult mathematical problem to solve, but the answer is easy to verify.
The hash function takes an input string of numbers and letters (literally, random letters, numbers, and / or symbols of any string) and converts it to a new 32-bit string consisting of random letters and numbers. This 32-bit numeric string is a hash output. If any number or letter in the input string changes, the hash output changes randomly. However, the same input string will always provide the same output string.
Now consider the data in the block as hash input (a string of data). When this input is hashed, it provides a hash output (32-bit digital string). One rule of the bitcoin chunk chain is that the output string needs to start with a consecutive number of zeros in order to qualify as a block signature. This is what each miner is looking for when trying to add blocks to the blockchain; an output string that starts with a certain amount of zero. But what if the data string of the block is not hashed into an output string that begins with a zero number? Well, that's why miners repeatedly change some of the data in their blocks, called nonce. Because random numbers change all the time, the input data of the hash function also changes, resulting in different hash outputs. Eventually, the miner wants to find an input string (block data and a string of strings) that hash into a qualified output string (starting with a number of zeros). The following example uses seven zeros, but the number of zeros actually depends on the difficulty of the blockchain. If you are not ready, please do not click on it.
That's how miners need to find qualified signatures, and that's why it takes so much computing power to solve this mathematical problem. Guessing so many different nonce takes a lot of time and computing power.
Note: this process is not actually defined as a mathematical problem, but as a deterministic event-the computer is performing a predetermined operation on the number to see if the output meets the needs.
Step 5
The miners first find a qualified signature (solution) for their block and broadcast this signature to all other miners.
Step 6
Other miners now verify that the solution corresponds to the problem with the sender block (if the hash input actually causes the signature). If valid, other miners will confirm the solution and agree that the block can be added to the block chain. This is the source of the definition of "proof of workload". The miners who find the solution send their "proof of workload" (also known as the solution) to other miners, and then they will verify that the solution is legal. If so, then other miners will agree and reach a "consensus" on the blockchain. You can now add a block to the blockchain and broadcast it to all other nodes on the network and their signatures. As long as the transaction within the block correctly corresponds to the current wallet balance (transaction history) at that point in time, other nodes will accept the block and save it to their transaction data.
Step 7
If most miners agree, the block is added to the block chain. Each time another block is added to the top of this block, it is treated as another "confirmation" of its lower square. For example, if my transaction is included in block 502 and the block chain is 507 blocks long, that means my transaction has 5 confirmations (507-502). That's what Etherscan meant when he showed you the details of the deal. The more confirmation of your trade, the harder it will be for the attacker to change it. When a new block is added to the block chain, all miners will have to start over in step 3 to form a new trading block. Miners can't go on (well, they can, but it doesn't matter) mining also solves the block problem they're working on for two reasons.
1. It may contain transactions confirmed by the last block that has been added to the blockchain, so some of these transactions may now be invalid, invalidating the entire block.
two。 Each block needs to add hash output to the last block of the block chain to its metadata.
That's why it's called the blockchain. If the miners continue to mine the block they are already working on, other miners will note that the hash output does not correspond to the output of the most recently added block on the block chain, so the block will be rejected.
This is the answer to the question about how blockchain miners dig and trade through seven steps. I hope the above content can be of some help to you, if you still have a lot of doubts to be solved. You can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.