TWI824173B - A method of mixing public blockchains with private blockchains and computer readable medium - Google Patents

A method of mixing public blockchains with private blockchains and computer readable medium Download PDF

Info

Publication number
TWI824173B
TWI824173B TW109129146A TW109129146A TWI824173B TW I824173 B TWI824173 B TW I824173B TW 109129146 A TW109129146 A TW 109129146A TW 109129146 A TW109129146 A TW 109129146A TW I824173 B TWI824173 B TW I824173B
Authority
TW
Taiwan
Prior art keywords
blockchain
block
hash
public
signature
Prior art date
Application number
TW109129146A
Other languages
Chinese (zh)
Other versions
TW202209845A (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 TW109129146A priority Critical patent/TWI824173B/en
Publication of TW202209845A publication Critical patent/TW202209845A/en
Application granted granted Critical
Publication of TWI824173B publication Critical patent/TWI824173B/en

Links

Images

Landscapes

  • Preparation Of Clay, And Manufacture Of Mixtures Containing Clay Or Cement (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present invention is a method for mixing public blockchains with private blockchains. The method includes: providing a private blockchain managed by a hybrid chain service system, and deploying a smart contract on a public blockchain; hashing a new block to generate a block hash when the block is generated by the private blockchain; generating a first time stamp signature form the hash block through a time stamp service organization; generating a second time stamp signature form the first time stamp signature through the hybrid chain service system; and publishing the second time stamp signature. Accordingly, the private blockchain transactions that are not anchored to the public blockchain also has credible in the present invention. The present invention further provides a computer-readable medium for performing the method for mixing public blockchains with private blockchains.

Description

一種公有區塊鏈混合私有區塊鏈的方法及電腦可讀媒介 A method of mixing public blockchain with private blockchain and computer-readable medium

本發明係關於混合區塊鏈之技術,特別是指一種公有區塊鏈混合私有區塊鏈的方法。 The present invention relates to the technology of hybrid blockchain, and particularly refers to a method of mixing a public blockchain with a private blockchain.

區塊鏈為以分散式節點達到網路數據之存儲、傳遞、驗證的一種技術,區塊鏈之主要特色為去中心化,亦即區塊鏈上的各節點都需要自我傳遞、驗證以及管理。簡言之,為了達到區塊鏈的共享性以及讓使用者無需依靠額外管理或硬體設備以減少中心機制之需求,不僅區塊鏈上的資料被儲存於不同的雲端,連計算與儲存皆是分散式。 Blockchain is a technology that uses distributed nodes to store, transmit, and verify network data. The main feature of blockchain is decentralization, that is, each node on the blockchain needs to transmit, verify, and manage itself. . In short, in order to achieve the shareability of the blockchain and eliminate the need for users to rely on additional management or hardware equipment to reduce the need for central mechanisms, not only the data on the blockchain are stored in different clouds, but also the computing and storage are It is decentralized.

由於區塊鏈之技術是開源的,除了交易訊息會加密之外,其餘運算數據都是開放的,使得區塊鏈具備開放性,任何人皆可查詢區塊鏈的資料數據;另外,區塊鏈之系統無需要依靠第三方,具備獨立性,如此也減少其他外部干涉。然在區塊鏈具備開放性與獨立性下,也存在安全性以及匿名性的問題,但基於區塊鏈是分散式計算,因而減少數據被任意 修改的可能,且區塊鏈上之訊息無需要公開驗證,因而訊息都可以匿名傳遞,此讓上述安全性以及匿名性之問題被淡化。 Since the blockchain technology is open source, except for the encryption of transaction information, the rest of the computing data is open, making the blockchain open and anyone can query the data of the blockchain; in addition, the blockchain The chain system does not need to rely on a third party and is independent, which also reduces other external interference. Although the blockchain is open and independent, there are also issues of security and anonymity. However, based on the blockchain's decentralized computing, it reduces the risk of data being arbitrarily used. It is possible to modify, and the information on the blockchain does not need to be publicly verified, so the information can be transmitted anonymously, which dilutes the above security and anonymity issues.

儘管區塊鏈存在許多優勢,但目前仍未被廣泛運用是因為區塊鏈無法完美達成效能、安全性、去中心化三點,因此,有許多方法是使用私有區塊鏈來做為公有區塊鏈的側鏈並將私有區塊鏈的交易錨定(Anchored)至公有區塊鏈,如此可將安全性與去中心化這兩點建構在公有區塊鏈上,並在私有區塊鏈上可以大幅度的增加效能,然上述架構存在一個重大問題,即私有區塊鏈在錨定至公有區塊鏈之前並無安全性認證,也就是無法確定私有區塊鏈在錨定前是否是正確無誤的。 Although blockchain has many advantages, it is still not widely used because blockchain cannot perfectly achieve the three points of performance, security, and decentralization. Therefore, there are many ways to use private blockchains as public areas. The side chain of the blockchain anchors the transactions of the private blockchain to the public blockchain, so that security and decentralization can be built on the public blockchain and on the private blockchain. It can greatly increase the performance. However, there is a major problem in the above architecture, that is, there is no security certification before the private blockchain is anchored to the public blockchain. That is, it is impossible to determine whether the private blockchain is secure before anchoring. Correct.

因此,若能找出一種混合區塊鏈之技術,特別是在公有區塊鏈混合私有區塊鏈時,能確保私有區塊鏈未被竄改且正確無誤,藉此提升公有區塊鏈混合私有區塊鏈的安全性,此將成為本技術領域人員急欲追求解決方案之目標。 Therefore, if a hybrid blockchain technology can be found, especially when a public blockchain is mixed with a private blockchain, it can ensure that the private blockchain has not been tampered with and is correct, thereby improving the public blockchain hybrid private blockchain. The security of blockchain will become a goal that people in this technical field are eager to pursue solutions for.

為解決上述現有技術之問題,本發明係揭露一種公有區塊鏈混合私有區塊鏈的方法,係包括下列步驟:提供由混合鏈服務系統所管理之私有區塊鏈,且於公有區塊鏈佈署一智能合約;令該私有區塊鏈產生帶有區塊雜湊之新的區塊;令該混合鏈服務系統將該區塊雜湊透過一時戳服務機構產生時戳簽章;令該混合鏈服務系統對該時戳簽章再進行一次簽章,以得到時間簽章:以及公開該時間簽章。 In order to solve the above-mentioned problems of the prior art, the present invention discloses a method of mixing a public blockchain with a private blockchain, which includes the following steps: providing a private blockchain managed by a hybrid chain service system, and adding a private blockchain to a public blockchain. Deploying a smart contract; causing the private blockchain to generate a new block with block hash; causing the hybrid chain service system to hash the block through a timestamp service agency to generate a timestamp signature; causing the hybrid chain The service system signs the timestamp signature again to obtain the time signature: and publishes the time signature.

於一實施例中,公開該時間簽章之步驟係包括利用公開式網頁或星際檔案系統(InterPlanetary File System,簡稱IPFS)公開。 In one embodiment, the step of disclosing the time signature includes disclosing it using a public web page or InterPlanetary File System (IPFS).

於另一實施例中,該私有區塊鏈產生新的區塊之步驟係指該私有區塊鏈依據一交易請求使用共識演算法而產生該區塊。 In another embodiment, the step of the private blockchain generating a new block means that the private blockchain uses a consensus algorithm to generate the block based on a transaction request.

於另一實施例中,該智能合約用於儲存該私有區塊鏈錨定該公有區塊鏈時的錨定雜湊值以及錨定雜湊高度。 In another embodiment, the smart contract is used to store the anchor hash value and anchor hash height when the private blockchain is anchored to the public blockchain.

於前述方法中,復包括若已公開之該時間簽章與使用者取得之時間簽章不一致時,以產生時間較早者為正確。 In the above method, including if the published time signature is inconsistent with the time signature obtained by the user, the earlier generation time will be the correct one.

於前述方法中,復包括該混合鏈服務系統執行錨定時,係包括:查詢該公有區塊鏈之智能合約中前一次錨定之區塊高度;查詢該私有區塊鏈之最新的區塊高度;對未錨定之區塊的該時間簽章產生錨定雜湊;以及紀錄該錨定雜湊與該區塊高度至該公有區塊鏈之智能合約。 In the aforementioned method, when the hybrid chain service system performs anchoring, it includes: querying the previously anchored block height in the smart contract of the public blockchain; querying the latest block height of the private blockchain; Generate an anchor hash for the time signature of the unanchored block; and record the anchor hash and the height of the block to a smart contract on the public blockchain.

於前述方法中,復包括該混合鏈服務系統接收使用者發出之交易,係包括:於該使用者發出該交易至該私有區塊鏈時,令該交易被包進該區塊;利用交易雜湊向該私有區塊鏈查詢該區塊雜湊;以及對該區塊雜湊產生該時間簽章。 In the aforementioned method, the hybrid chain service system receiving the transaction sent by the user includes: when the user sends the transaction to the private blockchain, causing the transaction to be included in the block; using transaction hash Query the private blockchain for the block hash; and generate the time signature for the block hash.

於前述方法中,復包括使用者對該私有區塊鏈作即時稽核,係包括:於該使用者確認交易後,取得該區塊之該時間簽章;使用該混合鏈服務系統之公鑰對該時間簽章解密,以取得該時戳服務機構之該時戳簽章;使用該時戳服務機構之公鑰對該時戳簽章解密,以取得該區塊雜湊及時戳;以及比對該時戳簽章解密後之該區塊雜湊以及從該私有區塊鏈所取得之區塊雜湊。 In the aforementioned method, it also includes the user's real-time audit of the private blockchain, which includes: after the user confirms the transaction, obtaining the time signature of the block; using the public key pair of the hybrid chain service system Decrypt the timestamp signature to obtain the timestamp signature of the timestamp service organization; use the public key of the timestamp service organization to decrypt the timestamp signature to obtain the block hash timestamp; and compare the The block hash decrypted by the timestamp signature and the block hash obtained from the private blockchain.

於前述方法中,復包括使用者對已錨定之區塊進行稽核,係包括:該使用者對該混合鏈服務系統指定一錨定雜湊發出稽核要求;取得該混合鏈服務系統中錨定區塊之所有時間簽章;計算該所有時間簽章之雜湊,以與該公有區塊鏈之錨定雜湊進行比較,使用該混合鏈服務系統之公鑰將範圍內該所有時間簽章進行解密,以取得該時戳服務機構之時戳簽章;使用該時戳服務機構之公鑰對該時戳簽章解密,以取得該區塊雜湊及時戳;取得該私有區塊鏈中錨定區塊之區塊雜湊;以及比對該時戳簽章解密後之該區塊雜湊以及從該私有區塊鏈所取得之區塊雜湊並檢查其時間順序。 In the aforementioned method, the user's audit of the anchored block includes: the user specifies an anchor hash in the hybrid chain service system to issue an audit request; and obtains the anchor block in the hybrid chain service system. All time signatures; calculate the hash of all time signatures to compare with the anchor hash of the public blockchain, and use the public key of the hybrid chain service system to decrypt all time signatures within the range to Obtain the timestamp signature of the timestamp service organization; use the public key of the timestamp service organization to decrypt the timestamp signature to obtain the hash time stamp of the block; obtain the anchor block in the private blockchain block hash; and compare the block hash after decryption of the timestamp signature with the block hash obtained from the private blockchain and check its chronological order.

另外,前述該混合鏈服務系統中錨定區塊之所有時間簽章皆為公開。 In addition, all time signatures of the anchor blocks in the aforementioned hybrid chain service system are public.

本發明復提供一種電腦可讀媒介,應用於計算裝置或電腦中,係儲存有指令,以執行上述之公有區塊鏈混合私有區塊鏈的方法。 The present invention further provides a computer-readable medium, which is used in a computing device or a computer and stores instructions to execute the above-mentioned method of mixing a public blockchain with a private blockchain.

由上可知,為了確保私有區塊鏈在錨定至公有區塊鏈時具安全性,本發明將於原本私有區塊鏈在錨定至公有區塊鏈的架構中,加入時戳服務機構,使得私有區塊鏈錨定至公有區塊鏈前即具備安全性。簡言之,在私有區塊鏈在錨定到公有區塊鏈時,先透過時戳服務機構產生一時戳簽章,藉此確保私有區塊鏈之區塊具有公信力,之後,混合鏈服務系統再次對該時戳簽章進行簽章以產生一時間簽章並供大眾查閱,如此即可讓其他使用者認定該筆交易是否被確認過,且本發明所述方法還可讓使用者進行稽核,例如針對私有區塊鏈的稽核或是已錨定之區塊鍊的稽核,若發生問題,在簽章具有不可否認性下,亦可釐清責任歸屬。 It can be seen from the above that in order to ensure the security of the private blockchain when anchored to the public blockchain, the present invention adds a timestamp service organization to the original private blockchain anchored to the public blockchain architecture. This makes the private blockchain secure before anchoring it to the public blockchain. In short, when the private blockchain is anchored to the public blockchain, a timestamp signature is first generated through a timestamp service organization to ensure that the blocks of the private blockchain have credibility. After that, the hybrid chain service system The timestamp signature is signed again to generate a time stamp for public review, so that other users can determine whether the transaction has been confirmed, and the method of the present invention can also allow users to conduct audits , such as the audit of private blockchains or audits of anchored blockchains. If a problem occurs, the responsibility can be clarified when the signature is non-repudiation.

201-203:流程 201-203:Process

301-304:流程 301-304:Process

401-404:流程 401-404:Process

501-505:流程 501-505:Process

601-605:流程 601-605:Process

701-705:流程 701-705:Process

S11-S15:步驟 S11-S15: Steps

圖1為本發明之公有區塊鏈混合私有區塊鏈的方法的步驟圖。 Figure 1 is a step diagram of the method of mixing a public blockchain with a private blockchain according to the present invention.

圖2為本發明之混合鏈服務系統的啟動流程圖。 Figure 2 is a startup flow chart of the hybrid chain service system of the present invention.

圖3為本發明之混合鏈服務系統產生時間簽章的流程圖。 Figure 3 is a flow chart for generating time signatures in the hybrid chain service system of the present invention.

圖4為本發明之混合鏈服務系統執行錨定的流程圖。 Figure 4 is a flow chart of anchoring execution by the hybrid chain service system of the present invention.

圖5為本發明所述方法中使用者發送交易的流程圖。 Figure 5 is a flow chart of a user sending a transaction in the method of the present invention.

圖6為本發明所述方法中對私有區塊鏈進行稽核的流程圖。 Figure 6 is a flow chart of auditing the private blockchain in the method of the present invention.

圖7為本發明所述方法中對已錨定之區塊進行稽核的流程圖。 Figure 7 is a flow chart of auditing anchored blocks in the method of the present invention.

以下藉由特定的具體實施形態說明本發明之技術內容,熟悉此技藝之人士可由本說明書所揭示之內容輕易地瞭解本發明之優點與功效。然本發明亦可藉由其他不同的具體實施形態加以施行或應用。 The following describes the technical content of the present invention through specific embodiments. Those familiar with the art can easily understand the advantages and effects of the present invention from the content disclosed in this specification. However, the present invention can also be implemented or applied through other different specific implementation forms.

圖1為本發明之公有區塊鏈混合私有區塊鏈的方法的步驟圖。本發明主要目的是要讓私有區塊鏈錨定到公有區塊鏈時,確保私有區塊鏈之區塊具有公信力,因而提出透過一時戳服務機構(Time Stamp Authority,簡稱TSA)來對私有區塊鏈新產生的區塊進行簽章,如此能驗證區塊鏈之區塊在錨定前是否有被修改。 Figure 1 is a step diagram of the method of mixing a public blockchain with a private blockchain according to the present invention. The main purpose of this invention is to ensure that the blocks of the private blockchain have credibility when anchoring the private blockchain to the public blockchain. Therefore, it is proposed to use a Time Stamp Authority (TSA) to manage the private area. The newly generated blocks in the blockchain are signed, so that it can be verified whether the blocks in the blockchain have been modified before being anchored.

於步驟S11,提供由混合鏈服務系統所管理之私有區塊鏈,且於公有區塊鏈佈署一智能合約。本步驟係說明私有區塊鏈本身由混合鏈 服務系統管理,且要將混合鏈服務系統所管理之私有區塊鏈錨定到公有區塊鏈之前,需於公有區塊鏈中先佈署一智能合約,以便兩者錨定時有關雜湊的相關數據能被紀錄。 In step S11, a private blockchain managed by the hybrid chain service system is provided, and a smart contract is deployed on the public blockchain. This step explains that the private blockchain itself is composed of a hybrid chain Service system management, and before anchoring the private blockchain managed by the hybrid chain service system to the public blockchain, a smart contract needs to be deployed in the public blockchain to facilitate the hash correlation between the two. Data can be logged.

於一實施例中,該智能合約用於儲存該私有區塊鏈錨定該公有區塊鏈時的錨定雜湊值以及錨定雜湊高度。 In one embodiment, the smart contract is used to store the anchor hash value and anchor hash height when the private blockchain is anchored to the public blockchain.

於步驟S12,令該私有區塊鏈產生帶有區塊雜湊之新的區塊。本步驟係說明私有區塊鏈產生新的區塊,而該區塊本來帶有區塊雜湊(Block hash),而私有區塊鏈產生新的區塊的情況,通常是在私有區塊鏈接收到使用者之交易請求後,依據所使用共識演算法產生新的區塊。 In step S12, the private blockchain is caused to generate a new block with block hash. This step explains the situation where the private blockchain generates a new block, and the block originally has a block hash (Block hash), and the private blockchain generates a new block, usually it is collected in the private blockchain After receiving the user's transaction request, a new block is generated according to the consensus algorithm used.

於步驟S13,令該混合鏈服務系統將該區塊雜湊透過一時戳服務機構產生時戳簽章。為了確保私有區塊鏈在錨定前的正確性,故本步驟係混合鏈服務系統將前一步驟的區塊雜湊,透過一外部的時戳服務機構產生時戳簽章,此時戳簽章是基於對應前述交易所產生者,透過產生時間可確保錨定前私有區塊鏈的正確性。 In step S13, the hybrid chain service system is caused to hash the block through a timestamp service agency to generate a timestamp signature. In order to ensure the correctness of the private blockchain before anchoring, this step is for the hybrid chain service system to hash the blocks from the previous step and generate a timestamp signature through an external timestamp service agency. It is based on the corresponding transaction generator, and the correctness of the private blockchain before anchoring can be ensured through the generation time.

於步驟S14,令該混合鏈服務系統對該時戳簽章再進行一次簽章,以得到時間簽章。為了確保交易是由混合鏈服務系統提出,故於本步驟中,混合鏈服務系統會對前述之時戳簽章再進行一次簽章以得到時間簽章。簡言之,此時間簽章是通過兩道程序的簽章,故能提供交易產生時間以及是否為混合鏈服務系統提出的兩道驗證。 In step S14, the hybrid chain service system is asked to sign the timestamp signature again to obtain the time signature. In order to ensure that the transaction is initiated by the hybrid chain service system, in this step, the hybrid chain service system will sign the aforementioned timestamp signature again to obtain the time signature. In short, this time signature is a signature that has passed two procedures, so it can provide two verifications of the transaction generation time and whether it is a hybrid chain service system.

於步驟S15,公開該時間簽章以供查閱。本步驟係說明該時間簽章將被公開,如此所有人可取得該時間簽章,藉此驗證該筆交易是否 正確。於一實施例中,可利用公開式網頁或星際檔案系統(IPFS)來公開時間簽章。 In step S15, the time signature is disclosed for review. This step explains that the time signature will be made public so that everyone can obtain the time signature to verify whether the transaction is correct. In one embodiment, a public web page or InterPlanetary File System (IPFS) can be used to make the time signature public.

於一實施例中,使用者透過使用對應的公鑰(Public Key)進行解簽,以取得簽章中的雜湊值(Hash),進而達到驗證目的,而使用者取得時間簽章時,可與已公開之時間簽章進行比對,藉以確保私有區塊鏈錨定至公有區塊鏈時的正確性,假若使用者取得之時間簽章與已公開之時間簽章與不一致時,則以產生時間較早者為正確,亦即若區塊被竄改,也無法取得較早的時戳,故以產生時間較早者為正確。 In one embodiment, the user decrypts the signature using the corresponding public key to obtain the hash value (Hash) in the signature, thereby achieving the purpose of verification. When the user obtains the time signature, he or she can The public time signature is compared to ensure the correctness of the private blockchain when anchored to the public blockchain. If the time signature obtained by the user is inconsistent with the public time signature, an error will occur. The one with an earlier time is correct. That is to say, if the block is tampered with, an earlier timestamp cannot be obtained, so the one with an earlier time is considered correct.

下面以一具體範例來說明書本發明,要執行本發明所述之方法時,整體架構會包含混合鏈服務系統、時戳服務機構(TSA)、具有智能合約功能的公有區塊鏈、以及由混合鏈服務系統管理之私有區塊鏈,在混合鏈服務系統開始服務之前,必須先至公有區塊鏈佈署一個智能合約,用途為儲存錨定雜湊值及錨定雜湊高度。 The present invention is described below with a specific example. When the method described in the present invention is to be executed, the overall architecture will include a hybrid chain service system, a timestamp service authority (TSA), a public blockchain with smart contract functions, and a hybrid chain service system. For the private blockchain managed by the chain service system, before the hybrid chain service system starts serving, a smart contract must be deployed on the public blockchain to store the anchored hash value and anchored hash height.

在前述架構中,在使用者對私有區塊鏈發出交易時,私有區塊鏈會依照所使用共識演算法產生新的區塊(Block),而該新的區塊帶有區塊雜湊(Block hash),之後可利用時戳服務機構產生時間之時戳簽章,接著,混合鏈服務系統再對其時戳簽章再簽一次簽章而產生時間簽章,並將此時間簽章公開以供查閱,例如公開於開放式網頁或星際檔案系統(IPFS)。前述使用之共識演算法係指私有區塊鏈預設使用之共識演算法,可例如但不限制為:工作量證明(Proof of Work,POW)、權益證明(Proof of Stake,POS)、權威證明(Proof of Authority,POA)。 In the aforementioned architecture, when a user issues a transaction to the private blockchain, the private blockchain will generate a new block (Block) according to the consensus algorithm used, and the new block will have a block hash (Block). hash), and then the timestamp service organization can be used to generate a timestamp signature of the time. Then, the hybrid chain service system will sign the timestamp signature again to generate a time signature, and make this time signature public to the public. Available for review, such as on an open web page or the InterPlanetary File System (IPFS). The consensus algorithm used above refers to the consensus algorithm used by default in private blockchains, which can be, for example, but not limited to: Proof of Work (POW), Proof of Stake (POS), and Proof of Authority. (Proof of Authority, POA).

綜上可知,通過時戳服務機構的簽章確保了產生的時間,而混合鏈服務系統的簽章則證明此動作是由此服務系統(即使用本發明之混合鏈服務系統)所發起,上述程序能使私有區塊鏈之區塊具有公信力,具公信力之原是因為私有區塊鏈之管理者為混合鏈服務系統,經由此系統負責共識及產生新區塊,使用者在交易發送後會對私有區塊鏈確認交易是否已經被包進區塊,若可取得混合鏈服務系統所產生之時戳簽章,即可認定此交易已被確認,反之,若出現使用者取得之時戳簽章與混合鏈服務系統所公開之時戳簽章不一致時,將以產生時間較早者為正確,因為時戳服務機構必須為公正第三方,被竄改之區塊無法獲得比已公開之時間簽章更早的時戳,因而時間簽章為包含使用者與混合鏈服務系統的簽章,因此具有不可否認性,一但資料遭竄改即可利用簽章釐清責任歸屬,以便進一步根據服務條約求償。 In summary, it can be seen that the signature of the timestamp service organization ensures the time of generation, and the signature of the hybrid chain service system proves that this action was initiated by this service system (that is, the hybrid chain service system using the present invention). The above-mentioned The program can make the blocks of the private blockchain have credibility. The reason why it is credible is because the manager of the private blockchain is a hybrid chain service system. Through this system, it is responsible for consensus and generation of new blocks. After the transaction is sent, the user will The private blockchain confirms whether the transaction has been included in the block. If the timestamp signature generated by the hybrid chain service system can be obtained, the transaction can be deemed to have been confirmed. On the contrary, if the timestamp signature obtained by the user appears, If it is inconsistent with the timestamp signature disclosed by the hybrid chain service system, the earlier generation time will be the correct one, because the timestamp service organization must be an impartial third party, and the tampered block cannot obtain a time signature earlier than the one that has been published. An earlier time stamp, so the time signature includes the signature of the user and the hybrid chain service system, so it is non-repudiation. Once the data is tampered with, the signature can be used to clarify the attribution of responsibility, so as to further claim compensation according to the service contract.

於一實施例中,混合鏈服務系統在執行錨定,將執行下列步驟:查詢公有區塊鏈之智能合約中前一次錨定之區塊高度,查詢私有區塊鏈之最新的區塊高度,對未錨定之區塊的時間簽章產生錨定雜湊,以及紀錄錨定雜湊與區塊高度到公有區塊鏈之智能合約。 In one embodiment, when performing anchoring, the hybrid chain service system will perform the following steps: query the previously anchored block height in the smart contract of the public blockchain, query the latest block height of the private blockchain, and The time signature of the unanchored block generates the anchor hash, and a smart contract records the anchor hash and block height to the public blockchain.

於一具體實例中,混合鏈服務系統會定時將私有區塊鏈的區塊進行錨定,首先,先到公有區塊鏈的智能合約查詢上次錨定之區塊高度,以及到私有區塊鏈查詢最新區塊高度,接著,該混合鏈服務系統對未錨定之區塊的時間簽章產生錨定雜湊,以將錨定雜湊與區塊高度紀錄至公有區塊鏈的智能合約,藉以完成錨定。 In a specific example, the hybrid chain service system will regularly anchor the blocks of the private blockchain. First, it first goes to the smart contract of the public blockchain to query the height of the last anchored block, and then goes to the private blockchain. Query the latest block height. Then, the hybrid chain service system generates an anchoring hash for the time signature of the unanchored block, and records the anchoring hash and block height to the smart contract of the public blockchain to complete the anchoring. Certainly.

於一實施例中,當混合鏈服務系統接收使用者所發出之交易時,將執行下列步驟:於使用者發出交易至私有區塊鏈時,令該交易包含進該區塊,接著,利用交易雜湊向該私有區塊鏈查詢該區塊雜湊,以及對該區塊雜湊產生該時間簽章。 In one embodiment, when the hybrid chain service system receives a transaction sent by a user, it will perform the following steps: when the user sends a transaction to the private blockchain, include the transaction in the block, and then use the transaction The hash queries the private blockchain for the block hash and generates the time signature for the block hash.

於一具體實例中,使用者可以直接對私有區塊鏈發出交易,發送交易的流程包括使用者發送交易至私有區塊鏈,等待交易被包進區塊後,利用交易雜湊向私有區塊鏈查詢區塊雜湊,等待混合鏈服務系統對區塊進行雜湊以產生時間簽章(其間還包含通過時戳服務機構產生時戳簽章),最終取得該時間簽章後交易即完成。 In a specific example, the user can directly send a transaction to the private blockchain. The process of sending the transaction includes the user sending the transaction to the private blockchain, waiting for the transaction to be included in the block, and then using the transaction hash to send the transaction to the private blockchain. Query the block hash and wait for the hybrid chain service system to hash the block to generate a time signature (which also includes generating a timestamp signature through the timestamp service agency). After finally obtaining the time signature, the transaction is completed.

在稽核部分,使用者的稽核分成兩種,第一種為對私有區塊鏈之即時稽核,第二種為對已錨定之區塊進行稽核。 In the audit part, the user's audit is divided into two types. The first is real-time audit of the private blockchain, and the second is the audit of anchored blocks.

在使用者對私有區塊鏈之即時稽核時,將執行下列步驟:於使用者確認交易後,取得區塊之時間簽章,接著,使用混合鏈服務系統之公鑰對該時間簽章進行解密,以取得時戳服務機構所產生之時戳簽章,之後,再使用該時戳服務機構之公鑰對該時戳簽章進行解密,以取得區塊雜湊及時戳,最後,比對該時戳簽章解密後之該區塊雜湊以及從該私有區塊鏈所取得之區塊雜湊。 When the user performs real-time audit of the private blockchain, the following steps will be performed: After the user confirms the transaction, the time signature of the block is obtained, and then the public key of the hybrid chain service system is used to decrypt the time signature. , to obtain the timestamp signature generated by the timestamp service organization, and then use the public key of the timestamp service organization to decrypt the timestamp signature to obtain the block hash timestamp. Finally, compare the time stamp The block hash decrypted by the signature and the block hash obtained from the private blockchain.

於一具體實例中,在使用者在確認交易後,會取得區塊之時間簽章,為了稽核,可向私有區塊鏈取得區塊雜湊,並使用混合鏈服務系統之公鑰進行解密,藉以取得時戳服務機構的時戳簽章,之後,會再使用時戳服務機構之公鑰對時戳簽章解密以取得區塊雜湊及時戳,最後,比對兩個區塊雜湊是否一致,即可完成稽核。 In a specific example, after the user confirms the transaction, he will obtain the time signature of the block. For auditing, the block hash can be obtained from the private blockchain and decrypted using the public key of the hybrid chain service system. After obtaining the timestamp signature of the timestamp service organization, the public key of the timestamp service organization is used to decrypt the timestamp signature to obtain the block hash and time stamp. Finally, the two block hashes are compared to see if they are consistent, that is Audit can be completed.

在對已錨定之區塊進行稽核時,將執行下列步驟:當使用者對混合鏈服務系統指定一錨定雜湊發出稽核要求,取得該混合鏈服務系統中錨定區塊之所有時間簽章,接著,計算該所有時間簽章之雜湊以與公有區塊鏈之錨定雜湊進行比較,使用該混合鏈服務系統之公鑰將範圍內該所有時間簽章進行解密,藉以取得時戳服務機構之時戳簽章,使用該時戳服務機構之公鑰對該時戳簽章解密,以取得該區塊雜湊及時戳,另外,取得私有區塊鏈中錨定區塊之區塊雜湊,最後,比對該時戳簽章解密後之該區塊雜湊以及從該私有區塊鏈所取得之區塊雜湊並檢查時間順序是否正確。 When auditing the anchored block, the following steps will be performed: When the user issues an audit request to the hybrid chain service system by specifying an anchor hash, all time signatures of the anchored blocks in the hybrid chain service system are obtained. Then, the hash of all time signatures is calculated to compare with the anchor hash of the public blockchain, and the public key of the hybrid chain service system is used to decrypt all time signatures in the range, thereby obtaining the time stamp service organization's hash. Timestamp signature: Use the public key of the timestamp service organization to decrypt the timestamp signature to obtain the block hash and timestamp. In addition, obtain the block hash of the anchor block in the private blockchain. Finally, Compare the decrypted block hash from the timestamp signature with the block hash obtained from the private blockchain and check whether the time sequence is correct.

於一具體實例中,使用者對混合鏈服務系統指定一錨定雜湊發出稽核要求,並取得混合鏈服務系統錨定區塊之公開所有時間簽章,接著,計算所有時間簽章之雜湊且與公有區塊鏈之錨定雜湊進行比較,之後,使用混合鏈服務系統之公鑰將範圍內所有時間簽章進行解密,進而取得時戳服務機構的時戳簽章,再使用時戳服務機構之公鑰對時戳簽章進行解密,以取得區塊雜湊及時戳,接著,到私有區塊鏈取得錨定區塊之區塊雜湊,將兩者所取得之區塊雜湊進行比對,並且檢查時間順序是否正確,即完成稽核。 In a specific example, the user issues an audit request to the hybrid chain service system by specifying an anchor hash, and obtains all public time signatures of the anchor block of the hybrid chain service system. Then, the hash of all time signatures is calculated and compared with The anchor hash of the public blockchain is compared, and then the public key of the hybrid chain service system is used to decrypt all the time signatures in the range, and then the timestamp signatures of the timestamp service organization are obtained, and then the timestamp signatures of the timestamp service organization are obtained. The public key decrypts the timestamp signature to obtain the block hash and timestamp. Then, it goes to the private blockchain to obtain the block hash of the anchor block, compares the block hashes obtained by the two, and checks If the time sequence is correct, the audit is completed.

圖2為本發明之混合鏈服務系統的啟動流程圖。 Figure 2 is a startup flow chart of the hybrid chain service system of the present invention.

如圖所示,於流程201,混合鏈服務系統對公有區塊鏈佈署智能合約。本流程即混合鏈服務系統會先佈署智能合約至公有區塊鏈,其中,智能合約用途為儲存錨定雜湊值及錨定雜湊高度。 As shown in the figure, in process 201, the hybrid chain service system deploys smart contracts on the public blockchain. This process, that is, the hybrid chain service system will first deploy the smart contract to the public blockchain. The smart contract is used to store the anchored hash value and anchored hash height.

於流程202,混合鏈服務系統對公有區塊鏈檢查智能合約佈署狀況。此流程是判斷智能合約是否佈署完成,若佈署完成,則進入流程203,反之則持續停留在流程202,等待智能合約佈署完成。 In process 202, the hybrid chain service system checks the smart contract deployment status on the public blockchain. This process is to determine whether the deployment of the smart contract is completed. If the deployment is completed, it will enter process 203. Otherwise, it will continue to stay in process 202 and wait for the deployment of the smart contract to be completed.

於流程203,混合鏈服務系統服務開始。 In process 203, the hybrid chain service system service starts.

圖3為本發明之混合鏈服務系統產生時間簽章的流程圖。 Figure 3 is a flow chart for generating time signatures in the hybrid chain service system of the present invention.

如圖所示,於流程301,私有區塊鏈接收使用者交易。於本流程中,使用者可直接對私有區塊鏈發出交易請求。 As shown in the figure, in process 301, the private blockchain receives user transactions. In this process, users can directly issue transaction requests to the private blockchain.

於流程302,私有區塊鏈用共識演算法產生區塊。於本流程中,即私有區塊鏈會依照所使用之共識演算法產生新的區塊。 In process 302, the private blockchain uses a consensus algorithm to generate blocks. In this process, the private blockchain will generate new blocks according to the consensus algorithm used.

於流程303,混合鏈服務系統用區塊雜湊產生時間戳章。於本流程中,混合鏈服務系統會即時監聽私有區塊鏈是否產生新的區塊,當前流程中,有新的區塊產生時(B n ,高度為n的區塊),混合鏈服務系統(S)會將區塊雜湊(

Figure 109129146-A0101-12-0011-5
)利用時戳服務機構(O)產生時間(T n )之時戳簽章(
Figure 109129146-A0101-12-0011-4
),混合鏈服務系統再對其時戳簽章再簽一次簽章(
Figure 109129146-A0101-12-0011-1
Figure 109129146-A0101-12-0011-38
),以產生時間簽章(
Figure 109129146-A0101-12-0011-3
)。 In process 303, the hybrid chain service system uses block hashing to generate a timestamp. In this process, the hybrid chain service system will instantly monitor whether the private blockchain generates new blocks. In the current process, when a new block is generated ( B n , a block with a height of n), the hybrid chain service system ( S ) will hash the block (
Figure 109129146-A0101-12-0011-5
) Use the timestamp service organization ( O ) to generate a timestamp signature ( T n ) for the time (T n)
Figure 109129146-A0101-12-0011-4
), the hybrid chain service system signs the timestamp and signs it again (
Figure 109129146-A0101-12-0011-1
Figure 109129146-A0101-12-0011-38
), to generate a time signature (
Figure 109129146-A0101-12-0011-3
).

