TWI728899B - Methods and apparatuses for processing chaining data - Google Patents

Methods and apparatuses for processing chaining data Download PDF

Info

Publication number
TWI728899B
TWI728899B TW109128081A TW109128081A TWI728899B TW I728899 B TWI728899 B TW I728899B TW 109128081 A TW109128081 A TW 109128081A TW 109128081 A TW109128081 A TW 109128081A TW I728899 B TWI728899 B TW I728899B
Authority
TW
Taiwan
Prior art keywords
hash value
data
link
root
root hash
Prior art date
Application number
TW109128081A
Other languages
Chinese (zh)
Other versions
TW202046673A (en
Inventor
黃冠寰
Original Assignee
國際信任機器股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 國際信任機器股份有限公司 filed Critical 國際信任機器股份有限公司
Priority to TW109128081A priority Critical patent/TWI728899B/en
Publication of TW202046673A publication Critical patent/TW202046673A/en
Application granted granted Critical
Publication of TWI728899B publication Critical patent/TWI728899B/en

Links

Images

Abstract

Methods and apparatuses for processing chaining data are provided. The method includes storing a plurality of binary trees in a database in an off-chain manner. Each binary tree includes a root and a plurality of leaf nodes. Each leaf node includes a root hash. The method further includes reading the root hashes from the database, performing a hashing and chaining operation on the root hashes read from the database to determine a calculated root hash, reading a specific root hash from a blockchain, determining whether the specific root hash is the same as the calculated root hash, and determining that the root hashes in the database are correct when the specific root hash is the same as the calculated root hash.

Description

用於處理鏈接資料的方法與裝置Method and device for processing linked data

本發明是關於一種可與區塊鏈協作並用於處理鏈接資料的方法與裝置。The present invention relates to a method and device that can cooperate with blockchain and used to process linked data.

在現有技術中,區塊鏈(blockchain)採取分散式架構來達到去中心化的目的,全世界的終端電腦可藉由區塊鏈而產生連接,任一終端電腦所傳送到區塊鏈上的資料,可透過特定的運算方式而分佈在區塊鏈上的其他終端電腦中。由於這些資料是存在於區塊鏈上的大量終端電腦中,因此資料的正確性可透過區塊鏈的大量終端電腦互相驗證,這使得區塊鏈資料難以被變造或竄改。In the existing technology, the blockchain adopts a decentralized architecture to achieve the purpose of decentralization. Terminal computers all over the world can be connected through the blockchain, and any terminal computer transmits to the blockchain. Data can be distributed in other terminal computers on the blockchain through a specific calculation method. Since these data exist in a large number of terminal computers on the blockchain, the correctness of the data can be mutually verified through a large number of terminal computers on the blockchain, which makes it difficult for the blockchain data to be altered or altered.

在傳統的終端電腦對中心伺服器的架構中,當一台終端電腦要將資料上傳到伺服器或是由伺服器下載資料,此作業只牽涉到終端電腦、中心伺服器與兩者間的網路伺服器等有限裝置的運作,以時下的網路速度與電腦計算能力來說,此作業可以執行得極為快速。但在區塊鏈的架構中,當一台終端電腦要將資料上傳到區塊鏈或是由區塊鏈下載資料時,基於區塊鏈的特性,此作業會牽涉到區塊鏈上其他大量的終端電腦(如礦工)的驗證程序,從而導致龐大的網路傳輸需求及運算量,因此相對耗時,且運算成本(如礦工費用)居高不下。In the traditional terminal computer-to-central server architecture, when a terminal computer wants to upload data to the server or download data from the server, this operation only involves the terminal computer, the central server, and the network between the two. For the operation of limited devices such as road servers, this operation can be performed extremely fast in terms of current network speed and computer computing power. But in the blockchain architecture, when a terminal computer wants to upload data to the blockchain or download data from the blockchain, based on the characteristics of the blockchain, this operation will involve a large number of other on the blockchain. The verification procedures of the terminal computers (such as miners) lead to huge network transmission requirements and calculations. Therefore, it is relatively time-consuming and the calculation costs (such as miners’ fees) remain high.

一般來說,區塊鏈是採用二元樹(binary tree)或稱模克樹(Merkle tree)的樹狀資料結構,所有資料會經過雜湊運算而產生雜湊值(hash value)。所述二元樹包括頂層的樹根(root)與底層的多個葉節點(leaf node),每一筆資料的雜湊值會被儲存在葉節點,而所有葉節點的雜湊值會經過逐層運算而最終產生位於樹根的根雜湊值(root hash)。所有的二元樹會儲存在區塊鏈上的各個終端電腦中,若要驗證某一二元樹的某一筆資料的正確性,可藉由比對此二元樹在各終端電腦上的根雜湊值,來驗證此二元樹與其資料的正確性。Generally speaking, a blockchain uses a binary tree or Merkle tree as a tree-like data structure. All data undergoes a hash operation to generate a hash value. The binary tree includes a root at the top level and multiple leaf nodes at the bottom. The hash value of each piece of data will be stored in the leaf node, and the hash value of all leaf nodes will be processed layer by layer. Finally, the root hash at the root of the tree is generated. All binary trees will be stored in each terminal computer on the blockchain. If you want to verify the correctness of a certain piece of data of a binary tree, you can compare the root hash of the binary tree on each terminal computer. Value to verify the correctness of this binary tree and its data.

基於現有區塊鏈,當大量讀取區塊鏈上的資料時,會造成區塊鏈上的終端電腦的負荷,且效率不彰。此外,若大量讀取資料的動作被區塊鏈上的終端電腦當成惡意行為,輕則此次的讀取要求被區塊鏈上的終端電腦阻擋,造成資料無法讀取,重則發出讀取要求的網路位址被區塊鏈上的終端電腦列入黑名單,從此無法再由此終端電腦存取區塊鏈。Based on the existing blockchain, when a large amount of data on the blockchain is read, it will cause a load on the terminal computer on the blockchain, and the efficiency is not high. In addition, if a large amount of data reading is regarded as malicious by the terminal computer on the blockchain, the reading request will be blocked by the terminal computer on the blockchain, causing the data to be unreadable, and the reading request will be issued if it is heavy. The network address of is blacklisted by the terminal computer on the blockchain, and the terminal computer can no longer access the blockchain from then on.

有鑑於此,在本發明的一些實施例中,提出一種用於處理鏈接資料的方法、裝置以及驗證系統,藉此解決大量讀取區塊鏈上的資料時所導致效率不彰的問題,且解決大量讀取時造成區塊鏈的網路傳輸需求與運算負荷過大的問題。In view of this, in some embodiments of the present invention, a method, device, and verification system for processing linked data are proposed, so as to solve the problem of inefficiency caused by a large amount of data on the blockchain, and Solve the problem that the network transmission demand of the blockchain and the computing load are too large when a large number of readings occur.

本發明一實施例提出一種由安全協定裝置執行的用於處理鏈接資料的方法。此方法包括:將多個二元樹儲存於鏈下的一資料庫,其中各個二元樹包括樹根與多個葉節點,各個樹根儲存有根雜湊值。此方法更包括:讀取資料庫上的該些根雜湊值;對讀取自資料庫的該些根雜湊值進行雜湊與鏈接運算,以決定一推算根雜湊值;自區塊鏈讀取一特定根雜湊值,判斷特定根雜湊值與推算根雜湊值是否一致;以及在特定根雜湊值與推算根雜湊值一致時,判斷資料庫的該些根雜湊值為正確。An embodiment of the present invention provides a method for processing linked data executed by a security protocol device. The method includes: storing a plurality of binary trees in a database under the chain, wherein each binary tree includes a tree root and a plurality of leaf nodes, and each tree root stores a root hash value. This method further includes: reading the root hash values on the database; performing hash and link operations on the root hash values read from the database to determine an estimated root hash value; reading a root hash value from the blockchain The specific root hash value is to determine whether the specific root hash value is consistent with the estimated root hash value; and when the specific root hash value is consistent with the estimated root hash value, it is determined that the root hash values of the database are correct.

本發明一實施例提出一種由安全協定裝置。此安全協定裝置包括記憶體以及處理器。處理器耦接記憶體,並用以:將多個二元樹儲存於鏈下的一資料庫,其中各個二元樹包括樹根與多個葉節點,各個樹根儲存有根雜湊值。處理器更用以:讀取資料庫上的該些根雜湊值;對讀取自資料庫的該些根雜湊值進行雜湊與鏈接運算,以決定一推算根雜湊值;自區塊鏈讀取一特定根雜湊值;判斷特定根雜湊值與推算根雜湊值是否一致;以及在特定根雜湊值與推算根雜湊值一致時,判斷資料庫的該些根雜湊值為正確。An embodiment of the present invention provides a security protocol device. The security protocol device includes a memory and a processor. The processor is coupled to the memory and used for storing a plurality of binary trees in a database under the chain, wherein each binary tree includes a tree root and a plurality of leaf nodes, and each tree root stores a root hash value. The processor is further used to: read the root hash values on the database; perform hash and link operations on the root hash values read from the database to determine an estimated root hash value; read from the blockchain A specific root hash value; to determine whether the specific root hash value is consistent with the estimated root hash value; and when the specific root hash value is consistent with the estimated root hash value, it is determined that the root hash values of the database are correct.

本發明一實施例提出一種由區塊鏈裝置執行的方法,當中包括:自安全協定裝置接收多個根雜湊值,根據該些根雜湊值產生鏈接資料串,其中鏈接資料串包括多個以串列方式鏈接的資料集合,各資料集合分別包括各根雜湊值與對應的鏈接雜湊值,該些資料集合的最前者的鏈接雜湊值為雜湊化初始鏈接值而產生,而在最前的資料集合之後的各資料集合的鏈接雜湊值為雜湊化前一資料集合而產生。此方法更包括:傳送特定根雜湊值至安全協定裝置,以供安全協定裝置驗證儲存於鏈下的資料庫中的多個二元樹的正確性;其中,特定根雜湊值為鏈接資料串的資料區段中的最後一筆的資料集合的根雜湊值,而資料區段對應於提供至安全協定裝置的讀取指令所指示的資料讀取範圍。An embodiment of the present invention provides a method executed by a blockchain device, which includes: receiving a plurality of root hash values from a security protocol device, and generating a link data string based on the root hash values, wherein the link data string includes a plurality of root hash values. Data collections linked in a row, each data collection includes each root hash value and the corresponding link hash value. The link hash value of the first of these data sets is generated by the initial link value of the hash, and after the first data set The link hash value of each data set of is generated by hashing the previous data set. This method further includes: sending a specific root hash value to the security protocol device for the security protocol device to verify the correctness of the multiple binary trees stored in the database under the chain; wherein the specific root hash value is the link data string The root hash value of the last data set in the data section, and the data section corresponds to the data read range indicated by the read command provided to the security protocol device.

本發明一實施例提出一種區塊鏈裝置,其包括記憶體以及處理器。處理器耦接記憶體,並用以自安全協定裝置接收多個根雜湊值,以及根據該些根雜湊值產生鏈接資料串,其中鏈接資料串包括多個以串列方式鏈接的資料集合,各資料集合分別包括各根雜湊值與對應的鏈接雜湊值,該些資料集合的最前者的鏈接雜湊值為雜湊化初始鏈接值而產生,而在最前的資料集合之後的各資料集合的鏈接雜湊值為雜湊化前一資料集合而產生。處理器更用以傳送特定根雜湊值至安全協定裝置,以供安全協定裝置驗證儲存於鏈下的資料庫中的多個二元樹的正確性;其中,特定根雜湊值為鏈接資料串的資料區段中的最後一筆的資料集合的根雜湊值,而資料區段對應於提供至安全協定裝置的讀取指令所指示的資料讀取範圍。An embodiment of the present invention provides a blockchain device, which includes a memory and a processor. The processor is coupled to the memory, and is used for receiving a plurality of root hash values from the security protocol device, and generating a link data string based on the root hash values, wherein the link data string includes a plurality of data sets linked in a serial manner, and each data The collection includes each root hash value and the corresponding link hash value. The link hash value of the first of these data sets is generated by hashing the initial link value, and the link hash value of each data set after the first data set is Generated by hashing the previous data set. The processor is further used to send a specific root hash value to the security protocol device for the security protocol device to verify the correctness of the multiple binary trees stored in the database under the chain; wherein the specific root hash value is the link data string The root hash value of the last data set in the data section, and the data section corresponds to the data read range indicated by the read command provided to the security protocol device.

本發明一實施例提出一種驗證系統,其適用於與區塊鏈協作並用於鏈接資料。驗證系統包括安全協定裝置、區塊鏈裝置與資料庫裝置。安全協定裝置接收多個紀錄資料並根據雜湊函數整合該些紀錄資料為多個二元樹,各二元樹包括樹根與多個葉節點,各樹根儲存有根雜湊值,且各紀錄資料的雜湊值分別儲存於各葉節點。區塊鏈裝置位於區塊鏈且通訊連接安全協定裝置,安全協定裝置傳送該些二元樹的該些根雜湊值至區塊鏈裝置。區塊鏈裝置包括至少一鏈接資料串,鏈接資料串包括多個以串列方式鏈接的資料集合,各資料集合分別包括各根雜湊值與對應的鏈接雜湊值,每一資料集合的鏈接雜湊值關聯於前一資料集合的根雜湊值與鏈接雜湊值,且該些資料集合最前者的鏈接雜湊值關聯於初始鏈接值。資料庫裝置在無涉於區塊鏈的鏈下通訊連接安全協定裝置,安全協定裝置儲存該些二元樹與初始鏈接值於資料庫裝置。An embodiment of the present invention provides a verification system, which is suitable for collaboration with a blockchain and used for linking data. The verification system includes a security protocol device, a blockchain device, and a database device. The security protocol device receives multiple record data and integrates the record data into multiple binary trees according to the hash function. Each binary tree includes a tree root and multiple leaf nodes. Each tree root stores a root hash value, and each record data The hash value of is stored in each leaf node. The blockchain device is located in the blockchain and is in communication with the security protocol device, and the security protocol device transmits the root hash values of the binary trees to the blockchain device. The blockchain device includes at least one link data string, the link data string includes a plurality of data sets linked in a serial manner, each data set includes each root hash value and the corresponding link hash value, and the link hash value of each data set The root hash value and the link hash value of the previous data set are related, and the link hash value of the first data set is related to the initial link value. The database device communicates with the security protocol device under the chain that does not involve the blockchain, and the security protocol device stores the binary trees and the initial link value in the database device.

本發明一實施例提出一種驗證方法,其適用於與區塊鏈協作。驗證方法包括:在無涉於區塊鏈的鏈下接收多個紀錄資料;根據雜湊函數整合該些紀錄資料為多個二元樹,其中,各二元樹包括樹根與多個葉節點,各樹根儲存有根雜湊值,且各紀錄資料的雜湊值分別儲存於各葉節點;傳送該些二元樹的該些根雜湊值至區塊鏈,其中,區塊鏈上設置有至少一鏈接資料串,鏈接資料串包括多個以串列方式鏈接的資料集合,各資料集合分別包括各根雜湊值與對應的鏈接雜湊值,每一資料集合的鏈接雜湊值關聯於前一資料集合的根雜湊值與鏈接雜湊值,且該些資料集合最前者的鏈接雜湊值關聯於初始鏈接值;以及,在無涉於區塊鏈的鏈下儲存該些二元樹與初始鏈接值。An embodiment of the present invention provides a verification method, which is suitable for collaboration with a blockchain. The verification method includes: receiving multiple record data under a chain that is not involved in the blockchain; integrating the record data into multiple binary trees according to a hash function, where each binary tree includes a tree root and multiple leaf nodes, The root hash value of each tree is stored, and the hash value of each record data is stored in each leaf node; the root hash values of the binary trees are sent to the blockchain, where at least one Linked data string. The linked data string includes multiple data sets linked in a series. Each data set includes each root hash value and the corresponding link hash value. The link hash value of each data set is related to the previous data set. The root hash value and the link hash value, and the link hash value of the first of these data sets is associated with the initial link value; and the binary trees and the initial link value are stored under a chain that does not involve the blockchain.

綜上所述,根據本發明實施例的驗證系統、方法與裝置,在需要大量讀取二元樹的根雜湊值時,可透過鏈下資料庫裝置中讀取這些根雜湊值,並以區塊鏈上的鏈接資料串的資料集合在後者的鏈接雜湊值來驗證由鏈下讀取的根雜湊值的正確性,從而在維持資料的可信任度的前提下,減輕區塊鏈的網路傳輸需求與運算負荷。In summary, according to the verification system, method, and device of the embodiments of the present invention, when a large number of root hash values of a binary tree need to be read, these root hash values can be read from the off-chain database device, and the difference The data collection of the link data string on the blockchain uses the link hash value of the latter to verify the correctness of the root hash value read by the chain, thereby reducing the network of the blockchain while maintaining the trustworthiness of the data. Transmission demand and computing load.

以下在實施方式中詳細敘述本發明之詳細特徵以及優點,其內容足以使任何熟悉相關技術者暸解本發明之技術內容並據以實施,且根據本說明書所揭露之內容、申請專利範圍及圖式,任何熟習相關技術者可輕易地理解本發明相關之目的及優點。The detailed features and advantages of the present invention are described in detail in the following embodiments. The content is sufficient to enable anyone familiar with the relevant technology to understand the technical content of the present invention and implement it accordingly, and is based on the content disclosed in this specification, the scope of patent application and the drawings. Anyone familiar with the relevant technology can easily understand the purpose and advantages of the present invention.

請參照圖1,圖1為本發明一實施例的驗證系統10的方塊示意圖。在本實施例中,驗證系統10適用於與區塊鏈BC協作,區塊鏈BC可包括公有區塊鏈、私有區塊鏈或其組合。驗證系統10用以在鏈下(off chain)OC,亦即透過鏈下通道(off-chain channel),通訊連接多個終端裝置400,並在區塊鏈BC與鏈下OC間進行協作,且各終端裝置400可產生至少一筆紀錄資料RD。所述鏈下OC是指獨立於區塊鏈BC之外的路徑,即無涉於區塊鏈BC的路徑;所述在鏈下OC通訊連接是指在獨立於區塊鏈BC之外的路徑具有通訊連接關係,即透過無涉於區塊鏈BC的路徑建立通訊連接。例如,兩裝置在鏈下OC通訊連接,意味這兩裝置之間可透過網路直接連接並互相傳送訊號而無涉於區塊鏈BC。終端裝置400例如是桌上型電腦、筆記型電腦或各種感測器,紀錄資料RD例如是桌上型電腦或筆記型電腦產生的檔案或交易資訊或是感測器所感測的數值資訊,但不限於此。Please refer to FIG. 1, which is a block diagram of a verification system 10 according to an embodiment of the present invention. In this embodiment, the verification system 10 is adapted to cooperate with the blockchain BC, and the blockchain BC may include a public blockchain, a private blockchain, or a combination thereof. The verification system 10 is used for off-chain OC, that is, through an off-chain channel, to communicate with multiple terminal devices 400, and to cooperate between the blockchain BC and the off-chain OC, and Each terminal device 400 can generate at least one record RD. The off-chain OC refers to a path independent of the blockchain BC, that is, a path that does not involve the blockchain BC; the off-chain OC communication connection refers to a path independent of the blockchain BC It has a communication connection relationship, that is, a communication connection is established through a path that does not involve the blockchain BC. For example, two devices are connected in an off-chain OC communication, which means that the two devices can be directly connected through the network and transmit signals to each other without involving the blockchain BC. The terminal device 400 is, for example, a desktop computer, a notebook computer, or various sensors, and the record data RD is, for example, a file or transaction information generated by a desktop computer or a notebook computer, or numerical information sensed by the sensor. Not limited to this.

如圖1所示,在本實施例中,驗證系統10包括安全協定裝置100、資料庫裝置200與區塊鏈裝置300。安全協定裝置100是在無涉於區塊鏈BC的鏈下OC通訊連接資料庫裝置200,且安全協定裝置100通訊連接位於區塊鏈BC上的區塊鏈裝置300。資料庫裝置200例如是獨立於區塊鏈BC之外的資料儲存伺服器,區塊鏈裝置300例如是連接區塊鏈BC的複數電腦的集合,但不限於此。在本實施例中,安全協定裝置100是兼具區塊鏈BC與鏈下OC的通訊能力的伺服器。舉例來說,安全協定裝置100是位於鏈下OC與區塊鏈BC之間的中介者,其可作為終端裝置400與資料庫裝置200以及區塊鏈裝置300之間的橋樑,容後詳述。As shown in FIG. 1, in this embodiment, the verification system 10 includes a security protocol device 100, a database device 200 and a blockchain device 300. The security protocol device 100 is connected to the database device 200 in an off-chain OC communication that does not involve the blockchain BC, and the security protocol device 100 is communicatively connected to the blockchain device 300 on the blockchain BC. The database device 200 is, for example, a data storage server independent of the blockchain BC, and the blockchain device 300 is, for example, a collection of multiple computers connected to the blockchain BC, but is not limited to this. In this embodiment, the security protocol device 100 is a server with both the communication capabilities of the blockchain BC and the off-chain OC. For example, the security protocol device 100 is an intermediary between the off-chain OC and the blockchain BC, which can serve as a bridge between the terminal device 400 and the database device 200 and the blockchain device 300, which will be described in detail later .

請再參照圖2,圖2所示為本發明一實施例的二元樹BT的示意圖。如圖1與圖2所示,在本實施例中,各終端裝置400產生紀錄資料RD後,各終端裝置400會在鏈下OC傳送紀錄資料RD至安全協定裝置100。安全協定裝置100在鏈下OC接收各終端裝置400的該些紀錄資料RD之後,安全協定裝置100會根據雜湊函數整合該些紀錄資料RD為至少一二元樹BT。Please refer to FIG. 2 again, which is a schematic diagram of a binary tree BT according to an embodiment of the present invention. As shown in FIG. 1 and FIG. 2, in this embodiment, after each terminal device 400 generates the record data RD, each terminal device 400 transmits the record data RD to the security protocol device 100 in the off-chain OC. After the security protocol device 100 receives the record data RD of each terminal device 400 in the off-chain OC, the security protocol device 100 integrates the record data RD into at least one binary tree BT according to the hash function.

如圖2所示,在本實施例中,二元樹BT包括樹根R、多個中間節點MN與多個葉節點LN,以二元樹BT的樹狀資料結構來看,樹根R位於頂層、葉節點LN位於底層、而中間節點MN分佈於頂層與底層之間的一或多層。每兩個相鄰的葉節點LN在往上一層會合而為一個中間節點MN,每一層中的每兩個相鄰的中間節點MN在更往上一層又會合而為一個中間節點MN,而位於最上層的兩個中間節點MN會合而為樹根R。每一葉節點LN分別儲存各紀錄資料RD的雜湊值RDH,而每一中間節點MN的雜湊值與樹根R中的根雜湊值RH則關聯於各紀錄資料RD的雜湊值RDH。As shown in FIG. 2, in this embodiment, the binary tree BT includes a tree root R, a plurality of intermediate nodes MN, and a plurality of leaf nodes LN. From the tree-like data structure of the binary tree BT, the tree root R is located The top and leaf nodes LN are located at the bottom layer, and the intermediate nodes MN are distributed in one or more layers between the top layer and the bottom layer. Every two adjacent leaf nodes LN meet in the upper layer to become an intermediate node MN, and every two adjacent intermediate nodes MN in each layer meet in the upper layer to become an intermediate node MN, which is located at The two uppermost intermediate nodes MN meet to form the root R of the tree. Each leaf node LN stores the hash value RDH of each record data RD, and the hash value of each intermediate node MN and the root hash value RH in the root R are associated with the hash value RDH of each record data RD.

舉例來說,安全協定裝置100可採用SHA-256的雜湊函數將各筆紀錄資料RD雜湊化而產生對應的雜湊值RDH,且安全協定裝置100會將各紀錄資料RD的雜湊值RDH分別儲存於各葉節點LN。並且,每一組兩個相鄰的葉節點LN中所儲存的兩筆雜湊值會被連接後再被雜湊化而儲存於上一層的中間節點MN,每一層中的每一組兩個相鄰的中間節點MN所儲存的兩筆雜湊值也會被連接後再被雜湊化而儲存於更上一層的中間節點MN,以此類推。在本實施例中,所述兩筆雜湊值被連接後再被雜湊化的實現方式,可以是將此兩筆雜湊值先連接為一串編碼後再對此串編碼進行雜湊化,但不限於此。舉例來說,第一筆雜湊值是「xxx」,第二筆雜湊值是「ooo」,此兩筆雜湊值會先被連接為「xxxooo」的一串編碼,而此串編碼「xxxooo」會再被雜湊化而產生雜湊值。最後,位於最上層的兩個中間節點MN所儲存的兩筆雜湊值會被連接後再被雜湊化而產生根雜湊值RH。換言之,二元樹BT包括儲存於各葉節點LN中的紀錄資料RD的雜湊值RDH與儲存於樹根R的根雜湊值RH,並且,紀錄資料RD是不可竄改的,這是因為只要二元樹BT中任一筆紀錄資料RD遭到竄改,此筆紀錄資料RD的雜湊值RDH會產生變化,而只要任一葉節點LN的紀錄資料RD的雜湊值RDH產生變化,則二元樹BT的根雜湊值RH也會對應變化。藉由判斷根雜湊值RH是否產生變化,即可驗證此二元樹BT對應的紀錄資料RD的正確性。在不同的實施例中,單一個葉節點LN亦可儲存兩筆以上的紀錄資料RD的雜湊值RDH,在此情況下,此葉節點LN中所儲存的雜湊值RDH為兩筆以上的紀錄資料RD的雜湊值RDH被連接後再被雜湊化後之值。For example, the security protocol device 100 can use the SHA-256 hash function to hash each record data RD to generate a corresponding hash value RDH, and the security protocol device 100 stores the hash value RDH of each record data RD respectively in Each leaf node LN. In addition, the two hash values stored in each group of two adjacent leaf nodes LN will be concatenated and then hashed and stored in the intermediate node MN of the upper layer. Each group of two adjacent leaf nodes in each layer The two hash values stored in the intermediate node MN will also be connected and then hashed and stored in the intermediate node MN at a higher level, and so on. In this embodiment, the implementation of the two hash values being concatenated and then being hashed may be that the two hash values are first concatenated into a string of codes and then the string of codes is hashed, but it is not limited to this. For example, if the first hash value is "xxx" and the second hash value is "ooo", these two hash values will first be concatenated into a string of codes of "xxxooo", and this string of codes "xxxooo" will be It is then hashed to produce a hash value. Finally, the two hash values stored in the two middle nodes MN at the top level will be connected and then hashed to generate the root hash value RH. In other words, the binary tree BT includes the hash value RDH of the record data RD stored in each leaf node LN and the root hash value RH stored in the root R of the tree, and the record data RD cannot be tampered with, because as long as the binary If any record data RD in the tree BT is tampered, the hash value RDH of this record data RD will change, and as long as the hash value RDH of the record data RD of any leaf node LN changes, the root hash of the binary tree BT will be changed. The value RH will also change accordingly. By judging whether the root hash value RH has changed, the correctness of the record data RD corresponding to the binary tree BT can be verified. In different embodiments, a single leaf node LN can also store the hash value RDH of more than two record data RD. In this case, the hash value RDH stored in this leaf node LN is more than two record data. The hash value of RD RDH is concatenated and then hashed.

如圖1與圖2所示,在本實施例中,安全協定裝置100包括二元樹處理單元110與驗證單元120。二元樹處理單元110與驗證單元120例如但不限於是軟體/硬體所構成的功能模組,以分別執行特定功能,且二元樹處理單元110與驗證單元120可以是各自獨立的模組或整合為一體的模組。As shown in FIGS. 1 and 2, in this embodiment, the security protocol device 100 includes a binary tree processing unit 110 and a verification unit 120. The binary tree processing unit 110 and the verification unit 120 are, for example, but not limited to, functional modules composed of software/hardware to perform specific functions, and the binary tree processing unit 110 and the verification unit 120 may be independent modules. Or integrated into one module.

在本實施例中,安全協定裝置100的二元樹處理單元110會自動將所接收的該些紀錄資料RD進行雜湊化並整合產生二元樹BT。安全協定裝置100會傳送二元樹BT的根雜湊值RH至區塊鏈裝置300,亦即這些根雜湊值RH將會被儲存到區塊鏈BC上。此外,安全協定裝置100會將二元樹BT儲存於資料庫裝置200中,亦即完整的二元樹BT是儲存在鏈下OC,而不會儲存於區塊鏈BC上。在其他實施例中,完整的二元樹BT亦可同時儲存於資料庫裝置200並傳送至區塊鏈裝置300。In this embodiment, the binary tree processing unit 110 of the security protocol device 100 automatically hashes the received record data RD and integrates the binary tree BT. The security protocol device 100 will transmit the root hash value RH of the binary tree BT to the blockchain device 300, that is, the root hash value RH will be stored on the blockchain BC. In addition, the security protocol device 100 stores the binary tree BT in the database device 200, that is, the complete binary tree BT is stored in the off-chain OC, but not on the blockchain BC. In other embodiments, the complete binary tree BT can also be stored in the database device 200 and sent to the blockchain device 300 at the same time.

在本實施例中,安全協定裝置100的驗證單元120會驗證資料庫裝置200所儲存的二元樹BT的正確性。當安全協定裝置100接收一驗證要求,且此驗證要求是針對某一筆紀錄資料RD的正確性進行驗證,此時驗證單元120會自動比對區塊鏈裝置300上的對應於此紀錄資料RD的二元樹BT的根雜湊值RH與資料庫裝置200儲存的對應於此紀錄資料RD的二元樹BT的根雜湊值RH,以驗證資料庫裝置200儲存的二元樹BT的正確性。若區塊鏈裝置300上的根雜湊值RH與資料庫裝置200儲存的二元樹BT的根雜湊值RH經比對是一致的,則基於區塊鏈BC的特性,代表資料庫裝置200所儲存的此筆紀錄資料RD的二元樹BT正確無誤。In this embodiment, the verification unit 120 of the security protocol device 100 verifies the correctness of the binary tree BT stored in the database device 200. When the security protocol device 100 receives a verification request, and the verification request is to verify the correctness of a certain record data RD, the verification unit 120 will automatically compare the data on the blockchain device 300 corresponding to the record data RD. The root hash value RH of the binary tree BT and the root hash value RH of the binary tree BT stored in the database device 200 corresponding to the record data RD are used to verify the correctness of the binary tree BT stored in the database device 200. If the root hash value RH on the blockchain device 300 is consistent with the root hash value RH of the binary tree BT stored in the database device 200, then based on the characteristics of the blockchain BC, it represents the database device 200 The binary tree BT of the stored record data RD is correct.

由於完整的二元樹BT是位於鏈下OC的資料庫裝置200中,因此紀錄資料RD的雜湊值RDH的存取與運算主要是在鏈下OC進行,可節省傳統上在區塊鏈BC進行此項作業的網路傳輸需求、運算量、運算時間與運算成本。並且,資料庫裝置200中的二元樹BT的根雜湊值RH可經由與區塊鏈裝置300上的對應根雜湊值RH比對而得到驗證,鏈下OC的資料庫裝置200的資料正確性也得以確保。Since the complete binary tree BT is located in the database device 200 of the off-chain OC, the access and operation of the hash value RDH of the record data RD is mainly performed in the off-chain OC, which can save the traditional way of performing in the blockchain BC The network transmission requirements, calculation amount, calculation time and calculation cost of this operation. In addition, the root hash value RH of the binary tree BT in the database device 200 can be verified by comparing with the corresponding root hash value RH on the blockchain device 300, and the correctness of the data of the database device 200 of the off-chain OC It can also be ensured.

請參照圖3,圖3為本發明一實施例的鏈接資料串CDS的示意圖一。如圖1與圖3所示,在本實施例中,區塊鏈裝置300包括至少一鏈接資料串CDS,鏈接資料串CDS包括多個以串列方式鏈接的資料集合DS。所述串列是指由第一筆、第二筆、第三筆依序至倒數第二筆與最後一筆,且每一筆資料會關聯於前一筆資料,例如第二筆資料會關聯於第一筆資料、第三筆資料會關聯於第二筆資料而最後一筆資料會關聯於倒數第二筆資料,以此類推。在本實施例中,各資料集合DS分別包括各根雜湊值RH與對應的鏈接雜湊值CH,每一資料集合DS的鏈接雜湊值CH關聯於前一資料集合DS的根雜湊值RH與鏈接雜湊值CH,且該些資料集合DS最前者的鏈接雜湊值CH關聯於一初始鏈接值CH0Please refer to FIG. 3. FIG. 3 is a schematic diagram of a link data string CDS according to an embodiment of the present invention. As shown in FIGS. 1 and 3, in this embodiment, the blockchain device 300 includes at least one linked data string CDS, and the linked data string CDS includes a plurality of data sets DS linked in a serial manner. The series means from the first, second, and third to the penultimate and last in order, and each data will be related to the previous data, for example, the second data will be related to the first The data and the third data will be related to the second data and the last data will be related to the penultimate data, and so on. In this embodiment, each data set DS includes each root hash value RH and a corresponding link hash value CH. The link hash value CH of each data set DS is related to the root hash value RH and link hash of the previous data set DS. Value CH, and the link hash value CH of the first one of the data sets DS is associated with an initial link value CH 0 .

如圖1所示,在本實施例中,區塊鏈裝置300包括鏈接處理單元311,鏈接處理單元311用以產生鏈接資料串CDS。如圖1與圖3所示,在本實施例中,當區塊鏈裝置300接收多個二元樹BT的根雜湊值RH之後,鏈接處理單元311根據所接收的這些二元樹BT的根雜湊值RH的產生或接收時間,依序產生資料集合DS,每一資料集合DS的鏈接雜湊值CH為雜湊化前一資料集合DS而產生,且最前的資料集合DS的鏈接雜湊值CH為雜湊化初始鏈接值CH0 而產生。As shown in FIG. 1, in this embodiment, the blockchain device 300 includes a link processing unit 311, and the link processing unit 311 is used to generate a link data string CDS. As shown in FIGS. 1 and 3, in this embodiment, after the blockchain device 300 receives the root hash value RH of a plurality of binary trees BT, the link processing unit 311 according to the received roots of the binary trees BT When the hash value RH is generated or received, the data set DS is sequentially generated. The link hash value CH of each data set DS is generated by hashing the previous data set DS, and the link hash value CH of the first data set DS is the hash The initial link value CH 0 is generated.

在本實施例中,鏈接處理單元311會先產生所述初始鏈接值CH0 ,初始鏈接值CH0 可以是任意數值或任意字母或數字的組合。並且,鏈接處理單元311會根據以下兩個公式產生鏈接資料串CDS中的多個以串列方式鏈接的資料集合DS:In this embodiment, the link processing unit 311 first generates the initial link value CH 0 , and the initial link value CH 0 can be any numerical value or any combination of letters or numbers. In addition, the link processing unit 311 generates multiple serially linked data sets DS in the linked data string CDS according to the following two formulas:

CHi =hash(RHi-1 | CHi-1 );以及CH i =hash(RH i-1 | CH i-1 ); and

CH1 =hash(CH0 )。CH 1 =hash(CH 0 ).

其中,RHi-1 為根雜湊值RH,CHi-1 為鏈接雜湊值CH,且i為2至k的整數。Among them, RH i-1 is the root hash value RH, CH i-1 is the link hash value CH, and i is an integer from 2 to k.

如圖3所示,最前的資料集合DS的根雜湊值RH為RH1 而鏈接雜湊值CH為CH1 ,且CH1 為雜湊化CH0 而產生的雜湊值。在後的(排列在最前的資料集合DS後)的第二筆資料集合DS的根雜湊值RH為RH2 而鏈接雜湊值CH為CH2 ,且CH2 為雜湊化連接後的RH1 與CH1 而產生的雜湊值。如前所述,所述雜湊化連接後的RH1 與CH1 的實現方式,可以是將RH1 與CH1 連接後再進行雜湊化,但不限於此。在後的(排列在第二筆資料集合DS後)的第三筆資料集合DS的根雜湊值RH為RH3 而鏈接雜湊值CH為CH3 ,且CH3 為雜湊化連接後的RH2 與CH2 而產生的雜湊值。最後的資料集合DS的根雜湊值RH為RHk 而鏈接雜湊值CH為CHk ,且CHk 為雜湊化連接後的RHk-1 與CHk-1 而產生的雜湊值。其餘資料集合DS的根雜湊值RH與鏈接雜湊值CH則以此類推。並且,這些以串列方式鏈接的資料集合DS組成鏈接資料串CDS。在本實施例中,安全協定裝置100會將初始鏈接值CH0 儲存至資料庫裝置200,但不限於此。As shown in FIG. 3, the root hash value RH of the first data set DS is RH 1 and the link hash value CH is CH 1 , and CH 1 is a hash value generated by hashing CH 0. The root hash value RH of the second data set DS following (after the first data set DS) is RH 2 and the link hash value CH is CH 2 , and CH 2 is the RH 1 and CH after the hybridization connection 1 and the hash value generated. As described above, the RH of the connector 1 and the hash implementations CH 1, may then be connected to the CH 1 RH 1 hashed of, but is not limited thereto. The root hash value RH of the third data set DS after (arranged after the second data set DS) is RH 3 and the link hash value CH is CH 3 , and CH 3 is the RH 2 and The hash value generated by CH 2. The root hash value RH of the final data set DS is RH k and the link hash value CH is CH k , and CH k is the hash value generated by the hybridized connection RH k-1 and CH k-1. The root hash value RH and the link hash value CH of the remaining data sets DS can be deduced by analogy. In addition, these data sets DS linked in series form a linked data string CDS. In this embodiment, the security protocol device 100 stores the initial link value CH 0 in the database device 200, but it is not limited to this.

如圖1與圖3所示,在本實施例中,安全協定裝置100更包括讀取單元130,讀取單元130用以自區塊鏈裝置300與資料庫裝置200讀取對應的資料。終端裝置400可傳送讀取要求RR至安全協定裝置100,以讀取一或多個二元樹BT的根雜湊值RH。當安全協定裝置100接收讀取要求RR,且此讀取要求RR是要求讀取多個根雜湊值RH,而這多個根雜湊值RH屬於鏈接資料串CDS的多個資料集合DS,讀取單元130會自區塊鏈裝置300讀取此鏈接資料串CDS的該些資料集合DS在後者的根雜湊值RH,並自資料庫裝置200讀取此鏈接資料串CDS的該些資料集合DS在前者的一或多個根雜湊值RH,且安全協定裝置100以區塊鏈裝置300的在後的資料集合DS的鏈接雜湊值CH驗證資料庫裝置200的在前的一或多個根雜湊值RH的正確性。As shown in FIGS. 1 and 3, in this embodiment, the security protocol device 100 further includes a reading unit 130, and the reading unit 130 is used for reading corresponding data from the blockchain device 300 and the database device 200. The terminal device 400 may send a read request RR to the security protocol device 100 to read the root hash value RH of one or more binary trees BT. When the security protocol device 100 receives a read request RR, and the read request RR is a request to read multiple root hash values RH, and the multiple root hash values RH belong to multiple data sets DS of the linked data string CDS, read The unit 130 reads from the blockchain device 300 the data sets DS of the link data string CDS in the latter's root hash value RH, and reads the data sets DS of the link data string CDS from the database device 200 One or more root hash values RH of the former, and the security protocol device 100 uses the link hash value CH of the subsequent data set DS of the blockchain device 300 to verify the previous one or more root hash values of the database device 200 The correctness of RH.

舉例來說,當安全協定裝置100接收讀取要求RR,此讀取要求RR是要求讀取如圖3的鏈接資料串CDS的RH1 至RHk 的k個根雜湊值RH,讀取單元130會自區塊鏈裝置300讀取此鏈接資料串CDS的該些資料集合DS最後一筆的資料集合DS的根雜湊值RH與鏈接雜湊值CH(即RHk 與CHk ),並且,讀取單元130會自資料庫裝置200讀取在前的資料集合DS的根雜湊值RH(即RH1 至RHk-1 ),並且,驗證單元120會以最後一筆的資料集合DS的RHk 來驗證資料庫裝置200的在前的資料集合DS的RH1 至RHk-1 的正確性。驗證單元120可使用前述兩個公式,並以資料庫裝置200儲存的初始鏈接值CH0 與RH1 至RHk-1 進行雜湊與鏈接運算而推算出CHk ,並以推算出的CHk 來比對區塊鏈裝置300上的CHk 。若推算出的CHk 與區塊鏈裝置300上的CHk 一致,則表示資料庫裝置200儲存的RH1 至RHk-1 與區塊鏈裝置300上的RH1 至RHk-1 也會一致。因為基於雜湊運算,只要資料庫裝置200儲存的RH1 至RHk-1 中任一個根雜湊值RH與區塊鏈裝置300上的RH1 至RHk-1 中的對應根雜湊值RH不一致,則推算出的CHk 就會不同於區塊鏈裝置300上的CHkFor example, when the security protocol device 100 receives a read request RR, the read request RR is a request to read k root hash values RH of RH 1 to RH k of the link data string CDS as shown in FIG. 3, and the reading unit 130 The root hash value RH and the link hash value CH (ie RH k and CH k ) of the last data set DS of the data set DS of this link data string CDS will be read from the blockchain device 300, and the reading unit 130 will read the root hash value RH (ie RH 1 to RH k-1 ) of the previous data set DS from the database device 200, and the verification unit 120 will verify the data with the RH k of the last data set DS The correctness of RH 1 to RH k-1 of the previous data set DS of the library device 200. The verification unit 120 can use the aforementioned two formulas, and use the initial link values CH 0 and RH 1 to RH k-1 stored in the database device 200 to perform hash and link operations to calculate CH k , and use the calculated CH k to calculate CH k. Compare CH k on the blockchain device 300. If deduced CH k CH k coincides with the block chain means 300, 200 indicates a storage library device RH RH RH k-1 to the apparatus 300 1 and the block chain 1 will RH k-1 Unanimous. Because based on the hash calculation, as long as any one of the root hash values RH among RH 1 to RH k-1 stored in the database device 200 is inconsistent with the corresponding root hash value RH among RH 1 to RH k-1 on the blockchain device 300, Then the calculated CH k will be different from the CH k on the blockchain device 300.

請參照圖3a,圖3a為本發明一實施例的鏈接資料串CDS的示意圖二。圖3a的鏈接資料串CDS實質上同於圖3的鏈接資料串CDS,但為了便於說明,圖3a的鏈接資料串CDS示出一個連續的資料集合DS的資料區段SEC。如圖3a所示,在本實施例中,安全協定裝置100還可讀取鏈接資料串CDS的任一資料區段SEC的資料集合DS,並以此資料區段SEC的最後一筆資料集合DS進行驗證。舉例來說,當安全協定裝置100接收讀取要求RR,此讀取要求RR是要求讀取如圖3的鏈接資料串CDS的資料區段SEC的RHx-10 至RHx 共十一個根雜湊值RH,其中x小於k且大於等於10,讀取單元130會自區塊鏈裝置300讀取此資料區段SEC的該些資料集合DS最後一筆的資料集合DS的根雜湊值RH與鏈接雜湊值CH(即RHx 與CHx ),並且,讀取單元130會自資料庫裝置200讀取此資料區段SEC的在前的資料集合DS的根雜湊值RH(即RHx-10 至RHx-1 ),並且,驗證單元120會以資料區段SEC的最後一筆的資料集合DS的RHx 來驗證資料庫裝置200的資料區段SEC在前的資料集合DS的RHx-10 至RHx-1 的正確性。Please refer to FIG. 3a. FIG. 3a is a second schematic diagram of a linked data string CDS according to an embodiment of the present invention. The linked data string CDS in FIG. 3a is substantially the same as the linked data string CDS in FIG. 3, but for ease of description, the linked data string CDS in FIG. 3a shows the data section SEC of a continuous data set DS. As shown in FIG. 3a, in this embodiment, the security protocol device 100 can also read the data set DS of any data section SEC of the linked data string CDS, and perform data set DS of the last data section SEC of the data section SEC. verification. For example, when the security protocol device 100 receives a read request RR, the read request RR is a request to read a total of eleven roots RH x-10 to RH x of the data section SEC of the link data string CDS as shown in FIG. 3 The hash value RH, where x is less than k and greater than or equal to 10, the reading unit 130 reads the root hash value RH and link of the last data set DS of the data set DS of the data segment SEC from the blockchain device 300 The hash value CH (ie RH x and CH x ), and the reading unit 130 will read from the database device 200 the root hash value RH of the previous data set DS of the data segment SEC (ie RH x-10 to RH x-1 ), and the verification unit 120 will use the RH x of the last data set DS of the data section SEC to verify the RH x-10 to the previous data set DS of the data section SEC of the database device 200 The correctness of RH x-1.

在一些實施例中,初始鏈接值CH0 可不儲存於資料庫裝置200中。取而代之地,當安全協定裝置100接收讀取要求RR,讀取單元130會自區塊鏈裝置300讀取鏈接資料串CDS的初始鏈接值CH0 以及該些資料集合DS在後者的資料集合DS的根雜湊值RH,並自資料庫裝置200讀取鏈接資料串CDS的該些資料集合DS在前者的一或多個根雜湊值RH。In some embodiments, the initial link value CH 0 may not be stored in the database device 200. Instead, when the security protocol device 100 receives the read request RR, the reading unit 130 will read the initial link value CH 0 of the link data string CDS from the blockchain device 300 and the data set DS in the latter data set DS. Root hash value RH, and read from the database device 200 one or more root hash values RH of the data sets DS of the link data string CDS in the former.

請參照圖4,圖4為本發明另一實施例的驗證系統10a的方塊示意圖。圖1與圖4的驗證系統10、10a相同或相似的元件、連接關係與功能不再贅述,圖4的驗證系統10a相較於圖1的驗證系統10的差異之一在於,圖4的驗證系統10a的安全協定裝置100更包括鏈接處理單元140,而區塊鏈裝置300則不具有鏈接處理單元。在安全協定裝置100的二元樹處理單元110產生多個二元樹BT之後,安全協定裝置100的鏈接處理單元140會根據這些二元樹BT的多個根雜湊值RH依序產生資料集合DS,並根據前述兩個公式產生鏈接資料串CDS,而安全協定裝置100會將鏈接資料串CDS傳送至區塊鏈裝置300。也就是說,安全協定裝置100傳送至區塊鏈BC的資料已是具有鏈接資料串CDS的資料結構。Please refer to FIG. 4, which is a block diagram of a verification system 10a according to another embodiment of the present invention. The same or similar components, connection relationships and functions of the verification systems 10 and 10a in FIG. 1 and FIG. 4 will not be repeated. One of the differences between the verification system 10a in FIG. 4 and the verification system 10 in FIG. 1 is that the verification in FIG. 4 The security protocol device 100 of the system 10a further includes a link processing unit 140, while the blockchain device 300 does not have a link processing unit. After the binary tree processing unit 110 of the security protocol device 100 generates multiple binary trees BT, the link processing unit 140 of the security protocol device 100 sequentially generates a data set DS according to the multiple root hash values RH of the binary trees BT. , And generate the link data string CDS according to the aforementioned two formulas, and the security protocol device 100 transmits the link data string CDS to the blockchain device 300. In other words, the data sent by the security protocol device 100 to the blockchain BC already has a data structure with a link data string CDS.

請參照圖5,圖5為本發明又一實施例的驗證系統10b的方塊示意圖。圖1與圖5的驗證系統10、10b相同或相似的元件、連接關係與功能不再贅述,圖5的驗證系統10b相較於圖1的驗證系統10的差異之一在於,圖5的驗證系統10b包括安全協定裝置100、資料庫裝置200、區塊鏈裝置300與多個終端裝置400,安全協定裝置100通訊連接位於區塊鏈BC的區塊鏈裝置300並在鏈下OC通訊連接資料庫裝置200與各終端裝置400,且各終端裝置400還通訊連接區塊鏈裝置300。安全協定裝置100包括二元樹處理單元110、驗證單元120、讀取單元130、識別編號單元150、定位搜尋單元160、切片單元170與識別序號單元180,其中二元樹處理單元110、驗證單元120、讀取單元130、識別編號單元150、定位搜尋單元160、切片單元170與識別序號單元180例如但不限於是軟體/硬體所構成的功能模組,以分別執行特定功能,且二元樹處理單元110、驗證單元120、讀取單元130、識別編號單元150、定位搜尋單元160、切片單元170與識別序號單元180可以是各自獨立的模組或整合為一體的模組。Please refer to FIG. 5, which is a block diagram of a verification system 10b according to another embodiment of the present invention. The same or similar components, connection relationships and functions of the verification systems 10 and 10b in FIG. 1 and FIG. 5 will not be repeated. One of the differences between the verification system 10b in FIG. 5 and the verification system 10 in FIG. 1 is that the verification in FIG. 5 The system 10b includes a security protocol device 100, a database device 200, a blockchain device 300, and a plurality of terminal devices 400. The security protocol device 100 is communicatively connected to the blockchain device 300 located in the blockchain BC and is connected to the data in the off-chain OC. The library device 200 is connected to each terminal device 400, and each terminal device 400 is also communicatively connected to the blockchain device 300. The security protocol device 100 includes a binary tree processing unit 110, a verification unit 120, a reading unit 130, an identification number unit 150, a positioning search unit 160, a slicing unit 170, and an identification number unit 180, wherein the binary tree processing unit 110, the verification unit 120. The reading unit 130, the identification number unit 150, the positioning search unit 160, the slicing unit 170, and the identification number unit 180 are, for example, but not limited to, functional modules composed of software/hardware to perform specific functions respectively, and are binary The tree processing unit 110, the verification unit 120, the reading unit 130, the identification number unit 150, the positioning search unit 160, the slicing unit 170, and the identification number unit 180 may be independent modules or integrated modules.

如圖5所示,在本實施例中,區塊鏈裝置300包括至少一個智能合約(smart contract)310,安全協定裝置100傳送至區塊鏈裝置300的根雜湊值RH會儲存在對應的智能合約310中。在不同實施例中,區塊鏈裝置300亦可包括不同於智能合約的程式架構或介面,而根雜湊值RH可對應於不同的程式架構或介面而儲存在區塊鏈裝置300中。As shown in FIG. 5, in this embodiment, the blockchain device 300 includes at least one smart contract (smart contract) 310, and the root hash value RH transmitted by the security protocol device 100 to the blockchain device 300 is stored in the corresponding smart contract. Contract 310. In different embodiments, the blockchain device 300 may also include a program structure or interface different from a smart contract, and the root hash value RH may be stored in the blockchain device 300 corresponding to a different program structure or interface.

如圖5所示,在本實施例中,各終端裝置400包括紀錄資料產生單元410、識別資料產生單元420與切片驗證單元430。紀錄資料產生單元410、識別資料產生單元420與切片驗證單元430例如但不限於是軟體/硬體所構成的功能模組,以分別執行特定功能,且紀錄資料產生單元410、識別資料產生單元420與切片驗證單元430可以是各自獨立的模組或整合為一體的模組。紀錄資料產生單元410用以產生前述的紀錄資料RD,並且,當各終端裝置400的紀錄資料產生單元410產生紀錄資料RD時,各終端裝置400的識別資料產生單元420還會產生分別對應於各紀錄資料RD的多個識別資料ID,使得各紀錄資料RD會具有對應的識別資料ID。終端裝置400會將紀錄資料RD與對應的識別資料ID同時傳送給安全協定裝置100。在一些實施例中,終端裝置400可將紀錄資料RD與對應的識別資料ID整合為同一筆整合資料並傳送此筆整合資料至安全協定裝置100。在一些實施例中,識別資料ID為明碼。As shown in FIG. 5, in this embodiment, each terminal device 400 includes a record data generating unit 410, an identification data generating unit 420, and a slice verification unit 430. The record data generation unit 410, the identification data generation unit 420, and the slice verification unit 430 are, for example, but not limited to, functional modules composed of software/hardware to perform specific functions, and the record data generation unit 410 and the identification data generation unit 420 The slice verification unit 430 may be separate modules or an integrated module. The record data generating unit 410 is used to generate the aforementioned record data RD, and when the record data generating unit 410 of each terminal device 400 generates the record data RD, the identification data generating unit 420 of each terminal device 400 also generates the identification data corresponding to each The multiple identification data IDs of the record data RD, so that each record data RD has a corresponding identification data ID. The terminal device 400 transmits the record data RD and the corresponding identification data ID to the security protocol device 100 at the same time. In some embodiments, the terminal device 400 can integrate the record data RD and the corresponding identification data ID into the same integrated data and send the integrated data to the security protocol device 100. In some embodiments, the identification data ID is a clear code.

如圖5所示,在本實施例中,安全協定裝置100會接收該些紀錄資料RD與該些對應的識別資料ID,且安全協定裝置100根據各識別資料ID儲存各紀錄資料RD的雜湊值RDH至對應的各葉節點LN。舉例來說,當安全協定裝置100接收該些識別資料ID之後,安全協定裝置100的識別編號單元150會根據各識別資料ID產生分別對應於各葉節點LN的多個識別編號IN,且安全協定裝置100會根據各識別編號IN儲存各紀錄資料RD的雜湊值RDH至對應的各葉節點LN。在此情況下,每個識別編號IN在任一二元樹BT中是唯一的,且各識別編號IN會分別對應二元樹BT中的各葉節點LN。因此,各紀錄資料RD的雜湊值RDH可藉由對應的識別編號IN而被定位於各葉節點LN,容後詳述。As shown in FIG. 5, in this embodiment, the security protocol device 100 receives the record data RD and the corresponding identification data IDs, and the security protocol device 100 stores the hash value of each record data RD according to the identification data IDs. RDH to the corresponding leaf node LN. For example, after the security protocol device 100 receives the identification data IDs, the identification number unit 150 of the security protocol device 100 generates a plurality of identification numbers IN corresponding to each leaf node LN according to the identification data IDs, and the security protocol The device 100 stores the hash value RDH of each record data RD to each corresponding leaf node LN according to each identification number IN. In this case, each identification number IN is unique in any binary tree BT, and each identification number IN corresponds to each leaf node LN in the binary tree BT. Therefore, the hash value RDH of each record data RD can be located at each leaf node LN by the corresponding identification number IN, which will be described in detail later.

在本實施例中,安全協定裝置100的識別編號單元150會自各識別資料ID的雜湊值中取出多個預定位元以產生各識別編號IN。並且,所述預定位元的數量可關聯於對應的二元樹BT的高度值H。在二元樹BT具有高度值H的情況下,二元樹BT會具有2(H-1) 個葉節點LN。為使此二元樹BT的各葉節點LN具有對應且專屬唯一的識別編號IN,則該些預定位元是自各識別資料ID的雜湊值取出的至少H-1個位元,如此一來,這H-1個位元的排列組合將可滿足葉節點LN的數量,使得對應於葉節點LN的識別編號IN不會重複而具有唯一性。在本實施例中,這H-1個位元例如但不限於是識別資料ID的雜湊值中的前H-1個位元。在其他實施例中,所述H-1個位元可以是取自識別資料ID的雜湊值中的後H-1個位元或任意位置的H-1個位元。In this embodiment, the identification number unit 150 of the security protocol device 100 extracts a plurality of predetermined bits from the hash value of each identification data ID to generate each identification number IN. And, the number of the predetermined bits may be associated with the height value H of the corresponding binary tree BT. In the case where the binary tree BT has a height value H, the binary tree BT will have 2 (H-1) leaf nodes LN. In order to make each leaf node LN of the binary tree BT have a corresponding and exclusive unique identification number IN, the predetermined bits are at least H-1 bits taken from the hash value of each identification data ID. In this way, The permutation and combination of these H-1 bits can satisfy the number of leaf nodes LN, so that the identification number IN corresponding to the leaf node LN will not be repeated but unique. In this embodiment, the H-1 bits are, for example, but not limited to, the first H-1 bits in the hash value of the identification data ID. In other embodiments, the H-1 bits may be the last H-1 bits or H-1 bits at any position in the hash value of the identification data ID.

舉例來說,圖2的二元樹BT的高度值H為5,且此二元樹BT具有2(5-1) 個葉節點LN,亦即二元樹BT具有16個葉節點LN。假設對應於某一紀錄資料RD的識別資料ID為「E1534391」,則識別編號單元150會將此識別資料ID以SHA-256的雜湊函數進行雜湊化,而產生雜湊值「dbb9ed8b677468b4834d2f634a77ea1e6663431bf1ee7523041467ff8023fa64」,接著識別編號單元150會取出此雜湊值轉換為二進位後的位元數列的前4個位元「1101」,並轉換1101為十進位值「13」,從而產生識別編號IN為「13」。識別編號單元150可將此二元樹BT的所有16個葉節點LN依序設定為編號1至16的葉節點LN,而識別編號IN為13的紀錄資料RD的雜湊值RDH則儲存於編號13的葉節點LN中。在一些實施例中,不同的識別資料ID可能產生相同的識別編號IN,或者不同的紀錄資料RD可能具有相同的識別資料ID而產生相同的識別編號IN,在此情況下,多筆紀錄資料RD的雜湊值RDH可對應於相同的識別編號IN而儲存於相同的葉節點LN中。在一些實施例中,二元樹BT的每一葉節點LN可儲存兩筆以上的紀錄資料RD的雜湊值RDH,且對應於某一葉節點LN的兩筆以上的紀錄資料RD的雜湊值RDH會被連接後再被雜湊化而產生雜湊值,此對應於兩筆以上的紀錄資料RD的雜湊值會儲存於此葉節點LN中。For example, the height value H of the binary tree BT in FIG. 2 is 5, and the binary tree BT has 2 (5-1) leaf nodes LN, that is, the binary tree BT has 16 leaf nodes LN. Assuming that the identification data ID corresponding to a certain record data RD is "E1534391", the identification number unit 150 will hash the identification data ID with the hash function of SHA-256 to generate the hash value "dbb9ed8b677468b4834d2f634a77ea1e6663431bf1ee7523041467ff8023fa64", and then the identification number The unit 150 takes out the first 4 bits "1101" of the bit array after the hash value is converted into a binary number, and converts 1101 to a decimal value "13", thereby generating the identification number IN as "13". The identification number unit 150 can sequentially set all 16 leaf nodes LN of the binary tree BT as leaf nodes LN numbered 1 to 16, and the hash value RDH of the record data RD with the identification number IN of 13 is stored in number 13. The leaf node LN. In some embodiments, different identification data IDs may generate the same identification number IN, or different record data RD may have the same identification data ID and generate the same identification number IN. In this case, multiple records RD The hash value RDH corresponding to the same identification number IN can be stored in the same leaf node LN. In some embodiments, each leaf node LN of the binary tree BT can store the hash value RDH of more than two record data RD, and the hash value RDH of the two or more record data RD corresponding to a certain leaf node LN will be After the connection, it is hashed to generate a hash value, and the hash value corresponding to two or more record data RD will be stored in this leaf node LN.

如圖5所示,在本實施例中,安全協定裝置100的定位搜尋單元160可藉由識別編號IN而能定位紀錄資料RD的雜湊值RDH。當使用者需要尋找或驗證資料庫裝置200中的對應於某一二元樹BT中的某一筆紀錄資料RD的雜湊值RDH時,使用者可透過安全協定裝置100進行上述作業。此時,安全協定裝置100的定位搜尋單元160會透過識別編號IN以定位此筆紀錄資料RD的雜湊值RDH的位置(即所儲存的葉節點LN),並直接由對應於此識別編號IN的二元樹BT的葉節點LN中取出此筆紀錄資料RD的雜湊值RDH,達到可快速定位與搜尋資料的目的。並且,若要驗證某筆紀錄資料RD不存在,亦可藉由識別編號IN來完成,安全協定裝置100無須取得完整的二元樹BT中的所有雜湊值,安全協定裝置100的定位搜尋單元160可透過對應於此筆紀錄資料RD的識別編號IN以定位此筆紀錄資料RD的雜湊值RDH的位置,即對應的葉節點LN,並可直接確認此紀錄資料RD的雜湊值RDH是否存在於此葉節點LN中。若此葉節點LN沒有此筆紀錄資料RD的雜湊值RDH,即可驗證此筆紀錄資料RD不存在。如此一來,整個驗證作業所耗費的網路傳輸需求、運算量、運算時間與運算成本可大幅降低。As shown in FIG. 5, in this embodiment, the location search unit 160 of the security protocol device 100 can locate the hash value RDH of the record data RD by the identification number IN. When the user needs to find or verify the hash value RDH corresponding to a record data RD in a binary tree BT in the database device 200, the user can perform the above operations through the security protocol device 100. At this time, the location search unit 160 of the security protocol device 100 uses the identification number IN to locate the location of the hash value RDH of the record data RD (that is, the stored leaf node LN), and directly determines the location of the hash value RDH corresponding to the identification number IN. The hash value RDH of this record data RD is extracted from the leaf node LN of the binary tree BT, so as to achieve the purpose of quickly locating and searching data. Moreover, to verify that a certain record data RD does not exist, it can also be completed by the identification number IN. The security protocol device 100 does not need to obtain all the hash values in the complete binary tree BT. The location search unit 160 of the security protocol device 100 The identification number IN corresponding to this record data RD can be used to locate the location of the hash value RDH of this record data RD, that is, the corresponding leaf node LN, and it can be directly confirmed whether the hash value RDH of this record data RD exists here Leaf node LN. If the leaf node LN does not have the hash value RDH of the record data RD, it can be verified that the record data RD does not exist. In this way, the network transmission requirements, calculation amount, calculation time, and calculation cost of the entire verification operation can be greatly reduced.

如前所述,在一些實施例中,不同的紀錄資料RD的識別資料ID可能產生相同的識別編號IN,在此情況下,某一筆紀錄資料RD的雜湊值RDH可能被定位至兩個以上的葉節點LN,若需要驗證此筆紀錄資料RD,安全協定裝置100可由資料庫裝置200取得此兩個以上的葉節點LN中的雜湊值RDH並進行驗證。在本實施例中,重複的識別編號IN的機率相對低,即使某一筆紀錄資料RD的雜湊值RDH被定位至兩個以上的葉節點LN,這些被定位的葉節點LN的數量仍是小於或遠小於所有葉節點LN的數量,整個驗證作業所耗費的網路傳輸需求、運算量、運算時間與運算成本仍可大幅降低。As mentioned above, in some embodiments, the identification data ID of different record data RD may generate the same identification number IN. In this case, the hash value RDH of a certain record data RD may be located to two or more If the leaf node LN needs to verify the record data RD, the security protocol device 100 can obtain the hash value RDH in the two or more leaf nodes LN from the database device 200 and verify it. In this embodiment, the probability of the repeated identification number IN is relatively low. Even if the hash value RDH of a certain record data RD is located at more than two leaf nodes LN, the number of these located leaf nodes LN is still less than or It is much smaller than the number of all leaf nodes LN, and the network transmission requirements, calculation amount, calculation time and calculation cost of the entire verification operation can still be greatly reduced.

如圖5所示,在本實施例中,終端裝置400更包括識別編號單元440,終端裝置400的識別編號單元440與安全協定裝置100的識別編號單元150具有相同的功能,識別編號單元440亦可根據紀錄資料RD的識別資料ID而產生識別編號IN,且終端裝置400可透過識別編號單元440驗證安全協定裝置100是否從正確的葉節點LN取得資料。舉例來說,若終端裝置400需要驗證某一紀錄資料RD,且此紀錄資料RD的識別資料ID為「E1534391」(請參照前述例子),當終端裝置400傳送此驗證要求至安全協定裝置100,安全協定裝置100的定位搜尋單元160可透過對應於此筆紀錄資料RD的識別編號IN以定位此筆紀錄資料RD的雜湊值RDH的位置,並找出其是位於資料庫裝置200中的二元樹BT的編號13的葉節點LN中,且回傳編號13的葉節點LN中的雜湊值RDH至終端裝置400,以讓終端裝置400進行驗證。終端裝置400的識別編號單元440同樣可根據此紀錄資料RD的識別資料ID為「E1534391」而產生識別編號IN,並根據識別編號IN可推算此紀錄資料RD的雜湊值RDH應是儲存於編號13的葉節點LN中,藉此,終端裝置400可確認安全協定裝置100所回傳的紀錄資料RD的雜湊值RDH是否來自於正確的位置(即編號13的葉節點LN)。As shown in FIG. 5, in this embodiment, the terminal device 400 further includes an identification number unit 440. The identification number unit 440 of the terminal device 400 has the same function as the identification number unit 150 of the security protocol device 100, and the identification number unit 440 also The identification number IN can be generated according to the identification data ID of the record data RD, and the terminal device 400 can verify through the identification number unit 440 whether the security protocol device 100 obtains data from the correct leaf node LN. For example, if the terminal device 400 needs to verify a certain record data RD, and the identification data ID of the record data RD is "E1534391" (please refer to the aforementioned example), when the terminal device 400 sends the verification request to the security protocol device 100, The location search unit 160 of the security protocol device 100 can locate the location of the hash value RDH of the record data RD through the identification number IN corresponding to the record data RD, and find out that it is a binary in the database device 200 In the leaf node LN numbered 13 of the tree BT, and the hash value RDH in the leaf node LN numbered 13 is returned to the terminal device 400 for the terminal device 400 to verify. The identification number unit 440 of the terminal device 400 can also generate an identification number IN based on the identification data ID of the record data RD being "E1534391", and according to the identification number IN, the hash value RDH of this record data RD can be stored in number 13 In the leaf node LN, the terminal device 400 can confirm whether the hash value RDH of the record data RD returned by the security protocol device 100 comes from the correct location (ie, the leaf node LN numbered 13).

請再參照圖6,圖6為本發明一實施例的二元樹BT的切片BTS的示意圖。如圖5與圖6所示,在本實施例中,當安全協定裝置100傳送二元樹BT的根雜湊值RH至區塊鏈裝置300時,安全協定裝置100的切片單元170會自動切割二元樹BT為多個切片(slice)BTS且回傳各切片BTS至對應的各終端裝置400,而各終端裝置400的切片驗證單元430會驗證所接收的各切片BTS的正確性。如圖2與圖6所示,在本實施例中,每一切片BTS為二元樹BT的樹根R、對應的兩個葉節點LN與必要的中間節點MN所組成的模克證明(Merkle proof)。此組葉節點LN中儲存的紀錄資料RD的雜湊值RDH,可經由前述的運算過程,而得到位於樹根R的根雜湊值RH,而切片BTS的根雜湊值RH應與完整二元樹BT的根雜湊值RH一致。舉例來說,某一終端裝置400將某一筆紀錄資料RD與識別資料ID傳送至安全協定裝置100後,安全協定裝置100會將此紀錄資料RD的雜湊值RDH儲存至某一二元樹BT的某一葉節點LN中且會回傳此葉節點LN所對應的切片BTS至此終端裝置400,而此終端裝置400會比對此切片BTS的葉節點LN中的此筆紀錄資料RD的雜湊值RDH與此終端裝置400所產生的原始紀錄資料RD的原始雜湊值RDH是否一致,若一致則表示驗證正確,若不一致則表示驗證不正確。若驗證不正確,對應的終端裝置400可傳送一抗議訊息至區塊鏈裝置300,以進行後續資料修正或無效等程序。Please refer to FIG. 6 again, which is a schematic diagram of a slice BTS of a binary tree BT according to an embodiment of the present invention. As shown in FIGS. 5 and 6, in this embodiment, when the security protocol device 100 transmits the root hash value RH of the binary tree BT to the blockchain device 300, the slicing unit 170 of the security protocol device 100 will automatically cut two The metatree BT is a plurality of slice BTSs and each slice BTS is returned to each corresponding terminal device 400, and the slice verification unit 430 of each terminal device 400 verifies the correctness of each slice BTS received. As shown in Figures 2 and 6, in this embodiment, each slice BTS is a modular proof (Merkle proof) composed of the root R of the binary tree BT, the corresponding two leaf nodes LN, and the necessary intermediate node MN. proof). The hash value RDH of the record data RD stored in this group of leaf nodes LN can be obtained through the aforementioned calculation process to obtain the root hash value RH at the root R of the tree, and the root hash value RH of the slice BTS should be the same as the complete binary tree BT The root hash value RH is the same. For example, after a terminal device 400 sends a record data RD and identification data ID to the security protocol device 100, the security protocol device 100 stores the hash value RDH of the record data RD in a binary tree BT A certain leaf node LN will return the slice BTS corresponding to this leaf node LN to this terminal device 400, and this terminal device 400 will compare the hash value RDH of the record data RD in the leaf node LN of this slice BTS with Whether the original hash value RDH of the original record data RD generated by the terminal device 400 is consistent, if they are consistent, the verification is correct, and if they are inconsistent, the verification is incorrect. If the verification is incorrect, the corresponding terminal device 400 can send a protest message to the blockchain device 300 for subsequent data correction or invalidation procedures.

