WO2022166791A1 - 相关于区块挖矿的工作量证明的方法和运算装置 - Google Patents

相关于区块挖矿的工作量证明的方法和运算装置 Download PDF

Info

Publication number
WO2022166791A1
WO2022166791A1 PCT/CN2022/074477 CN2022074477W WO2022166791A1 WO 2022166791 A1 WO2022166791 A1 WO 2022166791A1 CN 2022074477 W CN2022074477 W CN 2022074477W WO 2022166791 A1 WO2022166791 A1 WO 2022166791A1
Authority
WO
WIPO (PCT)
Prior art keywords
random numbers
block
proof
condition
meet
Prior art date
Application number
PCT/CN2022/074477
Other languages
English (en)
French (fr)
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 CN202280003548.4A priority Critical patent/CN116235198A/zh
Publication of WO2022166791A1 publication Critical patent/WO2022166791A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present invention relates to a blockchain technology, in particular, to a method and a computing device for Proof-of-work (PoW) related to block mining.
  • PoW Proof-of-work
  • block and chain are used respectively in Bitcoin's white paper, with the development of a cryptocurrency (cryptocurrency).
  • cryptocurrency cryptocurrency
  • blockchain was the first blockchain application proposed.
  • various features of the blockchain have been developed today to meet the requirements for implementing trust in different applications in the Internet (Internet). For example, a smart contract is a trusted program that is verified by a peer node.
  • Proof of Work is a cryptographic proof that enables a prover to prove to others (verifiers) that a certain amount of specific computational effort has been spent. And the validator only needs to spend the least effort to confirm.
  • proof-of-work can be expressed by sending partial data from the requester to the service provider. Proof-of-Work was first proposed to avoid spam, and is achieved by doing a sufficiently large amount of work before delivering the email. Hash-based proof-of-work in Bitcoin is used to prove that enough computations have been done and allow the winner to append a new block. It is worth noting that the energy consumption problem of proof-of-work is due to the competition for enough work to get a high reward early. Due to Bitcoin’s limited supply and centralization of holdings, Bitcoin’s price jump has resulted in high rewards.
  • the present invention is directed to a method and computing device for proof of workload related to block mining, which improves trust and reduces energy consumption by increasing random numbers.
  • the method for proof-of-work related to block mining includes (but is not limited to) the following steps: receiving a block. Determine whether the hash values of multiple random numbers (nonces) corresponding to the block meet the conditions. In response to the fact that the first hash value of the first random number among the plurality of random numbers corresponding to the block meets the condition, it continues to determine that the second hash value of the second random number among the plurality of random numbers corresponding to the block meets the condition. Verify that at least two random numbers meet the conditions among multiple random numbers.
  • the computing device related to the proof-of-work of block mining includes (but is not limited to) a memory and a processor.
  • the memory is used to store program codes.
  • the processor is coupled to the memory.
  • the processor is configured to load and execute the program code to receive the block. Determine whether the hash values of multiple random numbers corresponding to the block meet the conditions, and verify at least two random numbers that meet the conditions among the multiple random numbers.
  • the processor is configured to be further configured to continue to determine a second one of the plurality of random numbers corresponding to the block in response to the first hash value of the first random number of the plurality of random numbers corresponding to the block being eligible The second hash of the random number is eligible.
  • FIG. 1 is a block diagram of components of a computing device according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of proof-of-work according to an embodiment of the present invention.
  • T maximum limit
  • n the required number of tests that meet the conditions
  • n' the total number of trials that meet the conditions
  • n total number of trials.
  • FIG. 1 is a block diagram of components of a computing device 100 according to an embodiment of the present invention.
  • the computing device 100 includes (but is not limited to) a memory 110 and a processor 150 .
  • the computing device 100 may be a computer, a server, a smart phone, a tablet computer, a mining machine, or other electronic devices.
  • the memory 110 may be any type of fixed or removable random-access memory (RAM), read-only memory (ROM), flash memory, the like, or a combination of the above.
  • RAM random-access memory
  • ROM read-only memory
  • flash memory the like, or a combination of the above.
  • the memory 110 records program code, device configuration, buffer data, or persistent data (eg, hash values, random numbers, target values, or conditions), which will be described later.
  • the processor 150 may be a central processing unit (CPU), microprocessor, microcontroller, graphics processing unit (GPU), digital signal processing (DSP) ) chip, field-programmable gate array (FPGA), or neural network accelerator.
  • CPU central processing unit
  • microprocessor microcontroller
  • GPU graphics processing unit
  • DSP digital signal processing
  • FPGA field-programmable gate array
  • the functions of the processor 150 may also be implemented by a stand-alone electronic device or an integrated circuit (IC), and the operations of the processor 150 may also be implemented by software.
  • computing device 100 also includes a communication transceiver 130 .
  • the communication transceiver 130 may be a communication interface or a wireless transceiver supporting, for example, Bluetooth (Bluetooth), Wi-Fi, mobile communication, IR wireless communication, USB, Ethernet (Ethernet), optical fiber network, and the like.
  • the communication transceiver 130 is used to communicate with external devices in order to receive data from or transmit data to external devices. For example, receive or transmit blocks.
  • the components and modules in the computing device 100 will be used to explain the method for proof-of-work related to block mining provided by the embodiments of the present invention.
  • Each step of the method can be adjusted according to the actual implementation, and should not be limited to the content described herein.
  • the processor 150 determines whether the hash values of the random numbers corresponding to the block meet the conditions (step S220). Specifically, in order to obtain the proof of work, a specific algorithm is used to calculate the result of the algorithm by spending time and computing resources. For example, the Bitcoin blockchain uses a hash algorithm as proof of work, allowing each node to generate valid new blocks through proof-of-work operations and verify them by other nodes.
  • the header of the block includes a nonce.
  • the processor 150 may combine the random number with other data (data from the header of the block or other sources), and substitute the mixed value of the two (ie, the value after combining the random number with other data) into the hash function to obtain hash value.
  • the processor 150 may determine whether the hash value of the one or more random numbers corresponding to the block is not greater than the target value. When the hash value is greater than the target value, the processor 150 may consider that the hash value does not meet the conditions. And when the hash value is not greater than (eg, less than or equal to), the processor 150 may regard the hash value as meeting the condition. That is, the condition of this embodiment is that it is not greater than the target value. However, in other embodiments, the processor 150 may use random numbers to perform other operations to obtain fairly random values such as hash values.
  • the processor 150 may change the random number when the hash value does not meet the conditions. For example, adding one to a random number, adding a specific value, or bringing it into a specific mathematical formula. Next, the processor 150 obtains its hash value based on the new random number, and determines whether the hash value meets the conditions.
  • the processor 150 continues to determine the second random number among the plurality of random numbers corresponding to the block in response to the first hash value of the first random number among the plurality of random numbers corresponding to the block meeting the condition
  • the second hash value of is eligible. That is, when the hash value meets the conditions, the processor 150 can still change the first random number to generate the second random number.
  • the processor 150 obtains the hash value based on the second random number, and determines whether the hash value meets the condition.
  • the processor 150 may determine whether the number of eligible random numbers is equal to m.
  • m is a positive integer greater than 0. For example, 2, 5, or 8. That is, as long as there are random numbers that meet the conditions, the processor 150 collects or stores the random numbers in the memory 110 until the number of random numbers that meet the conditions is equal to m.
  • the confidence level C of the estimated computing power of the general proof-of-work is related to m.
  • the probability that a conservative GPoW collects exactly m random numbers in n trials is the following formula (3), and the average value of n can be used to estimate the computing power (inversely proportional).
  • the processor 150 may determine m according to the confidence level C and/or the coefficient of variation CV. For example, first set the value of the trust degree C, and then solve the minimum m, so that the formula is less than 1-C.
  • the processor 150 may determine whether the eligible number of those random numbers is equal to m'.
  • m' is a positive integer greater than m. For example, 10, 6, or 7. That is to say, even if m qualified random numbers have been collected, as long as other random numbers still meet the conditions, the processor 150 collects or stores the random numbers in the memory 110 until the number of qualified random numbers is equal to m' .
  • m' is a number that can be customized by each node. As long as the time is less than half of the block interval (block interval), m' random numbers can be found, and at the same time, it will not lag behind the time when the block was first sent, and it will have a chance to be accepted.
  • This embodiment is called Aggressive General Proof-of-Work (GPoW).
  • the processor 150 may verify at least two random numbers among those random numbers that meet the conditions (step S230).
  • the processor 150 can send or broadcast at least two random numbers that meet the conditions to other nodes through the communication transceiver 130, and verify whether the hash values of these random numbers actually meet the conditions through the other nodes.
  • the processor 150 can also receive at least two random numbers sent from other nodes through the communication transceiver 130, and verify whether the hash values of these random numbers really meet the conditions. These random numbers calculated by a certain node can be recorded in the header of the block, and other nodes can verify whether the block meets the conditions.
  • the processor 150 may send the m random numbers through the transceiver 130 for verification. For example, record m random numbers in a block and broadcast the block.
  • the processor 150 may update the new block in response to the verification that the data in the block successfully meets the conditions. For example, if the hash values of m random numbers meet the conditions (for example, its estimated computing power is within the allowable range, its common ancestor block is within the specified range, the handling fee is within the specified range, etc.), the processor 150 may select the The first block of computing power (PowerTimeStamp) is earlier than a time difference range first, otherwise the one with greater computing power is first, so as to reset the current block and update it to the latest block.
  • the updating of the block can be implemented by receiving another block as described in step S210.
  • the processor 150 may averagely determine the estimated computing power of the PoW according to the hash values of the minimum m random numbers that meet the conditions.
  • the processor 150 may estimate the computing power in the grandfather block based on its estimated computing power A result of the 200% range or other allowable range determines that the random number successfully qualifies.
  • the processor 150 may determine that the random number successfully meets the condition according to the result that the common ancestor block is above the block containing the grandfather.
  • the processor 150 may determine that the random number successfully meets the conditions according to the result that the handling fee is zero.
  • the processor 150 may set the time difference range of the computing power according to the network time error (eg, one tenth of a second).
  • the GPoW proposed in the embodiment of the present invention reduces a lot of energy consumption compared to Bitcoin (even all traditional PoW) under measurement .
  • FIG. 3 is a flowchart of proof-of-work according to an embodiment of the present invention.
  • it is determined whether a block is received (step S1).
  • a random number is added (step S2). For example, add 1 to a random number.
  • It is determined whether the hash value derived from the random number of the header of the block is not larger than the target value (step S3).
  • It is determined whether or not m random numbers having a hash value not greater than the target value are collected (step S4). If m random numbers have not been collected, disable/stop/do not broadcast random numbers to other nodes for verification, and continue to increase random numbers.
  • step S5 the block including m random numbers is broadcast to other nodes for verification to confirm whether the mining has been mined, and the mining is reset.
  • the mined blocks can be verified (step S6). If the verification fails (ie, rejects), the random number is incremented (step S2) and its hash value is derived. If the verification is successful (ie, accepted), the block is confirmed and mining is reset (step S7).
  • EPoW continues EPoW and extends the consensus mechanism from one PoW of EPoW with two random numbers to m random numbers. That is, collect m random numbers that make the value of the block header hash function or other operations less than a specific target value t. Among them, these random numbers are included in the header of the block, and EPoW is an extension of the consensus mechanism from a PoW of Bitcoin (with only one random number). m, random number and hash value are all positive integers. The so-called conservative GPoW is because after expanding to m random numbers, if m random numbers are collected, the mining will be broadcast.
  • the positive GPoW is further extended to m' random numbers, and after collecting m random numbers, it continues to collect more favorable random numbers until it is satisfied. For example, find a higher maximum hash value, a lower minimum average hash value (representing real computing power), or even higher other next-highest hash values, etc.
  • GPoW is mainly to solve the energy consumption problem of the blockchain, and to establish a complete and accurate mathematical model that can be estimated by the blockchain to carry out various applications that mathematically ensure the degree of trust.
  • the acceptance or reward of a block is usually based on the real computing power, of course, it can also be based on the formula formed by the hash value represented by other random numbers, so which m random numbers are selected for broadcasting will have different considerations, even with It is related to the setting of the m value.
  • GPoW can broadcast the collected m random numbers in a block header for verification in the way of Bitcoin and EPoW.
  • the key is how to set the target value so that the above coefficient of variation can represent the degree of trust in the estimated computing power.
  • the system of simultaneous equations represents the most stable and reliable system state that will appear after several trials.
  • the relationship between x and the target value t can be obtained.
  • the weights of individual formulas can be set to obtain extreme value solutions or numerical solutions, or, like Bitcoin, the target value can be dynamically adjusted according to history so that the coefficient of variation or trust level is within a preset range, and the target value can be adjusted to make each mining verification successful.
  • the number of blocks is within a certain range to improve efficiency. Because x must not be greater than t to mine mines, so x ⁇ t ⁇ T, the integer T is the maximum limit of the hash value. Therefore, the smaller the value of t minus x is, the more stable or trustworthy the system is. The larger t is, the easier it is to dig mines, so the most trustworthy t that is the hardest to mine is x, the easiest t is Tv, and v is the smallest unit value that can distinguish the hash value in the system, which is not normalized. time is 1. If the variable x (i) is normalized between 0 and 1, v is 1/T, and the relationship between x and t becomes x ⁇ t ⁇ 1.
  • other related system functions can be designed. Even if part of the system design has nothing to do with computing power, such as real-name system or anonymity system, it can also be used to prevent and control the computing power indirectly after the computing power is controllable. Sybil attack, and the computing power obtained by saving energy can be used in the optimization design of any system, such as distributed synchronization and global event ordering. Therefore, the invention of GPoW solves all the technical problems of the current blockchain. Except for the resistance of the old forces with vested interests and the conservative wait-and-see humanity, there is no problem that cannot be solved.
  • FIG. 4 is a schematic diagram of proof-of-work according to an embodiment of the present invention.
  • T is the normalized target value
  • n is the total number of operational trials (trials)
  • m is the number of valid random numbers required (also the number of eligible trials)
  • m' is the number of all eligible random numbers ( is also the total number of eligible trials).
  • 1s is also one second, which means that in an example, the block interval is half of 2 seconds to estimate the maximum value of m'.
  • X k is the hash value of the kth trial
  • X (k) is the kth largest hash value.
  • the bottommost X n in the graph may appear anywhere between the largest and smallest hash values included.
  • X 1 , X 2 , ..., X n are given, and the order statistics X (1) , X (2) , ..., X (n) are also random variables (eg, for random variables The values of X 1 , X 2 , . . . , X n are sorted in increasing order).
  • an order statistic uniformly distributed over a unit period has a marginal distribution that belongs to the beta family of distributions.
  • the cumulative distribution function of the order statistic for these samples is:
  • U k F X (X k ) is defined to obtain corresponding random samples U 1 , . . . , U n from a standard uniform distribution.
  • the probability density function of the mth order statistic U (m) is:
  • the mth order statistic in a uniform distribution is a beta-distributed random variable.
  • U (m) ⁇ Beta(m, n-m+1).
  • the behavior of regularized GPoW mining with at least m random numbers is U (m) , assuming that u is given a target value t. It can be seen that the statistical equation in the beta distribution can be applied to GPoW mining.
  • the number of random numbers used for single-block mining is increased, and the estimable power with a high degree of trust is provided. target value, and provides a mathematical model for m or m' random numbers.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明实施例提供一种相关于区块挖矿的工作量证明的方法和运算装置。在方法中,接收区块。确定区块对应的多个随机数(nonce)的哈希值是否符合条件。反应于区块对应的多个随机数中的第一随机数的第一哈希值符合条件,继续确定区块对应的多个随机数中的第二随机数的第二哈希值符合条件。验证多个随机数中符合条件的至少二个随机数。藉此,可解决区块链的耗能问题,建立区块链可估算的完整准确数学模型,并据以适用于以数学保证信任程度的各种应用。