於流程304,混合鏈服務系統公開該區塊之時間戳章。本流程係說明時間戳章將會公開,以供使用者查閱,其中,可透過開放式網頁或星際檔案系統(IPFS)公開。 In process 304, the hybrid chain service system discloses the timestamp of the block. This process explains that the timestamp will be made public for users to view, which can be made public through an open web page or the InterPlanetary File System (IPFS).

圖4為本發明之混合鏈服務系統執行錨定的流程圖。 Figure 4 is a flow chart of anchoring execution by the hybrid chain service system of the present invention.

如圖所示,於流程401,混合鏈服務系統對公有區塊鏈查詢上次錨定之區塊高度。於本流程中,混合鏈服務系統定時將私有區塊鏈的 區塊進行錨定,其中,會先至公有區塊鏈的智能合約查詢上次錨定之區塊高度(h-1)。 As shown in the figure, in process 401, the hybrid chain service system queries the public blockchain for the last anchored block height. In this process, the hybrid chain service system regularly anchors the blocks of the private blockchain. Among them, the smart contract of the public blockchain will first query the last anchored block height ( h -1).

於流程402,混合鏈服務系統對私有區塊鏈用未錨定之區塊的時間簽章產生錨定雜湊。於本流程中,混合鏈服務系統會至私有區塊鏈查詢最新區塊高度(k),並對未錨定之區塊的時間簽章產生錨定雜湊(

Figure 109129146-A0101-12-0012-6
)。 In process 402, the hybrid chain service system uses the time signature of the unanchored block to generate an anchored hash for the private blockchain. In this process, the hybrid chain service system will query the private blockchain for the latest block height ( k ), and generate an anchor hash ( k ) for the time signature of the unanchored block.
Figure 109129146-A0101-12-0012-6
).