在本實施例中,各終端裝置400包括區塊鏈晶片,所述區塊鏈晶片例如但不限於是可自動在區塊鏈BC與驗證系統10、10b之間互相傳送訊號的積體電路(IC)。藉由區塊鏈晶片,終端裝置400可設計得更加輕薄短小,且終端裝置400可更容易設置於任何物件上或整合至任何電子裝置中。舉例來說,終端裝置400可設置或整合至電池(如電動或油電混合的公車或汽車用的大電池組)、電錶、汽車大燈、汽車本體(如透過5G聯網的汽車的行車電腦)或畫框,且終端裝置400會自動且持續上傳各物件的紀錄資料RD,這些紀錄資料RD例如但不限於是電池、電錶或汽車大燈的每時或每日(依據上傳預定間隔而定)歷史使用狀況,或汽車本體各感測器資訊(如引擎、里程表、啟動次數…等)的每時或每日的歷史感測資料,或畫框上的感測器所感測的每時或每日的濕溼度變化歷史感測資料與畫者原始資料等,而安全協定裝置100可將這些紀錄資料RD的雜湊值RDH儲存至鏈下OC的資料庫裝置200,並將根雜湊值RH上傳至區塊鏈裝置300。In this embodiment, each terminal device 400 includes a blockchain chip. The blockchain chip is, for example, but not limited to, an integrated circuit that can automatically transmit signals between the blockchain BC and the verification system 10, 10b ( IC). With the blockchain chip, the terminal device 400 can be designed to be lighter, thinner, shorter and smaller, and the terminal device 400 can be more easily installed on any object or integrated into any electronic device. For example, the terminal device 400 can be installed or integrated into batteries (such as electric or hybrid buses or large battery packs for automobiles), electric meters, car headlights, and car bodies (such as the trip computer of a car connected via 5G) Or picture frames, and the terminal device 400 will automatically and continuously upload the record data RD of each object, such as but not limited to the battery, electric meter or car headlight hourly or daily (depending on the upload interval) Historical usage, or hourly or daily historical sensing data of various sensor information of the car body (such as engine, odometer, number of starts... etc.), or hourly or daily sensed by the sensor on the picture frame Daily humidity and humidity change historical sensing data and original artist data, etc., and the security protocol device 100 can store the hash value RDH of the record data RD to the database device 200 of the off-chain OC, and upload the root hash value RH To the blockchain device 300.

