The present application claims priority of chinese patent application entitled "blockchain standard application model and method for applying same" filed by chinese patent office on 28/8/2018 with application number 201810986825.3, the entire contents of which are incorporated herein by reference.
Disclosure of Invention
The application provides a block chain system, which aims to solve the problems that a traditional block chain system does not support cross-chain transaction and cannot complete communication and interaction between different chains.
The application provides a blockchain system, which comprises a P2P network, wherein nodes in the P2P network are respectively deployed as public chain nodes or various access chain nodes, and the nodes are deployed as one or more of the following logic layers according to roles or functions of the nodes in the blockchain:
the data block layer comprises a sequence set based on physical data blocks and is used for providing distributed data storage and data reading of the whole block chain network;
the network switching layer comprises an infrastructure and a plurality of communication protocols and is used for mutual discovery, networking and communication of distributed nodes in the block chain network;
a platform framework layer comprising a plurality of blockchain platforms of an access blockchain network, and used for providing basic blockchain functions and architecture, and cross-chain mutual function registration and discovery;
the decentralized application layer comprises an application program set installed in a network environment and supports the construction of a third-party decentralized application program, and is used for realizing the creation, deployment, butt joint and use of an application;
and the cross-domain layer comprises a transaction server used for managing cross-chain transactions, transaction verification and providing cross-chain intelligent contracts.
Optionally, in the block chain system, each layer performs data operation independently, and data operation results are transmitted through a formatting interface between layers.
Optionally, the data block layer, the network exchange layer, the platform framework layer, and the decentralized application layer are deployed in any node; the cross-domain layer is deployed on a common node that is responsible for maintaining two or more blockchain networks.
Optionally, data operations of the same level and the same level between any two nodes are deployed through distributed application; different levels of data manipulation within the node are deployed by different applications.
Optionally, the data block layer is connected to the network exchange layer through a data interface;
the nodes deployed as the data block layer send the generated transaction information to the network exchange layer;
the node deployed as the data block layer also receives and reads transaction information from the network switching layer through the data interface and stores the transaction information in the memory.
Optionally, the network exchange layer is connected to the platform framework layer through a network interface.
Optionally, the platform framework layer is connected with the decentralized application layer through a contract interface and/or an application programmable interface;
the application program in the decentralized application layer takes the platform framework layer as a development environment and is accessed to the platform framework layer through the application programmable interface;
and if the transaction information generated by the data block layer contains intelligent contract information, sending the intelligent contract information to the platform framework layer through the contract interface so as to process the transaction information through an application program.
Optionally, the decentralized application layer is connected to the cross-domain layer through an application interface;
and the transaction server in the cross-domain layer calls an application program in the decentralized application layer through the application interface to implement cross-chain transaction.
Optionally, the cross-domain layer is further connected to the platform framework layer through a contract interface and/or an application programming interface;
and when the cross-domain layer implements cross-chain transaction, providing a cross-chain intelligent contract to a blockchain platform in the platform framework layer through a contract interface.
Optionally, the access link nodes are respectively affiliated to the blockchain networks connected with the public links, and the blockchain networks connected with the public links include sub-chains, industry chains and alliance chains based on public link node interface specifications, and third-party public links, industry chains, alliance chains and private chains.
According to the above technical solutions, the present application provides a blockchain system, including a peer-to-peer P2P network, where nodes in the P2P network are respectively deployed as public link nodes or various access link nodes, and the nodes are deployed as one or more logical levels of a data block layer, a network switch layer, a platform framework layer, a decentralized application layer, and a cross-domain layer according to roles or functions that the nodes assume in the blockchain network. Each layer carries out data operation in the layer independently, and can complete the data generation, verification and storage in the transaction through the data interaction among the layers. And managing cross-chain transactions, transaction verification and providing cross-chain intelligent contracts by deploying a cross-domain layer, and solving the problem that the traditional blockchain system does not support the cross-chain transactions.
Detailed Description
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following examples do not represent all embodiments consistent with the present application. But merely as exemplifications of systems and methods consistent with certain aspects of the application, as recited in the claims.
In the technical solution provided in the present application, the blockchain refers to accounting data generated by a transaction in a network system, and refers to a network operating a blockchain technology, that is, a blockchain network. The blockchain network refers to a point-to-point (P2P) network with decentralized application architecture, and the blockchain network can perform distributed storage, public consensus, digital encryption, transaction accounting and verification. I.e., a transaction platform that encompasses distributed technology, cryptography, P2P network architecture, and various consensus algorithms that may be applied.
The blockchain or blockchain information is accounting information generated according to transaction information when transactions occur in the blockchain network, namely a plurality of specific transactions form a blockchain, and the plurality of blocks form a blockchain. The blockchain network comprises nodes which establish point-to-point network connection with each other, and each node is configured with a corresponding consensus mechanism, such as an intelligent contract, and has enough computing power to perform transaction verification and accounting procedures. The nodes also have interface specifications that conform to some uniform standard to enable access to more nodes or other types of blockchain networks through the interface specifications.
Specifically, refer to fig. 2, which is a schematic structural diagram of a blockchain system according to the present application; fig. 3 is a schematic diagram of a connection structure between logic levels in the blockchain system of the present application. The blockchain system comprises a point-to-point P2P network, wherein the P2P network is composed of a plurality of nodes, and each node has computing capacity, application running capacity, storage capacity and the capacity of providing man-machine interaction. In practical applications, the nodes in the P2P network are not only gateway devices providing network information transfer, but also any computer devices authenticated by the blockchain network, such as personal computers, computer groups, servers, intelligent terminal devices, and so on.
In the technical solution provided by the present application, as shown in fig. 4, the blockchain network includes a public-link network providing a basic platform and other blockchain networks accessing the public-link network, that is, an access-link network. To implement the above form, the nodes in the P2P network described in this application are deployed as public-link nodes or various access-link nodes, respectively. For the public link network and the access link network, the public link network, the sub-link network and the private link network can be further divided according to the size of the block link network. According to the application field of the block chain network, the method can be divided into a public chain, an industry chain and a alliance chain, a third party public chain (such as a bitcoin network, an Ether Fang network and the like), a third party industry chain and a third party alliance chain and the like. In the application, each blockchain network is composed of nodes with different numbers, and transaction, verification and storage in the network can be independently completed in each blockchain network.
Furthermore, the public chain serves as a basic platform and has the functions of chain-crossing transmission, information relay and connection, and standard interfaces with unified specifications are arranged on nodes in the public chain. The access chain, which is a blockchain system having a specific function with respect to the public chain, may be a sub-chain developed based on the public link point interface specification, and a third party blockchain network. In some embodiments of the present application, therefore, the access link points are each affiliated with a blockchain network of the plurality of connected public chains, the blockchain network of connected public chains including sub-chains, industry chains, and federation chains based on the public link point interface specification, and third party public chains, industry chains, federation chains, and private chains.
As can be seen from fig. 2 and 3, in the blockchain system provided in the present application, according to the role or function that a node assumes in a blockchain, the node is deployed as one or more of the following logical levels:
the data block layer comprises a sequence set based on physical data blocks and is used for providing distributed data storage and data reading of the whole block chain network;
the network switching layer comprises an infrastructure and a plurality of communication protocols and is used for mutual discovery, networking and communication of distributed nodes in the block chain network;
a platform framework layer comprising a plurality of blockchain platforms of an access blockchain network, and used for providing basic blockchain functions and architecture, and cross-chain mutual function registration and discovery;
the decentralized application layer comprises an application program set installed in a network environment and supports the construction of a third-party decentralized application program, and is used for realizing the creation, deployment, butt joint and use of an application;
and the cross-domain layer is used for managing cross-chain transactions, transaction verification and providing cross-chain intelligent contracts.
In the technical scheme provided by the application, a many-to-many correspondence relationship is kept between each node and each of a data block layer, a network exchange layer, a platform framework layer, a decentralized application layer and a cross-domain layer, namely, for one layer, the data block layer, the network exchange layer, the platform framework layer, the decentralized application layer and the cross-domain layer can be deployed by one node independently or by a plurality of nodes together; for a node, it can be deployed as one layer of functions or roles, or as multiple layers of functions or roles simultaneously. For example, for a node in a blockchain system, where a data block layer, a network switching layer, a platform framework layer, a decentralized application layer, and a cross-domain layer can be deployed at the same time, such a node may participate in all data processing flows during a transaction occurring in the network system. But it is also possible for a node to act solely as a data block layer, i.e. in the node only a sequential set based on physical data blocks is deployed, in order to distribute data storage and data reading functions when a transaction occurs.
As can be seen from the above-mentioned layers, in the present application, the data block layer is mainly used for providing distributed data storage and data reading of the whole block chain network, that is, formatted standard data is generated according to transaction information, so as to perform reading and processing between each layer; and storing the data generated by each layer or storing the final result data of the transaction.
Further, for the data block layer, the following functions are mainly included: the data storage device is deployed in a node of a data block layer, and comprises a data storage device, such as a hard disk, and the like, and is used for storing data files and can be further configured to form a database.
For the network switch layer, network applications are deployed therein to enable network registration, network discovery, network authentication, network packets, network routing, and network transport, and thus, for nodes configured as the network switch layer, various network protocols should be stored therein.
For the platform framework layer, a virtual machine and various contracts and accounts are deployed. The system provides a development environment and a message channel, and performs set control related operations on transaction, expense, a blockchain format, a transaction state, transaction consensus, data encryption and decryption and a storage mode to ensure the normalization and the correctness of data transaction.
For the decentralized application layer, as an application layer, applications applied to multiple fields are deployed, for example: management platforms or applications such as electronic commerce, crowd funding platforms, gaming transactions, financial management, item transactions, market transactions, social systems, small-scale DAO systems, and the internet of things. In the technical solution provided by the present application, the decentralized application refers to an application installed on a node configured as a decentralized application layer or in a network environment in a blockchain system, a basic algorithm and a specific flow of the application are commonly known from the whole network, and a data processing process of the application is not controlled and modified by a central device, such as a server.
For the cross-domain layer, nodes configured as the cross-domain layer should store consensus contracts, and have standardized access interfaces, so as to complete cross-chain services such as cross-chain transaction, cross-chain verification, cross-chain contract configuration, cross-chain value discovery, sub-chain/third-party access chain management, and the like.
In the block chain system provided by the application, each layer is independent to perform data operation, and data operation results are transmitted through a formatting interface between layers. For example, for the data block layer, which independently stores, reads, and sets data, the process of generating the data file is not controlled and affected by any other layer, and in practical applications, the data block layer generates corresponding data such as transactions, contracts, and the like based on a specific application scenario, and transmits the result of the data operation through a formatting interface between layers.
In some embodiments of the present application, the data block layer is coupled to the network switch layer via a data interface, as shown in fig. 2. The nodes deployed as the data block layer send the generated transaction information to the network exchange layer; the node deployed as the data block layer also receives and reads transaction information from the network switching layer through the data interface and stores the transaction information in the memory. In this embodiment, the Data Interface (DI, Data Interface) is a DI Interface provided by the Data block layer to the outside in a unified manner, and the rest layers, mainly the network exchange layer and the platform framework layer, complete the docking and communication with the Data block layer directly based on the DI of the Data Interface. Further, the data interface may provide a collection of interfaces of the following types, such as data generation (DIG), data storage (DIS), data query (DIQ), data read (DIR), and data delete (DID).
The network exchange layer is connected with the platform framework layer through a network interface. The Network Interface (NI, Network Interface) is an NI Interface provided by the Network exchange layer, and other layers, such as the platform framework layer, directly complete Network communication and data exchange based on the NI Interface, and the Network Interface provides the following types of Interface sets: such as network discovery (NIQ), network registration (NIR), network access (NIC), data distribution (NIP), data synchronization (NIS), network packet (NIG), etc.
The platform framework layer is connected with the decentralized application layer through a contract interface and/or an application programmable interface. The application program in the decentralized application layer takes the platform framework layer as a development environment and is accessed into the platform framework layer through the application programmable interface, and if the transaction information generated by the data block layer contains intelligent contract information, the intelligent contract information is sent to the platform framework layer through the contract interface so as to process the transaction information through the decentralized application program.
For an Application Programming Interface (API), the API is used as a general name of an interface provided by a platform framework layer, so that all decentralized applications in a decentralized application layer can be developed, implemented and deployed based on the interface of the layer. The application programmable interface mainly provides a set of interfaces of the following types, such as a password interface, a consensus interface, an account interface, a status interface, a message interface, a channel interface, a data structure interface, a transaction interface, a fee interface, a block interface and the like, so that different types of data are transmitted according to the specific operation form of each decentralized application. For the intelligent Contract (CI) interface, a set of interfaces of the following types such as a virtual machine interface, a contract interface, and a release management interface are mainly provided.
The decentralized application layer is connected with the cross-domain layer through an application interface; and the transaction server in the cross-domain layer calls an application program in the decentralized application layer through the application interface to implement cross-chain transaction. In the present application, the Application Interface (AI) may be in the form of an intelligent contract, i.e., a decentralized application or network may provide value and information exchange capabilities via a standard intelligent contract.
In addition, in some embodiments of the present application, in order to complete a cross-link transaction, the cross-domain layer is further connected to the platform framework layer through a contract interface and/or an application programming interface; and when the cross-domain layer implements the cross-chain transaction, providing a cross-chain intelligent contract to a blockchain platform in the platform framework layer through the contract interface.
In the block chain system provided by the application, the data block layer, the network exchange layer, the platform framework layer and the decentralized application layer are deployed in any node; the cross-domain layer is deployed on a common node that is responsible for maintaining two or more blockchain networks. That is, in the blockchain system of the present application, any node may be used to deploy a data block layer, a network exchange layer, a platform framework layer, and a decentralized application layer. Each level is only required to have the computing capability and hardware configuration required by the corresponding level.
For a public link network, when there are a sufficient number of nodes in the public link network, all nodes may be divided into a plurality of parts, the plurality of parts are independent of each other, or there may be partial node overlap. And, some of the nodes are used to configure one hierarchy and some of the nodes are used to configure another hierarchy. By configuring different functional hierarchies for different parts of nodes, the computing power of each node in the public link network can be fully utilized, and the efficiency of data generation, operation, verification and storage is improved.
The data block layer, the network exchange layer, the platform framework layer and the decentralized application layer are configured to transmit data frequently, so that the 4 hierarchies may be deployed in nodes close to each other in a network environment in order to improve data transmission efficiency. In addition, for a node with a higher hardware device configuration, the node can be configured to be a hierarchy of multiple roles or functions, for example, the node is configured to have functions of a data block layer, a network exchange layer, a platform framework layer and a decentralized application layer at the same time; while for nodes configured lower, it may be configured as a single functional hierarchy, e.g. only as a network switch layer.
Since the main function of the cross-domain layer is to implement cross-chain transactions, in the present application, the cross-domain layer should be deployed on a common node that undertakes maintenance of two or more blockchain networks, that is, a node connected by two blockchain networks, and the function of the cross-domain layer is preferentially configured. In this embodiment, the function of configuring the cross-domain layer for the common node that undertakes maintenance of two or more blockchain networks may facilitate cross-chain data transmission and verification, so as to improve the processing efficiency of cross-chain transactions.
Further, when the blockchain network system performs a transaction operation, a part of nodes in the blockchain network system are randomly selected to serve as a combination of one or more logic layer functions of the data block layer, the network exchange layer, the platform framework layer, the decentralized application layer and the cross-domain layer. By randomly selecting proper nodes as corresponding level functions, the transaction data generated by each level can be prevented from being artificially changed, and the anti-repudiation effect of the block chain data can be greatly improved by combining an encryption algorithm. Moreover, by randomly selecting and configuring the functions and roles of all the nodes, the number of the nodes participating in the broadcast verification process of the block data can be reduced on the premise of ensuring the data security, the verification efficiency of the transaction data is improved, and the accounting program is accelerated.
In some embodiments of the present application, data operations at the same level, and at the same level, between any nodes are deployed through a distributed application; different levels of data manipulation within the node are deployed by different applications. Among them, Decentralized Application (DAPP) is an Application program applied in a network environment, and may implement configuration on a plurality of network nodes at the same time. Therefore, in this embodiment, data operations of the same level between any nodes can be deployed and completed through distributed application, so as to ensure the uniformity of the data operations within the deployed level and reduce the probability of data errors. For the interior of one node, when one node is simultaneously deployed with roles and functions of multiple hierarchies, each hierarchy corresponds to one application program, so that when data operation is performed, the respective data operation can be respectively completed through the application programs corresponding to different hierarchies in the interior of the node. Therefore, data operation in a hierarchy is avoided, frequent transmission among different nodes is realized, and the data operation efficiency is improved.
According to the above-provided blockchain network system, as shown in fig. 5, the blockchain network system executes the following program steps for the transaction operation:
s11: the node serving as a transaction initiator generates a data block according to the transaction information and sends the data block to the platform framework layer through the network exchange layer;
s12: the platform framework layer calls an application program in the decentralized application layer, and the data block is processed through the application program;
s13: the platform framework layer completes transaction according to the data blocks by using the called application program, and generates accounting data in the platform framework layer;
s14: and the platform framework layer sends the accounting data to the data block layer for distributed storage through the network exchange layer.
As can be seen from the above steps, in practical application, for a general transaction operation, a node serving as a transaction initiator generates a data block according to transaction information, and sends the data block to a platform framework layer through a network exchange layer; the platform framework layer processes the data blocks by calling the application program in the decentralized application layer; the platform framework layer completes transaction according to the data blocks, and generates accounting data in the platform framework layer; wherein generating accounting data refers to broadcasting and verifying in each node to form a block chain. And finally, the platform framework layer sends the accounting data to the data block layer through the network exchange layer to be stored in a distributed mode, and the transaction is completed.
Further, as shown in fig. 6, the blockchain network system performs the following program steps for cross-chain transaction operation:
s21: the node serving as a transaction initiator generates a data block according to the transaction information and sends the data block to the platform framework layer through the network exchange layer;
s22: the platform framework layer calls an application program from the decentralized application layer to process a data block, and determines a block chain platform corresponding to a transaction target party through the cross-domain layer;
s23: the cross-domain layer completes transaction according to the data block and a block chain platform corresponding to the target party by using the called application program, and generates accounting data in the platform framework layer;
s24: and the platform framework layer sends the accounting data to the data block layer for distributed storage through the network exchange layer.
According to the steps, when cross-link transaction is carried out, a node serving as a transaction initiator generates a data block according to transaction information and sends the data block to the platform framework layer through the network exchange layer; and calling an application program from the decentralized application layer through the platform framework layer to process the data block, and meanwhile, determining a transaction target party, namely a public link network or a block chain platform corresponding to an access link accessed to the public link network through the cross-domain layer. After a transaction target chain is determined, the cross-domain layer completes transaction according to a block chain platform corresponding to the data block and the target party by using a called application program, generates accounting data in the platform framework layer, and finally, the platform framework layer sends the accounting data to the data block layer through the network exchange layer for distributed storage.
Therefore, in the technical scheme provided by the application, for the situation that the transaction needs to span two or more than two, the cross-domain layer needs to be called to find the transaction target chain and transmit the transaction data from the transaction initiator blockchain network to the transaction target blockchain network.
It should be noted that, in the technical solution provided in the present application, as long as the transaction process is not completed in one blockchain network, it can be determined as a cross-chain transaction. For example, a transaction between a third party public chain and a public chain, a transaction between an industry chain, a alliance chain and a public chain, a transaction between a public chain and a sub-chain, and the like, since the transaction process spans two blockchain networks, a cross-chain transaction can be completed according to the above steps. While for partial transactions, more than two blockchain networks may be spanned, e.g., one industry chain is transacted across a public chain with another industry chain. For the cross-chain transaction, the cross-chain transaction process can be executed once between the first business chain and the public chain; and executing the cross-chain transaction flow once between the public chain and the second industry chain to complete the final cross-chain transaction.
That is, in the blockchain system as a whole, as shown in fig. 7, the cross-chain transaction is completed by the following steps:
s31: the transaction initiating chain initiates service transaction to the public chain;
s32: the public link transmits the service transaction to a transaction target chain;
s33: the transaction target chain verifies the transaction conditions and returns service content to the public chain according to the received service transaction after the transaction conditions are verified to be qualified;
s34: the public link delivers the service content to the transaction initiation chain.
In the embodiment, cross-chain transaction transmission is implemented by establishing the public chain, so that in practical application, cross-chain transactions among different chains can be realized by establishing the whole network public chain and connecting the block chain network participating in the transactions to the public chain.
According to the above technical solutions, the present application provides a blockchain system, including a peer-to-peer P2P network, where nodes in the P2P network are respectively deployed as public link nodes or various access link nodes, and the nodes are deployed as one or more logical levels of a data block layer, a network switch layer, a platform framework layer, a decentralized application layer, and a cross-domain layer according to roles or functions that the nodes assume in the blockchain network. Each layer carries out data operation in the layer independently, and can complete the data generation, verification and storage in the transaction through the data interaction among the layers. And managing cross-chain transactions, transaction verification and providing cross-chain intelligent contracts by deploying a cross-domain layer, and solving the problem that the traditional blockchain system does not support the cross-chain transactions.
The embodiments provided in the present application are only a few examples of the general concept of the present application, and do not limit the scope of the present application. Any other embodiments extended according to the scheme of the present application without inventive efforts will be within the scope of protection of the present application for a person skilled in the art.