於流程403,混合鏈服務系統對公有區塊鏈紀錄區塊高度與錨定雜湊。本流程即是將錨定雜湊與區塊高度紀錄至公有區塊鏈之智能合約,以利於後續查詢和稽核。 In process 403, the hybrid chain service system records the block height and anchor hash in the public blockchain. This process is to record the anchor hash and block height into the smart contract of the public blockchain to facilitate subsequent query and audit.

於流程404,混合鏈服務系統錨定完成。 In process 404, the anchoring of the hybrid chain service system is completed.

圖5為本發明所述方法中使用者發送交易的流程圖。 Figure 5 is a flow chart of a user sending a transaction in the method of the present invention.

如圖所示,於流程501,使用者發出交易至私有區塊鏈。本流程即使用者對私有區塊鏈發送交易(Tx)。 As shown in the figure, in process 501, the user sends a transaction to the private blockchain. This process means that the user sends a transaction ( Tx ) to the private blockchain.

於流程502,使用者對私有區塊鏈用交易雜湊查詢區塊雜湊。本流程即等待交易被包進區塊(B n ,高度為n的區塊),並利用交易雜湊(

Figure 109129146-A0101-12-0012-8
)向私有區塊鏈查詢區塊雜湊(
Figure 109129146-A0101-12-0012-7
),若完成,前進流程503,反之則停留在流程502直到此流程執行完畢。 In process 502, the user queries the block hash using the transaction hash on the private blockchain. This process waits for the transaction to be included in the block ( B n , a block with height n), and uses transaction hash (
Figure 109129146-A0101-12-0012-8
) queries the private blockchain for the block hash(
Figure 109129146-A0101-12-0012-7
), if completed, proceed to process 503, otherwise, stay in process 502 until the execution of this process is completed.

