This article will discuss the most simple model that describes the essence of the blockchain. The specificity of the information stored in blocks is not considered, whether it be transactions, smart contracts or something else. That is, the blocks simply store records whose values depend on the specific application. This approach will allow us to understand the principle of the blockchain as a whole, without affecting the details of a specific implementation.
We will start from the simplest trivial model and will complement its capabilities until we get a full-fledged model.
Define the purpose of using the blockchain:
There are several participants who are interested in maintaining the integrity of the overall data set and supplementing it.
Basic model
Data is represented by a sequence of records that can be supplemented. Records along with supporting information are stored in blocks. Blocks are stored as a single-linked list. Each participant is represented by a node (node), which stores the entire current data array and contacts with other nodes. Nodes can add new entries to the end of the list, and also inform each other about changes to the list.
Consistent extension of functionality
Priority to a longer listChoosing between several versions of the list of records, the nodes retain a longer one. Thus, a new entry added in one node applies to all other nodes.
')
Previous entry hashThe block stores the hash code of the previous entry. Such a hash code uniquely identifies all previous blocks and their relative position. Consequently, the block inside the list cannot be changed without changing subsequent blocks.
The computational complexity of creating a blockA new field is added in the block — counter is an arbitrary number. It is necessary to select a counter value such that the block hash code ends with a certain number of zeros.
Raw records poolNew entries are pooled. Nodes pull records from the pool, form a block, and after adding the block to the list, delete the record from the pool.
Mining order to third partiesRecords from the pool are selected by miners, form a block and transfer the finished block to the node. The main computational load is shifted to the miners.
The node checks the block and adds to the list.
Multiple entries in blockThere can be several entries in a block. Miners choose any records to form a block. The block is limited to maximum length.
Well, that's all - the conceptual model is ready, thank you for your attention.