System and method for establishing trust relationships in a distributed system
By generating and verifying service records within the trusted execution environment of the distributed system, it solves the problem of consensus methods consuming computing resources in a decentralized environment, and achieves efficient and scalable service content verification and increased transaction frequency.
Patent Information
- Application Number
- CN201980102534.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-05
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2039-12-05
AI Technical Summary
In a decentralized environment, existing consensus methods consume large amounts of computing resources, limit transaction frequency, and create efficient and scalable consensus systems for massive service transactions among a large number of nodes, especially in self-organizing dynamic networks. Efficiently calculate service workload and cost challenges.
By using a Trusted Execution Environment (TEE) in a distributed system to generate service records, accumulate service content, and verify data packets through hash trees and signature mechanisms to ensure the integrity and consistency of service content, thereby verifying nodes reach a consensus.
It achieves efficient identification of transactions and services between customers and service providers in a decentralized environment, reduces computing resource consumption, improves transaction frequency and system scalability, and ensures the security and consistency of service content.
Smart Images

Figure CN114762288B_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to establishing trust relationships in a distributed system. Background Art
[0002] Trusted computing platforms can rely on hardware isolation to create a trusted execution environment (TEE) in which security-sensitive operations can be performed, such as backing up sensitive data using cloud backup services and sharing sensitive information such as photos, meeting minutes, and documents with individuals through social networking sites. These trusted computing platforms can integrate security co-processors (e.g., manageability engines, converged security engines (CSE), etc.) to meet security processing requirements. The TEE environment can be used to perform cryptographic operations using trusted platform module (TPM) technology, platform trust technology (PTT), identity protection technology (IPT), etc. Summary of the invention
[0003] According to one aspect of the present invention, there is a computer-implemented method for establishing a trust relationship in a distributed system. The method includes: a node calculates a hash of the content of a service in a data packet received from an adjacent node, wherein the data packet includes the service and service-related information; the node verifies the data packet by comparing the hash of the content of the service received from the adjacent node with the hash of the content calculated by the node; the node accumulates the content amount of the service with the same service ID in the data packet received from the adjacent node; the node generates a first signature according to a code stored in a trusted execution environment (TEE); the node sends the data packet including the service and the service-related information to the next adjacent node, wherein the service-related information includes the service ID, the hash of the accumulated content amount, and the first signature.
[0004] Optionally, in any of the above aspects, the computer-implemented method further comprises: sending a confirmation message to the neighboring node, wherein the confirmation message comprises the service ID, a hash of the accumulated content of the service, and another signature.
[0005] Optionally, in any of the above aspects, the computer-implemented method also includes: creating a hash tree, wherein the hash tree includes a node structure, the node structure includes one or more leaf nodes, one or more child nodes and one or more parent nodes, each leaf node represents a hash of the content in the data packet received from the adjacent node, and each parent node represents a cumulative hash of the content of each direct leaf node or each child node.
[0006] Optionally, in any of the above aspects, the accumulation of the hash is calculated in the following manner: using the hash tree according to the service ID; adding the hash of the content of the service in the received data packet as a leaf node to the hash tree; and removing one or more child nodes of each parent node when the child nodes of each parent node are complete.
[0007] Optionally, in any of the above aspects, the hash tree is divided into hash subtrees, wherein each hash subtree represents a parent node and its corresponding one or more leaf nodes or one or more child nodes; and data packets corresponding to each hash subtree are received from the adjacent nodes along multiple different paths.
[0008] Optionally, in any of the above aspects, the computer-implemented method further comprises: merging each of the hash subtrees corresponding to the received data packet along the multiple different paths at the node.
[0009] Optionally, in any of the above aspects, the computer-implemented method also includes: determining whether the hash of the data packet is lost in the cumulative hash by: storing the cumulative hash with the same service ID for each transmission path after sending the data packet to the adjacent node; extracting the cumulative hash from the confirmation message of the adjacent node; and comparing the extracted cumulative hash with the stored cumulative hash.
[0010] Optionally, in any of the above aspects, the computer-implemented method further includes: after receiving a data packet with the same service ID, sending the data packet including the accumulated content volume of the service, the accumulated hash of the data packet and the node signature to the verification node, wherein the verification node uses the public key in the key pair of each record received from the adjacent node to verify that the content volume of the service and the hash of the content are valid; and based on the verification records with the same service ID received from different adjacent nodes, reaching a consensus on the accumulated content volume of the service received in the data packet sent to the node in the distributed system.
[0011] Optionally, in any of the above aspects, the service-related information received by the neighboring node includes the service ID, a hash of the content of the service, and a second signature created by a private key in a key pair.
[0012] Optionally, in any of the above aspects, the computer-implemented method further comprises: using a public key in a key pair to verify the signature in the data packet signed by the neighboring node.
[0013] According to another aspect of the present invention, a node for establishing a trust relationship in a distributed system is provided. The node includes: a non-transient memory storage including instructions; one or more processors communicating with the memory, wherein the one or more processors execute the instructions to: calculate the hash of the content of the service in the data packet received from the adjacent node, wherein the data packet includes the service and service-related information; verify the data packet by comparing the hash of the content of the service received from the adjacent node with the hash of the content calculated by the node; the node accumulates the amount of content of the service with the same service ID in the data packet received from the adjacent node; the node generates a first signature according to the code stored in the trusted execution environment (TEE); and sends the data packet including the service and the service-related information to the next adjacent node, wherein the service-related information includes the service ID, the hash of the content, and the first signature.
[0014] According to another aspect of the present invention, there is a non-transitory computer-readable medium storing computer instructions. The computer instructions are used to establish a trust relationship in a distributed system, and when the computer instructions are executed by one or more processors, the one or more processors perform the following steps: a node receives a data packet from an adjacent node, wherein the data packet includes a service and service-related information; the node calculates a hash of the content of the service in the data packet received from the adjacent node; the data packet is verified by comparing the hash of the content of the service received from the adjacent node with the hash of the content calculated by the node; the node accumulates the amount of content of the service with the same service ID in the data packet received from the adjacent node; the node generates a first signature according to a code stored in a trusted execution environment (TEE); and the data packet including the service and the service-related information is sent to the next adjacent node, wherein the service-related information includes the service ID, the hash of the content, and the first signature.
[0015] This summary is provided to introduce in simplified form some concepts further described in the following detailed description. The purpose of this summary is not to identify the key features or essential features of the subject matter for which protection is sought, nor is it to help determine the scope of the subject matter for which protection is sought. The subject matter for which protection is sought is not limited to implementations that address any or all of the shortcomings noted in the background technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The various aspects of the present invention are illustrated by way of example and not limitation in the accompanying figures, in which like reference numerals indicate elements thereof.
[0017] Figure 1 An exemplary system is shown in which embodiments of the present invention may be implemented.
[0018] Figure 2 Shown in Figure 1 An example of configuring nodes in a distributed network to form a trusted environment.
[0019] Figure 3 An exemplary distributed system including a trusted execution environment in a system node is shown.
[0020] Figure 4A An exemplary processing flow within a trusted execution environment (TEE) is shown.
[0021] Figure 4B Shows Figure 4A The data structure of the provided service node.
[0022] Figure 5A and Figure 5B An exemplary hash tree generated according to the disclosed embodiments is shown.
[0023] Figure 5C and 5D An example of a multi-path hash tree and a verification of a multi-path hash tree are shown.
[0024] Figure 6 An embodiment of a node provided by an embodiment of the present invention is shown.
[0025] Figure 7 An example of a computing system for implementing an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0026] The present invention is described below with reference to the accompanying drawings, which generally relate to techniques for establishing trust relationships in a distributed system.
[0027] Distributed decentralized service systems based on consensus are challenging traditional centralized system services. How to identify transactions and services between customers and providers in a decentralized environment and reach consensus is the key. However, existing consensus methods have many limitations, such as proof of work in Bitcoin, which consumes a lot of computing resources and often limits the frequency of transactions. Intel TM's hardware-based consensus (i.e., proof of time) is more efficient and scalable, and Microsoft TM's COCO framework is based on TEE that leverages Intel hardware to accelerate consensus. However, it remains challenging to create an efficient and scalable consensus system for massive service transactions between a large number of nodes. For example, in a self-organizing dynamic network for sharing Internet connections, it remains a difficult problem for intermediate nodes to effectively calculate service workloads and costs in a trusted manner.
[0028] The disclosed technology identifies transactions and services between customers and service providers in a decentralized environment and reaches consensus. For example, for a customer transaction requesting a specific service from a service provider, a service node in a distributed network generates a service record in a corresponding TEE based on the service volume accumulation of adjacent nodes and the service content hash. The service record generated in the TEE is sent to the verification node (and adjacent nodes) for verification, and then a consensus is reached on the services provided. The verification node verifies the service records received from each service node for the same service, and then reaches a consensus on the service volume. In one embodiment, the result is then sent to a payment system, which stores the result in a ledger (e.g., a blockchain-based ledger for transaction records) and executes the corresponding transaction.
[0029] It should be understood that the current embodiment of the present invention can be realized in many different forms, and the scope of the claims should not be understood to be limited to the embodiments set forth herein. On the contrary, these embodiments are provided to make the present invention thorough and complete, and to fully convey the inventive embodiment concepts to those skilled in the art. In fact, the present invention is intended to cover substitutes, modifications and equivalents of these embodiments included in the spirit and scope of the present invention as defined by the appended claims. In addition, in the following detailed description of the current embodiment of the present invention, many specific details are set forth in order to provide a thorough understanding. However, it is clear to those of ordinary skill in the art that the current embodiment of the present invention can be implemented without providing these specific details.
[0030] Figure 11 shows an exemplary system in which embodiments of the present invention may be implemented. System 100 includes a computing device 110 and a network node 120 connected via a network 130. In one embodiment, system 100 is a distributed system in which computing device 110 and / or network node 120 include a trusted execution environment (TEE), as described below. Figure 1 Specific components in system 100 are shown, but system 100 is not limited to these components and may also include more and / or different components. For example, in some examples, system 100 may include a network storage device, a maintenance manager, and / or other suitable components (not shown). Figure 1 The computing device 110 shown can be located in various locations such as on-premises, in the cloud, etc. For example, the computing device 110 can be located at a client, a server, etc.
[0031] The network 130 may be a wired or wireless network, and may include a public network or a private network, including but not limited to a local area network (LAN), a wide area network (WAN), a satellite network, a cable network, a WiMax network, and a communication network such as LTE and 5G networks. Figure 1 As shown, the network 130 may include one or more network nodes 120 that interconnect multiple computing devices 110 and connect the computing devices 110 to an external network 140, such as the Internet or an intranet. For example, the network node 120 may include any number of different devices that facilitate network communication, such as servers, switches, routers, hubs, gateways, access points, firewalls, base stations, repeaters, backbone devices, network controllers, or other network elements. In some examples, the computing devices 110 may be organized into racks, activity areas, groups, sets, or other suitable partitions. For example, in the example shown, the computing devices 110 are divided into three host sets, identified as the first, second, and third host sets 110, respectively. In the example shown, each host set 110 is coupled to a corresponding network node by operation, and these network nodes are generally referred to as "racks" or "TOR" network nodes. Then, the TOR network node 120 can be coupled to other network nodes 120 by operation to form a computer network of a hierarchical, flat, mesh, or other suitable type of topology that implements communication between the computing device 110 and the external network 140. In other examples, multiple sets of hosts 110 may share a single network node 120 .
[0032] The computing devices 110 may be any type of general or special computing devices. For example, these computing devices may be user devices, such as desktop computers, laptop computers, tablet computers, display devices, cameras, printers, Internet of Things (IoT) devices, wearable computing devices, mobile devices, or smart phones. However, in a data center environment, these computing devices may be server devices, such as application server computers, virtual computing host computers, or file server computers. Moreover, the computing devices 110 may be used alone to provide computing, storage, and / or other suitable computing services.
[0033] Figure 2 Shown in Figure 1 An example of configuring nodes in a distributed network to form a trusted environment. Configuration system 200 initializes (or configures) a secure area of a processor or processing device so that a trusted application can be executed with integrity. Although the configuration is not limited to the disclosed embodiments, the configuration system 200 as shown includes a verifier device 210 and an evaluator 215, both of which can communicate with platform 220 via a wired or wireless network, etc. In one embodiment, platform 220 can be a collection of one or more hardware components. For example, platform 220 can be at least one of a chipset, an integrated circuit, a processor, a microprocessor, a digital signal processor, or other types of embedded systems. In one embodiment, platform 220 is (or belongs to) network node 120 and / or computing device 110. The integrity of platform 220 can be verified at system startup or when the device is running.
[0034] As shown in the exemplary embodiment, the platform 220 includes a central processing unit (CPU) 220A, a memory 220B, and a trusted platform module (TPM) 230. In one embodiment, the CPU 220A in the platform 220 can be a general-purpose processing unit. The memory 220B can also store code 220C, which includes an authorization code from a trusted third party. Among other functions, the code 220C is used to generate a key pair (private key and public key) during the initialization process of the platform 220.
[0035] TPM 230 includes an internal secure processor 230A and a memory 230B. In one embodiment, the memory 230B in TPM 230 includes a unique signature key (SK). The processor 230A in TPM 230 is generally a general hardware unit that can perform cryptographic operations such as key generation, encryption, and decryption.
[0036] These components all include control logic for executing the steps in the attestation (or signing) process. In general, the control logic can be implemented in hardware or software or a combination thereof. For discussion purposes, in the following examples, it is assumed that each system component is implemented by a general-purpose computer. Specifically, the platform 220 is implemented by a user PC (e.g., computing device 110) and includes a security module in the form of a TPM 230. The structure and operation of the TPM are defined in detail in the Trusted Computing Group, TPM Specification v.12 and later. Typically, a TPM is a hardware component in the form of a dedicated integrated circuit built into various platforms. The TPM has tamper-proof capabilities, provides secure storage of digital keys, certificates, and passwords, and provides functions for various security-related operations such as key generation, platform attestation, privacy protection functions, and encryption algorithms and protocol implementations. The platform attestation function provided by the TPM is based on the secure storage and reporting of platform configuration values. These values are derived from measurements of hardware and software configurations and are securely stored in a set of platform configuration registers (PCRs) within the TPM.
[0037] More specifically, the attestation process includes sending the PCR value to the verifier 210 under a digital signature, which can be verified by the verifier 210. According to the TPM specification, an attestation identity key (AIK) can be used for this purpose. AIK is an RSA (Rivest, Shamir, Adleman) key pair that is specifically used as a signing key for signing PCR data. That is, the private key in the AIK pair is used to sign the data sent to the verifier, and the verifier then verifies the signature by verifying the data using the public AIK key. The validity of the public AIK key can be ensured by some form of credential that the verifier trusts. For example, the platform can obtain an AIK certificate from a trusted third party (Trusted Third Party, TTP) (e.g., a certification authority (CA)). This certificate can then be sent to the verifier using the public AIK key. Other processes can be used.
[0038] As described above, a signature key (SK) is defined in the TPM 230 of the platform 220. The signature key (SK) is bound to the TPM 230 and a defined configuration of the platform 220. The effect of this binding is that the private key of the signature key (SK) can be securely stored in the TPM 230 if the signature key (SK) can only be used with that specific TPM (i.e., the SK is not migratable) and only if the platform 220 has a defined configuration corresponding to a defined state of the PCRs. Such a defined state of the PCRs can be, for example, that the PCRs include a set (one or more) of specified PCR values, or that a set of stored PCR values satisfies a defined condition, such as application of a predetermined hash function to produce a specified hash value.
[0039] During the implementation of the attestation process, the platform 220 obtains the certificate of the signature key (SK) from the evaluator 215. The purpose of the certificate is to prove that the platform configuration to which the signature key (SK) is bound is a trusted platform configuration. In the first step, the signature key (SK) (specifically the public key) is sent to the evaluator 215 together with data representing the specific PCR state to which the key SK is bound. The evaluator 215 then verifies that the PCR state corresponds to the trusted platform configuration. Assuming that the PCR state is trusted, the evaluator 215 sends the certificate of the signature key back to the platform 220. Afterwards, when the verifier 210 sends a challenge (e.g., a message or a random number) to the platform 220, the platform 220 can use the certificate to prove the validity of its configuration. Specifically, the platform proves that it can sign the challenge using the signature key (SK) and proves to the verifier 210 that it has the certificate. The verifier 210 can verify the certificate, and the trust evaluator 215 knows that the certificate is issued for the key SK corresponding to the trusted PCR state. Furthermore, since the key SK is bound to the PCR state verified by the evaluator 2, being able to sign the challenge using SK is confirmation that the configuration of the platform 220 is authentic. In this way, the user platform configuration can be adapted to the verifier 210.
[0040] Figure 3 An exemplary distributed system including a trusted execution environment in a system node is shown. Distributed system 300 includes computing device 110, one or more service nodes 120i to 120k, one or more verification nodes 202, and payment system 204. In one embodiment, the components in distributed system 300 can be communicated through a network (e.g. Figure 1 and Figure 6In one embodiment, the distributed system 300 is designed to identify and reach consensus on transactions and services between clients (e.g., computing devices) and service providers (e.g., service nodes) in a decentralized environment. For example, service nodes 120i to 120k generate service records within corresponding TEEs 120A, as described in further detail below.
[0041] The service records of one or more service nodes of the service nodes 120i to 120k can be sent to the verification node 202 for verification, and then a consensus is reached on the services provided by the service provider. Once the service record is received, the verification node 202 verifies the service record (from each service node) of the same service and reaches a consensus. For example, the consensus can be the amount of service sent to the payment system 204 (e.g., a blockchain-based ledger for transaction records). When the payment system 204 receives the consensus from the verification node 202, the payment system 204 stores the result (e.g., stored in the ledger) and executes the corresponding transaction (e.g., a blockchain-based payment system). It should be understood that any number of computing devices, service nodes, and verification nodes can be included in the distributed system, and are not limited to the embodiments shown. Similarly, the node is not limited to a single TEE, and can include one or more instances of a TEE. In addition, although it is shown that the distributed system 300 can protect the payment system, any of a variety of other systems can be used with the system, such as mobile identity, IoT, content protection, etc.
[0042] Each node (i.e., service node and verification node) includes a hardware platform 220 (represented as TEE 120A and 202A and rich operating system (rich OS) 120B and 202B), a receiver 102RX / 202RX and a transmitter 120TX / 202TX. In one embodiment, rich OS 120B and 202B are part of a larger rich OS environment, which is the execution environment of the entire hardware platform. An "execution environment" is a set of hardware components and software components (e.g., system software, embedded software, software applications, etc.) that supports one or more applications executed within the execution environment. Examples of rich OS include Linux operating system, The rich OS environment also includes a TEE client application programming interface (API) and a TEE functional API. TEE client functional APIs are APIs that enable applications executed in a rich OS environment to connect to TEE 120A or 202A. The rich OS environment also includes one or more client applications that are executed in the rich OS environment and connected to TEE 120A or 202A through TEE client or functional APIs. Similarly, TEE 120A and 202A include TEE internal APIs that enable trusted applications executed in TEE 120A and 202A to connect to the rich OS environment.
[0043] As described above, TEE 120A and 202A is a secure execution environment that is separate from other execution environments, provides security from software attacks originating from outside TEE 120A and 202A through hardware mechanisms that other execution environments cannot control, and supports one or more trusted applications to access one or more secure hardware components. More specifically, TEE 120A and 202A are execution environments in which (a) any software component such as a computer program, module or application executed within TEE 120A and 202A is trusted in terms of authenticity and integrity; (b) TEE 120A and 202A can resist software attacks, thereby protecting one or more hardware components within TEE 120A and 202A; (c) hardware components and software components are protected from unauthorized tracking and control through debugging and testing functions. TEE 120A and 202A also define security protection measures regarding which hardware components and software components can be accessed by applications outside TEE 120A and 202A.
[0044] In one embodiment, the system includes one or more secure hardware components as security measures. Secure hardware components are hardware components in a hardware platform, and these hardware components are protected so that only trusted applications can access these hardware components. Examples of secure hardware components include secure elements, keys, secure memories, trusted user interfaces (such as keyboards or screens), cryptographic accelerators, controllers, etc. In another embodiment, a Java TEE environment is used to execute one or more trusted applications. The Java TEE environment is a runtime environment that can execute Java-specific applications. The Java TEE API is a part of the Java TEE environment so that trusted applications executed in the Java TEE environment can be connected to a rich OS environment. Java trusted applications can be included in a Java TEE environment, such as a payment user interface application connected to a payment system 204.
[0045] The service nodes described in detail below are generally responsible for generating service records within the TEE. These service records include the services and service-related information associated with the transaction, which will be forwarded to the verification node 202 (and adjacent service nodes) through the transmitter 120TX for verification and then reaching a consensus on the services provided.
[0046] When receiving the service record through the receiver 202RX, etc., the verification node 202 determines whether the transaction is valid by verifying the service-related information in the service record (i.e., the accumulated service amount and hash information) according to whether all the received service records with the same service ID and the public key of the corresponding service node are valid. The verification can be performed by a single verification node or multiple verification nodes. In one embodiment, one or more service nodes are used as verification nodes. Once the verification is completed, the validator node submits the service record for one or more validator nodes 202 to reach a consensus. Then, the validator node 202 votes "yes" or "no" (e.g., a threshold number of identical votes) including the service node of the transaction 104 sent to the payment system 204.
[0047] Figure 4A An exemplary process flow within a trusted execution environment (TEE) is shown. In an embodiment, the process flow may be a computer-implemented method performed at least in part by the hardware and / or software components shown in the various figures described herein. In an embodiment, the disclosed process flow may be performed by Figure 3 and the TEE execution disclosed in Figure 4. In one embodiment, a software component executed by one or more processors (eg, one or more processors 230A or processor 704) performs at least a portion of the process.
[0048] In step 402, before the service node 120 receives the data packet, Figure 2 The above process shown configures TEE 120A. The configuration generates the keys and signatures required to form a trusted environment.
[0049] Once the configuration has been completed, the receiver 120RX may receive data packets from neighboring nodes (e.g., one-hop nodes or nodes directly adjacent to the current node) in step 401. In one embodiment, the neighboring nodes may be determined by a geographic area, a radius from a central node, a defined number of hops, etc. For example, in the case of an area, nodes within a defined boundary area are considered to be adjacent.
[0050] The data packet may also include services (or files) and service (or file) related information generated by adjacent nodes. Services may include, for example, microservices (including micropayments), shared Internet connections, shared computing resources, smart contracts, P2P services, etc. Files may include content, such as images in image files, or any other content that can be stored in files. In one embodiment, service-related information is securely generated within its corresponding TEE 120A. For example, the service-related information generated in TEE 120A may include a service identifier (identifier, ID) of an adjacent node (i.e., a sending node), a hash of the content of a service (or file) generated by an adjacent node, and a signature of an adjacent node created by a private key in a key pair for verification and auditing. As described in detail below, service-related information may be transmitted to adjacent nodes and verification nodes for verification.
[0051] In another embodiment, the received data packets are for the same service (or file).
[0052] After the service node 120 receives the data packet, the TEE 120A calculates the hash of the content of the service (or file), verifies the data packet, and updates the hash tree of the content of the service (or file); accumulates the content of the services (or files) of the adjacent nodes; generates a node signature according to the code 220C in the TEE 120A. In one embodiment, the code 220C has Figure 4B A data structure 400 is provided as follows.
[0053] In step 404, TEE 120A verifies the data packet by calculating a hash of the content of the service (or file) received in the data packet by the current service node 120 (the service node that received the data packet from the neighboring node). As described above, any well-known hashing technique can be used. The hash of the content of the service (or file) calculated by the current service node 120 is compared with the hash of the content of the service calculated by the neighboring node (not shown) and received from the neighboring node. If the calculation results match, the data packet is verified and the hash tree of the content of the service is updated. If the calculation results do not match, the data packet is not verified and the process of identifying lost or empty data packets is performed, refer to the following Figure 5B Discussion.
[0054] If the data packet received from the neighboring node is verified, then in step 406, the service node 120 uses the code 220C in the TEE 120A to accumulate the content volume of the service (or file) provided by its neighboring node. Specifically, each service node 120 (i.e., any one of the service nodes 120i to 120k) has a data structure including an accumulator (also called an object recorder or a cryptographic accumulator), which is used to accumulate the services (or files) of the neighboring nodes. For example, a static cryptographic accumulator scheme can be used to accumulate a set of finite values (e.g., information in a data packet) into a succinct value (i.e., an accumulator), or a dynamic accumulator (i.e., an extended version of a static accumulator) can be used to dynamically add values to / delete values from the accumulator. However, it should be understood that any number of different accumulators can be used, and the implementation is not limited to the disclosed embodiments. It should also be understood that the code 220C in step 406 can be responsible for several other functions, including but not limited to the generation of key pairs, etc.
[0055] In order to record and verify the content of a service (or file), a hash tree is generated. A hash tree (or Merkle tree) is a data structure that includes a tree of summary information about a larger data (such as a file) used to verify its content. More specifically, a hash tree is a tree that includes hashes, where leaf nodes are hashes of data blocks in a file or a group of files, etc. The higher nodes in the tree are hashes of their corresponding child nodes. The highest node in the tree is called the root node and includes all hash values of all branches in the tree. In one embodiment, the hash tree includes a data structure having one or more leaf nodes, one or more child nodes, and one or more parent nodes. In one example, each leaf node represents a hash of the content in a data packet received from an adjacent node, and each parent node represents the cumulative hash of the content of each direct leaf node or each child node. Refer to the following FIG. 5A to FIG. 5D Detailed examples of computing and updating a hash tree.
[0056] In step 408, after completing the reception of the data packet with the same ID, a signature is generated using the corresponding private key in the key pair according to the code 220C stored in the TEE 120A. This signature is then used to encapsulate the data packet sent to the next adjacent node and / or verification node, and optionally, another signature is generated to encapsulate the confirmation data packet sent to the previous adjacent node (i.e., the adjacent node where the current node receives the data packet). The data packet sent to the next adjacent node by the transmitter 120TX includes updated service-related information. For example, the data packet includes the service ID, the hash of the content of the service calculated by the current node, and the signature of the current node. The confirmation data packet includes a hash of the accumulated content amount of the service calculated by the current node and the signature of the current node.
[0057] In one embodiment, by having the content volume of the service (or file) of each service node 120 accumulated by its neighboring nodes through the trusted code 220C inside the TEE 120A, a chain verification process is formed, which improves system security and provides a robust mechanism for easy consensus. For example, the content volume of the service of the service node 120i is accumulated and calculated by its neighboring service node 120j, thereby forming a chain trusted service including records.
[0058] Figure 4B Shows Figure 4A The data structure of the service node provided. The data structure is represented as code 220C (also called trusted code), including an "accumulator" for accumulating service content, an "expectedAccumulatedHashValue" for checking for lost packets, and a "messageToNextNode" for sending packets to adjacent nodes. In one embodiment, the accumulator code hashes the accumulated content amount of the service (or file) together with the packet identifier (ID), where the ID is represented as the union of a range (startID, endID, interval). For example, the hash of a first packet can be accumulated together with the hash of a second packet of the same service (or file) ID, as shown in reference Figure 5A In one embodiment, the hash values of the subtree with empty nodes in the ID range (interval) are represented as (hashValue1, packetIDs_1) and (hashValue2, packetIDs_2). That is, the nodes with empty child nodes in the hash tree may include intermediate nodes with the same value as other non-empty child nodes (i.e., child nodes with hash values for packets), as shown in reference Figure 5A describe.
[0059] In one embodiment, if packet loss occurs during transmission, the hash tree may include empty nodes or "lost" nodes. The expectedAccumulatedHashValue code checks for lost packets based on the accumulated hash of the content of the service (or file) received in the confirmation packet. In one embodiment, if the received hash value and the expected hash value are equal, no packet is lost. Otherwise, the accumulated hash values after the last pair of equal hash values can be compared, and then the lost packet ID can be found. More specifically, when sending and receiving packets from neighboring nodes with the same service (or file) ID, the accumulated hash of the content is stored. The stored accumulated hash is then compared with the accumulated hash extracted from the confirmation message of the neighboring node. The extracted accumulated hash and the stored accumulated hash are then compared. For example, (expectedAccumulatedHashValue_i, packetID_i, packet, packetHash) can be compared with the hash value in the confirmation packet. Refer to the following Figure 5B Provide a detailed description.
[0060] In another embodiment, a data packet is sent to the next neighboring node. The data packet includes a service and service related information, wherein the service related information includes a service ID, a hash of the content, and a first signature. For example, the code messageToNextNode includes a serviceID, a data packet (including data content), a hash of the data packet, and a signature (signed using a private key inside the TEE of the current node).
[0061] Figure 5A and Figure 5B An exemplary hash tree generated according to the disclosed embodiments is shown. In an embodiment, the hash tree may be generated by a computer-implemented method performed at least in part by the hardware and / or software components shown in the various figures described herein. In an embodiment, the disclosed hash tree may be generated by Figure 1 and Figure 3 The service node 120, verification node 202, and / or computing device 110 disclosed in the embodiment of the present invention are executed. In one embodiment, a software component executed by one or more processors (e.g., CPU 220 or processor 704) performs at least a portion of the process. For discussion purposes, the service node 120 performs the following process.
[0062] Steering Figure 5A, discloses an exemplary hash tree of data packets that a service node 120 has received from a neighboring node. A hash tree 500 or Merkle tree is a tree data structure in which nodes are labeled with a checksum of the labels or values of their child nodes, such as a hash value. Merkle trees can be used to efficiently and securely verify the contents of large data structures by repeatedly hashing pairs of nodes until only one hash (the root hash or Merkle root) remains. The root hash summarizes all the data in the hash tree nodes and maintains data integrity. If the content in the node changes (or the order changes), the root hash also changes. In one embodiment, hashing pairs of nodes includes using a hash function. A hash function is a well-defined process or mathematical function that converts a large amount of data into small data (e.g., a single integer) that can be used as an index (e.g., in an array or other data structure). Examples of cryptographic hash functions include, but are not limited to, elf64, HAVAL, MD2, MD4, MD5, Wireless Gatún, RIPEMD-64, RIPEMD-160, RIPEMD-320, SHA-1, SHA-256, SHA-384, SHA-512, Skein, Tiger, and Whirlpool. Although examples of cryptographic hashes are disclosed, it should be understood that any suitable hash function may be used with embodiments of the present invention.
[0063] As shown, each leaf node 502 to 510 in the Merkle tree represents a hash of the content in a data packet of the same ID (e.g., a service or file ID) received from an adjacent node (e.g., a hash of data packets 1 to n). Each non-leaf node 512 to 522 (e.g., an intermediate node or a root hash) represents the cumulative hash of the content of each direct leaf node or intermediate (child or parent) node. For example, leaf nodes 502 to 510 are hash values of data packets 1 to n received from adjacent nodes, respectively. Intermediate node 512 includes hashes of leaf nodes 502 and 504, where the hash is the accumulation of the hash of data packet 1 and the hash of data packet 2 (i.e., Hash_1_2=hash(hash_1, hash_2)). Intermediate node 514 is a hash of leaf nodes 506 and 508, where the hash is the accumulation of the hash of data packet 3 and the hash of data packet 4 (i.e., Hash_3_4=hash(hash_3, hash_4)). In addition, intermediate node 516 has a single leaf node 510, which includes a hash of the content of data packet n. Since there is only a single leaf node, intermediate node 516 includes leaf node 510 and other child nodes. The hash function continues to intermediate nodes 518 and 520. Intermediate node 518 includes a hash of the content of intermediate nodes 512 and 514. For example, hashing intermediate nodes 512 and 514 produces a hash value of Hash_1_2_3_4=hash(hash_1_2, hash_3_4), that is, a cumulative hash of the hash of the content of the intermediate node. Intermediate node 520 includes intermediate node 516 and other child nodes. The final hash of the intermediate node forms a root hash node 522. As described above, the root hash node summarizes all data in the hash tree node. In this example, root hash node 522 is represented as the hash of intermediate nodes 518 and 520, which forms the root as Hash1_2_3_4_...n=hash(hash1_2_3_4_..._n). In one embodiment, only the root value needs to be maintained when each subtree is generated.
[0064] Figure 5B An exemplary hash tree with lost or empty packets is shown. Figure 5B The hash tree in corresponds to Figure 5A The hash tree in 500. Figure 5B In the example of , the packet loss occurred in one of the packets (i.e., one of packets 1 to n) received by the current node 120. In this example, there is a packet loss associated with packet 2. Accordingly, the hash of packet 2 in leaf node 504a is empty or missing content received from the neighboring node. Therefore, the root hash of the hash tree (and each subtree) lacks the missing information in the hash of packet 2, as described below.
[0065] To identify missing content or empty data packets, the service node 120 compares the expected hash value of the content of the service (or file) calculated by the current service node 120 with the accumulated hash of the content of the service (or file) calculated by the neighboring node and received from the neighboring node ( Figure 4A If the calculation results match, the data packet is verified. If the calculation results do not match, a packet loss occurs. Identifying lost content or empty data packets (hereinafter referred to as lost / empty data packets) can be performed by comparing the accumulator hash values after the last pair of equal hash values is determined (i.e., after the calculation results match). As will be apparent from the following discussion, one advantage of this approach is that the current service node 120 can add the accumulated hash of the content of the service (or file) to the confirmation message that arrives at the previous neighbor node ( Figure 4A This enables the previous neighbor node to check the hash value and determine the lost / empty data packet and resend the data packet without having to resend it from the source node 120.
[0066] To identify missing / empty packets, the code "expectedAccumulatedHashValues" in data structure 400 is executed by TEE 120A. Each accumulated hash of the content of a service (or file) with the same service (or file) ID is stored after sending a packet. The following accumulated hashes are stored:
[0067] {(expectedAccumulatedHash_1,packetID_1),(expectedAccumulatedHash_2,packetID_2),(expectedAccumulatedHash_3,packetID_3),…}.
[0068] If data packet 2 is not successfully delivered to the next adjacent node (such as Figure 5B As shown in the figure), the last matching hash value is "expectedAccumulatedHash_1", and the accumulated hash received from the confirmation packet does not match "expectedAccumulatedHash_2", but does match hash(expectedAccumulatedHash_1, hash(packet3)). Therefore, the lost packet is identified.
[0069] When an acknowledgment packet is received from a neighboring node (i.e., a downstream node), the accumulated hash is extracted from the packet as follows: “receivedAccumulatedHash_i”. For example, the “receivedAccumulatedHash_i” of node 518a is “Hash_1_2_3_4”. Then, receivedAccumulatedHash_i is compared with the values in the (previously saved) list “expectedAccumulatedHash”. If a match is found, there is no packet loss (i.e., there is no lost / empty packet), and the “expectedAccumulatedHash” value in the list preceding the matching value can be removed, resulting in the service node storing {(expectedAccumulatedHash_i, packetID_i), (expectedAccumulatedHash_i+1, packetID_i+1),…}. If no match is found, there is packet loss. In this case, for each packet sent after the last match, it is assumed that the packet (i.e., packetID_n) is lost (i.e., the corresponding node in the hash tree has an empty value). In this case, a corresponding "expectedAccumulatedHash" value is calculated for each additional packet sent, which yields:
[0070] {(new_expectedAccumulatedHash_n+1,packetID_n+1),(new_expectedAccumulatedHash_n+2,packetID_n+2),…}.
[0071] The new "expectedAccumulatedHash" value above is compared to "receivedAccumualtedHash_i". If a match is found, the packet with ID_n should be retransmitted. If no match is found, all packets from the last match may need to be retransmitted.
[0072] In one embodiment, storage space can be reduced because the parent (or root) node on the hash tree can remove its child nodes (after the child nodes have completed calculating the hash values). For example, after receiving packets 1 to n, the parent (root) node 522 stores hash_1_2_3_4_...n. However, the hash values stored in the child nodes (e.g., nodes 502, 504, 506, 508, 510, 512a, 514, 516, 518, and 520) can be removed because all packets on the leaf nodes are complete.
[0073] Figure 5C and5D An example of a multipath hash tree and a verification of a multipath hash tree are shown. In an embodiment, the hash tree may be generated by a computer-implemented method performed at least in part by the hardware and / or software components shown in the various figures described herein. In an embodiment, the disclosed hash tree may be generated by Figure 1 and Figure 3 The service node 120, verification node 202, and / or computing device 110 disclosed in the embodiment of the present invention are executed. In one embodiment, a software component executed by one or more processors (e.g., CPU 220 or processor 704) performs at least a portion of the process. For discussion purposes, the service node 120 performs the following process.
[0074] Go to Figure 5C , shows an example of a multipath hash tree. A multipath hash tree is Figure 5A An embodiment of a hash tree of FIG. 500, wherein a data packet from a service node (e.g., node i) is sent to another service node (e.g., service node n) along different paths through multiple adjacent nodes. That is, data packets from different subtrees in the hash tree can be sent along different paths through different adjacent nodes. For example, the first subtree 500A ( Figure 5A ) may include hash tree nodes 506, 508, and 514, and the second subtree 500B in the hash tree 500 may include hash tree nodes 504, 504, and 512. In this example, the hash of the content of data packets 3 and 4 (associated with the first subtree 500A) is sent to the adjacent node 514C via path 1, where the cumulative hash (hash_3_4=hash(hash_3, hash_4) is calculated and stored. Similarly, the hash of the content of data packets 1 and 2 (associated with the second subtree 500B) is sent to the adjacent node 512C via path 2, where the cumulative hash (hash_1_2=hash(hash_1, hash_2) is calculated and stored. Then, hash_3_4 and hash_1_2 are sent via corresponding paths 2 and 1, and these hashes are merged in the service node n.
[0075] In one embodiment, reference Figure 5D , a service node (e.g., service node i) can send and receive data packets to and from multiple neighboring nodes (e.g., neighboring nodes 524D and 526D) and construct a hash subtree. For example, hash tree 500 ( Figure 5A) can be divided into different subtrees with multi-path transmission, where data packets with odd packet ID numbers are sent along one path and data packets with even packet ID numbers are sent along another path. Therefore, in one example, subtrees are formed according to the odd / even ID numbers of the data packets. In other words, there may be n subtrees: (1, n+1, 2n+1, ...), (2, n+2, 2n+2, ...) ... (n, 2n, 3n). As described in the exemplary embodiment, the hash tree of service node i (expressed as hash_1_3_2_4 = hash (hash_1_3, hash_2_4)) is divided into two subtrees: a first subtree 500C including hash_1_3 and a second subtree 500D including hash_2_4. Then, both subtrees 500C and 500D can be sent along corresponding paths (e.g., path 1 and path 2) stored in different adjacent nodes 524D and 526D, and sent to service node n, where the two hash trees can be merged together.
[0076] Then, merging hash subtrees from different paths can be used to verify the transmission of content. In the disclosed embodiment, service node n stores two hash trees (e.g., hash_1_3 and hash_2_4) sent from service node i, one for each path, so that the verification node ( Figure 3 ) can compare them with the hash values stored from node j and node k (also sent to the verification node as described above). In one embodiment, the verification node can merge the two hash trees and compare them with the hash values sent from service node i and service node n to verify the record and reach consensus, as described above.
[0077] Figure 6 FIG. 6 shows an embodiment of a node provided by an embodiment of the present invention. Node (eg, server, router, etc.) 600 may be Figure 1 Any computing device 110 and 120 in the system or any other node as described above, etc. The node 600 may include multiple input / output ports 610 / 630 and / or a receiver (Rx) 612 and a transmitter (Tx) 632 for receiving and sending data from other nodes, and a processor 620 including a TEE 120A for processing secure data.
[0078] Although processor 620 is shown as a single processor, processor 620 is not limited thereto and may include multiple processors. Processor 620 may be implemented as one or more central processing unit (CPU) chips, one or more cores (e.g., multi-core processors), one or more field programmable gate arrays (FPGAs), one or more application specific integrated circuits (ASICs), and / or one or more digital signal processors (DSPs), and / or may be part of one or more ASICs. Processor 620 may be used to implement any of the schemes described herein using any one or combination of the steps described in the embodiments. In addition, processor 620 may be implemented using hardware and / or software.
[0079] Figure 7 An example of a computing system for implementing an embodiment of the present invention is shown. Computer system 700 includes a processor 704 and a memory 708, which communicate with each other and with other components via a bus 712. Bus 712 may include any of several types of bus structures, including but not limited to a memory bus, a memory controller, a peripheral bus, a local bus, and any combination thereof using any of a variety of bus architectures.
[0080] The memory 708 may include various components (e.g., machine-readable media), including, but not limited to, random access memory components, read-only components, and any combination thereof. In one example, a basic input / output system (BIOS) 716 may be stored in the memory 708, and the BIOS 716 includes basic routines that help transfer information between elements within the computer system 700 during the startup process. The memory 708 may also include instructions (e.g., software) 720 (e.g., stored in one or more machine-readable media), thereby including any one or more aspects and / or methods of the present invention. In another example, the memory 708 may also include any number of program modules, including, but not limited to, an operating system, one or more application programs, other program modules, program data, and any combination thereof.
[0081] The computer system 700 also includes a storage device 724. Examples of storage devices (e.g., storage device 724) include, but are not limited to, hard disk drives, disk drives, optical disk drives combined with optical media, solid-state memory devices, and any combination thereof. The storage device 724 may be connected to the bus 712 via a suitable interface (not shown). Exemplary interfaces include, but are not limited to, SCSI, advanced technology attachment (ATA), serial ATA, universal serial bus (USB), IEEE 1394 (Firewire interface), and any combination thereof. In one example, the storage device 724 (or one or more of its components) may be detachably connected to the computer system 700 (e.g., via an external port connector (not shown)). Specifically, the storage device 724 and the associated machine-readable medium 728 may provide non-volatile and / or volatile storage of machine-readable instructions, data structures, program modules, and / or other data for the computer system 700. In one example, the software 720 may be located entirely or partially within the machine-readable medium 728. In another example, the software 720 may be located entirely or partially within the processor 704.
[0082] The computer system 700 may also include an input device 732. In one example, a user of the computer system 700 may input commands and / or other information into the computer system 700 via the input device 732. Examples of the input device 732 include, but are not limited to, an alphanumeric input device (e.g., a keyboard), a pointing device, a joystick, a game pad, an audio input device (e.g., a microphone, a voice response system, etc.), a cursor control device (e.g., a mouse), a touch pad, an optical scanner, a video capture device (e.g., a still camera, a video camera), a touch screen, and any combination thereof. The input device 732 may be connected to the bus 712 via any of a variety of interfaces (not shown), including, but not limited to, a serial interface, a parallel interface, a game port, a USB interface, a FireWire interface, a direct interface to the bus 712, and any combination thereof. The input device 732 may include a touch screen interface, which may be part of or separate from the display 736, as will be discussed further below. The input device 732 may be used as a user selection device to select one or more graphical representations in the graphical interface as described above.
[0083] The user may also input commands and / or other information to the computer system 700 through the storage device 724 (e.g., a removable disk drive, a flash drive, etc.) and / or the network interface device 740. The network interface device (e.g., the network interface device 740) may be used to connect the computer system 700 to one or more of various networks (e.g., the network 744) and one or more remote devices 748 connected thereto. Examples of network interface devices include, but are not limited to, network interface cards (e.g., mobile network interface cards, LAN cards), modems, and any combination thereof. Examples of networks include, but are not limited to, wide area networks (e.g., the Internet, enterprise networks), local area networks (e.g., networks associated with offices, buildings, campuses, or other relatively small geographic spaces), telephone networks, data networks associated with telephone / voice providers (e.g., mobile communications provider data and / or voice networks), direct connections between two computing devices, and any combination thereof. The network (e.g., the network 744) may employ wired and / or wireless communication modes. In general, any network topology may be used. Information (e.g., data, software 720, etc.) may be transmitted between the computer systems 700 via the network interface device 740.
[0084] The computer system 700 may also include a video display adapter 752 for sending a displayable image to a display device, such as a display device 736. Examples of display devices include, but are not limited to, liquid crystal displays (LCD), cathode ray tubes (CRT), plasma displays, light emitting diodes (LED) displays, and any combination thereof. Display adapter 752 and display device 736 may be used in conjunction with processor 704 to provide graphical representations of various aspects of the present invention. In addition to the display device, the computer system 700 may also include one or more other peripheral output devices, including, but not limited to, audio speakers, printers, and any combination thereof. Such peripheral output devices may be connected to bus 712 via a peripheral interface 756. Examples of peripheral interfaces include, but are not limited to, serial ports, USB connections, FireWire interface connections, parallel connections, and any combination thereof.
[0085] It should be understood that the subject matter of the present invention can be embodied in many different ways and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to make this subject matter thorough and complete, and to fully convey the present invention to those skilled in the art. In fact, the purpose of this subject matter is to cover the substitutes, modifications and equivalents of these embodiments, which are included in the scope and spirit of this subject matter defined by the appended claims. Moreover, in the detailed description of the subject matter of the present invention below, many specific details are set forth in order to provide a thorough understanding of the subject matter of the present invention. However, it is clear to those of ordinary skill in the art that the subject matter of the present invention can be practiced without these specific details.
[0086] Various aspects of the present invention are described herein in conjunction with the flowchart and / or block diagram of the method, device (system) and computer program product provided in the embodiment of the present invention. It should be understood that each square frame of the flowchart and / or block diagram and the combination of square frames in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable instruction execution device produce a mechanism for implementing the function / action described in detail in the flowchart and / or block diagram.
[0087] Non-transitory computer-readable media include all types of computer-readable media, including magnetic storage media, optical storage media, and solid-state storage media, but specifically do not include signals. It should be understood that the software can be installed in the device and sold with the device. Alternatively, the software can be obtained and loaded into the device, including via optical disk media or any other means of obtaining the software from a network or distribution system, including, for example, from a server owned by the creator of the software or from a server that the creator of the software does not own but uses. For example, the software can be stored in a server for distribution over the Internet.
[0088] Computer-readable storage media do not include propagating signals, are accessible by computers and / or processors, and include volatile and non-volatile removable and / or non-removable internal and / or external media. Various types of storage media hold stored data in any suitable digital format for a computer. Those skilled in the art will appreciate that other types of computer-readable media, such as compression drives, solid-state drives, magnetic tapes, flash cards, flash drives, boxes, etc., may be used to store computer-executable instructions for performing the novel methods (actions) of the disclosed architecture.
[0089] The terms used herein are only for the purpose of describing specific aspects and are not intended to limit the present invention. Unless the context clearly indicates otherwise, the singular forms "a", "an" and "said" used herein include plural meanings. It should also be understood that the term "comprising" used in this specification is used to illustrate the presence of the described features, integers, steps, operations, elements and / or parts, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or combinations thereof.
[0090] The description of the present invention is presented for illustration and description purposes only and is not intended to be exhaustive or to limit the present invention in any disclosed manner. Various modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the present invention. Various aspects of the present invention are selected and described in order to better explain the principles and practical applications of the present invention and to enable those of ordinary skill in the art to understand the present invention and various modifications suitable for the intended specific use.
[0091] For the purposes of this document, each process associated with the disclosed technology can be performed serially by one or more computing devices. Each step in the process can be performed by the same or different computing devices used in other steps, and each step does not have to be performed by a single computing device.
[0092] Although the subject matter has been described in language specific to structural features and / or method actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Instead, the specific features and actions described above are disclosed as exemplary ways to implement the claims.
Claims
1. A computer-implemented method for establishing a trust relationship in a distributed system, characterized in that: The method comprises: The node calculates a hash of the content of a service in a data packet received from a neighboring node, wherein the data packet includes the service and service-related information; The node verifies the data packet by comparing a hash of the content of the service received from the neighboring node with a hash of the content calculated by the node; The node accumulates the content amount of the service with the same service ID in the data packet received from the neighboring node; The node generates a first signature according to the code stored in the trusted execution environment TEE; The node sends the data packet including the service and the service-related information to a next adjacent node, wherein the service-related information includes the service ID, a hash of the service content in the data packet, and the first signature.
2. The computer-implemented method of claim 1, wherein: The method further includes sending a confirmation message to the neighboring node, wherein the confirmation message includes the service ID, a hash of the accumulated content volume of the service, and another signature.
3. The computer-implemented method according to claim 1 or 2, characterized in that: The method further comprises: Create a hash tree, wherein the hash tree includes a node structure, the node structure includes one or more leaf nodes, one or more child nodes and one or more parent nodes, each leaf node represents a hash of the content in the data packet received from the adjacent node, and each parent node represents a cumulative hash of the content of each direct leaf node or each child node.
4. The computer-implemented method of claim 3, wherein: The accumulation of the hash is calculated as follows: increasing the accumulated content volume of the service according to the service ID; Adding the hash of the content of the service in the received data packet as a leaf node to the hash tree, and updating the corresponding parent node until the root node; When there are no empty leaf nodes among the child nodes of each parent node and / or a confirmation message sent to the parent node is received, one or more child nodes of each parent node are removed.
5. The computer-implemented method according to claim 1 or 2, characterized in that: The hash tree is divided into hash subtrees, wherein each hash subtree represents a parent node and its corresponding one or more leaf nodes or one or more child nodes; The data packets corresponding to each hash subtree are received from the neighboring nodes along a plurality of different paths.
6. The computer-implemented method of claim 5, wherein: The method further includes: merging each of the hash subtrees corresponding to the received data packet along the plurality of different paths at the node.
7. The computer-implemented method of claim 4, wherein: The method further comprises: Determine whether the hash of the data packet is missing in the accumulated hash by: After sending the data packet to the adjacent node, storing the accumulated hash corresponding to each transmission path with the same service ID; Extracting the accumulated hash from the confirmation message of the neighboring node; The extracted cumulative hash is compared with the stored cumulative hash.
8. The computer-implemented method of claim 3, wherein: The method further comprises: After receiving a data packet with the same service ID, sending the data packet including the accumulated content volume of the service, the accumulated hash of the data packet and the node signature to the verification node, wherein the verification node Verifying that the content volume and the hash of the content of the service are valid using a public key in each recorded key pair received from the neighboring node; A consensus is reached on the accumulated content amount of the service received in the data packet sent to the node in the distributed system based on the verification records with the same service ID received from different neighboring nodes.
9. The computer-implemented method of claim 1, wherein: The service-related information received by the neighboring node includes the service ID, a hash of the content of the service, and a second signature created by a private key in a key pair.
10. The computer-implemented method of claim 1, wherein: The method further includes verifying the signature in the data packet signed by the neighboring node using a public key in a key pair.
11. A node for establishing a trust relationship in a distributed system, characterized in that: The nodes include: A non-transitory memory including instructions; one or more processors in communication with the memory, wherein the one or more processors execute the instructions to: Calculating a hash of the content of a service in a data packet received from a neighboring node, wherein the data packet includes the service and service-related information; verifying the data packet by comparing a hash of the content of the service received from the neighboring node with a hash of the content calculated by the node; The node accumulates the content amount of the service with the same service ID in the data packet received from the neighboring node; The node generates a first signature according to the code stored in the trusted execution environment TEE; Send the data packet including the service and the service-related information to the next adjacent node, wherein the service-related information includes the service ID, a hash of the service content in the data packet, and the first signature.
12. The node according to claim 11, characterized in that: The one or more processors further execute the instructions to send a confirmation message to the neighboring node, wherein the confirmation message includes the service ID, a hash of the accumulated content volume of the service, and another signature.
13. The node according to claim 11 or 12, characterized in that: The one or more processors also execute the instructions to create a hash tree, wherein the hash tree includes a node structure, the node structure includes one or more leaf nodes, one or more child nodes and one or more parent nodes, each leaf node represents a hash of the content in the data packet received from the adjacent node, and each parent node represents a cumulative hash of the content of each direct leaf node or each child node.
14. The node according to claim 13, characterized in that: The accumulation of the hash is calculated as follows: increasing the accumulated content volume of the service according to the service ID; Adding the hash of the content of the service in the received data packet as a leaf node to the hash tree, and updating the corresponding parent node until the root node; When there are no empty leaf nodes among the child nodes of each parent node and / or a confirmation message sent to the parent node is received, one or more child nodes of each parent node are removed.
15. The node according to claim 11 or 12, characterized in that: The hash tree is divided into hash subtrees, wherein each hash subtree represents a parent node and its corresponding one or more leaf nodes or one or more child nodes; The data packets corresponding to each hash subtree are received from the neighboring nodes along a plurality of different paths.
16. The node according to claim 15, characterized in that The one or more processors also execute the instructions to merge, at the node, each of the hash subtrees corresponding to the received data packet along the plurality of different paths.
17. The node according to claim 14, characterized in that The one or more processors also execute the instructions to: Determine whether the hash of the data packet is missing in the accumulated hash by: After sending the data packet to the adjacent node, storing the accumulated hash corresponding to each transmission path with the same service ID; Extracting the accumulated hash from the confirmation message of the neighboring node; The extracted cumulative hash is compared with the stored cumulative hash.
18. The node according to claim 13, characterized in that: The one or more processors also execute the instructions to: After receiving a data packet with the same service ID, sending the data packet including the accumulated content volume of the service, the accumulated hash of the data packet and the node signature to the verification node, wherein the verification node Verifying that the content volume and the hash of the content of the service are valid using a public key in each recorded key pair received from the neighboring node; A consensus is reached on the accumulated content amount of the service received in the data packet sent to the node in the distributed system based on the verification records with the same service ID received from different neighboring nodes.
19. The node according to claim 11, characterized in that The service-related information received by the neighboring node includes the service ID, a hash of the content of the service, and a second signature created by a private key in a key pair.
20. The node according to claim 11, characterized in that The one or more processors further execute the instructions to verify the signature in the data packet signed by the neighboring node using a public key of a key pair.
21. A non-transitory computer readable medium storing computer instructions, characterized in that: The computer instructions are used to establish a trust relationship in a distributed system. When the computer instructions are executed by one or more processors, the one or more processors perform the following steps: The node receives a data packet from a neighboring node, wherein the data packet includes a service and service-related information; The node calculates a hash of the content of the service in the data packet received from the neighboring node; verifying the data packet by comparing a hash of the content of the service received from the neighboring node with a hash of the content calculated by the node; The node accumulates the content amount of the service with the same service ID in the data packet received from the neighboring node; The node generates a first signature according to the code stored in the trusted execution environment TEE; Send the data packet including the service and the service-related information to a next adjacent node, wherein the service-related information includes the service ID, a hash of the service content in the data packet, and the first signature.
22. The non-transitory computer readable medium of claim 21, wherein: The computer instructions further cause the one or more processors to send a confirmation message to the neighboring node, wherein the confirmation message includes the service ID, a hash of the accumulated content volume of the service, and another signature.
23. The non-transitory computer readable medium according to claim 21 or 22, wherein: The computer instructions further cause the one or more processors to perform the following steps: Create a hash tree, wherein the hash tree includes a node structure, the node structure includes one or more leaf nodes, one or more child nodes and one or more parent nodes, each leaf node represents a hash of the content in the data packet received from the adjacent node, and each parent node represents a cumulative hash of the content of each direct leaf node or each child node.
24. The non-transitory computer readable medium of claim 23, wherein: The accumulation of the hash is calculated as follows: increasing the accumulated content volume of the service according to the service ID; Adding the hash of the content of the service in the received data packet as a leaf node to the hash tree, and updating the corresponding parent node until the root node; When there are no empty leaf nodes among the child nodes of each parent node and / or a confirmation message sent to the parent node is received, one or more child nodes of each parent node are removed.
25. The non-transitory computer readable medium according to claim 21 or 22, wherein: The hash tree is divided into hash subtrees, wherein each hash subtree represents a parent node and its corresponding one or more leaf nodes or one or more child nodes; The data packets corresponding to each hash subtree are received from the neighboring nodes along a plurality of different paths.
26. The non-transitory computer readable medium of claim 25, wherein: The computer instructions further cause the one or more processors to perform the step of merging, at the node, each of the hash subtrees corresponding to the received data packet along the plurality of different paths.
27. The non-transitory computer readable medium of claim 24, wherein: The computer instructions further cause the one or more processors to perform the following steps: Determine whether the hash of the data packet is missing in the accumulated hash by: After sending the data packet to the adjacent node, storing the accumulated hash corresponding to each transmission path with the same service ID; Extracting the accumulated hash from the confirmation message of the neighboring node; The extracted cumulative hash is compared with the stored cumulative hash.
28. The non-transitory computer readable medium of claim 23, wherein: The computer instructions further cause the one or more processors to perform the following steps: After receiving a data packet with the same service ID, sending the data packet including the accumulated content volume of the service, the accumulated hash of the data packet and the node signature to the verification node, wherein the verification node Verifying that the content volume and the hash of the content of the service are valid using a public key in each recorded key pair received from the neighboring node; A consensus is reached on the accumulated content amount of the service received in the data packet sent to the node in the distributed system based on the verification records with the same service ID received from different neighboring nodes.
29. The non-transitory computer readable medium of claim 21, wherein: The service-related information received by the neighboring node includes the service ID, a hash of the content of the service, and a second signature created by a private key in a key pair.
30. The non-transitory computer readable medium of claim 21, wherein: The computer instructions further cause the one or more processors to perform the step of verifying the signature in the data packet signed by the neighboring node using a public key in a key pair.
Citation Information
Patent Citations
Information verification system based on blockchain
CN108711052A
Calculation verification method and system based on block chain
CN109889498A