於流程503,使用者對混合鏈服務系統用區塊雜湊查詢時戳簽章。等待混合鏈服務系統對區塊雜湊產生的時間簽章(

Figure 109129146-A0101-12-0012-9
),若完成,前進流程504,反之則回到流程503直到此流程執行完畢。 In process 503, the user uses the block hash query timestamp to sign the hybrid chain service system. Waiting for the time signature generated by the hybrid chain service system on the block hash (
Figure 109129146-A0101-12-0012-9
), if completed, proceed to process 504, otherwise return to process 503 until the execution of this process is completed.

於流程504,使用者保存時戳簽章,交易完成。本流程係說明取得時間簽章後,交易即完成。 In process 504, the user saves the timestamp signature and the transaction is completed. This process explains that after obtaining the time signature, the transaction is completed.

圖6為本發明所述方法中對私有區塊鏈進行稽核的流程圖。 Figure 6 is a flow chart of auditing the private blockchain in the method of the present invention.

如圖所示,於流程601,使用者對混合鏈服務系統取得區塊之時間簽章。本流程即使用者在確認交易後,有取得區塊之時間簽章(

Figure 109129146-A0101-12-0013-11
)。 As shown in the figure, in process 601, the user obtains the time signature of the block from the hybrid chain service system. This process means that after the user confirms the transaction, he will obtain the time signature of the block (
Figure 109129146-A0101-12-0013-11
).