基於驗證系統10、10a、10b,除了可藉由鏈下OC的資料庫裝置200來達到各種資料的快速定位與搜尋之外,也可藉由區塊鏈BC的驗證來達到資料的不可否認性。且基於終端裝置400的搭配應用,物件的狀況可獲得保證,而物件的價值也得以提高。例如原本長程車用的中古大電池組在使用一定程度後可轉給短程車用,而短程車用的中古大電池組在使用一定程度後又可轉給諸如漁塭等場所作為備用發電電池。而這之間每一次轉換都可經過諸如中古買賣平台進行交易,而每次交易都可藉由驗證系統10、10a、10b來驗證物件的狀況,從而提高物件品質的信賴度與物件價值。Based on the verification systems 10, 10a, and 10b, in addition to quickly locating and searching various data through the off-chain OC database device 200, the non-repudiation of the data can also be achieved through the verification of the blockchain BC . And based on the matching application of the terminal device 400, the condition of the object can be guaranteed, and the value of the object can be increased. For example, the old large battery packs originally used for long-distance vehicles can be transferred to short-range vehicles after a certain level of use, while the large secondary battery packs used for short-distance vehicles can be transferred to places such as Yuyuan and other places as backup power generation batteries after a certain level of use. And each conversion between these can be traded through a trading platform such as the Middle Ages, and each transaction can be verified by the verification system 10, 10a, 10b to verify the condition of the object, thereby improving the reliability of the quality of the object and the value of the object.

