current position:Home>[blockchain Apocalypse: Nakamoto collection] II: working principle of bitcoin (Part 2)

[blockchain Apocalypse: Nakamoto collection] II: working principle of bitcoin (Part 2)

2022-02-02 15:20:31 Overflow tears

02- How bitcoin works

hash function —— Digital fingerprinting

  • Encrypted hashing is a complex algorithm that performs simple tasks , You can convert any length of text into a random string of fixed length . The output of the hash function is usually The information in this paper, , A fingerprint that is considered a document . You can see , Only one character entered below has been changed , The output will look completely different .
     Insert picture description here
  • Generating summaries is easy , But it is impossible to derive the original text from the summary . therefore , Hash function is an ideal choice to realize bitcoin . Miners often need millions of hashes to find the right pattern when looking for answers to questions , But other miners only need one hash calculation to verify the correctness of the answer .
  • The ideal hash function has four main properties :
    1. Calculating the hash value of any given message is simple
    2. It is not possible to generate a message based on a given hash value
    3. It's not possible to just modify the message and keep the hash value unchanged
    4. It is impossible to find two messages with the same hash value
  • Users need to digitally sign documents or texts of the special currency system , The hash function is part of this process .
  • Bitcoin is used for workload proof S H A − 256 SHA-256 SHA256 And the user's bitcoin address R I P E M D − 160 RIPEMD-160 RIPEMD160. Hash function is the core of workload proof .

The miner's workload proves

  • Every miner is actively engaged in generating the next block to join the blockchain by solving problems at any time , This is the proof of workload . The reward for the first miner to complete the workload certification includes the sum of the newly built bitcoin and the transaction fee of the output block . When bitcoin is minted , Miners will only be rewarded with transaction fees .
  • therefore , It can be considered that the workload has proved to be a competition between bitcoin miners , Competing to find the blocks to be generated with certain characteristics S H A − 256 SHA-256 SHA256 Hash value . The miner's goal is to solve the problem by generating hash values that match the characteristics .
  • For the sake of simplicity , Assume that the value range of the output hash value is 0 ∼ 1 e 6 0\sim 1e6 01e6, The first one calculates less than 1 e 4 1e4 1e4 The miner of hash value wins . here 1 e 4 1e4 1e4 That's the threshold , Each bitcoin block contains a number , Its sole purpose is to help reach the threshold . This number is called Provisional ( n o n c e nonce nonce). Miners continue to increase the value of temporary numbers , Until the hash value of the block is less than the threshold . Because different miners' blocks have different information , Therefore, the same temporary number will produce different hash values . The bitcoin software running on each miner's computer controls the difficulty of continuously adjusting the bitcoin protocol , Make sure about every 10 10 10 A miner will answer the question in minutes .
     Insert picture description here
  • This requirement of bitcoin system leads to a hardware competition , Everyone wants to create hardware that can calculate more values per second . If the difficulty level is determined , More miners will add more hashes per second . It must be after , Bitcoin protocol evaluates the speed of block generation to increase or reduce the difficulty level .
  • Once the miner finds a temporary number that can produce the correct hash value , Broadcast the block , Other miners accepted it after verification , And start working on the next block .
     Insert picture description here

Miner consensus and solitary block

  • The normal operation of bitcoin largely depends on consensus . When two miners finish the block at almost the same time , Consensus is beginning to work . At this time , Both blocks will be accepted and retained by all other miners , But the miners will calculate the next block based on the block they received first .
     Insert picture description here
  • At this time , Which of the two blocks will become part of the real blockchain depends on how fast the next block answers , And the miner who solved the next block received the miner's block first , There are two versions of blockchain on this node . Quickly become a formal chain , The other becomes a solitary block .
     Insert picture description here

How bitcoin works

  • The working principle of bitcoin was discussed earlier , But it doesn't clarify why . We need to understand the following concepts first :
    • Bitcoin is open source software
    • Bitcoin software sets the operating instructions that miners and wallet clients must follow
    • Bitcoin software defines and runs a set of communication protocols
    • The distributed file sharing of blockchain allows open accounting

The impact of bitcoin

  • As a monetary system , The impact of bitcoin is huge . It allows people to make global remittances , You can shop online and donate online .

03- Nakamoto's paper

The address of the paper is :Bitcoin: A Peer-to-Peer Electronic Cash System

copyright notice
author[Overflow tears],Please bring the original link to reprint, thank you.

Random recommended