於流程602,使用者對私有區塊鏈使用交易雜湊取得區塊雜湊。本流程即向私有區塊鏈取得區塊雜湊(

Figure 109129146-A0101-12-0013-12
)。 In process 602, the user uses transaction hash on the private blockchain to obtain the block hash. This process obtains the block hash (
Figure 109129146-A0101-12-0013-12
).

於流程603,使用者驗證區塊雜湊與時間簽章。本流程系進行驗證,包括使用混合鏈服務系統之公鑰對時間簽章(

Figure 109129146-A0101-12-0013-13
)進行解密(
Figure 109129146-A0101-12-0013-14
),以產生時戳服務機構的時戳簽章(
Figure 109129146-A0101-12-0013-19
T n )),接著,再使用時戳服務機構之公鑰對時戳簽章(
Figure 109129146-A0101-12-0013-15
)進行解密,以取得區塊雜湊及時戳(
Figure 109129146-A0101-12-0013-16
,T h ),之後,將本步驟取得之區塊雜湊(
Figure 109129146-A0101-12-0013-17
)與流程602取得之區塊雜湊(
Figure 109129146-A0101-12-0013-18
)進行比對。 In process 603, the user verifies the block hash and time signature. This process is for verification, including time signature using the public key of the hybrid chain service system (
Figure 109129146-A0101-12-0013-13
) to decrypt (
Figure 109129146-A0101-12-0013-14
) to generate the timestamp signature of the timestamp service organization (
Figure 109129146-A0101-12-0013-19
T n )), and then use the public key of the timestamp service organization to sign the timestamp (
Figure 109129146-A0101-12-0013-15
) to decrypt to obtain the block hash timestamp (
Figure 109129146-A0101-12-0013-16
, T h ), and then hash the block obtained in this step (
Figure 109129146-A0101-12-0013-17
) and the block hash ( obtained by process 602
Figure 109129146-A0101-12-0013-18
) for comparison.