如圖5所示,在本實施例中,區塊鏈裝置300的智能合約310更包括鏈接處理單元311與累計序號單元312。安全協定裝置100的識別序號單元180用以產生識別序號IS,區塊鏈裝置300的累計序號單元312用以產生累計序號AS,而鏈接處理單元311用以產生鏈接資料串CDS。As shown in FIG. 5, in this embodiment, the smart contract 310 of the blockchain device 300 further includes a link processing unit 311 and an accumulating serial number unit 312. The identification serial number unit 180 of the security protocol device 100 is used to generate the identification serial number IS, the cumulative serial number unit 312 of the blockchain device 300 is used to generate the cumulative serial number AS, and the link processing unit 311 is used to generate the link data string CDS.

請參照圖7,圖7為本發明另一實施例的鏈接資料串CDS的示意圖。如圖5與圖7所示,在本實施例中,鏈接資料串CDS的每一筆資料集合DS包括根雜湊值RH、識別序號IS、累計序號AS與鏈接雜湊值CH,每一資料集合DS的鏈接雜湊值CH關聯於前一資料集合DS的根雜湊值RH、識別序號IS、累計序號AS與鏈接雜湊值CH,且該些資料集合DS最前者的鏈接雜湊值CH關聯於初始鏈接值CH0 。在一些實施例中,鏈接資料串CDS的每一筆資料集合DS包括根雜湊值RH、識別序號IS與鏈接雜湊值CH,但不包括累計序號AS,而每一資料集合DS的鏈接雜湊值CH關聯於前一資料集合DS的根雜湊值RH、識別序號IS與鏈接雜湊值CH。在本實施例中,每一資料集合DS的鏈接雜湊值CH為雜湊化前一資料集合DS而產生,且最前的資料集合DS的鏈接雜湊值CH為雜湊化初始鏈接值CH0 而產生。Please refer to FIG. 7. FIG. 7 is a schematic diagram of a link data string CDS according to another embodiment of the present invention. As shown in Figures 5 and 7, in this embodiment, each data set DS of the linked data string CDS includes a root hash value RH, an identification number IS, an accumulated serial number AS, and a link hash value CH. The link hash value CH is related to the root hash value RH of the previous data set DS, the identification number IS, the cumulative serial number AS, and the link hash value CH, and the link hash value CH of the first data set DS is related to the initial link value CH 0 . In some embodiments, each data set DS of the link data string CDS includes the root hash value RH, the identification number IS, and the link hash value CH, but does not include the cumulative serial number AS, and the link hash value CH of each data set DS is associated The root hash value RH, the identification number IS and the link hash value CH of the previous data set DS. In the present embodiment, each data set DS link hash value CH front hash of a data set DS is generated, and the information on the foremost set DS link hash value CH as a hash of the initial chaining value CH 0 is generated.