Description

相关于区块挖矿的工作量证明的方法和运算装置 技术领域
本发明涉及一种区块链(blockchain)技术,尤其是,还涉及一种相关于区块挖矿(block mining)的工作量证明(Proof-of-work,PoW)的方法和运算装置。
背景技术
在比特币(Bitcoin)的白皮书中分别使用用语“区块”与“链”,随着发展出密码货币(cryptocurrency)。在区块链名称确定之前,比特币已是首先提出的区块链应用。而区块链技术发展至今,除了比特币,还有超过一万五千种密码货币。另外,现今已发展出区块链的多种特征以符合在互联网(Internet)中不同应用对落实信任的需求。例如,智能合约(smart contract),它是一种受对等节点(peer node)验证的可信任程序。
值得注意的是,工作量证明是一种基于密码学的(cryptographic)证明,使证明者可向他人(验证者)证明已花费一定量的特定运算努力。而验证者只要花费最少的努力来确认。另外,可通过从要求者发出部分数据给业务提供者来表现工作量证明。工作量证明首先提出来用于避免垃圾邮件,并通过传送邮件前进行一些够大量的工作来实现。而在比特币中的基于哈希(hash)的工作量证明是用于证明已完成足够的运算量,并让赢者可附加新的区块。值得注意的是,工作量证明的能耗问题是由于要竞争足够的工作以尽早获得高额的奖励。由于比特币的供应有限与持有的集中化,使得比特币的价格跳升造成了高额的奖励。
发明内容
本发明是针对一种相关于区块挖矿的工作量证明的方法和运算装置,通过增加随机数来提升信任度并降低能耗。
根据本发明的实施例,相关于区块挖矿的工作量证明的方法包括(但不仅限于)下列步骤:接收区块。确定区块对应的多个随机数(nonce)的哈希值是 否符合条件。反应于区块对应的多个随机数中的第一随机数的第一哈希值符合条件,继续确定区块对应的多个随机数中的第二随机数的第二哈希值符合条件。验证多个随机数中符合条件的至少二个随机数。
根据本发明的实施例,相关于区块挖矿的工作量证明的运算装置包括(但不仅限于)存储器和处理器。存储器用以存储程序代码。处理器耦接存储器。处理器经配置用以加载且执行程序代码以接收区块。确定区块对应的多个随机数的哈希值是否符合条件,验证多个随机数中符合条件的至少二个随机数。处理器经配置用以还经配置用以反应于区块对应的多个随机数中的第一随机数的第一哈希值符合条件,继续确定区块对应的多个随机数中的第二随机数的第二哈希值符合条件。
基于上述,根据本发明实施例的相关于区块挖矿的工作量证明的方法和运算装置,即使已有多个随机数的哈希值符合条件,但仍须根据区块内的数据计算是否符合其他如时限、手续费等条件。藉此,可解决区块链的耗能问题,并确保信任度。
附图说明
包含附图以便进一步理解本发明,且附图并入本说明书中并构成本说明书的一部分。附图说明本发明的实施例,并与描述一起用于解释本发明的原理。
图1为根据本发明实施例的运算装置的组件方块图;
图2为根据本发明实施例的方法的流程图;
图3为根据本发明实施例的工作量证明的流程图;
图4为根据本发明实施例的工作量证明的示意图。
附图标号说明
100:运算装置;
110:存储器;
130:通讯收发器;
150:处理器;
S210~S230、S1~S7:步骤;
t:目标值;
T:最大值限;
m:符合条件的试验所需数量;
m’:符合条件的试验总数量;
n:试验的总数量。
具体实施方式
现将详细地参考本发明的示范性实施例,示范性实施例的实例说明于附图中。只要有可能,相同组件符号在图式和描述中用来表示相同或相似部分。
图1为根据本发明实施例的运算装置100的组件方块图。请参照图1,运算装置100包括(但不仅限于)存储器110和处理器150。运算装置100可以是计算机、服务器、智能手机、平板计算机、挖矿机或其他电子装置。
存储器110可以是任何类型的固定或可移动随机存取存储器(random-access memory;RAM)、只读存储器(read-only memory;ROM)、快闪存储器、类似装置或以上装置的组合。存储器110记录程序代码、装置配置、缓冲器数据或永久数据(例如哈希值、随机数、目标值或条件),且稍后将介绍这些数据。
处理器150耦接存储器110。处理器150配置成加载并执行存储在存储器110中的程序代码,以进行本公开的示范性实施例的程序。
在一些实施例中,处理器150可以是中央处理单元(central processing unit;CPU)、微处理器、微控制器、图形处理单元(graphics processing unit;GPU)、数字信号处理(digital signal processing;DSP)芯片、现场可编程门阵列(field-programmable gate array;FPGA)或神经网络加速器。处理器150的功能也可由独立电子装置或集成电路(integrated circuit;IC)实施,且处理器150的操作也可通过软件来实施。
在一些实施例中,运算装置100还包括通信收发器130。通信收发器130可以是支持例如蓝牙(Bluetooth)、Wi-Fi、移动通信、IR无线通信、USB、以太网(Ethernet)、光纤网络等的通信接口或无线收发器。在一些实施例中,通信收发器130用于与外部装置通信,以便从外部装置接收数据或将数据传输到外部装置。例如,接收或传送区块。
在以下实施例中将以运算装置100中的组件和模块来解释本发明实施例所提供的相关于区块挖矿的工作量证明的方法。方法的每个步骤可根据实际实施情况进行调整,且不应限于本文中所描述的内容。
图2为根据本发明实施例的方法的流程图。请参照图2,处理器150接收区块(步骤S210)。例如,处理器150通过通讯收发器130接收来自发布者、业务提供者的服务器或其他节点所提供的区块。又例如,处理器150自经由输入接口(图未示)接收来自存储装置所存储的区块。然而,本发明实施例不加以限制区块的来源或产生方式。
处理器150确定所述区块对应的多个随机数的哈希值是否符合条件(步骤S220)。具体而言,为了得出工作量证明,会采用特定算法,以通过花费时间和运算资源来运算出算法的结果。例如,比特币(Bitcoin)区块链采用哈希算法作为工作量证明,让各节点经由工作量证明运算来生成有效的新区块,并经由其他节点验证。
在一实施例中,区块的头(header)包括随机数(nonce)。处理器150可将随机数结合其他数据(来自区块的头或其他来源的数据),并将两者的混合值(即,随机数与其他数据结合后的值)代入哈希函数以得出哈希值。在一实施例中,处理器150可确定区块对应的一个或更多个随机数的哈希值是否未大于目标值。当哈希值大于目标值,则处理器150可视为这哈希值未符合条件。而当哈希值未大于(例如,小于或等于),则处理器150可视为这哈希值符合条件。也又是说,这实施例的条件是未大于目标值。然而,在其他实施例中,处理器150可能使用随机数进行其他运算所得出的如同哈希值相当随机的值。
在一实施例中,当哈希值未符合条件时,处理器150可改变随机数。例如,将随机数加一、加特定值、或带入特定数学式。接着,处理器150再基于新的随机数得出其哈希值,并确定哈希值是否符合条件。
在一实施例中,反应于区块对应的多个随机数中的第一随机数的第一哈希值符合条件,处理器150继续确定区块对应的多个随机数中的第二随机数的第二哈希值符合条件。也就是说,当哈希值符合条件时,处理器150仍可改变第一随机数,以生成第二随机数。接着,处理器150再基于第二随机数得出其哈希值,并确定哈希值是否符合条件。
在一实施例中,处理器150可确定那些随机数中符合条件的数量是否等于m个。m为大于0的正整数。例如,2、5、或8。也就是说,只要有随机数符合条件,处理器150收集或存储这随机数在存储器110,直到符合条件的随机数的数量等于m个。在一些应用情境中,若m=1,则可等同于比特币的做法。若m=2,则可等同于可估计工作量证明(Estimatable Proof-of-Work,EPoW)。这实施例称为保守型通用工作量证明(Conservative General Proof-of-Work,GPoW)。
在一实施例中,通用工作量证明的估计算力的可信任程度C相关于m。例如,n次试验中保守型GPoW收集到正好m个随机数的概率是如下公式(3),n的平均值可用来估计算力(成反比)。根据贝氏定理(Bayes’Theory),假设每次试验的机率是1/n,估计算力的变异系数(Coefficient of Variation)为
Figure PCTCN2022074477-appb-000001
而估计算力可信任程度C是1减去其变异系数CV。即,C=1-CV。例如,m=10的试验中,可信任程度可高达90.09%。若m=1000,可信任程度甚至接近99.9%。在一实施例中,处理器150可根据可信任程度C和/或变异系数CV确定m。例如,先设定可信任程度C的值,再解出最小的m,使得该公式小于1-C。
在一实施例中,处理器150可确定那些随机数中符合条件的数量是否等于m’个。m’为大于m正整数。例如,10、6、或7。也就是说,即便已收集到m个符合条件的随机数,只要有其他随机数仍符合条件,处理器150收集或存储这随机数在存储器110,直到符合条件的随机数的数量等于m’个。m’是各节点可以自订的数字,只要时间小于区块区间(block interval)的一半内找得到m’个随机数,同时不会落后最先送出区块的时间,就有机会被接受。这实施例称为积极型通用工作量证明(Aggressive General Proof-of-Work,GPoW)。
在一实施例中,第m个顺序统计量(Order Statistics)还相关于beta分布。beta分布可用于解释以m为前提的基于哈希的工作量证明的行为,并待后续实施例详述。
处理器150可验证那些随机数中符合条件的至少二个随机数(步骤S230)。在一实施例中,处理器150可通过通讯收发器130发送或广播符合条件的至少二个随机数给其他节点,并通过其他节点验证这些随机数的 哈希值是否确实符合条件。在另一实施例中,处理器150也可通过通讯收发器130接收来自其他节点所发送的至少二个随机数,并验证这些随机数的哈希值是否确实符合条件。而某一个节点所运算的这些随机数一并可记录在区块的头中,并由其他节点验证这区块是否符合条件。
在一实施例中,反应于所述多个随机数中符合所述条件的数量等于m个或等于m’个,处理器150可通过讯收发器130发送那m个随机数以供验证。例如,将m个随机数记录在区块中,并广播这区块。
在一实施例中,反应于验证区块中数据都成功符合条件,处理器150可更新新区块。例如,若m个随机数的哈希值符合条件(例如是,其估计算力在允许范围中,其共同祖先区块在规定范围,手续费合乎规定等),则处理器150可选出时算力(PowerTimeStamp)最先的区块,早于一时间差范围者为先,否则再比算力大者为先,从而重置当前区块并更新成最新区块。而更新区块可采用如步骤S210所述的接收另一个区块来实现。
在一实施例中,处理器150可根据符合条件的最小m个随机数的哈希值平均确定工作量证明的估计算力。
在一实施例中,处理器150可根据其估计算力在祖父区块估计算力
Figure PCTCN2022074477-appb-000002
200%范围或其他容许范围的结果确定随机数成功符合条件。
在一实施例中,处理器150可根据共同祖先区块在含祖父区块以上的结果确定随机数成功符合条件。
在一实施例中,处理器150可根据手续费为零的结果确定随机数成功符合条件。
在一实施例中,处理器150可根据网路时间误差(如十分之一秒),设定时算力的时间差范围。
假设这里只计产生一次GPoW区块的m个随机数所需的m个哈希值,则本发明实施例所提出的GPoW在测量下相较于比特币(甚至所有传统PoW)降低许多能耗。
以下说明基于哈希函数的工作量证明的整体流程(可由运算装置100或其他装置实现)。图3为根据本发明实施例的工作量证明的流程图。请参照图3,确定是否接收到区块(步骤S1)。增加随机数(步骤S2)。例如,随机数加1。确定区块的头的随机数所得出的哈希值是否未大于目标值(步 骤S3)。确定是否收集到m个具有未大于目标值的哈希值的随机数(步骤S4)。若尚未收集到m个随机数,则禁能/停止/不广播随机数给其他节点来验证,并继续增加随机数。而若收集到m个随机数,则将包括m个随机数的区块广播至其他节点来验证以确认是否已挖到矿,并重置挖矿(步骤S5)。另一方面,可验证已挖的区块(步骤S6)。若验证失败(即,拒绝),则增加随机数(步骤S2)并得出其哈希值。若验证成功(即,接受),则确认区块并重置挖矿(步骤S7)。
值得注意的是,GPoW延续EPoW,并将共识机制从EPoW的一个PoW两个随机数扩展到m个随机数。也就是搜集m个让区块头(block header)的哈希函数或其他运算后的值小于特定目标值t的随机数。其中,这些随机数包含于区块的头,而EPoW是将共识机制由比特币的一个PoW(只含一个随机数)扩充而来,m、随机数与哈希值都是正整数。所谓保守型GPoW是因为扩展到m个随机数后,若搜集了m个随机数即广播挖到矿。而积极型GPoW是进一步扩展到m’个随机数,搜集了m个随机数后继续搜集更有利的随机数直到满意为止。例如,找到更高的最大哈希值,更低的最小平均哈希值(代表真正算力),甚至更高的其他次高哈希值等。GPoW主要就是解决区块链的耗能问题,并建立区块链可估算的完整准确数学模型,来进行以数学保证信任程度的各种应用。区块的接受或报酬通常基于真正算力,当然也可以基于由其他随机数代表的哈希值所构成的公式,所以从m’个随机数选哪m个来广播会有不同考虑,甚至跟m值的设定有关。
GPoW可依照比特币与EPoW的方式将所搜集的m个随机数放在一个区块标头内广播出去受验证。关键是如何设定目标值使得上述的变异系数能代表所估计算力的信任程度。先求平均试验数
Figure PCTCN2022074477-appb-000003
与最大哈希值的平均值
Figure PCTCN2022074477-appb-000004
的联立方程组,表示试验若干次之后会出现的最稳定而可信任的系统状态,分别得出解n与x后,可求出x与目标值t的关系。例如,可以设定个别公式的权重求极值解或数值解,或像比特币根据历史动态调整目标值使得变异系数或信任程度在预设范围内,以及调整目标值使得每次挖矿验证成功的区块数量在一定的范围内以提高效率。因为x必须不大于t才能挖到矿,所以x≤t<T,整数T是哈希值的最大值限。因此,t减x的值越小就是这系统越稳定或是越可信任的指标。而t越大表示越容易挖到矿,所以最可信任中最难挖到矿 的t是x,最容易的t是T-v,v是系统中哈希值可区分的最小单位值,未正规化时是1。若x (i)变量正规化到0与1之间,v为1/T,x与t的关系变成x≤t<1。根据这样设定的目标值t所运作的系统就是可信可控的,甚至可设定t=x+wv,w≧1越大代表系统允许的各个参数运作弹性越大。从可控的算力估计,可进而设计其他相关的系统函数,就算部分系统设计是与算力无关的,如实名制或匿名制,也可以在算力可控后间接用来防治与算力相关的女巫攻击,而节省能耗所得的算力更可用在任何系统的优化设计,如分布式同步(distributed synchronization)与全局事件顺序(global event ordering)。因此,GPoW的发明解决了目前区块链所有的技术问题,除了既得利益的旧势力抵制与保守的观望人性,还没遇到不能解决的问题。
图4为根据本发明实施例的工作量证明的示意图。请参照图4,假设哈希值是0至2 256-1中的一个值,即最大哈希值T=2 256-1。哈希值是在[0,T=2 256)中均匀分布的整数。加上值2^256可被正规化成标准连续的均匀分布[0,1],以适用于beta分布或其他分布的分析。T为正规化的目标值,n为运算试验(trial)的总数量,m为所需有效随机数的数量(也是符合条件的试验所需数量),m’为所有符合条件随机数的数量(也是符合条件的试验总数量)。其中,1s也就是一秒,表示在一实例中区块间隔为2秒的一半以估计m’的最大值。而基于顺序统计量(Order Statistics)的概念,X k为第k次试验的哈希值,X (k)为第k大的哈希值。假设X i=(1)为最小哈希值,且X j=(n)为最大哈希值。因此,X n=i=(1)为具有最小哈希值的最后试验。注意图中最下方的X n可能出现在包含最大哈希值与最小哈希值之间的任何地方。
假设给定任意随机变量X 1、X 2、...、X n,且顺序统计量X (1)、X (2)、...、X (n)也是随机变量(例如,对随机变量X 1、X 2、...、X n的值以升序(increasing order)排序)。对于独立随机变量,在单位期间上的均匀分布的顺序统计量具有属于beta分布家族的边际分布(marginal distribution)。针对随机变数X 1、X 2、...、X n的样本,假设有累积分布函数(Cumulative Distribution Function,CDF)F X(x)及概率密度函数(Probability Density Function,PDF)f X(x)=F′ X(x)。而针对这些样本的顺序统计量的累积分布函数为:
Figure PCTCN2022074477-appb-000005
,且对应的概率密度函数为:
Figure PCTCN2022074477-appb-000006
也就是说,
Figure PCTCN2022074477-appb-000007
是在未大于x的随机变量X 1、X 2、...、X n中至少m个变量的事件的概率。此外,
Figure PCTCN2022074477-appb-000008
这概率相同于在n个试验中未大于目标值x的至少m个哈希值的概率。
若定义U k=F X(X k)以自标准均匀分布中取得对应随机样本U 1、...、U n。顺序统计量同样满足
Figure PCTCN2022074477-appb-000009
针对标准均匀分布给出F U(u)=u,则f U(u)=1。而第m个顺序统计量U (m)的概率密度函数为:
Figure PCTCN2022074477-appb-000010
也就是说,均匀分布中的第m个顺序统计量是成beta分布的随机变数。例如,U (m)~Beta(m,n-m+1)。其中,假设为u给予目标值t,则具有至少m个随机数的正规化GPoW挖矿的行为是U (m)。由此可知,在beta分布中的统计方程式可应用在GPoW挖矿。
基于上述,在本发明实施例的相关于区块挖矿的工作量证明的方法和运算装置中,增加用于单一区块挖矿的随机数的数量,提供具有高信任程度的可估算力的目标值,并提供适用于m或m’个随机数的数学模型。藉此,可有效避免攻击,降低功耗,提升信任程度,及/或改进安全或系统弹性度。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (16)

  1. 一种相关于区块挖矿的工作量证明的方法,其特征在于,包括:
    接收区块;
    确定所述区块对应的多个随机数的哈希值是否符合条件,其中
    反应于所述区块对应的所述多个随机数中的第一随机数的第一哈希值符合所述条件,继续确定所述区块对应的所述多个随机数中的第二随机数的第二哈希值符合所述条件;以及
    验证所述多个随机数中符合所述条件的至少二个随机数。
  2. 根据权利要求1所述的相关于区块挖矿的工作量证明的方法,其特征在于,确定所述区块对应的所述多个随机数的哈希值是否符合所述条件的步骤包括:
    确定所述区块对应的所述多个随机数所在的区块头哈希值是否未大于目标值。
  3. 根据权利要求1所述的相关于区块挖矿的工作量证明的方法,其特征在于,还包括:
    确定所述多个随机数中符合所述条件的数量是否等于m个,其中m为大于零的正整数。
  4. 根据权利要求3所述的相关于区块挖矿的工作量证明的方法,其特征在于,还包括:
    确定所述多个随机数中符合所述条件的数量是否等于m’个,其中m’为大于m的正整数,且第m’个顺序统计量相关于beta分布。
  5. 根据权利要求3所述的相关于区块挖矿的工作量证明的方法,其特征在于,还包括:
    反应于所述多个随机数中符合所述条件的数量等于m个,发送所述m个随机数以供验证。
  6. 根据权利要求4所述的相关于区块挖矿的工作量证明的方法,其特征在于,还包括:
    反应于所述多个随机数中符合所述条件的数量等于m’个,发送所述m个随机数以供验证。
  7. 根据权利要求1所述的相关于区块挖矿的工作量证明的方法,其特征 在于,还包括:
    反应于验证所述多个随机数中符合所述条件的所述至少二个随机数都成功,更新新区块。
  8. 根据权利要求3所述的相关于区块挖矿的工作量证明的方法,其特征在于,还包括:
    根据符合所述条件的最小m个随机数的哈希值平均确定算力。
  9. 一种相关于区块挖矿的工作量证明的运算装置,其特征在于,包括:
    存储器,用以存储程序代码;以及
    处理器,耦接所述存储器,并经配置用以加载且执行所述程序代码以:
    接收区块;
    确定所述区块对应的多个随机数的哈希值是否符合条件,其中
    反应于所述区块对应的所述多个随机数中的第一随机数的第一哈希值符合所述条件,继续确定所述区块对应的所述多个随机数中的第二随机数的第二哈希值符合所述条件;以及
    验证所述多个随机数中符合所述条件的至少二个随机数。
  10. 根据权利要求9所述的相关于区块挖矿的工作量证明的运算装置,其特征在于,所述处理器还经配置用以:
    确定所述区块对应的所述多个随机数的哈希值是否未大于目标值。
  11. 根据权利要求9所述的相关于区块挖矿的工作量证明的运算装置,其特征在于,所述处理器还经配置用以:
    确定所述多个随机数中符合所述条件的数量是否等于m个,其中m为大于零的正整数。
  12. 根据权利要求11所述的相关于区块挖矿的工作量证明的运算装置,其特征在于,所述处理器还经配置用以:
    确定所述多个随机数中符合所述条件的数量是否等于m’个,其中m’为大于m的正整数,且第m’个顺序统计量相关于beta分布。
  13. 根据权利要求11所述的相关于区块挖矿的工作量证明的运算装置,其特征在于,所述处理器还经配置用以:
    反应于所述多个随机数中符合所述条件的数量等于m个,发送所述m个随机数以供验证。
  14. 根据权利要求12所述的相关于区块挖矿的工作量证明的运算装置,其特征在于,所述处理器还经配置用以:
    反应于所述多个随机数中符合所述条件的数量等于m’个,发送所述m个随机数以供验证。
  15. 根据权利要求9所述的相关于区块挖矿的工作量证明的运算装置,其特征在于,所述处理器还经配置用以:
    反应于验证所述多个随机数中符合所述条件的所述至少二个随机数都成功,更新新区块。
  16. 根据权利要求11所述的相关于区块挖矿的工作量证明的运算装置,其特征在于,所述处理器还经配置用以:
    根据符合所述条件的最小m个随机数的哈希值平均确定算力。