經前述比對後,若相符,則進入流程604,使用者稽核完成,亦即驗證成功即完成稽核,反之,若不相符,則進入流程605,使用者稽核失敗,資料已被竄改。 After the foregoing comparison, if they match, then proceed to process 604, and the user audit is completed, that is, if the verification is successful, the audit is completed. Otherwise, if they do not match, then proceed to process 605, the user audit has failed, and the data has been tampered with.

圖7為本發明所述方法中對已錨定之區塊進行稽核的流程圖。 Figure 7 is a flow chart of auditing anchored blocks in the method of the present invention.

如圖所示,於流程701,使用者對混合鏈服務系統指定錨定雜湊發出稽核要求。本流程係使用者對混合鏈服務系統發出稽核要求,稽核對象則是使用者指定錨定雜湊。 As shown in the figure, in process 701, the user issues an audit request to the specified anchor hash of the hybrid chain service system. This process is where the user issues an audit request to the hybrid chain service system, and the audit object is the user-specified anchor hash.

於流程702,混合鏈服務系統對使用者回傳錨定區塊時間簽章。本流程即是取得混合鏈服務系統錨定區塊之公開所有時戳簽章(

Figure 109129146-A0101-12-0014-20
,
Figure 109129146-A0101-12-0014-21
,...,
Figure 109129146-A0101-12-0014-22
)。 In process 702, the hybrid chain service system returns the anchor block time signature to the user. This process is to obtain all public timestamp signatures of the anchor block of the hybrid chain service system (
Figure 109129146-A0101-12-0014-20
,
Figure 109129146-A0101-12-0014-21
,...,
Figure 109129146-A0101-12-0014-22
).

於流程703,使用者驗證區塊雜湊與時間簽章。本流程之驗證包括計算所有時間簽章之雜湊與公有區塊鏈之錨定雜湊進行比較(

Figure 109129146-A0101-12-0014-23
),使用混合鏈服務系統之公鑰將範圍內所有時間簽章進行解密(
Figure 109129146-A0101-12-0014-24
),以取得時戳服務機構的時戳簽章(
Figure 109129146-A0101-12-0014-25
),接著,再使用時戳服務機構之公鑰對時戳簽章(
Figure 109129146-A0101-12-0014-26
),以取得區塊雜湊及時戳(
Figure 109129146-A0101-12-0014-27
,T h ),另外,至私有區塊鏈取得錨定區塊之區塊雜湊(
Figure 109129146-A0101-12-0014-28
,
Figure 109129146-A0101-12-0014-29
,...,
Figure 109129146-A0101-12-0014-30
),最後,將兩處取得之區塊雜湊進行比對並檢查時間順序是否正確(T h <T h+1<…<T k )。 In process 703, the user verifies the block hash and time signature. Verification of this process involves calculating the hash of all time signatures and comparing it with the anchor hash of the public blockchain (
Figure 109129146-A0101-12-0014-23
), use the public key of the hybrid chain service system to decrypt all time signatures within the range (
Figure 109129146-A0101-12-0014-24
) to obtain the timestamp signature from the timestamp service agency (
Figure 109129146-A0101-12-0014-25
), and then use the public key of the timestamp service organization to sign the timestamp (
Figure 109129146-A0101-12-0014-26
) to obtain the block hash timestamp (
Figure 109129146-A0101-12-0014-27
, T h ), in addition, go to the private blockchain to obtain the block hash of the anchor block (
Figure 109129146-A0101-12-0014-28
,
Figure 109129146-A0101-12-0014-29
,...,
Figure 109129146-A0101-12-0014-30
), finally, compare the block hashes obtained from the two places and check whether the time sequence is correct ( T h < T h +1 <...< T k ).

經前述比對後,若相符,則進入流程704,使用者稽核完成,即驗證成功並完成稽核,反之,若不相符,則進入流程705,使用者稽核失敗,資料已被竄改。 After the aforementioned comparison, if they match, then proceed to process 704, and the user audit is completed, that is, the verification is successful and the audit is completed. Otherwise, if they do not match, then proceed to process 705, the user audit failed, and the data has been tampered with.

此外,本發明還揭示一種電腦可讀媒介,係應用於具有處理器(例如,CPU、GPU等)及/或記憶體的計算裝置或電腦中,且儲存有指令,並可利用此計算裝置或電腦透過處理器及/或記憶體執行此電腦可讀媒介,以於執行此電腦可讀媒介時執行上述之方法及各步驟。 In addition, the present invention also discloses a computer-readable medium, which is applied to a computing device or computer having a processor (eg, CPU, GPU, etc.) and/or a memory, and stores instructions, and can utilize the computing device or computer. The computer executes the computer-readable medium through the processor and/or memory to perform the above methods and steps when executing the computer-readable medium.

綜上所述,本發明之公有區塊鏈混合私有區塊鏈的方法及電腦可讀媒介,主要是在私有區塊鏈錨定至公有區塊鏈的架構中,加入時戳服務機構,使得私有區塊鏈錨定至公有區塊鏈前即具備安全性。簡言之,除了混合鏈服務系統原本的簽章外,透過混合鏈服務系統,在私有區塊鏈錨 定時,先進行一次簽章,確保私有區塊鏈錨定之前具公信力,如此,本發明能使未錨定至公有區塊鏈的私有區塊鏈交易也具備可信任度。另外,本發明亦讓使用者能進行稽核交易,稽核內容包含各角色簽章,故具不可否認性,倘若出現問題,也易於釐清責任歸屬。 To sum up, the method and computer-readable medium of mixing a public blockchain with a private blockchain in the present invention mainly add a timestamp service organization to the architecture in which the private blockchain is anchored to the public blockchain, so that Private blockchains are secure even before they are anchored to the public blockchain. In short, in addition to the original signature of the hybrid chain service system, through the hybrid chain service system, the private blockchain anchor Timing, a signature is performed first to ensure that the private blockchain has credibility before being anchored. In this way, the present invention can make private blockchain transactions that are not anchored to the public blockchain also have credibility. In addition, the present invention also allows users to conduct audit transactions. The audit content includes the signatures of each role, so it is non-repudiation. If a problem occurs, it is easy to clarify the responsibility.