如圖5與圖7所示,在本實施例中,鏈接資料串CDS的各資料集合DS的識別序號IS分別對應於各根雜湊值RH。當安全協定裝置100傳送該些根雜湊值RH至區塊鏈裝置300,安全協定裝置100還會對應產生並傳送該些識別序號IS至區塊鏈裝置300。舉例來說,識別序號IS包括時間戳記,時間戳記關聯於對應的該根雜湊值RH,當安全協定裝置100在一特定時間點產生某一筆根雜湊值RH時,識別序號單元180會對應於此特定時間點而產生識別序號IS,此識別序號IS即包括對應此特定時間點的時間戳記。換句話說,不同時間點產生的根雜湊值RH必定會對應於不同的識別序號IS,且時間是不斷推進,在後產生的根雜湊值RH的識別序號IS的時間戳記所對應的時間點必定會晚於在前產生的根雜湊值RH的識別序號IS的時間戳記所對應的時間點。相應的,在鏈接資料串CDS中,在後的資料集合DS的識別序號IS的時間戳記所對應的時間點必定會晚於在前的資料集合DS的識別序號IS的時間戳記所對應的時間點。藉此,可加強鏈接資料串CDS的資料集合DS的不可修改性,使鏈接資料串CDS的資料難以被竄改。As shown in FIG. 5 and FIG. 7, in this embodiment, the identification number IS of each data set DS of the linked data string CDS corresponds to each root hash value RH, respectively. When the security protocol device 100 transmits the root hash values RH to the blockchain device 300, the security protocol device 100 will also correspondingly generate and transmit the identification serial numbers IS to the blockchain device 300. For example, the identification number IS includes a time stamp, and the time stamp is associated with the corresponding root hash value RH. When the security protocol device 100 generates a certain root hash value RH at a specific time point, the identification number unit 180 will correspond to this The identification number IS is generated at a specific time point, and the identification number IS includes a time stamp corresponding to the specific time point. In other words, the root hash value RH generated at different time points must correspond to different identification numbers IS, and the time is constantly advancing, the time point corresponding to the time stamp of the identification number IS of the root hash value RH generated later must be It will be later than the time point corresponding to the time stamp of the identification number IS of the previously generated root hash value RH. Correspondingly, in the linked data string CDS, the time point corresponding to the time stamp of the identification number IS of the subsequent data set DS must be later than the time point corresponding to the time stamp of the identification number IS of the previous data set DS . Thereby, the unmodifiable of the data set DS of the linked data string CDS can be strengthened, and the data of the linked data string CDS is difficult to be tampered with.

如圖5與圖7所示,在本實施例中,鏈接資料串CDS的各資料集合DS的累計序號AS分別對應於各根雜湊值RH,且每一資料集合DS的累計序號AS為前一資料集合DS的累計序號AS的累計值。當安全協定裝置100傳送該些根雜湊值RH與該些識別序號IS至區塊鏈裝置300,區塊鏈裝置300的累計序號單元312會對應於該些根雜湊值RH與該些識別序號IS而依序產生該些累計序號AS。舉例來說,當區塊鏈裝置300接收到第一筆根雜湊值RH與對應的識別序號IS,累計序號單元312會產生值為整數1的累計序號AS,而鏈接處理單元311會整合第一筆資料集合DS,其中包括第一筆根雜湊值RH、對應的識別序號IS、值為整數1的累計序號AS與對應的鏈接雜湊值CH。而當安全協定裝置100接收到第二筆根雜湊值RH與對應的識別序號IS,累計序號單元312會累加1至前一筆累計序號AS而產生值為整數2的累計序號AS,而鏈接處理單元311會整合第二筆資料集合DS,其中包括第二筆根雜湊值RH、對應的識別序號IS、值為整數2的累計序號AS與對應的鏈接雜湊值CH。換句話說,累計序號AS是不斷累加的,而在後產生的資料集合DS的累計序號AS必定會大於在前產生的資料集合DS的累計序號AS。並且,累計序號AS是由區塊鏈上的區塊鏈裝置300產生,其具有不可否認性。藉此,可加強鏈接資料串CDS的資料集合DS的不可修改性,使鏈接資料串CDS的資料難以被竄改。As shown in Figures 5 and 7, in this embodiment, the cumulative sequence number AS of each data set DS of the linked data string CDS corresponds to each root hash value RH, and the cumulative sequence number AS of each data set DS is the previous one. The cumulative value of the cumulative serial number AS of the data set DS. When the security protocol device 100 transmits the root hash values RH and the identification serial numbers IS to the blockchain device 300, the cumulative serial number unit 312 of the blockchain device 300 will correspond to the root hash values RH and the identification serial numbers IS The cumulative sequence numbers AS are sequentially generated. For example, when the blockchain device 300 receives the first root hash value RH and the corresponding identification serial number IS, the cumulative serial number unit 312 will generate the cumulative serial number AS whose value is an integer 1, and the link processing unit 311 will integrate the first The data set DS includes the first root hash value RH, the corresponding identification serial number IS, the cumulative serial number AS whose value is an integer 1, and the corresponding link hash value CH. When the security protocol device 100 receives the second root hash value RH and the corresponding identification serial number IS, the cumulative serial number unit 312 will accumulate 1 to the previous cumulative serial number AS to generate the cumulative serial number AS whose value is an integer 2, and the link processing unit 311 will integrate the second data set DS, which includes the second root hash value RH, the corresponding identification serial number IS, the cumulative serial number AS whose value is an integer of 2, and the corresponding link hash value CH. In other words, the cumulative sequence number AS is continuously accumulated, and the cumulative sequence number AS of the data set DS generated later must be greater than the cumulative sequence number AS of the data set DS generated before. Moreover, the cumulative serial number AS is generated by the blockchain device 300 on the blockchain, which is undeniable. Thereby, the unmodifiable of the data set DS of the linked data string CDS can be strengthened, and the data of the linked data string CDS is difficult to be tampered with.