PCT/CN2022/074477 2021-02-07 2022-01-28 相关于区块挖矿的工作量证明的方法和运算装置 WO2022166791A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202280003548.4A CN116235198A (zh) 2021-02-07 2022-01-28 相关于区块挖矿的工作量证明的方法和运算装置

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US202163146696P 2021-02-07 2021-02-07
US63/146,696 2021-02-07

Publications (1)

Publication Number Publication Date
WO2022166791A1 true WO2022166791A1 (zh) 2022-08-11

Family

ID=82741959

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/074477 WO2022166791A1 (zh) 2021-02-07 2022-01-28 相关于区块挖矿的工作量证明的方法和运算装置

Country Status (2)

Country Link
CN (1) CN116235198A (zh)
WO (1) WO2022166791A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107481145A (zh) * 2017-08-30 2017-12-15 北京知金链网络技术有限公司 区块链多维随机数共识推举方法
US20200044854A1 (en) * 2018-08-03 2020-02-06 National Taiwan University Estimable proof-of-work for blockchain
CN111185011A (zh) * 2019-12-13 2020-05-22 杭州复杂美科技有限公司 区块链游戏的链下随机数应用方法、设备和存储介质
CN111401909A (zh) * 2020-03-11 2020-07-10 北京价值互联科技有限公司 一种基于区块链的去中心化随机红包处理方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107481145A (zh) * 2017-08-30 2017-12-15 北京知金链网络技术有限公司 区块链多维随机数共识推举方法
US20200044854A1 (en) * 2018-08-03 2020-02-06 National Taiwan University Estimable proof-of-work for blockchain
CN111185011A (zh) * 2019-12-13 2020-05-22 杭州复杂美科技有限公司 区块链游戏的链下随机数应用方法、设备和存储介质
CN111401909A (zh) * 2020-03-11 2020-07-10 北京价值互联科技有限公司 一种基于区块链的去中心化随机红包处理方法