上述實施例僅為例示性說明,而非用於限制本發明。任何熟習此項技藝之人士均可在不違背本發明之精神及範疇下,對上述實施例進行修飾與改變。因此,本發明之權利保護範圍係由本發明所附之申請專利範圍所定義,只要不影響本發明之效果及實施目的,應涵蓋於此公開技術內容中。 The above embodiments are only illustrative and not intended to limit the present invention. Anyone skilled in the art can make modifications and changes to the above embodiments without departing from the spirit and scope of the invention. Therefore, the scope of rights protection of the present invention is defined by the scope of the patent application attached to the present invention. As long as it does not affect the effect and implementation purpose of the present invention, it should be covered by this disclosed technical content.

S11-S15:步驟 S11-S15: Steps

Claims (11)

一種公有區塊鏈混合私有區塊鏈的方法,係包括下列步驟:提供由混合鏈服務系統所管理之私有區塊鏈,且於公有區塊鏈佈署一智能合約,其中,該智能合約係用以紀錄該公有區塊鏈與該私有區塊鏈錨定時的相關數據;令該私有區塊鏈產生帶有區塊雜湊之新的區塊;令該混合鏈服務系統將該區塊雜湊透過一時戳服務機構產生時戳簽章;令該混合鏈服務系統對該時戳簽章再進行一次簽章,以得到時間簽章,其中,該時間簽章係用以提供交易產生時間以及是否為該混合鏈服務系統提出的兩道驗證:以及公開該時間簽章。 A method of mixing a public blockchain with a private blockchain includes the following steps: providing a private blockchain managed by a hybrid chain service system, and deploying a smart contract on the public blockchain, wherein the smart contract is It is used to record the relevant data when the public blockchain and the private blockchain are anchored; to cause the private blockchain to generate a new block with block hash; to have the hybrid chain service system hash the block through A timestamp service agency generates a timestamp signature; the hybrid chain service system signs the timestamp signature again to obtain a time signature, where the time signature is used to provide the transaction generation time and whether it is The hybrid chain service system proposes two verifications: and the disclosure of the time signature. 如請求項1所述之公有區塊鏈混合私有區塊鏈的方法,其中,公開該時間簽章之步驟係包括利用公開式網頁或星際檔案系統公開。 The method of mixing a public blockchain with a private blockchain as described in claim 1, wherein the step of disclosing the time signature includes disclosing it using a public web page or an interstellar file system. 如請求項1所述之公有區塊鏈混合私有區塊鏈的方法,其中,該私有區塊鏈產生新的區塊之步驟係指該私有區塊鏈依據一交易請求使用共識演算法而產生該區塊。 The method of mixing a public blockchain with a private blockchain as described in claim 1, wherein the step for the private blockchain to generate a new block means that the private blockchain uses a consensus algorithm to generate a new block based on a transaction request. the block. 如請求項1所述之公有區塊鏈混合私有區塊鏈的方法,其中,該智能合約用於儲存該私有區塊鏈錨定該公有區塊鏈時的錨定雜湊值以及錨定雜湊高度,且其中,該錨定雜湊值以及該錨定雜湊高度係分別為該混合鏈服務系統於執行錨定時,基於該時間簽章產生於該混合鏈服務系 統進行稽核時作為稽核之標的之錨定雜湊所對應之數據資料以及該數據資料之區域數量。 The method of mixing a public blockchain with a private blockchain as described in request 1, wherein the smart contract is used to store the anchor hash value and anchor hash height when the private blockchain anchors the public blockchain. , and among them, the anchor hash value and the anchor hash height are respectively generated by the hybrid chain service system based on the time signature when the hybrid chain service system executes anchoring. The data corresponding to the anchor hash that is the target of the audit when the system is audited, and the number of areas of the data. 如請求項1所述之公有區塊鏈混合私有區塊鏈的方法,復包括若已公開之該時間簽章與使用者取得之時間簽章不一致時,以產生時間較早者為正確。 The method of mixing a public blockchain with a private blockchain as described in request 1 also includes that if the public time signature is inconsistent with the time signature obtained by the user, the earlier generation time will be the correct one. 如請求項1所述之公有區塊鏈混合私有區塊鏈的方法,復包括該混合鏈服務系統執行錨定時,係包括:查詢該公有區塊鏈之智能合約中前一次錨定之區塊高度,該區塊高度為所錨定之區塊的區塊數量;查詢該私有區塊鏈之最新的區塊高度;對未錨定之區塊的該時間簽章產生錨定雜湊,該錨定雜湊係於該混合鏈服務系統進行稽核時,作為稽核之標的;以及紀錄該錨定雜湊與該區塊高度至該公有區塊鏈之智能合約。 The method of mixing a public blockchain with a private blockchain as described in request item 1 includes: when the hybrid chain service system performs anchoring, it includes: querying the height of the previously anchored block in the smart contract of the public blockchain. , the block height is the number of blocks of the anchored block; query the latest block height of the private blockchain; generate an anchored hash for the time signature of the unanchored block, and the anchored hash is When the hybrid chain service system is audited, it is used as the audit target; and the smart contract that records the anchor hash and the block height to the public blockchain. 如請求項1所述之公有區塊鏈混合私有區塊鏈的方法,復包括該混合鏈服務系統接收使用者發出之交易,係包括:於該使用者發出該交易至該私有區塊鏈時,令該交易被包進該區塊;利用交易雜湊向該私有區塊鏈查詢該區塊雜湊;以及對該區塊雜湊產生該時間簽章。 The method of mixing a public blockchain with a private blockchain as described in request item 1, including the hybrid chain service system receiving a transaction sent by a user, includes: when the user sends the transaction to the private blockchain , causing the transaction to be included in the block; using the transaction hash to query the private blockchain for the block hash; and generating the time signature for the block hash. 如請求項1所述之公有區塊鏈混合私有區塊鏈的方法,復包括使用者對該私有區塊鏈作即時稽核,係包括:於該使用者確認交易後,取得該區塊之該時間簽章; 使用該混合鏈服務系統之公鑰對該時間簽章解密,以取得該時戳服務機構之該時戳簽章;使用該時戳服務機構之公鑰對該時戳簽章解密,以取得該區塊雜湊及時戳;以及比對該時戳簽章解密後之該區塊雜湊以及從該私有區塊鏈所取得之區塊雜湊。 The method of mixing a public blockchain with a private blockchain as described in request item 1 also includes the user's real-time audit of the private blockchain, including: after the user confirms the transaction, obtain the block's time signature; Use the public key of the hybrid chain service system to decrypt the timestamp signature to obtain the timestamp signature of the timestamp service organization; use the public key of the timestamp service organization to decrypt the timestamp signature to obtain the timestamp signature. Block hash and timestamp; and compare the block hash after decryption of the timestamp signature with the block hash obtained from the private blockchain. 如請求項1所述之公有區塊鏈混合私有區塊鏈的方法,復包括使用者對已錨定之區塊進行稽核,係包括:該使用者對該混合鏈服務系統指定一錨定雜湊發出稽核要求;取得該混合鏈服務系統中錨定區塊之所有時間簽章;計算該所有時間簽章之雜湊,以與該公有區塊鏈之錨定雜湊進行比較,使用該混合鏈服務系統之公鑰將範圍內該所有時間簽章進行解密,以取得該時戳服務機構之時戳簽章;使用該時戳服務機構之公鑰對該時戳簽章解密,以取得該區塊雜湊及時戳;取得該私有區塊鏈中錨定區塊之區塊雜湊;以及比對該時戳簽章解密後之該區塊雜湊以及從該私有區塊鏈所取得之區塊雜湊並檢查其時間順序。 The method of mixing a public blockchain with a private blockchain as described in request item 1 includes the user auditing the anchored block, which includes: the user designates an anchor hash to be issued by the hybrid chain service system. Audit requirements; obtain all time signatures of the anchor block in the hybrid chain service system; calculate the hash of all time signatures to compare with the anchor hash of the public blockchain, and use the hybrid chain service system The public key decrypts all time signatures within the range to obtain the timestamp signature of the timestamp service organization; use the public key of the timestamp service organization to decrypt the timestamp signature to obtain the block hash time stamp; obtain the block hash of the anchor block in the private blockchain; and compare the block hash decrypted by the timestamp signature with the block hash obtained from the private blockchain and check its time order. 如請求項9所述之公有區塊鏈混合私有區塊鏈的方法,其中,該混合鏈服務系統中錨定區塊之所有時間簽章皆為公開。 The method of mixing a public blockchain with a private blockchain as described in claim 9, wherein all time signatures of anchor blocks in the hybrid chain service system are public. 一種電腦可讀媒介,應用於計算裝置或電腦中,係儲存有指令,以執行如請求項1至10之任一者所述之公有區塊鏈混合私有區塊鏈的方法。 A computer-readable medium, used in a computing device or computer, storing instructions to execute the method of mixing a public blockchain with a private blockchain as described in any one of claims 1 to 10.
TW109129146A 2020-08-26 2020-08-26 A method of mixing public blockchains with private blockchains and computer readable medium TWI824173B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109129146A TWI824173B (en) 2020-08-26 2020-08-26 A method of mixing public blockchains with private blockchains and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109129146A TWI824173B (en) 2020-08-26 2020-08-26 A method of mixing public blockchains with private blockchains and computer readable medium