在本實施例中,鏈接處理單元311會根據以下兩個公式產生鏈接資料串CDS中的多個以串列方式鏈接的資料集合DS:In this embodiment, the link processing unit 311 generates multiple serially linked data sets DS in the link data string CDS according to the following two formulas:

CHi =hash(RHi-1 | ISi-1 | i-1 | CHi-1 );以及CH i =hash(RH i-1 | IS i-1 | i-1 | CH i-1 ); and

CH1 =hash(CH0 )。CH 1 =hash(CH 0 ).

其中,RHi-1 為根雜湊值RH,ISi-1 為識別序號IS,i-1為累計序號AS,CHi-1 為鏈接雜湊值CH,且i為2至k的整數。Among them, RH i-1 is the root hash value RH, IS i-1 is the identification serial number IS, i-1 is the cumulative serial number AS, CH i-1 is the link hash value CH, and i is an integer from 2 to k.

如圖7所示,最前的資料集合DS的根雜湊值RH為RH1 、識別序號IS為IS1 、累計序號AS為1而鏈接雜湊值CH為CH1 ,且CH1 為雜湊化CH0 而產生的雜湊值。在後的(排列在最前的資料集合DS後)的第二筆資料集合DS的根雜湊值RH為RH2 、識別序號IS為IS2 、累計序號AS為2而鏈接雜湊值CH為CH2 ,且CH2 為雜湊化連接後的RH1 、IS1 、1與CH1 而產生的雜湊值。在後的(排列第二筆資料集合DS後)的第三筆資料集合DS的根雜湊值RH為RH3 、識別序號IS為IS3 、累計序號AS為3而鏈接雜湊值CH為CH3 ,且CH3 為雜湊化連接後的RH2 、IS2 、2與CH2 而產生的雜湊值。最後的資料集合DS的根雜湊值RH為RHk 、識別序號IS為ISk 、累計序號AS為k而鏈接雜湊值CH為CHk ,且CHk 為雜湊化連接後的RHk-1 、ISk-1 、k-1與CHk-1 而產生的雜湊值。其餘資料集合DS的根雜湊值RH、識別序號IS、累計序號AS與鏈接雜湊值CH則以此類推。並且,這些以串列方式鏈接的資料集合DS組成鏈接資料串CDS。As shown in Figure 7, the root hash value RH of the first data set DS is RH 1 , the identification number IS is IS 1 , the cumulative number AS is 1, and the link hash value CH is CH 1 , and CH 1 is the hash CH 0 and The resulting hash value. The root hash value RH of the second data set DS following (after the first data set DS) is RH 2 , the identification number IS is IS 2 , the cumulative number AS is 2 and the link hash value CH is CH 2 , And CH 2 is the hash value generated by RH 1 , IS 1 , 1 and CH 1 after the hybridization connection. The root hash value RH of the third data set DS following (after arranging the second data set DS) is RH 3 , the identification serial number IS is IS 3 , the cumulative serial number AS is 3, and the link hash value CH is CH 3 , And CH 3 is the hash value generated by hybridizing the connected RH 2 , IS 2 , 2 and CH 2. The root hash value RH of the final data set DS is RH k , the identification serial number IS is IS k , the cumulative serial number AS is k, and the link hash value CH is CH k , and CH k is the RH k-1 and IS after the hash connection The hash value generated by k-1 , k-1 and CH k-1. The root hash value RH, identification serial number IS, cumulative serial number AS, and link hash value CH of the remaining data sets DS can be deduced by analogy. In addition, these data sets DS linked in series form a linked data string CDS.

如圖5與圖7所示,在本實施例中,安全協定裝置100除了會將二元樹BT與初始鏈接值CH0 儲存到資料庫裝置200中,安全協定裝置100也會將對應於各二元樹BT的各根雜湊值RH(或對應於鏈接資料串CDS的各資料集合DS)的識別序號IS與累計序號AS儲存到資料庫裝置200中。當安全協定裝置100接收讀取要求RR,且此讀取要求RR是要求讀取多個根雜湊值RH,而這多個根雜湊值RH屬於某一鏈接資料串CDS的多個資料集合DS,讀取單元130會自區塊鏈裝置300讀取此鏈接資料串CDS的該些資料集合DS在後者的根雜湊值RH,並自資料庫裝置200讀取此鏈接資料串CDS的該些資料集合DS在前者的一或多個根雜湊值RH,且安全協定裝置100以區塊鏈裝置300的在後的資料集合DS的鏈接雜湊值CH驗證資料庫裝置200的在前的一或多個根雜湊值RH的正確性。As shown in FIG. 5 and FIG. 7, in this embodiment, in addition to storing the binary tree BT and the initial link value CH 0 in the database device 200, the security protocol device 100 will also correspond to each The identification serial number IS and the cumulative serial number AS of each root hash value RH of the binary tree BT (or each data set DS corresponding to the link data string CDS) are stored in the database device 200. When the security protocol device 100 receives a read request RR, and the read request RR requires to read multiple root hash values RH, and the multiple root hash values RH belong to multiple data sets DS of a certain linked data string CDS, The reading unit 130 reads the root hash value RH of the data sets DS of the link data string CDS from the blockchain device 300, and reads the data sets of the link data string CDS from the database device 200 DS is at one or more root hash values RH of the former, and the security protocol device 100 uses the link hash value CH of the subsequent data set DS of the blockchain device 300 to verify the previous one or more roots of the database device 200 The correctness of the hash value RH.

舉例來說,當安全協定裝置100接收讀取要求RR,此讀取要求RR是要求讀取如圖7的鏈接資料串CDS的RH1 至RHk 的k個根雜湊值RH,讀取單元130會自區塊鏈裝置300讀取此鏈接資料串CDS的該些資料集合DS最後一筆的資料集合DS的根雜湊值RH與鏈接雜湊值CH(即RHk 與CHk ),並且,讀取單元130會自資料庫裝置200讀取在前的資料集合DS的根雜湊值RH(即RH1 至RHk-1 )、識別序號IS(即IS1 至ISk-1 )與累計序號AS(即1至k-1),並且,驗證單元120會以最後一筆的資料集合DS的RHk 來驗證資料庫裝置200的在前的資料集合DS的RH1 至RHk-1 的正確性。驗證單元120可使用前述兩個公式,並以資料庫裝置200儲存的初始鏈接值CH0 、RH1 至RHk-1 、IS1 至ISk-1 與1至k-1進行雜湊與鏈接運算而推算出CHk ,並以推算出的CHk 來比對區塊鏈裝置300上的CHk 。若推算出的CHk 與區塊鏈裝置300上的CHk 一致,則表示資料庫裝置200儲存的RH1 至RHk-1 與區塊鏈裝置300上的RH1 至RHk-1 也會一致。因為基於雜湊運算,只要資料庫裝置200儲存的RH1 至RHk-1 中任一個根雜湊值RH與區塊鏈裝置300上的RH1 至RHk-1 中的對應根雜湊值RH不一致,則推算出的CHk 就會不同於區塊鏈裝置300上的CHkFor example, when the security protocol device 100 receives a read request RR, the read request RR is a request to read k root hash values RH of RH 1 to RH k of the link data string CDS as shown in FIG. 7, the reading unit 130 The root hash value RH and the link hash value CH (ie RH k and CH k ) of the last data set DS of the data set DS of this link data string CDS will be read from the blockchain device 300, and the reading unit 130 will read from the database device 200 the root hash value RH (ie RH 1 to RH k-1 ), the identification number IS (ie IS 1 to IS k-1 ) and the cumulative sequence number AS (ie 1 to k-1), and the verification unit 120 uses the RH k of the last data set DS to verify the correctness of the RH 1 to RH k-1 of the previous data set DS of the database device 200. The verification unit 120 can use the aforementioned two formulas, and use the initial link values CH 0 , RH 1 to RH k-1 , IS 1 to IS k-1 and 1 to k-1 stored in the database device 200 to perform hashing and linking operations. and calculate CH k, and to calculate the ratio of the CH k CH k to the block chain means 300. If deduced CH k CH k coincides with the block chain means 300, 200 indicates a storage library device RH RH RH k-1 to the apparatus 300 1 and the block chain 1 will RH k-1 Unanimous. Because based on the hash calculation, as long as any one of the root hash values RH among RH 1 to RH k-1 stored in the database device 200 is inconsistent with the corresponding root hash value RH among RH 1 to RH k-1 on the blockchain device 300, Then the calculated CH k will be different from the CH k on the blockchain device 300.

在不同實施例中,驗證系統10、10a與10b中的各元件可任意組合。例如,驗證系統10b可不包括終端裝置400;或者,驗證系統10、10a可包括類似於驗證系統10b的終端裝置400,但不限於此。In different embodiments, the components of the verification systems 10, 10a, and 10b can be combined arbitrarily. For example, the verification system 10b may not include the terminal device 400; or, the verification system 10, 10a may include the terminal device 400 similar to the verification system 10b, but is not limited thereto.

請參照圖8,圖8為本發明一實施例的驗證方法的流程圖。在本實施例中,驗證方法可透過圖1或圖4所示的驗證系統10、10a實現,但不限於此。驗證方法適用於與區塊鏈BC協作。在步驟S101中,安全協定裝置100會在鏈下OC自多個終端裝置400接收多個紀錄資料RD。在步驟S103中,安全協定裝置100會根據雜湊函數整合該些紀錄資料RD為至少一二元樹BT,且各紀錄資料RD的雜湊值RDH分別儲存於二元樹BT的各葉節點LN。在步驟S105中,安全協定裝置100會傳送二元樹BT的根雜湊值RH至區塊鏈BC,且區塊鏈裝置300會儲存這些根雜湊值RH。在步驟S107中,區塊鏈裝置300或安全協定裝置100會根據前述公式產生鏈接資料串CDS。Please refer to FIG. 8, which is a flowchart of a verification method according to an embodiment of the present invention. In this embodiment, the verification method can be implemented through the verification systems 10 and 10a shown in FIG. 1 or FIG. 4, but is not limited to this. The verification method is suitable for collaboration with the blockchain BC. In step S101, the security protocol device 100 receives multiple record data RD from multiple terminal devices 400 in the off-chain OC. In step S103, the security protocol device 100 integrates the record data RD into at least one binary tree BT according to the hash function, and the hash value RDH of each record data RD is stored in each leaf node LN of the binary tree BT. In step S105, the security protocol device 100 will transmit the root hash value RH of the binary tree BT to the blockchain BC, and the blockchain device 300 will store these root hash values RH. In step S107, the blockchain device 300 or the security protocol device 100 generates the link data string CDS according to the aforementioned formula.

在步驟S109中,安全協定裝置100會在鏈下OC儲存二元樹BT與初始鏈接值CH0 ,即安全協定裝置100會將完整的二元樹BT與初始鏈接值CH0 儲存於鏈下OC的資料庫裝置200。在不同實施例中,初始鏈接值CH0 可不儲存於資料庫裝置200中;當有需要時,安全協定裝置100可自區塊鏈裝置300讀取初始鏈接值CH0In step S109, the security protocol device 100 stores the binary tree BT and the initial link value CH 0 in the off-chain OC, that is, the security protocol device 100 stores the complete binary tree BT and the initial link value CH 0 in the off-chain OC的Database device 200. In different embodiments, the initial link value CH 0 may not be stored in the database device 200; when necessary, the security protocol device 100 can read the initial link value CH 0 from the blockchain device 300.

在步驟S111中,當安全協定裝置100接收一驗證要求,安全協定裝置100會比對位於區塊鏈BC上的區塊鏈裝置300中的根雜湊值RH與在鏈下OC的資料庫裝置200中儲存的二元樹BT的根雜湊值RH,以驗證在鏈下OC儲存的二元樹BT的正確性。在步驟S113中,當安全協定裝置100接收讀取要求RR,且此讀取要求RR要求讀取鏈接資料串CDS中的多個資料集合DS的多個根雜湊值RH,安全協定裝置100會讀取區塊鏈BC上的資料集合DS在後者的根雜湊值RH並讀取在鏈下OC儲存的資料集合DS在前者的一或多個根雜湊值RH。在步驟S115中,安全協定裝置100會以區塊鏈BC上的在後的資料集合DS的鏈接雜湊值CH驗證在鏈下OC儲存的在前的一或多個根雜湊值RH的正確性。In step S111, when the security protocol device 100 receives a verification request, the security protocol device 100 compares the root hash value RH in the blockchain device 300 on the blockchain BC with the database device 200 in the off-chain OC. The root hash value RH of the binary tree BT stored in OC is used to verify the correctness of the binary tree BT stored in the off-chain OC. In step S113, when the security protocol device 100 receives a read request RR, and the read request RR requests to read multiple root hash values RH of multiple data sets DS in the link data string CDS, the security protocol device 100 will read Take the root hash value RH of the data set DS on the blockchain BC in the latter and read one or more root hash values RH of the data set DS stored in the off-chain OC in the former. In step S115, the security protocol device 100 uses the link hash value CH of the subsequent data set DS on the blockchain BC to verify the correctness of the previous one or more root hash values RH stored in the off-chain OC.

請參照圖9,圖9為本發明另一實施例的驗證方法的流程圖。在本實施例中,驗證方法可透過圖5所示的驗證系統10b實現,但不限於此。在步驟S201中,安全協定裝置100會在鏈下OC自多個終端裝置400接收多個紀錄資料RD與多個識別資料ID,各識別資料ID是分別對應於各紀錄資料RD。在步驟S203中,當安全協定裝置100接收該些識別資料ID之後,安全協定裝置100會根據各識別資料ID產生分別對應於各葉節點LN的多個識別編號IN,二元樹BT的每一葉節點LN會對應於專屬的識別編號IN。舉例來說,安全協定是自各識別資料ID的雜湊值中取出多個預定位元以產生各識別編號IN,並且,若二元樹BT具有一高度值H,該些預定位元為各識別資料ID的雜湊值的前H-1個位元。在步驟S205中,安全協定裝置100會根據雜湊函數整合該些紀錄資料RD為至少一二元樹BT。在步驟S207中,安全協定裝置100會根據各識別編號IN,儲存各紀錄資料RD的雜湊值RDH至對應的各葉節點LN。在步驟S209中,安全協定裝置100會傳送二元樹BT的根雜湊值RH與對應的識別序號IS至區塊鏈BC,且區塊鏈裝置300會儲存這些根雜湊值RH與對應的識別序號IS。在步驟S211中,安全協定裝置100會將二元樹BT切割為多個切片BTS。在步驟S213中,安全協定裝置100會在鏈下OC回傳各切片BTS至對應的各終端裝置400。Please refer to FIG. 9, which is a flowchart of a verification method according to another embodiment of the present invention. In this embodiment, the verification method can be implemented through the verification system 10b shown in FIG. 5, but it is not limited to this. In step S201, the security protocol device 100 receives multiple record data RD and multiple identification data IDs from multiple terminal devices 400 in the off-chain OC, and each identification data ID corresponds to each record data RD. In step S203, after the security protocol device 100 receives the identification data IDs, the security protocol device 100 generates a plurality of identification numbers IN corresponding to each leaf node LN according to each identification data ID, and each leaf of the binary tree BT The node LN will correspond to the unique identification number IN. For example, the security protocol is to extract multiple predetermined bits from the hash value of each identification data ID to generate each identification number IN, and if the binary tree BT has a height value H, these predetermined bits are the identification data The first H-1 bits of the hash value of the ID. In step S205, the security protocol device 100 integrates the record data RD into at least one binary tree BT according to the hash function. In step S207, the security protocol device 100 stores the hash value RDH of each record data RD to each corresponding leaf node LN according to each identification number IN. In step S209, the security protocol device 100 will transmit the root hash value RH of the binary tree BT and the corresponding identification number IS to the blockchain BC, and the blockchain device 300 will store the root hash value RH and the corresponding identification number. IS. In step S211, the security protocol device 100 cuts the binary tree BT into multiple slice BTSs. In step S213, the security protocol device 100 will return each slice BTS to the corresponding terminal device 400 in the off-chain OC.

