POW workload proves bitcoin
Publish: 2021-05-22 05:23:12
1. We know the process of information computing hash packing: transaction record, time, account number, last hash value. We also know that all calculation and storage need to consume computer resources. In Nakamoto's design, the completion of bookkeeping can be rewarded with bitcoin by the system, which is also the process of issuing bitcoin. Therefore, bookkeeping becomes mining
bookkeeping
because bookkeeping is a reward, each time you can add a certain number of bitcoin for yourself, so everyone is competing for bookkeeping, which of course leads to a problem: when there is inconsistency in bookkeeping, the system introces workload proof to solve the problem, and the rules are as follows:
1. In a period of time, only one person can succeed in bookkeeping
2. Obtain the unique bookkeeping right by solving the cryptography problem
3. Other nodes the bookkeeping results
but before the workload proof, The accounting node will do the following preparatory work:
1. Collect the original transaction information that has not been recorded in the broadcast
2. Check whether the payment address in each transaction information has enough balance
3. Verify whether the transaction has the correct signature
4. Package and record the verified transaction information
5. Add a reward transaction: add 12.5 to your address Bitcoin
if you succeed in competing for bookkeeping rights, you can get a reward of 12.5 bitcoin
workload proof
the hash value of the previous block and the current account page information will be hashed together as the original information in each bookkeeping. In order to ensure that only one person can keep accounts around 10 minutes, we have to improve the difficulty of keeping accounts. The results of hash must start with several zeros. In order to satisfy the condition, hash is to introce a random number variable
denoted by pseudo code:
1. Hash (last hash value, transaction record set) = 456635bcd
2. Hash (last hash value, transaction record set, random number) = 0000afd635bcd
if you change part of the original information of hash, the hash value will also change continuously. Therefore, when you run hash, the value of random number will change continuously, A random number can always be found so that the result of hash starts with several zeros. The node that finds the random number first obtains the unique bookkeeping right
verification
after the node successfully finds the hash value, it will broadcast and package the block to the whole network immediately, and the node of the network will verify it after receiving the broadcast. If the verification is passed, it indicates that a node has successfully decrypted, it will not compete for the current block, but will choose to accept the block and record it in its own account book for the next round of competitive guessing. Only the fastest decrypted block in the network will be added to the ledger, and other nodes will to ensure the uniqueness of the whole ledger
If a node has cheating behavior, it will cause the node of the network to fail the verification, give up its packaged block directly, and cannot be recorded in the general ledger, then the consumption cost of the cheating node will be in vain. Therefore, miners consciously abide by the consensus protocol of bitcoin system, and ensure the security of the whole system
it's like you go to the construction site to move bricks. After moving bricks for one day, the contractor asks you how can you prove that you move bricks for one day?
bookkeeping
because bookkeeping is a reward, each time you can add a certain number of bitcoin for yourself, so everyone is competing for bookkeeping, which of course leads to a problem: when there is inconsistency in bookkeeping, the system introces workload proof to solve the problem, and the rules are as follows:
1. In a period of time, only one person can succeed in bookkeeping
2. Obtain the unique bookkeeping right by solving the cryptography problem
3. Other nodes the bookkeeping results
but before the workload proof, The accounting node will do the following preparatory work:
1. Collect the original transaction information that has not been recorded in the broadcast
2. Check whether the payment address in each transaction information has enough balance
3. Verify whether the transaction has the correct signature
4. Package and record the verified transaction information
5. Add a reward transaction: add 12.5 to your address Bitcoin
if you succeed in competing for bookkeeping rights, you can get a reward of 12.5 bitcoin
workload proof
the hash value of the previous block and the current account page information will be hashed together as the original information in each bookkeeping. In order to ensure that only one person can keep accounts around 10 minutes, we have to improve the difficulty of keeping accounts. The results of hash must start with several zeros. In order to satisfy the condition, hash is to introce a random number variable
denoted by pseudo code:
1. Hash (last hash value, transaction record set) = 456635bcd
2. Hash (last hash value, transaction record set, random number) = 0000afd635bcd
if you change part of the original information of hash, the hash value will also change continuously. Therefore, when you run hash, the value of random number will change continuously, A random number can always be found so that the result of hash starts with several zeros. The node that finds the random number first obtains the unique bookkeeping right
verification
after the node successfully finds the hash value, it will broadcast and package the block to the whole network immediately, and the node of the network will verify it after receiving the broadcast. If the verification is passed, it indicates that a node has successfully decrypted, it will not compete for the current block, but will choose to accept the block and record it in its own account book for the next round of competitive guessing. Only the fastest decrypted block in the network will be added to the ledger, and other nodes will to ensure the uniqueness of the whole ledger
If a node has cheating behavior, it will cause the node of the network to fail the verification, give up its packaged block directly, and cannot be recorded in the general ledger, then the consumption cost of the cheating node will be in vain. Therefore, miners consciously abide by the consensus protocol of bitcoin system, and ensure the security of the whole system
it's like you go to the construction site to move bricks. After moving bricks for one day, the contractor asks you how can you prove that you move bricks for one day?
2. Ether clown is based on Ethereum blockchain to develop a digital phone, blockchain game with collection value! Now I'll introce it
1. The proction of clowns
the proction mechanism of clowns can be divided into two kinds, one is the official output, the other is the breeding output between two clowns
one official clown is proced every 15 minutes, and the total number is only 50000. At certain times, the official will also release some strange clowns with special shapes. The price of the original clown is the average of the prices of the last five clowns in the market
two clowns of different genders can reproce in the breeding center of the market. In each breeding pair, one clown who plays the role of father can receive the breeding fee paid by the other party (maternal Master). After breeding, there is a certain recovery period, which is related to the clown's genes. The clown in the role of mother will have a period of pregnancy, and she will not be able to breed with other clowns until she gives birth to her baby. There is no limit to the number of breeding times of each etheric clown, but the recovery period and pregnancy period will increase with the number of breeding times< Each clown's appearance is determined by the tamperable genes stored in the smart contract, and each gene is unique, so each clown is unique
the appearance of a clown is composed of eight parts, each part of which can be divided into ordinary and rare attributes. The number of rare attributes is less than that of ordinary attributes, which makes the clown with rare attributes more precious
the appearance of a clown born in breeding is closely related to his parents and the genetic genes carried by his parents. The offspring have a high probability of inheriting the shape of some parts of his parents, so that their parents' good genes can be inherited, and it is possible to mutate and become a completely different clown from his parents
3. Clown trading
etheric clown can be directly used for trading
sell: users can choose clowns to be auctioned in the market, and they can sell their own clowns. When selling, users need to set the highest starting price, the lowest acceptance price and the auction time. The Dutch auction is adopted in the auction. During the auction time, the highest price set by the seller is graally transferred to the lowest price. If the owner is not willing to sell at a low price, a longer auction time can be set or the clown can be sold off the shelves
buy: the buyer selects the clown on sale in the market and pays ether to buy the clown he likes. When the buyer purchases, the transaction will be concluded at the auction price at the current time point. If you have a favorite clown, but feel that the price is not suitable for the time being, and want to pay more attention, you can collect the clown after you like it. Later, we can understand the dynamic of the clown through "my attention"< There are four kinds of clown attribute values: growth value, strength value, agility value and wisdom value. Generation 0 clowns get the value of each attribute randomly, and the non generation 0 clowns are mainly inherited
attribute values can be changed by eating food
after the clown's growth value reaches the requirement (100 points), he can go to the factory to earn money (ETH). Different kinds of factories need different clowns. Dream college needs the wisdom of every working clown. Clowns with more than 800 points of wisdom go to Dream Academy of Sciences to work, and their income can get bonus. If a clown with less than 300 wisdom goes to work, his income will be reced to
a part-time job will consume physical strength. The total physical strength is 120 points. It consumes 1 point every 12 minutes and can work up to 24 hours. During the period of not working, physical strength can be recovered, a little every 8 minutes
when the time reaches 0 o'clock or the clown's physical exertion is completed, the clown's work income will be settled according to the actual working hours at 0 o'clock every day. When every 12 minutes is a work, less than 12 minutes will not be counted
5. Clown food and feeding
owners can buy spinach, beef, carrots, walnuts and other food through the mall to feed clown pets
the price of food is related to the selling price of original clowns on the platform the day before. So the owners can hoard some food when the price of food is low
feeding spinach is helpful to growth value, beef corresponds to clown pet's strength value, carrot corresponds to agility, walnut corresponds to wisdom
the clown can only eat one food a day. We suggest that spinach should be fed in the early stage to meet the working conditions as soon as possible, and then according to the natural properties of clown in the later stage. When working, choose the type of factory with the highest attributes to work.
1. The proction of clowns
the proction mechanism of clowns can be divided into two kinds, one is the official output, the other is the breeding output between two clowns
one official clown is proced every 15 minutes, and the total number is only 50000. At certain times, the official will also release some strange clowns with special shapes. The price of the original clown is the average of the prices of the last five clowns in the market
two clowns of different genders can reproce in the breeding center of the market. In each breeding pair, one clown who plays the role of father can receive the breeding fee paid by the other party (maternal Master). After breeding, there is a certain recovery period, which is related to the clown's genes. The clown in the role of mother will have a period of pregnancy, and she will not be able to breed with other clowns until she gives birth to her baby. There is no limit to the number of breeding times of each etheric clown, but the recovery period and pregnancy period will increase with the number of breeding times< Each clown's appearance is determined by the tamperable genes stored in the smart contract, and each gene is unique, so each clown is unique
the appearance of a clown is composed of eight parts, each part of which can be divided into ordinary and rare attributes. The number of rare attributes is less than that of ordinary attributes, which makes the clown with rare attributes more precious
the appearance of a clown born in breeding is closely related to his parents and the genetic genes carried by his parents. The offspring have a high probability of inheriting the shape of some parts of his parents, so that their parents' good genes can be inherited, and it is possible to mutate and become a completely different clown from his parents
3. Clown trading
etheric clown can be directly used for trading
sell: users can choose clowns to be auctioned in the market, and they can sell their own clowns. When selling, users need to set the highest starting price, the lowest acceptance price and the auction time. The Dutch auction is adopted in the auction. During the auction time, the highest price set by the seller is graally transferred to the lowest price. If the owner is not willing to sell at a low price, a longer auction time can be set or the clown can be sold off the shelves
buy: the buyer selects the clown on sale in the market and pays ether to buy the clown he likes. When the buyer purchases, the transaction will be concluded at the auction price at the current time point. If you have a favorite clown, but feel that the price is not suitable for the time being, and want to pay more attention, you can collect the clown after you like it. Later, we can understand the dynamic of the clown through "my attention"< There are four kinds of clown attribute values: growth value, strength value, agility value and wisdom value. Generation 0 clowns get the value of each attribute randomly, and the non generation 0 clowns are mainly inherited
attribute values can be changed by eating food
after the clown's growth value reaches the requirement (100 points), he can go to the factory to earn money (ETH). Different kinds of factories need different clowns. Dream college needs the wisdom of every working clown. Clowns with more than 800 points of wisdom go to Dream Academy of Sciences to work, and their income can get bonus. If a clown with less than 300 wisdom goes to work, his income will be reced to
a part-time job will consume physical strength. The total physical strength is 120 points. It consumes 1 point every 12 minutes and can work up to 24 hours. During the period of not working, physical strength can be recovered, a little every 8 minutes
when the time reaches 0 o'clock or the clown's physical exertion is completed, the clown's work income will be settled according to the actual working hours at 0 o'clock every day. When every 12 minutes is a work, less than 12 minutes will not be counted
5. Clown food and feeding
owners can buy spinach, beef, carrots, walnuts and other food through the mall to feed clown pets
the price of food is related to the selling price of original clowns on the platform the day before. So the owners can hoard some food when the price of food is low
feeding spinach is helpful to growth value, beef corresponds to clown pet's strength value, carrot corresponds to agility, walnut corresponds to wisdom
the clown can only eat one food a day. We suggest that spinach should be fed in the early stage to meet the working conditions as soon as possible, and then according to the natural properties of clown in the later stage. When working, choose the type of factory with the highest attributes to work.
3. The client does not need to know the real random number. The client (also the system) actually wants the hash value of the "random number" to be less than a certain value
for example, the value of sha256 of 041665464 (random number) is: (hexadecimal) 0ffffffff... (if)
it does not meet the requirement of less than 00ffffff, so it is not a block
the value of sha256 of 041665465 (random number) is: (hexadecimal) 000ffffff... (if)
it meets the requirement of less than 00ffffff, so it is a block
in fact, it is very difficult to find a random number less than a hash value, which is the principle of workload proof
the value to be less than (00ffff...) is variable (difficulty), which varies with time and computing power.
for example, the value of sha256 of 041665464 (random number) is: (hexadecimal) 0ffffffff... (if)
it does not meet the requirement of less than 00ffffff, so it is not a block
the value of sha256 of 041665465 (random number) is: (hexadecimal) 000ffffff... (if)
it meets the requirement of less than 00ffffff, so it is a block
in fact, it is very difficult to find a random number less than a hash value, which is the principle of workload proof
the value to be less than (00ffff...) is variable (difficulty), which varies with time and computing power.
4. Anti counterfeiting
like the theory of evolution, the main chain is obtained through continuous screening consensus, and the accumulated amount of computation is high. If you want to forge the main chain, you must pay a higher price (half of the computing power of the whole network). For example, the electricity consumption of bitcoin mining is equal to that of Singapore. You have to pay half of Singapore's electricity if you want to fake it
like the theory of evolution, the main chain is obtained through continuous screening consensus, and the accumulated amount of computation is high. If you want to forge the main chain, you must pay a higher price (half of the computing power of the whole network). For example, the electricity consumption of bitcoin mining is equal to that of Singapore. You have to pay half of Singapore's electricity if you want to fake it
5. Proof of work (POW), as the name suggests, is the proof of workload. Generally speaking, it can only be proved from the results, because the monitoring process is usually cumbersome and inefficient
bitcoin uses the pow mechanism in the process of block generation. A block hash that meets the requirements is composed of n leading zeros, and the number of zeros depends on the difficulty value of the network. In order to get a reasonable block hash, it needs a lot of calculation, and the calculation time depends on the hash speed of the machine. When a node provides a reasonable block hash value, it means that the node has gone through a lot of calculation. Of course, the absolute value of calculation times can not be obtained, because it is a probability event to find a reasonable hash. When a node has n% of the computing power of the whole network, it has n / 100 probability to find block
hash
the work proof mechanism seems very mysterious, but it is widely used in society. For example, diploma, degree certificate and other certificates are proof of work. Having a certificate means that you have devoted yourself to study and work in the past. Most things in life are judged by results.
bitcoin uses the pow mechanism in the process of block generation. A block hash that meets the requirements is composed of n leading zeros, and the number of zeros depends on the difficulty value of the network. In order to get a reasonable block hash, it needs a lot of calculation, and the calculation time depends on the hash speed of the machine. When a node provides a reasonable block hash value, it means that the node has gone through a lot of calculation. Of course, the absolute value of calculation times can not be obtained, because it is a probability event to find a reasonable hash. When a node has n% of the computing power of the whole network, it has n / 100 probability to find block
hash
the work proof mechanism seems very mysterious, but it is widely used in society. For example, diploma, degree certificate and other certificates are proof of work. Having a certificate means that you have devoted yourself to study and work in the past. Most things in life are judged by results.
6. Proof of work (POW) is a proof to confirm that you have done a certain amount of work. The whole process of monitoring work is usually extremely inefficient, and it is a very efficient way to prove that the corresponding workload has been completed through the certification of the work results. For example, in real life, graation certificate, driver's license and so on, are also obtained through the way of test results (through the relevant examination).
7. Unknown_Error
8. It's about how many things you've done. There should be one thing that proves that you did it. For example, the teacher has two classes, the schele and the students can prove that the class is yours. I wrote two articles. The manuscript can prove that you wrote the article.
Hot content