Publications (2)

Publication Number Publication Date
TW202209845A TW202209845A (en) 2022-03-01
TWI824173B true TWI824173B (en) 2023-12-01

Family

ID=81746752

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109129146A TWI824173B (en) 2020-08-26 2020-08-26 A method of mixing public blockchains with private blockchains and computer readable medium

Country Status (1)

Country Link
TW (1) TWI824173B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104348870A (en) * 2013-08-02 2015-02-11 航天信息股份有限公司 Data management method and system of cloud storage system based on trusted timestamp
CN107733855A (en) * 2017-08-31 2018-02-23 中国科学院信息工程研究所 A kind of block catenary system and application process that can support publicly-owned chain, alliance's chain and privately owned chain simultaneously
US20180268401A1 (en) * 2017-03-17 2018-09-20 Royal Bank Of Canada Systems and methods for hybrid blockchain platform
CN109639406A (en) * 2018-12-24 2019-04-16 国泰君安证券股份有限公司 Efficient trust solution based on block chain and IPFS
TW201935299A (en) * 2018-02-12 2019-09-01 林俊良 Blockchain system, node server and method for processing strategy model scripts of financial assets
TWM586416U (en) * 2019-06-05 2019-11-11 陳志誠 Implementing a multi-center, distributed verification system for transactions based on blockchain technology
US20190370793A1 (en) * 2018-06-04 2019-12-05 Decentralized Finance Labs, Inc. Hybrid consensus for blockchain using proof of work and proof of stake
US20200007344A1 (en) * 2018-06-28 2020-01-02 Blockchain Integrated Partners, Llc Systems and methods for data validation and assurance
CN111108526A (en) * 2019-09-02 2020-05-05 阿里巴巴集团控股有限公司 Centralized account book system based on block chain management
TW202027456A (en) * 2018-12-28 2020-07-16 香港商阿里巴巴集團服務有限公司 Credibility verification method, system, apparatus and device for alliance chain
US20200250295A1 (en) * 2019-01-31 2020-08-06 Salesforce.Com, Inc. Systems, methods, and apparatuses for protecting consumer data privacy using solid, blockchain and ipfs integration
US20200260147A1 (en) * 2019-02-12 2020-08-13 Vijay Madisetti Hybrid Blockchains and Streamchains Using Non-Crypto Hashes for Securing Audio-, Video-, Image-, and Speech-Based Transactions and Contracts

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104348870A (en) * 2013-08-02 2015-02-11 航天信息股份有限公司 Data management method and system of cloud storage system based on trusted timestamp
US20180268401A1 (en) * 2017-03-17 2018-09-20 Royal Bank Of Canada Systems and methods for hybrid blockchain platform
CN107733855A (en) * 2017-08-31 2018-02-23 中国科学院信息工程研究所 A kind of block catenary system and application process that can support publicly-owned chain, alliance's chain and privately owned chain simultaneously
TW201935299A (en) * 2018-02-12 2019-09-01 林俊良 Blockchain system, node server and method for processing strategy model scripts of financial assets
US20190370793A1 (en) * 2018-06-04 2019-12-05 Decentralized Finance Labs, Inc. Hybrid consensus for blockchain using proof of work and proof of stake
US20200007344A1 (en) * 2018-06-28 2020-01-02 Blockchain Integrated Partners, Llc Systems and methods for data validation and assurance
CN109639406A (en) * 2018-12-24 2019-04-16 国泰君安证券股份有限公司 Efficient trust solution based on block chain and IPFS
TW202027456A (en) * 2018-12-28 2020-07-16 香港商阿里巴巴集團服務有限公司 Credibility verification method, system, apparatus and device for alliance chain
US20200250295A1 (en) * 2019-01-31 2020-08-06 Salesforce.Com, Inc. Systems, methods, and apparatuses for protecting consumer data privacy using solid, blockchain and ipfs integration
US20200260147A1 (en) * 2019-02-12 2020-08-13 Vijay Madisetti Hybrid Blockchains and Streamchains Using Non-Crypto Hashes for Securing Audio-, Video-, Image-, and Speech-Based Transactions and Contracts
TWM586416U (en) * 2019-06-05 2019-11-11 陳志誠 Implementing a multi-center, distributed verification system for transactions based on blockchain technology
CN111108526A (en) * 2019-09-02 2020-05-05 阿里巴巴集团控股有限公司 Centralized account book system based on block chain management

Also Published As

Publication number Publication date
TW202209845A (en) 2022-03-01

Similar Documents

Publication Publication Date Title
TWI725655B (en) Method, apparatus and system for program execution and data proof for executing a sub-logic code within a trusted execution environment
US10846416B2 (en) Method for managing document on basis of blockchain by using UTXO-based protocol, and document management server using same
TWI707245B (en) Retrieving access data for blockchain networks using highly available trusted execution environments
JP7076682B2 (en) Data processing methods, devices, electronic devices and computer programs based on blockchain networks
US20200382326A1 (en) Digital certificate verification method and apparatus, computer device, and storage medium
CN110771095B (en) System and method for implementing blockchain-based digital certificates
TWI732620B (en) Method, system and apparatus for managing blockchain-based centralized ledger systems
EP3130104B1 (en) System and method for sequential data signatures
CN110741600A (en) Computer-implemented system and method for providing a decentralized protocol to retrieve encrypted assets
JP4266096B2 (en) File storage system and NAS server
US20200344068A1 (en) Managing blockchain-based centralized ledger systems
CN110569674A (en) Block chain network-based authentication method and device
CN111461622B (en) Block chain-based warehouse credit rating, result acquisition and verification method and device
US10904017B2 (en) Managing blockchain-based centralized ledger systems
AU2019320957C1 (en) Managing trust points in ledger systems
Ulybyshev et al. (WIP) blockhub: Blockchain-based software development system for untrusted environments
Li et al. A privacy-protecting authorization system based on blockchain and zk-SNARK
JP2001517818A (en) Transient key digital stamp method and system
CN115208656A (en) Supply chain data sharing method and system based on block chain and authority management
CN114362958B (en) Intelligent home data security storage auditing method and system based on blockchain
CN110276693B (en) Insurance claim settlement method and system
CN115189884A (en) Multistage signature method with anonymity for alliance block chain
EP3742320B1 (en) Method and system for granting access to data in an immutable ledger system
TWI824173B (en) A method of mixing public blockchains with private blockchains and computer readable medium
JP2001331105A (en) Method for assuring information, and system therefor