接著,各終端裝置400會驗證所接收的各切片BTS的正確性。在步驟S215中,當切片BTS驗證為不正確,對應的終端裝置400傳送抗議訊息至區塊鏈BC。在步驟S217中,當切片BTS驗證為正確,終端裝置400無需傳送抗議訊息至區塊鏈BC。Next, each terminal device 400 verifies the correctness of each slice BTS received. In step S215, when the slice BTS verification is incorrect, the corresponding terminal device 400 sends a protest message to the blockchain BC. In step S217, when the slice BTS is verified to be correct, the terminal device 400 does not need to send a protest message to the blockchain BC.

在步驟S219中,區塊鏈BC的區塊鏈裝置300對應於根雜湊值RH與識別序號IS,而依序產生累計序號AS。在步驟S221中,區塊鏈BC的區塊鏈裝置300會根據根雜湊值RH、識別序號IS與累計序號AS而產生鏈接資料串CDS。在步驟S223中,安全協定裝置100會在鏈下OC將二元樹BT、初始鏈接值CH0 、識別序號IS與累計序號AS儲存至資料庫裝置200。In step S219, the blockchain device 300 of the blockchain BC corresponds to the root hash value RH and the identification serial number IS, and sequentially generates the cumulative serial number AS. In step S221, the blockchain device 300 of the blockchain BC generates the link data string CDS according to the root hash value RH, the identification serial number IS, and the cumulative serial number AS. In step S223, the security protocol device 100 stores the binary tree BT, the initial link value CH 0 , the identification serial number IS, and the cumulative serial number AS to the database device 200 in the off-chain OC.

在步驟S225中,當安全協定裝置100接收一驗證要求,安全協定裝置100會比對位於區塊鏈BC上的區塊鏈裝置300中的根雜湊值RH與在鏈下OC的資料庫裝置200中儲存的二元樹BT的根雜湊值RH,以驗證在鏈下OC儲存的二元樹BT的正確性。在步驟S227中,當安全協定裝置100接收一搜尋要求,且此搜尋要求是針對某一紀錄資料RD,安全協定裝置100會根據對應此紀錄資料RD的識別編號IN而定位在鏈下OC儲存的二元樹BT的葉節點LN,以搜尋對應於此識別編號IN的葉節點LN並由此葉節點LN取得此紀錄資料RD的雜湊值RDH,或驗證此紀錄資料RD的雜湊值RDH不存在此葉節點LN中。In step S225, when the security protocol device 100 receives a verification request, the security protocol device 100 compares the root hash value RH in the blockchain device 300 on the blockchain BC with the database device 200 in the off-chain OC. The root hash value RH of the binary tree BT stored in OC is used to verify the correctness of the binary tree BT stored in the off-chain OC. In step S227, when the security protocol device 100 receives a search request, and the search request is for a certain record data RD, the security protocol device 100 locates the OC storage under the chain according to the identification number IN corresponding to the record data RD The leaf node LN of the binary tree BT to search for the leaf node LN corresponding to the identification number IN and obtain the hash value RDH of the record data RD from the leaf node LN, or verify that the hash value RDH of the record data RD does not exist. Leaf node LN.

在步驟S229中,當安全協定裝置100接收讀取要求RR,且此讀取要求RR要求讀取鏈接資料串CDS中的多個資料集合DS的多個根雜湊值RH,安全協定裝置100會讀取區塊鏈BC上的資料集合DS在後者的根雜湊值RH並讀取在鏈下OC儲存的資料集合DS在前者的一或多個根雜湊值RH。在步驟S231中,安全協定裝置100會以區塊鏈BC上的在後的資料集合DS的鏈接雜湊值CH驗證在鏈下OC儲存的在前的一或多個根雜湊值RH的正確性。In step S229, when the security protocol device 100 receives a read request RR, and the read request RR requests to read multiple root hash values RH of multiple data sets DS in the link data string CDS, the security protocol device 100 will read Take the root hash value RH of the data set DS on the blockchain BC in the latter and read one or more root hash values RH of the data set DS stored in the off-chain OC in the former. In step S231, the security protocol device 100 uses the link hash value CH of the subsequent data set DS on the blockchain BC to verify the correctness of the previous one or more root hash values RH stored in the off-chain OC.

藉由驗證系統10、10a與10b,在有需要讀取大量資料時,可在基於鏈接資料串CDS的架構下,由鏈下OC讀取相對大量的資料,而僅需由區塊鏈BC讀取相對少量的資料,並以區塊鏈BC的資料來驗證鏈下OC的資料,從而可兼顧效率與可信度。舉例來說,一個公司中,各員工的每日上下班打卡紀錄的雜湊值會對應儲存在二元樹BT中的各葉節點LN中,且每一二元樹BT即是此間公司的所有員工單日上下斑打卡紀錄。那麼,所有員工一整年的打卡紀錄會累積成數百筆資料,即數百個二元樹BT,而這些資料都會基於驗證系統10、10a或10b加以儲存與運用。如果有一天,此公司的內控部門需要調出某位員工數年來的打卡紀錄,驗證系統10、10a或10b不需要對區塊鏈BC進行大量讀取,只須讀取區塊鏈BC上的每個鏈接資料串CDS的最後一筆資料集合DS的根雜湊值RH與鏈接雜湊值CH,而各鏈接資料串CDS的其餘根雜湊值RH皆可由鏈下OC的資料庫裝置200讀取,並可由區塊鏈BC上的最後一筆資料集合DS的鏈接雜湊值CH來驗證資料庫裝置200的其餘根雜湊值RH的正確性。如此一來,可大幅減輕區塊鏈的網路傳輸需求與運算負荷,同時也可經過驗證而確保鏈下OC資料的正確性。With the verification systems 10, 10a, and 10b, when a large amount of data needs to be read, a relatively large amount of data can be read by the off-chain OC under the structure based on the link data string CDS, and only the blockchain BC can be read Take a relatively small amount of data, and use the data of the blockchain BC to verify the data of the off-chain OC, so that both efficiency and credibility can be taken into account. For example, in a company, the hash value of each employee's daily clock-in record will be correspondingly stored in each leaf node LN in the binary tree BT, and each binary tree BT is all employees of this company Single-day up and down spot clocking records. Then, the check-in records of all employees for a whole year will accumulate into hundreds of data, that is, hundreds of binary tree BT, and these data will be stored and used based on the verification system 10, 10a or 10b. If one day, the company’s internal control department needs to call out the check-in records of an employee for several years, the verification system 10, 10a, or 10b does not need to read a lot of the blockchain BC, just read the information on the blockchain BC The root hash value RH and the link hash value CH of the last data set DS of each link data string CDS, and the remaining root hash values RH of each link data string CDS can be read by the database device 200 of the off-chain OC and can be The link hash value CH of the last data set DS on the blockchain BC is used to verify the correctness of the remaining root hash values RH of the database device 200. In this way, the network transmission demand and computing load of the blockchain can be greatly reduced, and at the same time, the correctness of the off-chain OC data can be ensured through verification.

綜上所述,習知的區塊鏈架構是將資料全部傳送到區塊鏈上,再透過區塊鏈礦工對資料進行驗證,如此將耗費大量的區塊鏈運算資源。根據本發明實施例的驗證系統與方法,在維持資料的可信任度(不可否認性)的前提下,可將大部分資料設置於鏈下資料庫裝置中,並透過安全協定裝置比對鏈下資料庫裝置的二元樹的根雜湊值與區塊鏈的對應根雜湊值,來驗證二元樹的正確性,藉此將主要運算轉為在鏈下執行,大幅減少區塊鏈的負荷。此外,安全協定裝置可根據識別編號定位紀錄資料,藉此可快速搜尋資料庫裝置中的紀錄資料的雜湊值所儲存的葉節點,並可快速驗證紀錄資料是否不存在。藉由本發明實施例的驗證系統與方法,可降低系統整體的運算量、運算時間與運算成本。並且,具有區塊鏈晶片的終端裝置可設置或整合至各種物件中,在實際應用上更加簡單方便,且可提高物件品質的信賴度與物件價值。In summary, the conventional blockchain architecture transmits all data to the blockchain, and then verifies the data through the blockchain miners, which will consume a lot of blockchain computing resources. According to the verification system and method of the embodiment of the present invention, under the premise of maintaining the trustworthiness (non-repudiation) of the data, most of the data can be set in the off-chain database device, and the off-chain comparison can be performed through the security protocol device The root hash value of the binary tree of the database device and the corresponding root hash value of the blockchain are used to verify the correctness of the binary tree, thereby turning the main calculations into off-chain execution and greatly reducing the load of the blockchain. In addition, the security protocol device can locate the record data according to the identification number, thereby quickly searching for leaf nodes stored in the hash value of the record data in the database device, and quickly verifying whether the record data does not exist. With the verification system and method of the embodiment of the present invention, the overall calculation amount, calculation time, and calculation cost of the system can be reduced. In addition, the terminal device with the blockchain chip can be installed or integrated into various objects, which is simpler and more convenient in practical application, and can improve the reliability of the object quality and the value of the object.

除此之外,藉由本發明實施例的驗證系統與方法的鏈接資料串,在需要大量讀取二元樹的根雜湊值時,可透過鏈下資料庫裝置中讀取這些根雜湊值,並以區塊鏈上的鏈接資料串的資料集合在後者的鏈接雜湊值來驗證由鏈下讀取的根雜湊值的正確性,從而在維持資料的可信任度的前提下,減輕區塊鏈的網路傳輸需求與運算負荷。In addition, with the link data string of the verification system and method of the embodiment of the present invention, when a large number of root hash values of a binary tree need to be read, these root hash values can be read from the off-chain database device, and Use the link hash value of the data collection of the link data string on the blockchain to verify the correctness of the root hash value read by the chain, so as to reduce the blockchain’s problems while maintaining the trustworthiness of the data. Network transmission requirements and computing load.

雖然本發明的技術內容已經以較佳實施例揭露如上,然其並非用以限定本發明,任何熟習此技術者,在不脫離本發明之精神所作些許之更動與潤飾,皆應涵蓋於本發明的範疇內,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the technical content of the present invention has been disclosed in the preferred embodiment as above, it is not intended to limit the present invention. Anyone who is familiar with this technology and makes some changes and modifications without departing from the spirit of the present invention should be covered by the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of the attached patent application.

10、10a、10b:驗證系統 100:安全協定裝置 110:二元樹處理單元 120:驗證單元 130:讀取單元 140:鏈接處理單元 150:識別編號單元 160:定位搜尋單元 170:切片單元 180:識別序號單元 200:資料庫裝置 300:區塊鏈裝置 310:智能合約 311:鏈接處理單元 312:累計序號單元 400:終端裝置 410:紀錄資料產生單元 420:識別資料產生單元 430:切片驗證單元 440:識別編號單元 AS:累計序號 BT:二元樹 BTS:二元樹的切片 CDS:鏈接資料串 CH:鏈接雜湊值 CH0:初始鏈接值 DS:資料集合 H:高度值 ID:識別資料 IN:識別編號 IS:識別序號 LN:葉節點 MN:中間節點 OC:鏈下 BC:區塊鏈 R:樹根 RD:紀錄資料 RDH:紀錄資料的雜湊值 RH:根雜湊值 RR:讀取要求 SEC:資料區段 S101:在鏈下自多個終端裝置接收多個紀錄資料 S103:根據雜湊函數整合紀錄資料為二元樹 S105:傳送二元樹的根雜湊值至區塊鏈 S107:產生鏈接資料串 S109:在鏈下儲存二元樹與初始鏈接值 S111:當接收驗證要求,比對區塊鏈上的根雜湊值與在鏈下儲存的二元樹的根雜湊值 S113:當接收讀取要求,讀取區塊鏈上的資料集合在後者的根雜湊值並讀取在鏈下儲存的資料集合在前者的一或多個根雜湊值 S115:以區塊鏈上的在後的資料集合的鏈接雜湊值驗證在鏈下儲存的在前的一或多個根雜湊值的正確性 S201:在鏈下自多個終端裝置接收多個紀錄資料與多個識別資料 S203:當接收識別資料之後,根據各識別資料產生分別對應於各葉節點的多個識別編號 S205:根據雜湊函數整合紀錄資料為二元樹 S207:根據各識別編號儲存各紀錄資料的雜湊值至對應的各葉節點 S209:傳送二元樹的根雜湊值與識別序號至區塊鏈 S211:切割二元樹為多個切片 S213:在鏈下回傳各切片至對應的各終端裝置 S215:驗證不正確,對應的終端裝置傳送抗議訊息至區塊鏈 S217:驗證正確,終端裝置無需傳送抗議訊息至區塊鏈 S219:依序產生累計序號 S221:產生鏈接資料串 S223:在鏈下儲存二元樹、初始鏈接值、識別序號與累計序號 S225:當接收驗證要求,比對區塊鏈上的根雜湊值與在鏈下儲存的二元樹的根雜湊值 S227:當接收搜尋要求,根據識別編號定位在鏈下儲存的二元樹的葉節點 S229:當接收讀取要求,讀取區塊鏈上的資料集合在後者的根雜湊值並讀取在鏈下儲存的資料集合在前者的一或多個根雜湊值 S231:以區塊鏈上的在後的資料集合的鏈接雜湊值驗證在鏈下儲存的在前的一或多個根雜湊值的正確性10.10a, 10b: verification system 100: security protocol device 110: binary tree processing unit 120: verification unit 130: reading unit 140: link processing unit 150: identification number unit 160: positioning search unit 170: slicing unit 180: Identification serial number unit 200: database device 300: blockchain device 310: smart contract 311: link processing unit 312: cumulative serial number unit 400: terminal device 410: record data generation unit 420: identification data generation unit 430: slice verification unit 440 : Identification number unit AS: Cumulative serial number BT: Binary tree BTS: Slice of binary tree CDS: Link data string CH: Link hash value CH 0 : Initial link value DS: Data set H: Height value ID: Identification data IN: Identification number IS: identification number LN: leaf node MN: intermediate node OC: off-chain BC: blockchain R: tree root RD: record data RDH: hash value of record data RH: root hash value RR: read request SEC: Data section S101: Receive multiple record data from multiple terminal devices under the chain S103: Integrate the record data into a binary tree according to the hash function S105: Send the root hash value of the binary tree to the blockchain S107: Generate a link data string S109: Store the binary tree and the initial link value under the chain S111: When receiving the verification request, compare the root hash value on the blockchain with the root hash value of the binary tree stored under the chain S113: When receiving the read request , Read the root hash value of the data set on the blockchain in the latter and read one or more root hash values of the data set stored under the chain in the former S115: take the subsequent data set on the blockchain The link hash value verifies the correctness of the previous one or more root hash values stored under the chain S201: Multiple record data and multiple identification data are received from multiple terminal devices under the chain S203: After the identification data is received, Generate multiple identification numbers corresponding to each leaf node according to each identification data S205: Integrate the record data into a binary tree according to the hash function S207: Store the hash value of each record data according to each identification number to the corresponding leaf node S209: Send The root hash value and identification number of the binary tree are sent to the blockchain S211: Cut the binary tree into multiple slices S213: Send each slice back to the corresponding terminal device under the chain S215: The verification is incorrect, the corresponding terminal device transmits Protest message to the blockchain S217: The verification is correct, and the terminal device does not need to send the protest message to the blockchain S219: Sequentially generate cumulative serial numbers S221: Generate link data string S223: Store binary tree, initial link value, and identification number under the chain S225: When receiving a verification request, compare the root hash value on the blockchain with the root hash value of the binary tree stored off-chain. S227: When receiving a search request, locate the binary stored off-chain according to the identification number. Leaf node S229 of the meta-tree: When receiving a read request, read the root hash value of the data set on the blockchain in the latter and read the data set stored off-chain in the former One or more root hash values of S231: Use the link hash value of the subsequent data set on the blockchain to verify the correctness of the previous one or more root hash values stored off-chain