Also Published As

Publication number Publication date
CN116235198A (zh) 2023-06-06
TW202244763A (zh) 2022-11-16

Similar Documents

Publication Publication Date Title
US11228440B2 (en) Proof-of-work for smart contracts on a blockchain
CN107733651B (zh) 一种区块链生成方法、节点及系统
CN106296184A (zh) 电子货币管理方法及电子货币系统
CN109947740B (zh) 区块链系统的性能优化方法及装置
CN111726303B (zh) 一种流量控制方法、装置以及计算设备
CN112579194B (zh) 基于时延和事务吞吐量的区块链共识任务卸载方法及装置
CN111968749B (zh) 一种风险评估方法、装置、终端设备及可读存储介质
JP2021523476A (ja) 準安定ビザンチン合意
Hieu et al. Resource management for blockchain-enabled federated learning: A deep reinforcement learning approach
US20230139892A1 (en) Apparatus and method for managing trust-based delegation consensus of blockchain network using deep reinforcement learning
WO2019157740A1 (zh) 处理数据的方法、处理数据的装置和处理数据的设备
CN113194146B (zh) 领导节点确定方法、计算机设备和存储介质
WO2022267715A1 (zh) 一种预言机节点筛选方法、装置、存储介质及电子装置
CN110231984B (zh) 多工作流任务分配方法、装置、计算机设备和存储介质
WO2022116421A1 (zh) 一种联邦学习工人节点选择方法、系统、终端以及存储介质
WO2022166791A1 (zh) 相关于区块挖矿的工作量证明的方法和运算装置
US10778549B2 (en) Apparatus and method for validating service control status
US20220292489A1 (en) Methods and devices for tracking and measuring proof-of-work contributions in a mining pool
TWI841910B (zh) 相關於區塊鏈挖礦的工作量證明的方法和運算裝置
CN111542052B (zh) 一种物联网中基于群体信任度的数据转发方法及装置
CN114492849B (zh) 一种基于联邦学习的模型更新方法及装置
CN112669091B (zh) 数据处理方法、装置及存储介质
Chatterjee et al. Brief announcement: A probabilistic performance model and tuning framework for eventually consistent distributed storage systems
CN107948130B (zh) 一种文件处理方法、服务器及系统
CN115514638B (zh) 供应链共识节点的信任值更新方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22749070

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 05.12.2023)