Writing bugs 2022-04-05 00:33:02 阅读数:794
Use the magic to seize the nature , One mind is better than nature's work .
Blockchain system consists of The data layer 、 The network layer 、 Consensus layer 、 layer 、 Contract layer and application layer form
first floor ： The data layer , Store the underlying data 、 Asymmetric data encryption And time stamps and other basic data .
The second floor ： The network layer , Including distributed networking mechanism 、 Data dissemination mechanism 、 Data verification mechanism, etc .
The third level ： Consensus layer , There are all kinds of consensus mechanism algorithms encapsulated , Determine how bookkeeping is determined , It's about The safety and reliability of the whole system . At present, there are well-known consensus encapsulation mechanisms workload Proof mechanism （PoW,Proof of Work）、 Share authorization certification mechanism （DPoS,Delegated Proof of Stake）、 Proof mechanism of rights and interests （PoS,Proof of Stake） etc. .
The fourth level ： layer , The economic means used in the blockchain technology system , Including the development of economic incentives Rows and assignments , Most of them appear in the public chain .
The fifth floor ： Contract layer , Encapsulating script code in blockchain system 、 Algorithms and smart contracts , help Blockchain handles data flexibly .
The sixth floor ： application layer , It encapsulates various application scenarios and cases , E-commerce shopping 、 News browsing 、 Video watching, etc .
Storage structure ： block — chain
Distributed fault tolerance ： Distributed network Extremely robust , It can tolerate the abnormal state of some nodes ;
Non tamperability ： Consistently submitted data will always exist , Cannot be destroyed or modified ;
Privacy protection ： Cryptography guarantees data privacy , Even if the data leaks , Can't parse .
The resulting business may include the following features ：
The currency （Bitcoin）： Safe and reliable decentralized digital currency mechanism
Blockchain does not introduce third-party intermediaries , Can provide decentralization 、 No tampering 、 Safety and reliability are guaranteed .
Blockchain includes Three basic concepts ：
If we take blockchain as a state machine , Then every transaction is an attempt to change the State , And every time consensus is generated Block of , That is, the participants confirm the result of the state change caused by the transaction in the block .
On the implementation , First, suppose there is a Distributed Data record ledger , This ledger Only... Can be added 、 Deletion is not allowed . The basic structure at the bottom of the ledger is a Linear linked list , This is also its name “ Blockchain ” To dig . The linked list consists of all **“ block ” Series connection form （ Pictured 2-1 Shown ）, The following block records the hash value of the leading block （ pre hash ） . New data to be added , Must be placed in a new block . And this piece （ And the transactions in the block ） Is it legal , Can pass Calculation Hash value The way to quickly test out . Any maintenance node Can propose a new legal block , However, it must go through a certain Consensus mechanism ** To reach an agreement on the final selected block .
Take bitcoin as an example to understand the working process of blockchain
Take the bitcoin network as an example , You can see how blockchain technology is used .
First , Bitcoin client initiates a transaction , radio broadcast Go to the bitcoin network and wait for confirmation . Nodes in the network will Package some received transactions waiting for confirmation （ In addition, it also includes Previous Information such as hash value of block header ）, Form a Candidate Block . then , Trying to find a nonce strand （ Random string ） Put it in the block , Make the candidate area Hash result of block Meet certain conditions （ For example, less than a certain value ）. This nonce The search of the string takes some time to calculate and try .
Once the node is calculated Meet the conditions Of nonce strand , The format of this block is Think it's “ legal ” 了 , Can be To try to broadcast it over the network . Other nodes receive candidate blocks , To verify , It is found that the agreed conditions are indeed met 了 , Just admit that this block is a legal new block , And add it to the blockchain you maintain . When Most nodes When you add blocks to the blockchain structure you maintain , The The block is accepted by the network , Included in the block transaction It's just To be confirmed .
Bitcoin's search is based on computing power nonce List of Consensus mechanism be called Proof of workload （ Proof of Work , PoW ）*** . at present , To make the hash result meet certain conditions , There are no known fast Heuristics , Only tentative Calculation of violence *. The more times you try （ More work ）, The greater the probability .
By adjusting the restrictions on Hash results , The average bitcoin network control is about 10 Minutes to generate a legal block . Work out The nodes of the block will receive the management fee of all transactions in the block and the reward fee fixed by the agreement （ At present, it is 12.5 The currency , Half every four years ）, This The process of calculating new blocks is commonly known as dig
Blockchain technology has been explored and concerned by everyone since the design of bitcoin network , From the initial service of the digital currency system , Today, in the distributed ledger scenario, it is playing a greater and greater technical potential .
The currency Blockchain already supports Simple script calculation , But only Digital currency Related treatment . In addition to supporting digital currency , The processing process executed on the blockchain can also be further generalized , I.e Intelligent contract （ smart contract ） . Smart contract can provide more flexible contract functions besides currency trading function , Perform more complex operations .
Modern double entry bookkeeping system （ double entry bookkeeping） By Italian mathematician Luca · Pacio is good for 1494 In 《 Summa de arithmetica, geometrica, proportioni et proportionali ta 》 First formulated in a Book . complex Bookkeeping records the source and destination of each account at the same time , The reconciliation verification function is introduced into the bookkeeping process for the first time , Improve the reliability of the accounting process .
From this point of view , Blockchain is the first digital accounting technology with reconciliation function .
Compared with the traditional accounting technology , The blockchain based distributed ledger should include the following features ：
Depending on the participants , It can be divided into public （public） chain 、 union （consortium） Chain and private （private） chain
according to Use purpose and scenario Different , It can also be divided into Digital currency For the purpose of Currency chain , With Record property rights by Purposeful Property right chain , With For the purpose of crowdfunding Of Crowdfunding chain etc. , There are also applications that are not limited to specific scenarios General chain .
Most existing blockchain implementations include at least The network layer 、 Consensus layer 、 Smart contract and application layer Isostructure , The realization of alliance chain often introduces certain Authority management mechanism
financial service ：
Blockchain technology can provide... For financial services It works 、 Credible proof of ownership , as well as A fairly reliable contract assurance mechanism .
The potential advantages of blockchain include Reduce transaction costs 、 Reduce the risk of cross organizational transactions etc. . The Blockchain applications in the field are currently the most concerned , Many banks and financial trading institutions around the world are the main promoters . Some investment institutions are also applying blockchain technology to reduce management costs and control risks . On the other hand , it is to be noted that Possible problems and risks .
for example , DA08 Such crowdfunding experiments , Remind users to be cautious at both business and operational levels ;
Credit investigation and ownership management ：
The digital management of credit investigation and ownership is the dream of large social platforms and insurance companies .
At present, the main technical problems in this field include the lack of sufficient data and analysis capacity ; Lack of reliable platform Support and effective data integration management .
Blockchain is considered to facilitate data trading and flow , Provide Safe and reliable Support for . The threshold of credit investigation industry is relatively high , We need multiple resources to jointly promote ;
Resource sharing ：
With Airbnb Companies represented by sharing economy will welcome decentralized applications , Sure Reduce management costs .
The topics in this field are relatively concentrated , Large design space , Attracted a lot of investment attention ;
Trade management ：
Blockchain technology can help Automated International Trade and Logistics supply chain Cumbersome procedures and processes in the field .
The trade management scheme designed based on blockchain will bring benefits to the participating multi-party enterprises Great convenience .
in addition , Digitization of sales and legal contracts in trade 、 Cargo monitoring and inspection 、 Real time payment And other directions may become a breakthrough for start-ups ;
The Internet of things ：
The Internet of things is the foundation of the era of big data , Blockchain technology is the foundation of the Internet of things era
The Internet of things is also a field suitable for the application of blockchain technology , It is expected that there will be a large number of Applications appear , especially lease 、 logistics And so on , They are all suitable scenarios for combining blockchain Technology .
But at this stage , Due to the technical limitations of the Internet of things, large-scale applications will not appear in the short term .
ACID Principle means ： Atomicity （ Atomicity ）、 Consistency （ Uniformity ）、 Isolation （ Isolation, ）、 Durability （ persistence ）, Abbreviations for four features are used .
ACID It is also a well-known principle of description consistency , Usually occurs in Distributed database field .
say concretely , ACID The principle describes Distributed database Consistency needs to be met , At the same time, it allows you to pay the price of availability .
ACID The features are as follows ：
The currency （ BitCoin , BTC） It's based on blockchain technology A kind of . Digital currency realizes , Bitcoin network is the first large-scale network in history 、 A long tested digital money system .
Bring your own trust 、 Distributed bitcoin tamper proof accounting network
Bitcoin network has the following features in function ：
Bitcoin network is a Distributed point-to-point The Internet , Miners in the network through “ dig ” To complete the transaction record Record the bookkeeping process , Maintain the normal operation of the network .
Provide a blockchain Publicly visible bookkeeping , This book does not record the balance of each account , It's about using To record the historical information of transactions that have occurred . This design can avoid replay attack , That is, a legal transaction is re sent many times, causing an attack .
** The etheric fang （ Ethereum）** The initial goal of the project is to create a Intelligent contract The platform of （ Platform for Smart Contract）, The platform supports Turing's complete application , According to the agreed logic of smart contract Automatic execution , Ideally, there will be no fault shutdown 、 review 、 cheat , And third-party intervention .
Ethereum platform currently supports Golang、 C＋＋、 Python And other clients implemented in multiple languages . Because of its core implementation yes Based on bitcoin network The core idea of , Therefore, it is very similar to bitcoin network in many design features .
The official website of Ethereum project is ethereum.org, Code is hosted in github.com/ethereum .
The bottom layer of Ethereum blockchain is also a network similar to bitcoin P2P network platform , Intelligent contract Running on the network In the Ethereum virtual machine . The Internet is itself Publicly accessible Of , Anyone can access and participate in the maintenance of data in the network , Provide resources for running Ethereum virtual machines .
Of TaiFang blockchain Technical characteristics It mainly includes ：
1、 Intelligent contract ：
2、 Account ：
Use accounts to record system status , Each account stores balance information 、 Smart contract code and internal data storage . Ethereum supports the transfer of data between different accounts , To achieve more complex The logic of .
There are two types of Ethereum accounts ： Contract account （ Contracts Accounts） And external accounts (Externally Owned Accounts, or EOA):
When the contract account is called , Store... In it Intelligent contract In the virtual machine at the miner's place Automatic execution , And consume A certain amount of fuel . Fuel is purchased through ether in an external account .
3、 transaction ：
transaction （ Transaction）, In Ethereum, it refers to... From one account to another The message data . The message data can be Ethernet or contract execution parameters .
Ethereum uses transactions as the smallest unit of operations .
Each transaction includes the following fields ：
Similar to bitcoin network , When sending a transaction , Users need to pay a certain transaction fee , By Ethernet Pay and consume .
at present , Ethereum network can support the transaction rate exceeding that of bitcoin network （ It can reach dozens of strokes per second ）.
4、 Ether money ：
Ether money （Ether） Is the currency in Ethereum network .
Ether is mainly used to buy fuel , Pay to miners , The cost of maintaining the smart contract of Ethereum network . The smallest unit of ether is wei, An ether is equal to 1018 individual wei.
Etheric coins can also be generated by mining , Ethereum miners who successfully generate new blocks can obtain 5 An etheric reward , And the fuel cost included in the transaction within the block . Users can also buy Ethereum directly through the trading market .
5、 fuel ：
fuel （ Gas）, Control the upper limit of a transaction execution order .
Each execution of a contract order consumes a fixed amount of fuel . When a transaction has not been executed, it ends , And when the fuel is consumed , Contract execution is terminated and rolled back .
actually , Participants will not be in EVM Write new code when requesting calculations on . Instead, the application developer will program （ Reusable code snippets ） Upload to EVM In storage , The user then requests the execution of these code fragments through different parameters . The programs we upload to the network and executed by the network are called smart contracts .
Simply speaking , You can think of a smart contract as a vending machine ： After calling the script with specific parameters , If certain conditions are met , Will perform some operations or calculations . for example , If the caller sends ether to a specific recipient , Digital asset ownership can be created and distributed through a simple seller smart contract .
Any developer can create smart contracts and publish them on the Internet , And use blockchain as its data layer , Pay for the Internet . then , Any user can call the smart contract to execute their code , And pay the network again .
therefore , Through smart contracts , Developers can arbitrarily build and deploy user oriented complex applications and services , For example, the market 、 financial instruments 、 Games etc. .
Who wants to wear a crown , Must inherit its weight （ Uneasy lies the head that wears a crown ）
2015 year 12 month , By the flagship organization of the open source world Linux The base Gold will lead , 30 Initial business member （ Include IBM、 Accenture、Intel 、 J . P.Morgan 、 R3 、 DAH 、 DTCC 、 FUJITSU 、 field TACHI 、 SWIFT 、 Cisco etc. ）, common Announced Hyperledger The joint project was established .
The super ledger item is transparent 、 Open 、 De centralization Enterprise level distributed ledger technology provides open source reference implementation , And push Blockchain and Distributed ledger Related agreements 、 Development of codes and standards .
The official website of the project is hyperledger.org.
Hyperledger The basic principle of ：
版权声明：本文为[Writing bugs]所创，转载请带上原文链接，感谢。 https://netfreeman.com/2022/03/202203310520036160.html