圖1所示為本發明一實施例的驗證系統的方塊示意圖; 圖2所示為本發明一實施例的二元樹的示意圖; 圖3所示為本發明一實施例的鏈接資料串的示意圖一; 圖3a所示為本發明一實施例的鏈接資料串的示意圖二; 圖4所示為本發明另一實施例的驗證系統的方塊示意圖; 圖5所示為本發明又一實施例的驗證系統的方塊示意圖; 圖6所示為本發明一實施例的二元樹的切片的示意圖; 圖7所示為本發明另一實施例的鏈接資料串的示意圖; 圖8所示為本發明一實施例的驗證方法的流程圖;以及 圖9所示為本發明另一實施例的驗證方法的流程圖。Fig. 1 is a block diagram of a verification system according to an embodiment of the present invention; FIG. 2 is a schematic diagram of a binary tree according to an embodiment of the present invention; FIG. 3 is a first schematic diagram of a linked data string according to an embodiment of the present invention; Fig. 3a shows a second schematic diagram of a link data string according to an embodiment of the present invention; FIG. 4 is a schematic block diagram of a verification system according to another embodiment of the present invention; FIG. 5 is a schematic block diagram of a verification system according to another embodiment of the present invention; Fig. 6 is a schematic diagram of a slice of a binary tree according to an embodiment of the present invention; FIG. 7 is a schematic diagram of a link data string according to another embodiment of the present invention; FIG. 8 is a flowchart of a verification method according to an embodiment of the present invention; and Fig. 9 is a flowchart of a verification method according to another embodiment of the present invention.

10b:驗證系統 10b: Verification system

100:安全協定裝置 100: Security Protocol Device

110:二元樹處理單元 110: Binary tree processing unit

120:驗證單元 120: Verification Unit

130:讀取單元 130: Reading unit

150:識別編號單元 150: Identification number unit

160:定位搜尋單元 160: Location search unit

170:切片單元 170: Slicing unit

180:識別序號單元 180: Identify the serial number unit

200:資料庫裝置 200: database device

300:區塊鏈裝置 300: Blockchain device

310:智能合約 310: Smart Contract

311:鏈接處理單元 311: Link Processing Unit

312:累計序號單元 312: Cumulative serial number unit

400:終端裝置 400: terminal device

410:紀錄資料產生單元 410: record data generating unit

420:識別資料產生單元 420: Identification data generation unit

430:切片驗證單元 430: Slice Verification Unit

440:識別編號單元 440: Identification Number Unit

AS:累計序號 AS: cumulative serial number

BT:二元樹 BT: Binary Tree

BTS:二元樹的切片 BTS: slicing of a binary tree

CDS:鏈接資料串 CDS: link data string

CH0:初始鏈接值 CH 0 : Initial link value

ID:識別資料 ID: identification data

IS:識別序號 IS: Identification number

OC:鏈下 OC: off-chain

BC:區塊鏈 BC: Blockchain

RD:紀錄資料 RD: record data

RDH:紀錄資料的雜湊值 RDH: hash value of record data

RH:根雜湊值 RH: Root hash value

RR:讀取要求 RR: Reading requirements

Claims (6)

一種用於處理鏈接資料的方法,由一安全協定裝置執行,該驗證方法包括:將多個二元樹儲存於鏈下的一資料庫,其中,各該二元樹包括一樹根與多個葉節點,各該樹根儲存有一根雜湊值;讀取該資料庫上的該些根雜湊值;對讀取自該資料庫的該些根雜湊值進行一雜湊與鏈接運算,以決定一推算根雜湊值;自一區塊鏈讀取一特定根雜湊值;判斷該特定根雜湊值與該推算根雜湊值是否一致;以及在該特定根雜湊值與該推算根雜湊值一致時,判斷該資料庫的該些根雜湊值為正確;其中該雜湊與鏈接運算包括:產生多個以串列方式鏈接的鏈下資料集合,各該鏈下資料集合分別包括讀取自該資料庫的各該根雜湊值與對應的一第一鏈接雜湊值,該些鏈下資料集合的最前者的該第一鏈接雜湊值由雜湊化一初始鏈接值產生,在該最前的資料集合之後的各該鏈下資料集合的該第一鏈接雜湊值為雜湊化前一該鏈下資料集合而產生,該些鏈下資料集合的最後者中的該根雜湊值為該推算根雜湊值;其中,各該鏈下資料集合更包括一識別序號以及一累計序號,各該累計序號分別對應於各該鏈下資料集合的該根雜湊值,各該鏈下資料集合的該累計序號衍生自前一該鏈下資料集合的該累計序號的累計值,且各該鏈 下資料集合的該第一鏈接雜湊值由雜湊化前一該鏈下資料集合的該根雜湊值、該識別序號、該累計序號與該第一鏈接雜湊值而產生。 A method for processing link data is executed by a security protocol device. The verification method includes: storing a plurality of binary trees in a database under the chain, wherein each of the binary trees includes a tree root and a plurality of leaves Node, each root of the tree stores a hash value; read the root hash values on the database; perform a hash and link operation on the root hash values read from the database to determine a deduced root Hash value; read a specific root hash value from a blockchain; determine whether the specific root hash value is consistent with the estimated root hash value; and when the specific root hash value is consistent with the estimated root hash value, determine the data The root hash values of the database are correct; wherein the hash and link operation includes: generating a plurality of data sets under the chain linked in a serial manner, and each of the data sets under the chain includes each root read from the database. A hash value and a corresponding first link hash value. The first link hash value of the first of the off-chain data sets is generated by hashing an initial link value, and each off-chain data after the first data set The first link hash value of the set is generated by the previous off-chain data set before the hashing, and the root hash value in the last of the off-chain data sets is the estimated root hash value; wherein, each off-chain data The collection further includes an identification serial number and a cumulative serial number. Each cumulative serial number corresponds to the root hash value of each off-chain data set. The cumulative serial number of each off-chain data set is derived from the previous off-chain data set. The cumulative value of the cumulative sequence number, and each chain The first link hash value of the lower data set is generated by hashing the root hash value, the identification serial number, the cumulative serial number, and the first link hash value of the previous off-chain data set. 如請求項1之方法,更包括:接收多個紀錄資料;根據雜湊函數整合該些紀錄資料為該些二元樹,其中該些紀錄資料的雜湊值分別儲存於該些葉節點;以及儲存該些二元樹的該些根雜湊值於該區塊鏈。 For example, the method of claim 1, further comprising: receiving multiple record data; integrating the record data into the binary trees according to a hash function, wherein the hash values of the record data are stored in the leaf nodes respectively; and storing the The root hash values of the binary trees are in the blockchain. 如請求項2之方法,其中,儲存於該區塊鏈上的該些根雜湊值包含於一鏈接資料串,該鏈接資料串包括多個以串列方式鏈接的資料集合,各該資料集合分別包括儲存於該區塊鏈上的各該根雜湊值與對應的一第二鏈接雜湊值,該些資料集合的最前者的該第二鏈接雜湊值由雜湊化該初始鏈接值產生,在該最前的資料集合之後的各該資料集合的該第二鏈接雜湊值為雜湊化前一該資料集合而產生,該些資料集合的最後者中的該根雜湊值為該特定根雜湊值;其中該方法更包括:傳送多個識別序號至該區塊鏈,使各該資料集合分別包括各該識別序號,各該識別序號包括一時間戳記。 Such as the method of claim 2, wherein the root hash values stored on the blockchain are included in a linked data string, and the linked data string includes a plurality of data sets linked in a serial manner, and each data set is respectively It includes each root hash value stored on the blockchain and a corresponding second link hash value. The second link hash value of the first one of the data sets is generated by hashing the initial link value, and the first The second link hash value of each data set after the data set is generated by the previous data set that was hashed, and the root hash value in the last of the data sets is the specific root hash value; wherein the method It further includes: transmitting a plurality of identification serial numbers to the blockchain, so that each of the data sets includes each identification serial number, and each identification serial number includes a time stamp. 一種安全協定裝置,包括:一記憶體;以及一處理器,耦接該記憶體,該處理器用以:將多個二元樹儲存於鏈下的一資料庫,其中,各該二元樹包括一樹根與多個葉節點,各該樹根儲存有一根雜湊值;讀取該資料庫上的該些根雜湊值; 對讀取自該資料庫的該些根雜湊值進行一雜湊與鏈接運算,以決定一推算根雜湊值;自一區塊鏈讀取一特定根雜湊值;判斷該特定根雜湊值與該推算根雜湊值是否一致;在該特定根雜湊值與該推算根雜湊值一致時,判斷該資料庫的該些根雜湊值為正確;以及產生多個以串列方式鏈接的鏈下資料集合,各該鏈下資料集合分別包括讀取自該資料庫的各該根雜湊值與對應的一第一鏈接雜湊值,該些鏈下資料集合的最前者的該第一鏈接雜湊值由雜湊化一初始鏈接值產生,在該最前的資料集合之後的各該鏈下資料集合的該第一鏈接雜湊值為雜湊化前一該鏈下資料集合而產生,該些鏈下資料集合的最後者中的該根雜湊值為該推算根雜湊值;其中,各該鏈下資料集合更包括一識別序號以及一累計序號,各該累計序號分別對應於各該鏈下資料集合的該根雜湊值,各該鏈下資料集合的該累計序號衍生自前一該鏈下資料集合的該累計序號的累計值,且各該鏈下資料集合的該第一鏈接雜湊值由雜湊化前一該鏈下資料集合的該根雜湊值、該識別序號、該累計序號與該第一鏈接雜湊值而產生。 A security protocol device includes: a memory; and a processor coupled to the memory. The processor is used for storing a plurality of binary trees in a database under the chain, wherein each of the binary trees includes A tree root and multiple leaf nodes, each of the tree roots stores a hash value; read the root hash values on the database; Perform a hash and link operation on the root hash values read from the database to determine a calculated root hash value; read a specific root hash value from a blockchain; determine the specific root hash value and the calculation Whether the root hash value is consistent; when the specific root hash value is consistent with the estimated root hash value, determine that the root hash values of the database are correct; and generate multiple serially linked off-chain data sets, each The off-chain data set includes each root hash value read from the database and a corresponding first link hash value. The first link hash value of the first one of the off-chain data sets is initialized by hashing Link value generation, the first link hash value of each off-chain data set after the first data set is generated by the previous off-chain data set before the hashing, and the last one of the off-chain data sets The root hash value is the inferred root hash value; wherein, each of the off-chain data sets further includes an identification serial number and a cumulative serial number, and each cumulative serial number corresponds to the root hash value of each off-chain data set, and each chain The cumulative serial number of the lower data set is derived from the cumulative value of the cumulative serial number of the previous off-chain data set, and the first link hash value of each off-chain data set is hashed by the root of the previous off-chain data set The hash value, the identification serial number, the cumulative serial number, and the first link hash value are generated. 如請求項4之安全協定裝置,該處理器更用以:接收多個紀錄資料;根據雜湊函數整合該些紀錄資料為該些二元樹,其中該些紀錄資料的雜湊值分別儲存於該些葉節點;以及儲存該些二元樹的該些根雜湊值於該區塊鏈。 For example, the security protocol device of claim 4, the processor is further used to: receive multiple record data; integrate the record data into the binary trees according to the hash function, wherein the hash values of the record data are respectively stored in the Leaf nodes; and storing the root hash values of the binary trees in the blockchain. 如請求項5之安全協定裝置,其中,儲存於該區塊鏈上的該些根雜湊值包含於一鏈接資料串,該鏈接資料串包括多個以串列方式鏈接的資料集合,各該資料集合分別包括儲存於該區塊鏈上的各該根雜湊值與對應的一第二鏈接雜湊值,該些資料集合的最前者的該第二鏈接雜湊值由雜湊化該初始鏈接值產生,在該最前的資料集合之後的各該資料集合的該第二鏈接雜湊值為雜湊化前一該資料集合而產生,該些資料集合的最後者中的該根雜湊值為該特定根雜湊值;其中該處理器更用以:傳送多個識別序號至該區塊鏈,使各該資料集合分別包括各該識別序號,各該識別序號包括一時間戳記。 For example, the security protocol device of claim 5, wherein the root hash values stored on the blockchain are included in a link data string, and the link data string includes a plurality of data sets linked in a serial manner, each of the data The sets respectively include each root hash value stored on the blockchain and a corresponding second link hash value. The second link hash value of the first one of the data sets is generated by hashing the initial link value. The second link hash value of each data set after the first data set is generated by hashing the previous data set, and the root hash value in the last of the data sets is the specific root hash value; where The processor is further used for transmitting a plurality of identification serial numbers to the blockchain, so that each of the data sets includes each identification serial number, and each identification serial number includes a time stamp.
TW109128081A 2019-04-24 2019-04-24 Methods and apparatuses for processing chaining data TWI728899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109128081A TWI728899B (en) 2019-04-24 2019-04-24 Methods and apparatuses for processing chaining data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109128081A TWI728899B (en) 2019-04-24 2019-04-24 Methods and apparatuses for processing chaining data

Publications (2)

Publication Number Publication Date
TW202046673A TW202046673A (en) 2020-12-16
TWI728899B true TWI728899B (en) 2021-05-21

Family

ID=74668234

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109128081A TWI728899B (en) 2019-04-24 2019-04-24 Methods and apparatuses for processing chaining data

Country Status (1)

Country Link
TW (1) TWI728899B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120143830A1 (en) * 2010-12-02 2012-06-07 At&T Intellectual Property I, L.P. Interactive proof to validate outsourced data stream processing
US8719576B2 (en) * 2003-12-22 2014-05-06 Guardtime IP Holdings, Ltd Document verification with distributed calendar infrastructure
US20180101701A1 (en) * 2016-10-07 2018-04-12 Acronis International Gmbh System and method for file authenticity certification using blockchain network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8719576B2 (en) * 2003-12-22 2014-05-06 Guardtime IP Holdings, Ltd Document verification with distributed calendar infrastructure
US20120143830A1 (en) * 2010-12-02 2012-06-07 At&T Intellectual Property I, L.P. Interactive proof to validate outsourced data stream processing
US20180101701A1 (en) * 2016-10-07 2018-04-12 Acronis International Gmbh System and method for file authenticity certification using blockchain network

Also Published As

Publication number Publication date
TW202046673A (en) 2020-12-16

Similar Documents

Publication Publication Date Title
TWI708154B (en) Verifying system and method applied for cooperation between blockchain and off-chain devices
TWI706662B (en) Method and apparatus for chaining data
CN109542979B (en) Fast synchronization and simple data storage mode of block chain system
EP3779760B1 (en) Blockchain-based data processing method and apparatus, and electronic device
US20210157790A1 (en) Optimizations for verification of interactions system and method using probability density functions
CN110012005A (en) Identify method, apparatus, electronic equipment and the storage medium of abnormal data
CN111612483B (en) Tea leaf credible tracing system based on decentralization and centralization cooperation
CN112286963A (en) Trusted inquiry system for block chain terminal data and implementation method thereof
CN111723159A (en) Data verification method and device based on block chain
WO2021196463A1 (en) Blockchain data synchronization method and apparatus, and electronic device and storage medium
TWI728899B (en) Methods and apparatuses for processing chaining data
TWI783441B (en) Data processing method and apparatus for cooperation with blockchain
CN111414417A (en) Video copyright management method based on block chain
CN112258184B (en) Method, apparatus, electronic device and readable storage medium for freezing blockchain network
CN114462998A (en) Log tamper-proofing method, system and storage medium
CN112487065A (en) Data retrieval method and device
CN116760632B (en) Data processing method, device, equipment and readable storage medium
CN112883038B (en) Data management method based on block chain, computer and readable storage medium
CN115952559A (en) Tamper-proof trusted index query method and device and electronic equipment
CN115081031A (en) Tamper-proof block chain data storage method and system
CN112100683A (en) Document verification method, document verification system and document verification server
CN115525644A (en) Experimental data efficient storage system based on Aero-Pike solid state disk
CN113868255A (en) Block chain-based equipment identifier storage method and device and electronic equipment
CN117640620A (en) Method and device for sharing data in gas hidden danger investigation scene
CN113919435A (en) Method and device for acquiring abnormal power data of laser, electronic equipment and medium