Blockchain circle

One stop hot information platform

About us:

Blockchain circle provides the latest information about blockchain, digital currency, digital wallet, exchange, metauniverse, bitcoin, Ethereum, contract, financial management and so on, and always pays attention to the latest market...

Deeply analyze the distributed mode of blockchain

Time : 04/11/2021 Author : abdyp8 Click : + -
        For example, file system with log structure, merge tree with log structure and copy on write (copy on write) are common patterns / techniques used to simulate immutable data structures in distributed systems. Blockchain processes transactions in a manner similar to event sourcing, which is a common technology used to process facts and operations in distributed computing. Instead of overwriting the old data with the latest data, create a log that contains all events / actions and can only append only. Pat & middot; Pat helland described invariance in his important popular paper "invariance changes everything".
 
        Accountants cannot use erasers; Otherwise, they might go to prison. All entries in the ledger are retained. Corrections can be made, but only new entries to be corrected can be added in the ledger. For example, when the company's quarterly results are published, it will include a small correction of the previous quarter. This small correction is supplementary because the data of the previous quarter has been published and cannot be changed. It can only be corrected in this quarter. From the perspective of time, this correction is actually a new addition. Blockchain is a simple distributed accounting ledger, so it is called distributed ledger Technology (DLT).
 
        The blockchain may run on various servers thousands of miles away. In this kind of asynchronous network, it is a classical problem of distributed system to ensure the order of various order transactions. All impossible theories such as FLP theorem (consensus algorithm of Distributed Systems) and cap theorem are applicable to blockchain. Just like the distributed system, there is no "now" concept in the blockchain block, and the clocks of different nodes in the distributed system may be isolated from each other. Therefore, it is not easy to conduct global real-time sequencing of events on all machines in the world, because the clocks of all nodes cannot always be synchronized. Therefore, it is no longer helpful to use the local time stamp of the machine. In addition, the delay of messages can reach any time, It can be in the order of milliseconds or seconds, or even in the order of minutes or even days. For the bitcoin blockchain, the founder Satoshi Nakamoto designed a clever way to sort order transactions to prevent the problem of double spending. He used a distributed timestamp server without a global clock.
 
        Nakamoto said in his bitcoin white paper:. Our solution is based on the timestamp server. The job of the timestamp server is to obtain the hash value of the entry of a block to be identified by the timestamp, and then widely publish the hash value. For example, in newspapers or BBS posts, a specific publishing time is always attached. This timestamp provides proof of the existence of the data (news or posts) at that time. Each current timestamp contains the hash of the previous timestamp, thus forming a chain. Such a timestamp is equivalent to two proofs of existence, which is more robust and reliable. This is similar to that in DBMS (database management system), all write operation events to the database are saved through transaction log records.
 
        In this case, the blockchain is essentially a distributed transaction log. In the absence of a global synchronization clock, the only way to determine the order of order transactions is through distributed consensus. It is just like reaching consensus on sorting events / Transactions on distributed machines, but it is difficult to reach consensus in distributed systems:. FLP (impossible result) indicates that in an asynchronous network, messages may be delayed but will not be lost. If at least one node is down due to failure, it is impossible to achieve consensus among all machines. Algorithms that can fault-tolerant the network crash include Paxos, Zab, raft, and viewstamped replication. These network fault-tolerant algorithms can reach consensus in the event that the process or machine may crash or cause message delivery delay.
 
        The above algorithms usually implement distributed systems within a controllable organization. The blockchain works under more complex conditions and is used to deal with the fault type called "Byzantine general problem". Some of the nodes may be malicious because they are run by different entities / organizations that do not trust each other. Blockchain assumes that your own network is not around you. Therefore, you need a Byzantine fault-tolerant algorithm to reach a consensus in the blockchain. Byzantine fault-tolerant algorithms have been studied for a long time in the literature of distributed systems. In 1999, Miguel Castro and Barbara Liskov introduced the actual Byzantine fault tolerance (pbft) algorithm, which provides high-performance Byzantine state machine replication, handles thousands of requests per second, and has a delay time of milliseconds.
 
        Although this article was written in 1999, until bitcoin used the "proof of work" algorithm in 2008, there was no known practical implementation of other BFT algorithms. It was only used to limit junk e-mail in some systems. Blockchain has aroused interest in the re research of BFT algorithm, and has spawned a large number of new BFT algorithms with the active efforts of the academic community. Some application cases include proofstack, bitcoin ng, tendermint and honeybadge. Different from the common people's idea, the network default is unreliable. Distributed systems engineers must deal with this grim fact.
 
        Bitcoin and other cryptocurrencies are built to work on the Internet, where network partitioning and message loss / reordering are common. Interestingly, the blockchain data structure itself is a smart way to detect message loss and reordering. Each block has a pointer to the previous block. Similar to a linked list, it can easily detect the missing block (the "isolated block" in the block link). Again, I quote the quotation of Satoshi Nakamoto:. New transactions do not necessarily need to be broadcast to all nodes. As long as most nodes can be reached, these new transactions will quickly enter a block. Blocking the broadcast can also tolerate the dropping of messages. If a node does not receive a block, it will re request the next block if it realizes that the block has been ignored.
 
        This principle is similar to replicating transaction logs or log shipping, which is a common technique used to keep replicas (especially read-only replicas) synchronized. When a transaction log is subscribed to, it provides a simple mechanism to detect gaps and repair replicas. Similarly, the integrity of each block in the block chain can be verified by checking the Merkle root in the block (representing the hash of all transactions in the block). Therefore, it is easy to find the missing transactions. Remind me that Merkle tree is a very common technology in the replication synchronization technology anti entropy. Blockchain is an exciting technological breakthrough.
 
        Let's have a distributed database implemented between entities that do not trust each other for the first time. We are still in the early stage of this interesting technology, similar to the period when the first distributed NoSQL database was written, such as Amazon's dynamo or Google's BigTable. These distributed databases show us a new way to build large databases, and open up new design patterns and data structures. NoSQL databases are now commercialized. If you hear about the new NoSQL database, 90% of the patterns and algorithms are the same. DLT is also going through a similar stage and will eventually become commercialized.
 
        But it is still in the early stage, and we are digging the best mode to build them.
 
        
Previous:Shanghai's third batch of regulatory sandbox pilot list was released, focusing on blockchain, big data and other technologies
Next:No more

Related articles:



© 2005-2032 | Blockchain Circle & & All Rights Reserved    Sitemap1 Sitemap2 If there is infringement, please contact us at: