TWI699986B - Method and system for generating blockchain - Google Patents
Method and system for generating blockchain Download PDFInfo
- Publication number
- TWI699986B TWI699986B TW108108696A TW108108696A TWI699986B TW I699986 B TWI699986 B TW I699986B TW 108108696 A TW108108696 A TW 108108696A TW 108108696 A TW108108696 A TW 108108696A TW I699986 B TWI699986 B TW I699986B
- Authority
- TW
- Taiwan
- Prior art keywords
- block
- blocks
- output
- priority
- candidate
- Prior art date
Links
Images
Abstract
Description
本發明關於一種區塊鏈產生方法及系統,並且特別地,關於一種可快速產生區塊且各節點可產生相同區塊鏈之區塊鏈產生方法及系統。 The present invention relates to a block chain generation method and system, and in particular, to a block chain generation method and system that can quickly generate blocks and each node can generate the same block chain.
近年來,區塊鏈技術成為極為重要的新創技術,其起源於虛擬貨幣:比特幣。至今,各種虛擬貨幣(Crypto Currency)已經在網際網路上大量使用和流行,如比特幣、以太幣、萊特幣、瑞波幣等,且這些虛擬貨幣的日交易額超過千萬美元,並且仍在不斷增長中。目前已有多間著名公司和機構支持使用比特幣或其他虛擬貨幣作為交易貨幣,未來可能會有更多公司或機構加入。然而,虛擬貨幣與一般貨幣不同,並沒有實體,但虛擬貨幣及其交易的可信賴度可依靠區塊鏈技術來支持。 In recent years, blockchain technology has become a very important new technology, which originated from the virtual currency: Bitcoin. So far, various virtual currencies (Crypto Currency) have been widely used and popular on the Internet, such as Bitcoin, Ethereum, Litecoin, Ripple, etc., and the daily transaction volume of these virtual currencies exceeds 10 million U.S. dollars, and they are still continuing Growing. At present, many well-known companies and institutions support the use of Bitcoin or other virtual currencies as transaction currencies, and more companies or institutions may join in the future. However, virtual currency is different from general currency and has no entity, but the trustworthiness of virtual currency and its transactions can be supported by blockchain technology.
區塊鏈技術是一種不依賴第三方、通過自身分散式節點進行網路數據的存儲、驗證、傳遞和交流的一種技術方案。因此,有人從金融會計的角度,把區塊鏈技術看成是一種分散式開放性去中心化的大型網路記賬薄(公開帳本),任何人任何時間都可以採用相同的技術標準加入自己的信息,延伸區塊鏈,持續滿足各種需求帶來的數據錄入需要。 Blockchain technology is a technical solution that does not rely on a third party, but uses its own distributed nodes to store, verify, transmit and communicate network data. Therefore, from the perspective of financial accounting, some people regard blockchain technology as a decentralized, open and decentralized large-scale network account book (public account book). Anyone can use the same technical standards to join at any time. Own information, extend the blockchain, and continue to meet the data entry needs brought by various needs.
例如,比特幣使用的公開帳本是一套基於工作量證明 (Proof-of-Work)機制的分散式存儲方案,通常具有極高的安全性和抗攻擊特性。要對比特幣區塊鏈的安全性形成有效攻擊,需要高達數千TH/s以上的計算能力,這已經超過了當前全球前500強超級電腦的計算能力總和的百倍。 For example, the public ledger used by Bitcoin is a set of proof-of-work (Proof-of-Work) distributed storage schemes usually have extremely high security and anti-attack characteristics. In order to form an effective attack on the security of the Bitcoin blockchain, computing power of thousands of TH/s or more is required, which has exceeded the total computing power of the top 500 supercomputers in the world.
在區塊鏈的技術中,每台連接到區塊鏈網路的電腦都可以形成一個節點以從區塊鏈網路上獲取信息或資料,例如獲得交易資料等,接著節點可將這些資料進行包含雜湊(Hash)運算等出塊程序或區塊產生程序以產生新區塊,並將新產生的區塊連接於該節點所儲存之區塊鏈的最後端。除了信息或資料本身的雜湊運算之外,在前述比特幣所採用的區塊鏈系統中還採用了工作量證明機制來決定區塊是否能產生,而工作量證明係以節點解開難解的雜湊運算來達成,先達成者能取得新區塊的產生權利。因此,為了能獲得新區塊的產生權利,每個節點都會耗費大量的運算能力在工作量證明的雜湊運算上。 In the blockchain technology, each computer connected to the blockchain network can form a node to obtain information or data from the blockchain network, such as obtaining transaction data, etc., and then the node can include these data Block generation procedures such as hash operations or block generation procedures to generate new blocks, and connect the newly generated blocks to the last end of the blockchain stored by the node. In addition to the hash calculation of the information or data itself, the blockchain system adopted by the aforementioned Bitcoin also uses a proof-of-work mechanism to determine whether the block can be generated, and the proof-of-work is based on the node to solve the inexplicable hash Computationally, the one who achieves first can obtain the right to generate new blocks. Therefore, in order to obtain the right to generate new blocks, each node will consume a large amount of computing power on the hash calculation of the workload proof.
區塊鏈發展至今已不僅僅是用在虛擬貨幣的用途,去中心化的技術可應用多種不同的技術領域,而工作量證明也不再是產生區塊的唯一憑藉。相反地,當區塊鏈應用於其他領域時,工作量證明反而成為阻礙區塊產生的重要因素,會使資料的處理速度受到極大的限制。因此,在某些區塊鏈架構中,各節點可自行處理資料並產出區塊,在此架構下不需要工作量證明,因此節點的運算能力可由工作量證明的雜湊運算解放出來,而產生區塊的速度也將會對應地提升。 So far, the development of blockchain has not only been used for virtual currency purposes, decentralized technology can be applied to many different technical fields, and proof of work is no longer the only way to generate blocks. On the contrary, when blockchain is used in other fields, proof of work becomes an important factor hindering the generation of blocks, which will greatly limit the processing speed of data. Therefore, in some blockchain architectures, each node can process data and generate blocks on its own. Under this architecture, proof of work is not required. Therefore, the computing power of the node can be freed by the hash calculation of the proof of work. The speed of the block will increase accordingly.
上述的區塊鏈架構中,雖然各節點也會得到其他節點所產生的區塊資訊來保證區塊鏈的不可竄改性,但基於各節點係自行產生區塊且 不同節點之區塊間的關係不像同一節點內的區塊間那麼單純,因此要讓所有節點自行產生一模一樣的區塊鏈相當困難,進一步會影響到區塊鏈的穩定性。 In the above-mentioned blockchain architecture, although each node will also obtain block information generated by other nodes to ensure that the blockchain cannot be modified, it is based on the fact that each node generates blocks and The relationship between the blocks of different nodes is not as simple as the blocks within the same node, so it is quite difficult for all nodes to generate exactly the same blockchain by themselves, which will further affect the stability of the blockchain.
因此,有必要研發一種新式的區塊鏈產生方法及系統架構,以解決上述問題。 Therefore, it is necessary to develop a new block chain generation method and system architecture to solve the above problems.
有鑑於此,本發明之一範疇在於提供一種區塊鏈產生方法,除了可快速產生區塊之外,還可保證各節點自行產生相同的區塊鏈,以解決先前技術之問題。 In view of this, one of the scopes of the present invention is to provide a block chain generation method, which can not only quickly generate blocks, but also ensure that each node generates the same block chain by itself, so as to solve the problems of the prior art.
根據本發明之一具體實施例,區塊鏈產生方法可由區塊鏈產生系統上的每個節點單獨執行。本具體實施例之區塊鏈產生方法包含以下步驟:基於區塊鏈協定自網路中獲取複數筆資料,每個節點所獲取的資料不重複;對所接收到的資料進行區塊產生程序以產生複數個區塊,各節點自身所產生之區塊互相連接形成節點區塊鏈,並且每一節點區塊鏈上之區塊與其他節點區塊鏈上之區塊互相確認而形成區塊網;根據候選標準從已被確認之區塊中挑選出複數個候選輸出區塊;根據輸出排序標準自候選輸出區塊中選出至少一優先輸出區塊以形成優先輸出區塊群組;當優先輸出區塊群組達到門檻標準時,輸出優先輸出區塊群組中的所有優先輸出區塊;以及,重複進行挑選候選輸出區塊、形成優先輸出群組以及輸出優先輸出群組之步驟以將區塊網壓實形成區塊鏈。 According to a specific embodiment of the present invention, the block chain generation method can be independently executed by each node on the block chain generation system. The block chain generation method of this specific embodiment includes the following steps: obtain a plurality of data from the network based on the block chain protocol, and the data obtained by each node is not repeated; perform a block generation process on the received data Multiple blocks are generated, the blocks generated by each node itself are connected to each other to form a node blockchain, and the blocks on each node's blockchain and the blocks on the other node's blockchain are mutually confirmed to form a blockchain network ; According to the candidate criteria, select a plurality of candidate output blocks from the blocks that have been confirmed; select at least one priority output block from the candidate output blocks according to the output sort criteria to form a priority output block group; when the priority output When the block group reaches the threshold standard, output all priority output blocks in the priority output block group; and repeat the steps of selecting candidate output blocks, forming priority output groups, and output priority output groups to remove the blocks Net compaction forms a blockchain.
本發明之另一範疇在於提供一種區塊鏈產生系統,除了可快速產生區塊之外,還可保證各節點自行產生相同的區塊鏈。 Another category of the present invention is to provide a block chain generation system, which can not only quickly generate blocks, but also ensure that each node automatically generates the same block chain.
根據本發明之另一具體實施例,區塊鏈產生系統可包含儲存有複數筆資料的區塊鏈網路以及連接區塊鏈網路以接收資料的複數個節點,其中,各節點分別包含處理器,且處理器可被程式化來執行區塊產生程序以及全局定序(Total Ordering)程序,進而產生相同的區塊鏈。 According to another embodiment of the present invention, the block chain generation system may include a block chain network storing a plurality of data and a plurality of nodes connected to the block chain network to receive the data, wherein each node includes processing The processor can be programmed to execute the block generation process and the total ordering process, thereby generating the same blockchain.
於本具體實施例中,處理器執行區塊產生程序以處理接收到的資料進而產生複數個區塊,各節點自身所產生之區塊互相連接形成節點區塊鏈,且各節點區塊鏈上之區塊與其他節點區塊鏈上之區塊互相確認而形成區塊網。並且,每一節點可分別自其他節點接收其他節點所產生之區塊。此外,該處理器被程式化來執行全局定序程序以重覆地根據候選標準自已被確認之區塊中挑選出複數個候選輸出區塊、根據輸出排序標準自候選輸出區塊中選出至少一優先輸出區塊以形成優先輸出區塊群組、以及根據門檻標準選擇性地輸出優先輸出區塊群組中的所有優先輸出區塊,以將區塊網壓實形成區塊鏈。 In this specific embodiment, the processor executes the block generation program to process the received data to generate a plurality of blocks, the blocks generated by each node itself are connected to form a node blockchain, and each node blockchain The blocks on the blockchain of other nodes confirm each other to form a block network. Moreover, each node can receive blocks generated by other nodes from other nodes. In addition, the processor is programmed to execute a global sequencing process to repeatedly select a plurality of candidate output blocks from the confirmed blocks according to the candidate criteria, and select at least one of the candidate output blocks according to the output sort criteria. The priority output block is used to form a priority output block group, and all priority output blocks in the priority output block group are selectively output according to a threshold standard to compact the block network to form a blockchain.
綜上述,於本發明之區塊鏈產生方法及系統中,每一個節點可自行產生區塊而形成區塊鏈,並且各節點所產生的區塊鏈均相同。 In summary, in the blockchain generation method and system of the present invention, each node can generate a block by itself to form a blockchain, and the blockchain generated by each node is the same.
1‧‧‧區塊鏈產生系統 1‧‧‧Blockchain generation system
10‧‧‧區塊鏈網路 10‧‧‧Blockchain network
12‧‧‧節點 12‧‧‧node
B1~B6‧‧‧區塊 Block B1~B6‧‧‧
C’‧‧‧節點區塊鏈 C’‧‧‧node blockchain
L‧‧‧區塊網 L‧‧‧Block Network
C‧‧‧區塊鏈 C‧‧‧Blockchain
S20~S29、S260~S262、S280~S284、S282’、S284’‧‧‧流程步驟 S20~S29, S260~S262, S280~S284, S282’, S284’‧‧‧Process steps
圖1係繪示根據本發明之一具體實施例之區塊鏈產生系統的示意圖。 FIG. 1 is a schematic diagram of a blockchain generation system according to a specific embodiment of the present invention.
圖2係繪示根據本發明之一具體實施例之區塊鏈產生方法的步驟流程圖。 FIG. 2 is a flowchart of steps of a method for generating a blockchain according to a specific embodiment of the present invention.
圖3係繪示圖2之區塊鏈產生方法更進一步的步驟流程圖。 FIG. 3 is a flowchart showing further steps of the block chain generation method of FIG. 2.
圖4係繪示圖2之區塊鏈產生方法更進一步的步驟流程圖。 FIG. 4 is a flowchart of further steps of the block chain generation method of FIG. 2.
圖5係繪示根據本發明之另一具體實施例之區塊鏈產生方法的步驟流程圖 Fig. 5 is a flowchart showing the steps of a block chain generation method according to another embodiment of the present invention
為了讓本發明的優點,精神與特徵可以更容易且明確地了解,後續將以具體實施例並參照所附圖式進行詳述與討論。值得注意的是,這些具體實施例僅為本發明代表性的具體實施例,其中所舉例的特定方法、裝置、條件、材質等並非用以限定本發明或對應的具體實施例。又,圖中各裝置僅係用於表達其相對位置且未按其實際比例繪述,合先敘明。 In order to make the advantages, spirit and features of the present invention easier and clearer to understand, the following will be detailed and discussed with specific embodiments and with reference to the accompanying drawings. It should be noted that these specific embodiments are only representative specific embodiments of the present invention, and the specific methods, devices, conditions, materials, etc. exemplified therein are not intended to limit the present invention or the corresponding specific embodiments. In addition, each device in the figure is only used to express its relative position and is not drawn according to its actual scale, which is described first.
請一併參考圖1,圖1係繪示根據本發明之一具體實施例之區塊鏈產生系統1的示意圖。如圖1所示,區塊鏈產生系統1可包含區塊鏈網路10及連接區塊鏈網路10的複數個節點12,其中區塊鏈網路10可為網際網路或建構於網際網路上基於區塊鏈協定的特定網路服務,而節點12可為與區塊鏈網路10連接之電腦主機或是任何可進行區塊產生程序的計算機裝置或設備。請注意,圖1為了圖面簡潔起見僅繪示出4個節點,但實務中節點的數量係可擴展的,本發明對此並不加以限制。
Please also refer to FIG. 1, which is a schematic diagram of a
區塊鏈網路10中可儲存多筆資料,這些資料可根據不同的應用領域而包含不同的形式或內容,例如,這些資料可為金融交易資料、醫療病歷、身分驗證資料、學歷資料或人工智慧學習資料等。於本具體實施例中,各節點12可分別且不重複地獲取區塊鏈網路10中的資料,並且每一個節點12中的處理器120可對所接收到的資料執行區塊產生程序來產生區塊,如圖1中之區塊B1~B6,並且每當各節點12完成一個區塊後即可自行提出,並不需要先進行雜湊運算來與其他節點搶奪新區塊的提出或產生權
利,因此本發明之區塊鏈產生系統1產生區塊的效率遠高於基於工作量證明而建構的區塊產生系統。於實務中,處理器120可為中央處理單元(Central Processing Unit,CPU)或處理晶片等。
The
每一個節點12之處理器120可分別以儲存於其記憶體、中央處理單元或其他儲存媒介中的區塊產生程序處理上述資料進而產生區塊,而各節點12自身所產生的區塊互相連接形成節點區塊鏈,如圖1所示之多條節點區塊鏈C’。此外,當一節點12產生並提出一新區塊時,會透過區塊鏈網路20對其他節點12進行關於此區塊的廣播,而當其他節點22接收到廣播時可對此新區塊進行確認,並且其他節點22可於後續產生的區塊中將前述廣播中的確認資訊一併寫入後續產生的區塊中。換言之,由後續產生的區塊確認了其他節點12的前一個區塊。舉例來說,區塊B3直接且同時確認了區塊B1及區塊B2,區塊B4直接且同時確認了區塊B1及區塊B3,區塊B5直接確認了區塊B3,而區塊B6則直接且同時確認了區塊B4及區塊B5。不同節點12間之區塊互相確認將會形成如圖1所示之區塊網L。請注意,上述的各區塊除了互相確認之外,每個節點12也都會從其他節點12收到其他節點12產生的區塊與區塊確認資訊,因此每個節點12中都會儲存相同的區塊網L。
The
此外,每一個節點12之處理器120也可分別以儲存於其記憶體、中央處理單元或其他儲存媒介中的全局定序程序處理,對區塊網L中的所有區塊進行排序,進而可根據排序結果將區塊網L壓實而產生區塊鏈C。每一個節點12的處理器120對同樣的區塊網L執行同樣的全局定序程序,因此即使各節點12之處理器120都是單獨運作的,各節點12所得到的區塊鏈C也都會相同。
In addition, the
請一併參照圖1以及圖2,圖2係繪示根據本發明之另一具體實施例之區塊鏈產生方法的步驟流程圖,請注意,圖2之區塊鏈產生方法可透過圖1之區塊鏈產生系統1來實行。如圖2所示,本具體實施例之區塊鏈產生方法包含以下步驟:於步驟S20,各節點12分別基於區塊鏈協定自區塊鏈網路10中獲取多筆資料,並且每一節點12所獲取的資料不重複;於步驟S22,各節點12分別對接收到的資料進行區塊產生程序而形成多個區塊,每一節點12中形成的區塊互相連接而形成各節點12自己的節點區塊鏈C’,且每一節點區塊鏈C’中的區塊與其他節點區塊鏈C’的區塊互相確認形成區塊網L;於步驟S24,各節點12分別根據一候選標準從已被確認之區塊中挑選出複數個候選輸出區塊;於步驟S26,各節點12分別根據一輸出排序標準自候選輸出區塊中選出至少一優先輸出區塊以形成優先輸出區塊群組;於步驟S28,各節點12係於優先輸出區塊群組達到一門檻標準時,輸出優先輸出區塊群組中的所有優先輸出區塊;以及,於步驟S29,重複進行上述步驟以將該區塊網L壓實形成區塊鏈C。本具體實施例之區塊鏈產生方法可由各節點12單獨執行,其中步驟S22為各節點12分別執行區塊產生程序,而步驟S24至S28則為各節點12分別執行全局定序程序。以下對各步驟進行詳細的描述。
Please refer to Fig. 1 and Fig. 2 together. Fig. 2 shows a flowchart of the block chain generation method according to another specific embodiment of the present invention. Please note that the block chain generation method in Fig. 2 can be seen in Fig. 1 The
於步驟S20中,各節點12可基於同一個區塊鏈協定來獲取如前述的金融交易資料、醫療病歷、身分驗證資料、學歷資料或人工智慧學習資料等等,以將這些資料進行處理並產生區塊。為了避免重複處理造成計算能力的浪費,各節點所獲取的資料並不會重複。
In step S20, each
於步驟S22中,各節點12可分別將所獲取的資料進行區塊產
生程序來產生多個區塊。詳言之,各節點12可將所獲取的資料批次進行加密運算等產生區塊所必要的計算,使資料可被寫入相同或不同的區塊中。每當各節點12產生一新區塊時,可將此新區塊連接於該節點中前一個產生的區塊而形成各節點12自己的節點區塊鏈C’(例如圖1中之區塊B2、B5為最左邊之節點12的節點區塊鏈C’上之區塊)。此外,各節點12產生新區塊時,可對區塊鏈網路10發出廣播,而廣播的內容包含了此新區塊的相關資訊,例如新區塊的創建者代碼(Block Proposer ID)、該區塊之雜湊值(Block Hash)、該區塊之前一區塊之雜湊值(Previous Block Hash)、創建者簽名(Signature)、區塊高度(Block Height)、以及確認資料(Acks)等。當其他節點12接收到前述廣播時即確認此新區塊,並於此時產生關於此新區塊的被確認時間,且當其他節點12於後續再產生新區塊時也會將廣播中的資訊寫入新區塊中,因此,各節點12間的區塊可互相確認而形成區塊的網狀結構,亦即圖1之區塊網L。另外,為了解決拜占庭將軍問題,可設定當一個新產生區塊被區塊鏈網路中超過總數量之三分之二的其他節點確認無誤時,此新產生區塊即成為一個已確認區塊,亦即一個可信賴的區塊。
In step S22, each
由於各節點12於前述步驟中各自對不重複的資料進行區塊產生程序提出區塊進而產生自身的節點區塊鏈C’,故每個節點12與其他節點12間的節點區塊鏈C’將會完全不同,因此,需要整合所有節點12的區塊並對各區塊進行排序,以在所有節點12中形成相同的區塊鏈來保持區塊鏈系統的穩定性。如前所述,圖1中之各節點12除了自身的區塊之外,還可自區塊鏈網路10接收其他節點12的區塊及區塊確認資訊,換言之,各節點12分別儲存了相同的區塊網L。於實務中,雖然每個節點12接收到其他節點12
之區塊的時間不盡相同(基於各節點12間的位置以及網路速度而定),但最終仍會得到所有的區塊的資訊。接著,本具體實施例之區塊鏈產生方法的步驟S24至步驟S28可利用全局定序程序來將每個節點12中的區塊網L壓實為完全相同的區塊鏈C。
Since each
於步驟S24中,每個節點12分別根據候選標準,從所接收到的所有區塊(包含自身產生的區塊)之已被確認的區塊中挑選出複數個候選輸出區塊。參考圖1之區塊B1至區塊B6,其中區塊B1至區塊B5為已被確認之區塊,而區塊B6則為尚未被確認之區塊。此外,於本具體實施例中,候選標準為:候選輸出區塊係已被其他區塊確認,且僅確認已被輸出為區塊鏈C之一部分的區塊。以圖1為例,在已被確認之區塊B1~B5中,區塊B1以及區塊B2只確認了已經成為區塊鏈C之一部分的區塊(圖未示),因此區塊B1及區塊B2被選為候選輸出區塊;相反地,區塊B3~B5除了被其他區塊確認之外,還確認了尚未輸出為區塊鏈C之一部分的區塊B1及區塊B2,故區塊B3~B5不為候選輸出區塊。
In step S24, each
於步驟S26中,每個節點12分別根據輸出排序標準,從候選輸出區塊(例如圖1中之區塊B1及區塊B2)中再選出至少一個優先輸出區塊,並且將此至少一個優先輸出區塊形成優先輸出區塊群組。舉例來說,區塊鏈產生系統中的一節點於一時間點可挑選出10個候選輸出區塊,並且從此10個候選輸出區塊中再進一步選出4個優先輸出區塊以形成優先輸出區塊群組。
In step S26, each
請參照圖3,圖3係繪示圖2之區塊鏈產生方法更進一步的步驟流程圖。如圖3所示,本具體實施例之區塊鏈產生方法的步驟S26進一步
包含步驟S260以及步驟S262。於步驟S260,各節點12分別根據確認了候選輸出區塊的其他區塊來產生關於此候選輸出區塊的確認權重向量;以及,於步驟S262,各節點分別將各候選輸出區塊的各確認權重向量互相比較,以自候選輸出區塊中選出至少一個優先輸出區塊而形成優先輸出區塊群組。換言之,步驟S260及步驟S262即為前述的輸出排序標準。
Please refer to FIG. 3. FIG. 3 is a flowchart of further steps of the block chain generation method of FIG. 2. As shown in FIG. 3, step S26 of the method for generating a blockchain of this embodiment is further
Including step S260 and step S262. In step S260, each
於本具體實施例中,每個候選輸出區塊的確認權重向量可包含N個參數,N等同於區塊鏈產生系統中的節點總數量,舉例來說,若圖1的系統僅具有圖面上的4個節點12,N即為4。請注意,N的數量係根據系統內的節點數量變化,因此並非完全固定的,當新的節點加入了區塊鏈產生系統,N也隨之增加。確認權重向量的N個參數分別代表各節點12所提出確認此候選輸出區塊之最舊區塊的高度。舉例來說,若圖1中之最左邊的節點12提出的區塊B2高度為3且區塊B5之高度為4,亦即,於此節點12的節點區塊鏈C’中,區塊B1為第三個區塊(前兩個已被輸出為區塊鏈C的一部分);區塊B3高度為2,區塊B6高度為3;區塊B1高度為1;區塊B4高度為7。因此,候選輸出區塊B1的確認權重向量為[∞,2,1,7],而候選輸出區塊B2的確認權重向量為[3,2,∞,7]。若某一節點12所提出之未被輸出的最舊區塊未確認該候選輸出區塊,則定義此節點12對候選輸出區塊的參數為∞。由圖1可知,最左側的節點12所提出之未被輸出的最舊區塊(亦即區塊B2)並未確認區塊B1,因此區塊B1的確認權重向量中對應最左側節點12之參數為∞。同理,區塊B2的確認權重向量中對應自最左側算起第三個節點12之參數也為∞。
In this specific embodiment, the confirmation weight vector of each candidate output block may include N parameters, and N is equal to the total number of nodes in the blockchain generation system. For example, if the system in Figure 1 only has a graph On the 4
各節點12分別產生了各候選輸出區塊的前述確認權重向量後,可將每個確認權重向量互相兩兩比對以得出確認權重向量的優先順
序,其中,比對的方式係為確認權重向量中的每個參數與其他確認權重向量中的相對應參數進行比對,例如圖1中之候選輸出區塊B1的確認權重向量中之第一個參數與候選輸出區塊B2的確認權重向量中之第一個參數進行比對。於此,當一確認權重向量中之第j個參數小於另一個確認權重向量之第j個參數時,定義前者的第j個參數為獲勝。當一候選輸出區塊的確認權重向量與另一候選輸出區塊的確認權重向量比對且獲勝的參數數量超過N/2時,稱前者的優先順序高於後者。
After each
當所有節點12的區塊確認資訊都被一節點12接收到時,此節點12即可得知所有候選輸出區塊的確認權重向量中的所有參數,故可進行比對而得到優先順序。基於網路速度限制以及各節點的地理位置關係,一節點12並非於同一時間點接收到所有其他節點12之區塊確認資訊而是依序收到的,因此該節點於此時間點所能獲得的上述確認權重向量的參數可能不完整。然而,當一定數量的其他節點12的區塊確認資訊被一節點12接收到之後,該節點12即可根據已獲得的區塊確認資訊預測出某一候選輸出區塊於未來是否會處於優先之順序。
When the block confirmation information of all
步驟S262中,當互相比對各確認權重向量後,對某一候選輸出區塊(於此稱其為第一輸出區塊)而言,若其他的候選輸出區塊的目前優先順序低於第一候選輸出區塊,且未來的優先順序也會低於第一候選輸出區塊時,則節點12將此第一候選輸出區塊選為優先輸出區塊。請注意,如前所述,一節點12係陸續地接收到其他節點12的區塊確認資訊,因此即使目前已經選擇了一個候選輸出區塊作為優先輸出區塊,於後續接收到其他節點12的區塊確認資訊後仍可能再選擇多個優先輸出區塊。這些被選擇出
來的優先輸出區塊形成優先輸出區塊群組,於後續輸出為區塊鏈C的一部分時,優先輸出區塊群組中的所有優先輸出區塊將會同時被輸出。
In step S262, after the confirmation weight vectors are compared with each other, for a certain candidate output block (herein referred to as the first output block), if the current priority of other candidate output blocks is lower than the first output block When a candidate output block has a lower priority in the future than the first candidate output block, the
當形成優先輸出區塊群組後,此優先輸出區塊群組達到一個門檻標準,各節點12即可自行將優先輸出區塊群組中的所有優先輸出區塊一起輸出成為區塊鏈C的一部分,如圖2之步驟S28所述。由於單一節點12得到其他節點12之區塊確認資訊的時間點不盡相同,因此各節點12輸出優先輸出群組的時間點也不相同,但基於所有節點12都能獲得相同的區塊網L與區塊確認資訊,故各節點12分別輸出的區塊鏈C是相同的。
When the priority output block group is formed, the priority output block group reaches a threshold standard, and each
請參照圖4,圖4係繪示圖2之區塊鏈產生方法更進一步的步驟流程圖。如圖4所示,本具體實施例之步驟S28更進一步包含步驟S280、步驟S282以及步驟S284。於步驟S280,各節點12分別判斷優先輸出區塊群組是否達到內部穩定條件;於步驟S282,各節點12分別判斷優先輸出區塊群組是否達到第一外部穩定條件;以及步驟S284,當優先輸出區塊群組同時達到內部穩定條件與第一外部穩定條件後,即輸出優先輸出區塊群組中的所有優先輸出區塊於已形成的區塊鏈C的最後端,使優先輸出區塊成為區塊鏈C的一部分。換言之,步驟S280以及步驟S282即為前述的門檻標準。
Please refer to FIG. 4. FIG. 4 is a flowchart of further steps of the block chain generation method of FIG. 2. As shown in FIG. 4, step S28 of this embodiment further includes step S280, step S282, and step S284. In step S280, each
於步驟S280中,內部穩定條件為:對於未被選為優先輸出區塊的每一個候選輸出區塊而言,優先輸出區塊群組中必定存在有至少一個優先輸出區塊,其目前優先順序和未來的優先順序都會高此不屬於候選輸出區塊的候選輸出區塊。換言之,對於不屬於優先輸出區塊的一個候選輸出區塊而言,至少存在一個優先輸出區塊,其優先順序永遠高於此候選輸出區塊,不論之後節點12接收到多少來自其他節點12的區塊確認資訊;
而對於不屬於優先輸出區塊的另一個候選輸出區塊而言,也同樣至少存在另一個優先輸出區塊(或同一個優先輸出區塊),其優先順序永遠高於此另一個候選輸出區塊。
In step S280, the internal stability condition is: for each candidate output block that is not selected as the priority output block, there must be at least one priority output block in the priority output block group, and its current priority order And the priority in the future will be higher. This candidate output block is not a candidate output block. In other words, for a candidate output block that is not a priority output block, there is at least one priority output block, and its priority is always higher than this candidate output block, regardless of how many
於步驟S282中,第一外部穩定條件為:節點12已經得到區塊鏈產生系統1中的所有其他節點12確認候選輸出區塊之狀態,亦即節點12已經接收到所有其他節點12的區塊確認資訊。換言之,所有候選輸出區塊以及優先輸出區塊的確認權重向量中的N個參數都已經得知。當節點12得到所有其他節點12的區塊確認資訊後,自然可確定所有優先輸出區塊的優先輸出順序高於其他候選輸出區塊,此稱為正常交付(normal delivery)。此外,根據一些數學的理論推導可知,第一外部穩定條件事實上即暗示了內部穩定條件,因此正常交付也可以被簡化為節點已經接收到所有其他節點的區塊確認資訊。
In step S282, the first external stable condition is: the
此外,如前所述,當一定數量的其他節點12的區塊確認資訊被一節點12接收到之後,該節點12即可根據已獲得的區塊確認資訊預測出某一候選輸出區塊或優先輸出區塊於未來是否會處於優先之順序,而不必等到節點12得到所有其他節點12的區塊確認資訊後才決定。換言之,節點12可以提早輸出優先輸出區塊群組使其成為區塊鏈C的一部分。
In addition, as mentioned above, when a certain number of block confirmation information of
請參照圖5,圖5係繪示根據本發明之另一具體實施例之區塊鏈產生方法的步驟流程圖,圖5之區塊鏈產生方法同樣可透過圖1之區塊鏈產生系統1來實行。如圖5所示,本具體實施例與上一具體實施例不同處,在於本具體實施例係以步驟S282’及步驟S284’取代上一具體實施例之步驟S282及步驟S284。請注意,本具體實施例中之其他步驟係與上一具體實施
例之相對應步驟大致相同,故於此不再贅述。
Please refer to FIG. 5. FIG. 5 shows a flowchart of the block chain generation method according to another specific embodiment of the present invention. The block chain generation method in FIG. 5 can also be used through the block
於步驟S282’,各節點12分別判斷優先輸出區塊群組是否達到第二外部穩定條件。此外,於步驟S284’,當優先輸出區塊群組同時達到內部穩定條件與第二外部穩定條件後,即輸出優先輸出區塊群組中的所有優先輸出區塊使其成為區塊鏈C的一部分。
In step S282', each
步驟S282’中,第二外部穩定條件包含以下兩個條件:優先輸出區塊群組中存在一個第一區塊,提出確認該第一區塊之區塊的該等節點之數量大於一個設定值;以及,對於優先輸出區塊群組中的每一優先輸出區塊而言,提出確認了每一優先輸出區塊之區塊的節點12數量大於等於N減去設定值。上述的設定值係小於等於N並大於N/2,亦即小於等於節點總數量並大於節點總數量的二分之一。
In step S282', the second external stability condition includes the following two conditions: there is a first block in the priority output block group, and it is proposed to confirm that the number of nodes in the block of the first block is greater than a set value ; And, for each priority output block in the priority output block group, it is proposed to confirm that the number of
於本具體實施例中,第二外部穩定條件可於節點12尚未接收到所有其他節點12的區塊確認資料時,使各節點12預測優先輸出區塊群組中的所有優先輸出區塊的優先順序會永遠高於不屬於優先輸出區塊的候選輸出區塊,因此,各節點12可提早輸出優先輸出區塊群組使其成為區塊鏈C的一部分,並不需要等到節點12接收到所有其他節點12的區塊確認資料後再輸出,此稱為提早交付(early delivery)。此外,根據一些數學的理論推導可知,當優先輸出區塊群組達到前述的內部穩定條件並且所有候選輸出區塊所組成之群組減去優先輸出區塊群組不為空集合時,優先輸出群組也自動達到了第二外部穩定條件,因此提早交付也可以被簡化為達到內部穩定條件且所有候選輸出區塊所組成之群組減去優先輸出區塊群組不為空集合。
In this embodiment, the second external stable condition can make each
圖4及圖5之具體實施例的區塊鏈產生方法之差別在於輸出優先輸出區塊之時間點不同,但所輸出的優先輸出區塊以及區塊鏈C是相同的,因此,於本發明之區塊鏈產生方法中,優先輸出區塊群組只要達到內部穩定條件與兩種外部穩定條件中的一者即可輸出。 The difference between the block chain generation methods of the specific embodiments of Fig. 4 and Fig. 5 is that the time point of outputting the priority output block is different, but the output priority output block and the block chain C are the same. Therefore, in the present invention In the block chain generation method, the priority output block group can be output as long as it reaches one of the internal stable conditions and the two external stable conditions.
前述的步驟S24、S26、S28以及其子步驟(如圖3、圖4及圖5所示)係用來對已被確認的區塊來進行全局定序程序來進行排序及輸出。然而,區塊鏈產生系統1中的所有節點12除了進行全局定序程序之外也同時在持續進行區塊產生程序,因此仍會陸續地提出新區塊並且新區塊互相確認或確認較舊但未被輸出為區塊鏈C之一部分的區塊,亦即,圖2中之步驟S20及步驟S22是持續不斷地在進行的。當一節點12接收到新的被確認區塊及區塊確認資訊時,會根據新接收到的區塊確認資訊更新所有候選輸出區塊的確認權重向量並更新排序,且進一步地判斷更新後的優先輸出區塊群組是否已達門檻標準而可輸出,亦即,圖2中之步驟S24至步驟S26也是持續不斷地在進行的。由此可知,本發明的區塊鏈產生方法是一種動態的方法。
The aforementioned steps S24, S26, S28 and their sub-steps (as shown in FIG. 3, FIG. 4, and FIG. 5) are used to perform a global sequence procedure for the confirmed blocks to sort and output. However, all the
此外,於前述各具體實施例中,各節點12雖然同時將優先輸出區塊群組中的所有優先輸出區塊一起輸出,但各優先輸出區塊同樣可依據特定標準來排定互相之間的順序。舉例來說,各節點可於輸出優先輸出區塊群組中的所有優先輸出區塊時,根據各優先輸出區塊的雜湊值(Hash)來排定連接至區塊鏈C之最後端的順序。
In addition, in the foregoing specific embodiments, although each
綜上述,本發明之區塊鏈產生系統及區塊鏈產生方法可使系統中的所有節點各自地提出區塊並使不同節點提出的區塊互相確認形成區塊網,使區塊產生效率大幅度的提高並保證區塊的不可竄改性。此外,各 節點各自透過對相同的區塊網執行相同的全局排序程序,可將區塊網壓實成完全相同的區塊鏈,進而保持區塊鏈系統的穩定性。 In summary, the block chain generation system and block chain generation method of the present invention can enable all nodes in the system to propose blocks individually and make the blocks proposed by different nodes mutually confirm to form a block network, so that the block generation efficiency is high. The increase in the amplitude ensures that the block cannot be modified. In addition, each Each node can compact the blockchain into an identical blockchain by performing the same global sorting procedure on the same blockchain, thereby maintaining the stability of the blockchain system.
藉由以上較佳具體實施例之詳述,係希望能更加清楚描述本發明之特徵與精神,而並非以上述所揭露的較佳具體實施例來對本發明之範疇加以限制。相反地,其目的是希望能涵蓋各種改變及具相等性的安排於本發明所欲申請之專利範圍的範疇內。因此,本發明所申請之專利範圍的範疇應根據上述的說明作最寬廣的解釋,以致使其涵蓋所有可能的改變以及具相等性的安排。 Based on the above detailed description of the preferred embodiments, it is hoped that the characteristics and spirit of the present invention can be described more clearly, rather than limiting the scope of the present invention by the preferred embodiments disclosed above. On the contrary, its purpose is to cover various changes and equivalent arrangements within the scope of the patent application for the present invention. Therefore, the scope of the patent application for the present invention should be interpreted in the broadest sense based on the above description, so that it covers all possible changes and equivalent arrangements.
S20~S29‧‧‧流程步驟 S20~S29‧‧‧Process steps
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW108108696A TWI699986B (en) | 2019-03-14 | 2019-03-14 | Method and system for generating blockchain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW108108696A TWI699986B (en) | 2019-03-14 | 2019-03-14 | Method and system for generating blockchain |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI699986B true TWI699986B (en) | 2020-07-21 |
TW202034664A TW202034664A (en) | 2020-09-16 |
Family
ID=72601935
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW108108696A TWI699986B (en) | 2019-03-14 | 2019-03-14 | Method and system for generating blockchain |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI699986B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017192837A1 (en) * | 2016-05-04 | 2017-11-09 | Silvio Micali | Distributed transaction propagation and verification system |
US20180096121A1 (en) * | 2016-09-30 | 2018-04-05 | Cable Television Laboratories, Inc | Systems and methods for secure person to device association |
CN108876361A (en) * | 2017-05-12 | 2018-11-23 | 李平 | Block catenary system, block generation method and computer readable storage medium |
US20190043024A1 (en) * | 2017-08-05 | 2019-02-07 | Proclus Technologies Limited | Method and System for Securing a Blockchain with Proof-of-Transactions |
-
2019
- 2019-03-14 TW TW108108696A patent/TWI699986B/en not_active IP Right Cessation
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017192837A1 (en) * | 2016-05-04 | 2017-11-09 | Silvio Micali | Distributed transaction propagation and verification system |
US20180096121A1 (en) * | 2016-09-30 | 2018-04-05 | Cable Television Laboratories, Inc | Systems and methods for secure person to device association |
CN108876361A (en) * | 2017-05-12 | 2018-11-23 | 李平 | Block catenary system, block generation method and computer readable storage medium |
US20190043024A1 (en) * | 2017-08-05 | 2019-02-07 | Proclus Technologies Limited | Method and System for Securing a Blockchain with Proof-of-Transactions |
Also Published As
Publication number | Publication date |
---|---|
TW202034664A (en) | 2020-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7362654B2 (en) | Maintenance and management of blockchain blocks in a divided blockchain network | |
JP7184959B2 (en) | Method and apparatus for distributed database in network | |
US20210073678A1 (en) | Method, apparatus and system for secure vertical federated learning | |
CN110135986B (en) | Method for realizing searchable encrypted file data based on blockchain intelligent contract | |
CN108984789B (en) | Distributed accounting method and device, storage medium and electronic equipment | |
JP2020519983A (en) | System and method for parallel processing blockchain transactions | |
CN110866546B (en) | Method and device for evaluating consensus node | |
Ding et al. | An adaptive gradient method for online auc maximization | |
Jin et al. | Synergistic partitioning in multiple large scale social networks | |
CN113114496A (en) | Block chain expandability problem solution based on fragmentation technology | |
Xu et al. | Towards heuristic web services composition using immune algorithm | |
CN112348518B (en) | Block chain transaction certification method and device | |
WO2021190179A1 (en) | Synchronous processing method and related apparatus | |
Garcia Bringas et al. | BlockChain platforms in financial services: current perspective | |
Bhuiyan et al. | Fast parallel algorithms for edge-switching to achieve a target visit rate in heterogeneous graphs | |
TWI699986B (en) | Method and system for generating blockchain | |
CN113994324B (en) | Block chain system with efficient world state data structure | |
CN113810507B (en) | Block chain credible node partitioning method based on IDE | |
WO2019080844A1 (en) | Data reasoning method and apparatus, and computer device | |
CN115048462A (en) | Block chain-based digital asset synthesis method and device | |
Zhang et al. | Refining regulatory networks through phylogenetic transfer of information | |
CN113722554A (en) | Data classification method and device and computing equipment | |
Klos et al. | Neural architecture search based on genetic algorithm and deployed in a bare-metal kubernetes cluster | |
Sadowski et al. | Learning and exploiting mixed variable dependencies with a model-based EA | |
US20230401452A1 (en) | Systems and methods for weight-agnostic federated neural architecture search |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |