WO2019218730A1 - System and method for optimizing core computing components of proof of work operation chip - Google Patents

System and method for optimizing core computing components of proof of work operation chip Download PDF

Info

Publication number
WO2019218730A1
WO2019218730A1 PCT/CN2019/074499 CN2019074499W WO2019218730A1 WO 2019218730 A1 WO2019218730 A1 WO 2019218730A1 CN 2019074499 W CN2019074499 W CN 2019074499W WO 2019218730 A1 WO2019218730 A1 WO 2019218730A1
Authority
WO
WIPO (PCT)
Prior art keywords
node data
dag node
dag
hash
module
Prior art date
Application number
PCT/CN2019/074499
Other languages
French (fr)
Chinese (zh)
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 中科声龙科技发展(北京)有限公司
Publication of WO2019218730A1 publication Critical patent/WO2019218730A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC

Definitions

  • the invention relates to the technical field of blockchain, workload proof, encrypted digital coin mining and integrated system, in particular to a method and system for optimizing the core computing component of a workload proof computing chip involving mining of Ethereum.
  • Proof of Work is a consensus mechanism used by mainstream encryption digital coins such as Bitcoin and Ethereum.
  • the basic feature is that a large number of hash operations are needed to find the conditions under certain difficulty values. The hash value.
  • FNV hashing can quickly hash large amounts of data and maintain a small collision rate. Its high degree of dispersion makes it suitable for hashing very similar strings, such as URL, hostname, file name, text, IP address, etc.
  • the mining workload proof algorithm used by a type of encrypted digital coin such as Ethereum is called ETHASH.
  • the DAG node data is generated in one-time operation and stored in the external memory in advance, so that the participating operations can be read at any time during the subsequent hash operation, which depends on the external memory.
  • An ETHASH algorithm optimization implementation method that does not depend on external memory includes the following three key steps: key step 1, pre-generating internal CACHE data; and key step 2, generating DAG node data in real time according to pre-generated internal CACHE data;
  • the key step 3 is to perform hash operation through the DAG node data generated in real time, and perform workload verification according to the operation result.
  • the optimization system corresponding to the method includes 1. one or more internal CACHE data generating units, 2. one or more Internal storage unit, 3. an internal storage access control unit, 4. one or more DAG node data generating units, 5. one or more hashing units.
  • the present invention relates to the key step 2 and the key step 3 of the above optimization method, and the corresponding core computing component which is composed of the optimized system unit 4 and the unit 5 (in the present invention, the name is uniformly named by the hash collision unit). Optimize the implementation method and implementation system.
  • the technical problem to be solved by the embodiments of the present invention is to provide an optimization method for the core computing component of the workload proof computing chip, which is applicable to the workload proof operation of a type of encrypted digital currency such as Ethereum.
  • the main flow of the method of the present invention is as follows: FNV hashing is performed on a header_hash (a hash value of a block header, a random number of 256 bits) and a plurality of nonce (a workload verification value, a 64-bit random number) value.
  • the operation and splicing operation result in multiple MIX (1024-bit random numbers, which are composed of any two adjacent DAG node data), and store these MIX values in the on-chip storage module, and calculate according to the MIX value.
  • the DAG node index required to update these MIX values is obtained, through which multiple DAG node data generating units are called in parallel to generate required DAG node data, and each DAG node data generating unit can calculate multiple in parallel.
  • Data provide the data to the hash collision unit to update the value of MIX, generate the final MIX value, perform data compression, splicing, FNV hash operation, etc., and then generate the final calculation result, and work according to the calculation result. Proof of quantity.
  • the time-division multiplexing and pipeline structure are used to improve the data throughput rate, which improves the computational efficiency of the ETHASH algorithm.
  • the invention also provides an optimization system for the core computing component of the workload proof computing chip, which is suitable for the workload proof operation of a type of encrypted digital currency such as Ethereum. specifically,
  • the present invention provides an optimization system for the core computing component of the workload proof computing chip, including:
  • a core computing component comprising a plurality of basic components
  • Each of the basic components includes: a hash collision unit and a plurality of DAG node data generating units respectively connected to the hash collision unit;
  • the hash collision unit includes: one or more SHA3 hash operation modules, one or more storage modules, one or more FNV hash operation modules, and one or more DAG node index generation modules;
  • the SHA3 hash operation module, the FNV hash operation module, and the DAG node index generation module are respectively connected to the storage module;
  • the DAG node data generating unit includes: one or more DAG node data loading modules, one or more SHA3 hash computing modules, one or more DAG node data computing modules, one or more CACHEs Node index generation module;
  • the DAG node data loading module and the DAG node data computing module are respectively connected to the SHA3 hash computing module; the CAHCE node index generating module is connected to the DAG node data computing module.
  • the hash collision unit and the DAG node data generation unit are both designed with a time division multiplexing structure; or the hash collision unit and the DAG node data generation unit are designed by using a pipeline structure;
  • the number of the DAG node data generating units is not less than 128.
  • the number of the DAG node data generating units is 1024.
  • the plurality of DAG node data generating units are time-multiplexed for one of the hash collision units.
  • the number of the DAG node data generating units that are time-multiplexed for one of the hash collision units is 64.
  • the DAG node data generating unit comprises: one or more temporary DAG sub-calculation modules; wherein the plurality of temporary DAG sub-calculation modules are time-multiplexed to one DAG node data generating unit.
  • the number of pipeline stages of the DAG node data generating unit is not less than 8.
  • the storage module is a static random access memory.
  • the application also provides an optimization method for the core computing component of the workload proof computing chip, based on the above system, including the steps:
  • the data transmitted from the host computer is hashed to obtain the DAG node index and stored;
  • the DAG node index is hashed to generate DAG node data
  • the step A comprises:
  • the data transmitted from the host computer is hashed and simultaneously generates one or more DAG node indexes and stores them.
  • the number of the DAG node indexes is 64.
  • the DAG node data in step B is node data of one or more DAG nodes generated at the same time.
  • the number of nodes of the DAG node data in step B is 256.
  • the step C includes:
  • the DAG node data is hashed, and one or more hash operations results for the workload proof are generated, and the workload proof is performed according to the hash operation result.
  • the number of hash operations is 256.
  • the present invention includes the following advantages: 1.
  • the efficiency of the algorithm is improved by the parallel computing structure; 2.
  • the data throughput rate is improved by the pipeline structure; 3.
  • the time division multiplexing structure is adopted. Improve data throughput, and reduce chip area and cost; 4, through the above advantages, improve the cost performance of the system
  • Figure 1 is a basic component of the present invention
  • FIG. 2 is a flow chart of a hash collision operation according to the present invention.
  • FIG. 3 is a flow chart of generating DAG node data according to the present invention.
  • FIG. 4 is a schematic structural view of a system according to the present invention.
  • an optimization method for a core computing component of a workload proof computing chip including the following steps:
  • step 2 obtain a MIX data through the splicing operation, and use the data and its related data to initialize the storage space required for the current operation in the hash collision unit (refer to FIG. 2);
  • step 5 Detect whether the MIX data in the storage module has completed 64 operations, and if so, transfer the MIX data in the storage module to the MIX compression module (step 5); if the 64 operations are not completed, the MIX data operation is obtained.
  • step b) after the CACHE node data obtained in step a is SHA3 hashed, populating to a temporary DAG node data module of an idle computing unit (S105 to S109);
  • step e determining whether the computing unit has completed 256 operation cycles, and if so, submitting the CACHE node data to the hash operation module (step e); if not, according to the temporary DAG node data in the current calculation unit Obtaining a CACHE node index by XOR, FNV hash operation, modulo operation, etc., and reading data from the memory access port according to the DAG node index (S109 to S112);
  • the hash operation module performs a SHA3 hash operation on the DAG node data to obtain a DAG node data, and transmits the DAG node data to the task port (S113 to S114);
  • the unit receives the DAG node data returned by the task interface, and uses it to update the MIX data in the storage module, and then repeats step 3 (S103);
  • the MIX compression module compresses the MIX into CMIX (a 256-bit random number, which is obtained by MIX through multiple FNV hash operations) through FNV hash operation, and performs the splicing operation with the value obtained in step 1, and submits it to Ukraine.
  • Greek operation module (S115 to S116);
  • step 6 Perform operations such as compression, hashing, and the like on the data in step 5, and submit the data that meets the requirements to the host computer (S116 to S117).
  • FIG. 4 specifically, it includes:
  • a hash collision unit consisting of a SHA3 hash operation module (S401), a storage module module (S402), a DAG node index generation module (S403), and an FNV hash operation module (S404);
  • a plurality of DAG node data generating units (S5001 to S500N): a DAG node data loading module (S501), a SHA3 hashing module (S408), and a plurality of parallel computing modules (S5041 to S504N), each of which includes A temporary DAG node data module (S5031 to S503N) and a CACHE node index generating unit (S505) are constructed.
  • the one hash collision unit (S400) is connected to the plurality of DAG node data generating units (S5001 to S500N);
  • the SHA3 hash operation module (S401) in the one hash collision unit (S400) is connected to the storage module module (S402);
  • the DAG node index generating module (S403) in the one hash collision unit (S400) is connected to the storage module module (S402);
  • the FNV hash operation module (S404) in the one hash collision unit (S400) is connected to the storage module module (S402);
  • a DAG node data loading module (S501) in the plurality of DAG node data generating units (S5001 to S500N) is connected to the SHA3 hash computing module (S502);
  • a SHA3 hash operation module (S502) in the plurality of DAG node data generating units (S5001 to S500N) is connected to the parallel computing modules (S5041 to S504N);
  • the parallel computing modules (S5041 to S504N) of the plurality of DAG node data generating units (S5001 to S500N) are connected to the CACHE node index generating module (S505).
  • a hash collision unit (S400) and a plurality of DAG node data generating units (S5001 to S500N) are taken as an example.
  • a header_hash value is used. Multiple nonce values are used to perform FNV hash operations and splicing operations to obtain multiple MIX values. These MIX values are stored in the on-chip storage module, and the DAG node index required to update these MIX values is calculated according to the MIX value.
  • each DAG node data generating unit can calculate multiple DAG node data in parallel, and provide DAG node data to Ukraine
  • the collision unit updates the value of MIX, and generates the final MIX value, after performing data compression, splicing, FNV hash operation, etc., the final calculation result is generated, and the workload is proved according to the calculation result.
  • the system implementation includes: a dedicated integrated system chip ASIC and a field programmable gate array FPGA, but the implementation manner is not limited to these types.

Abstract

The present invention relates to a system and method for optimizing the core computing components of a proof of work operation chip. Each basic component of the core computing components in the described method comprise a hash collision unit and a plurality of DAG node data generating units. The core computing components are composed of a plurality of the described basic components, the hash collision unit and DAG node data generating units in the basic components both employing structural designs such as parallel computing, time division multiplexing, an assembly line, and so on. The basic components increase the efficiency of algorithm implementation by means of a parallel computing structure and increase data throughput by means of time-division multiplexing and assembly line structures.

Description

一种工作量证明运算芯片核心计算部件的优化系统及方法Optimization system and method for core computing component of workload proof computing chip 技术领域Technical field
本发明涉及区块链、工作量证明、加密数字币挖矿和集成系统技术领域,特别是涉及以太币等挖矿的一种工作量证明运算芯片核心计算部件的优化方法和系统。The invention relates to the technical field of blockchain, workload proof, encrypted digital coin mining and integrated system, in particular to a method and system for optimizing the core computing component of a workload proof computing chip involving mining of Ethereum.
背景技术Background technique
工作量证明(Proof of Work,简称POW),是比特币、以太币等主流加密数字币采用的一种共识机制,基本特征是需要进行大量的哈希运算,在特定难度值条件下找到符合条件的哈希值。Proof of Work (POW) is a consensus mechanism used by mainstream encryption digital coins such as Bitcoin and Ethereum. The basic feature is that a large number of hash operations are needed to find the conditions under certain difficulty values. The hash value.
FNV哈希运算能快速hash大量数据并保持较小的冲突率,它的高度分散使它适用于hash一些非常相近的字符串,比如URL,hostname,文件名,text,IP地址等。FNV hashing can quickly hash large amounts of data and maintain a small collision rate. Its high degree of dispersion makes it suitable for hashing very similar strings, such as URL, hostname, file name, text, IP address, etc.
与比特币所采用的SHA3-256(一种哈希运算)挖矿工作量证明算法不同,以太币等一类加密数字币使用的挖矿工作量证明算法叫ETHASH。在ETHASH算法的传统实现方法中,DAG结点数据被一次性运算生成后预先存储于外部存储器中,便于后续哈希运算时可以随时读取参与运算,这需要依赖于外部存储器。一种不依赖于外部存储器的ETHASH算法优化实现方法,包括如下3个关键步骤:关键步骤1,预先生成内部CACHE数据;关键步骤2,根据预先生成的内部CACHE数据,实时生成DAG结点数据;关键步骤3,通过实时生成的DAG结点数据进行哈希运算,根据运算结果做工作量证明,该方法所对应的优化系统包括1.一个或多个内部CACHE数据生成单元,2.一个或多个内部存储单元,3.一个内部存储访问控制单元,4.一个或多个DAG结点数据生成单元,5.一个或多个哈希运算单元。本发明是关于以上优化方法关键步骤2和关键步骤3,以及所对应的优化系 统单元4和单元5(在本发明中名称统一按哈希碰撞单元命名)所构成的核心计算部件,所提出的优化实现方法和实现系统。Different from the SHA3-256 (a kind of hash operation) mining workload proof algorithm adopted by Bitcoin, the mining workload proof algorithm used by a type of encrypted digital coin such as Ethereum is called ETHASH. In the traditional implementation method of the ETHASH algorithm, the DAG node data is generated in one-time operation and stored in the external memory in advance, so that the participating operations can be read at any time during the subsequent hash operation, which depends on the external memory. An ETHASH algorithm optimization implementation method that does not depend on external memory includes the following three key steps: key step 1, pre-generating internal CACHE data; and key step 2, generating DAG node data in real time according to pre-generated internal CACHE data; The key step 3 is to perform hash operation through the DAG node data generated in real time, and perform workload verification according to the operation result. The optimization system corresponding to the method includes 1. one or more internal CACHE data generating units, 2. one or more Internal storage unit, 3. an internal storage access control unit, 4. one or more DAG node data generating units, 5. one or more hashing units. The present invention relates to the key step 2 and the key step 3 of the above optimization method, and the corresponding core computing component which is composed of the optimized system unit 4 and the unit 5 (in the present invention, the name is uniformly named by the hash collision unit). Optimize the implementation method and implementation system.
发明内容Summary of the invention
本发明实施例所要解决的技术问题是,提供一种工作量证明运算芯片核心计算部件的优化方法,适用于以太币等一类加密数字货币的工作量证明运算。The technical problem to be solved by the embodiments of the present invention is to provide an optimization method for the core computing component of the workload proof computing chip, which is applicable to the workload proof operation of a type of encrypted digital currency such as Ethereum.
本发明所述方法主要流程如下:对一个header_hash(区块头的哈希值,256位长的随机数)值和多个nonce(工作量验证值,64位长的随机数)值做FNV哈希运算和拼接操作得出多个MIX(1024位长的随机数,由任意两个相邻的DAG结点数据组合而成)值,将这些MIX值存储在片内存储模块中,根据MIX值计算得出更新这些MIX值所需要的DAG结点索引,通过该索引,并行调用多个DAG结点数据生成单元生成所需的DAG结点数据,每个DAG结点数据生成单元可以并行计算多个数据,将这些数据提供给哈希碰撞单元更新MIX的值,生成最终的MIX值后,对其做数据压缩、拼接、FNV哈希运算等操作后,生成最终计算结果,根据该计算结果做工作量证明。通过多DAG结点数据并行计算,采用分时复用以及流水线结构提高数据吞吐率,提升了ETHASH算法的运算效率。The main flow of the method of the present invention is as follows: FNV hashing is performed on a header_hash (a hash value of a block header, a random number of 256 bits) and a plurality of nonce (a workload verification value, a 64-bit random number) value. The operation and splicing operation result in multiple MIX (1024-bit random numbers, which are composed of any two adjacent DAG node data), and store these MIX values in the on-chip storage module, and calculate according to the MIX value. The DAG node index required to update these MIX values is obtained, through which multiple DAG node data generating units are called in parallel to generate required DAG node data, and each DAG node data generating unit can calculate multiple in parallel. Data, provide the data to the hash collision unit to update the value of MIX, generate the final MIX value, perform data compression, splicing, FNV hash operation, etc., and then generate the final calculation result, and work according to the calculation result. Proof of quantity. Through the parallel computing of multiple DAG nodes, the time-division multiplexing and pipeline structure are used to improve the data throughput rate, which improves the computational efficiency of the ETHASH algorithm.
本发明还提出一种工作量证明运算芯片核心计算部件的优化系统,适用于以太币等一类加密数字货币的工作量证明运算。具体地,The invention also provides an optimization system for the core computing component of the workload proof computing chip, which is suitable for the workload proof operation of a type of encrypted digital currency such as Ethereum. specifically,
本申请提供的一种工作量证明运算芯片核心计算部件的优化系统,包括:The present invention provides an optimization system for the core computing component of the workload proof computing chip, including:
核心计算部件,包括多个基本部件;a core computing component comprising a plurality of basic components;
其中,每个基本部件,包括:一个哈希碰撞单元和分别与所述哈希碰撞单元相连的多个DAG结点数据生成单元;Each of the basic components includes: a hash collision unit and a plurality of DAG node data generating units respectively connected to the hash collision unit;
其中,所述哈希碰撞单元,包括:一个或多个SHA3哈希运算模块、一个或多个存储模块、一个或多个FNV哈希运算模块、一个或多个DAG结点索引生成模块;其中,所述SHA3哈希运算模块、所 述FNV哈希运算模块以及所述DAG结点索引生成模块分别与所述存储模块相连;The hash collision unit includes: one or more SHA3 hash operation modules, one or more storage modules, one or more FNV hash operation modules, and one or more DAG node index generation modules; The SHA3 hash operation module, the FNV hash operation module, and the DAG node index generation module are respectively connected to the storage module;
其中,所述DAG结点数据生成单元,包括:一个或多个DAG结点数据加载模块、一个或多个SHA3哈希运算模块、一个或多个DAG结点数据计算模块、一个或多个CACHE结点索引生成模块;The DAG node data generating unit includes: one or more DAG node data loading modules, one or more SHA3 hash computing modules, one or more DAG node data computing modules, one or more CACHEs Node index generation module;
其中,所述DAG结点数据加载模块、所述DAG结点数据计算模块分别与所述SHA3哈希运算模块相连;所述CAHCE结点索引生成模块与所述DAG结点数据计算模块相连。The DAG node data loading module and the DAG node data computing module are respectively connected to the SHA3 hash computing module; the CAHCE node index generating module is connected to the DAG node data computing module.
其中,所述哈希碰撞单元和所述DAG结点数据生成单元均采用分时复用结构设计;或者,所述哈希碰撞单元和所述DAG结点数据生成单元均采用流水线结构设计;The hash collision unit and the DAG node data generation unit are both designed with a time division multiplexing structure; or the hash collision unit and the DAG node data generation unit are designed by using a pipeline structure;
优选地,所述DAG结点数据生成单元的数量为不少于128个。Preferably, the number of the DAG node data generating units is not less than 128.
优选地,所述DAG结点数据生成单元数量为1024个。Preferably, the number of the DAG node data generating units is 1024.
优选地,多个所述DAG结点数据生成单元对一个所述哈希碰撞单元分时复用。Preferably, the plurality of DAG node data generating units are time-multiplexed for one of the hash collision units.
优选地,对一个所述哈希碰撞单元分时复用的所述DAG结点数据生成单元的数量为64个。Preferably, the number of the DAG node data generating units that are time-multiplexed for one of the hash collision units is 64.
优选地,所述DAG结点数据生成单元包括:一个或者多个临时DAG子计算模块;其中,所述多个临时DAG子计算模块对一个DAG结点数据生成单元分时复用。Preferably, the DAG node data generating unit comprises: one or more temporary DAG sub-calculation modules; wherein the plurality of temporary DAG sub-calculation modules are time-multiplexed to one DAG node data generating unit.
优选地,所述DAG结点数据生成单元的流水线级数为不少于8级。Preferably, the number of pipeline stages of the DAG node data generating unit is not less than 8.
优选地,所述存储模块为静态随机存取存储器。Preferably, the storage module is a static random access memory.
本申请还提供一种工作量证明运算芯片核心计算部件的优化方法,基于上述的系统,包括步骤:The application also provides an optimization method for the core computing component of the workload proof computing chip, based on the above system, including the steps:
A、上位机传来的数据经哈希运算获得DAG结点索引并存储;A. The data transmitted from the host computer is hashed to obtain the DAG node index and stored;
B、对DAG结点索引经哈希运算生成DAG结点数据;B. The DAG node index is hashed to generate DAG node data;
C、对DAG结点数据进行哈希运算,根据运算结果做工作量证明。C. Hash the DAG node data, and do the workload proof according to the operation result.
优选地,所述步骤A包括:Preferably, the step A comprises:
上位机传来的数据经哈希运算同时生成一个或多个DAG结点索引并存储。The data transmitted from the host computer is hashed and simultaneously generates one or more DAG node indexes and stores them.
优选地,所述DAG结点索引的数量为64个。Preferably, the number of the DAG node indexes is 64.
优选地,步骤B所述DAG结点数据为同时生成的一个或多个DAG结点的结点数据。Preferably, the DAG node data in step B is node data of one or more DAG nodes generated at the same time.
优选地,步骤B所述DAG结点数据的结点数量为256个。Preferably, the number of nodes of the DAG node data in step B is 256.
优选地,所述步骤C包括:Preferably, the step C includes:
对DAG结点数据进行哈希运算,同时生成用于工作量证明的一个或多个哈希运算结果,根据所述哈希运算结果进行工作量证明。The DAG node data is hashed, and one or more hash operations results for the workload proof are generated, and the workload proof is performed according to the hash operation result.
优选地,所述哈希运算结果数量为256个。Preferably, the number of hash operations is 256.
综上所述,与现有技术相比,本发明包括以下优点:1、通过并行计算结构提升了算法实现的效率;2、通过流水线结构提高了数据吞吐率;3、通过分时复用结构提高了数据吞吐率,并且降低了芯片面积和成本;4、通过上述优点提高了系统的性价比In summary, compared with the prior art, the present invention includes the following advantages: 1. The efficiency of the algorithm is improved by the parallel computing structure; 2. The data throughput rate is improved by the pipeline structure; 3. The time division multiplexing structure is adopted. Improve data throughput, and reduce chip area and cost; 4, through the above advantages, improve the cost performance of the system
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is some embodiments of the invention.
图1是本发明所涉及的基本部件;Figure 1 is a basic component of the present invention;
图2是本发明所涉及的哈希碰撞运算流程;2 is a flow chart of a hash collision operation according to the present invention;
图3是本发明所涉及的DAG结点数据生成流程;3 is a flow chart of generating DAG node data according to the present invention;
图4是本发明所涉及系统的结构示意图。4 is a schematic structural view of a system according to the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有 做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
实施例一Embodiment 1
详细介绍本发明实施例提供的一种工作量证明运算芯片核心计算部件的优化方法。The method for optimizing the core computing component of the workload proof computing chip provided by the embodiment of the present invention is described in detail.
参照图1,提供了一种工作量证明运算芯片核心计算部件的优化方法,包括以下步骤:Referring to FIG. 1, an optimization method for a core computing component of a workload proof computing chip is provided, including the following steps:
1.通过碰撞初始化端口从上位机获得header_hash值和nonce。将这两个值拼接后做哈希运算,获得一个值(S101至S102);1. Obtain the header_hash value and nonce from the host computer through the collision initialization port. Splicing the two values and performing a hash operation to obtain a value (S101 to S102);
2.用步骤1中得到的值通过拼接操作得到一个MIX数据,用该数据及其相关数据初始化哈希碰撞单元(参照图2)中本次运算所需要的存储空间;2. Using the value obtained in step 1, obtain a MIX data through the splicing operation, and use the data and its related data to initialize the storage space required for the current operation in the hash collision unit (refer to FIG. 2);
3.检测存储模块中的MIX数据是否完成了64次运算,如果是,将存储模块中的MIX数据传递给MIX压缩模块(步骤5);如果未完成64次运算,则通过该MIX数据运算得到DAG结点的索引,提交给任务接口(S103至S114);3. Detect whether the MIX data in the storage module has completed 64 operations, and if so, transfer the MIX data in the storage module to the MIX compression module (step 5); if the 64 operations are not completed, the MIX data operation is obtained. An index of the DAG node, submitted to the task interface (S103 to S114);
a)通过任务接口获取DAG结点索引,根据该DAG结点索引通过访存接口获取一个CACHE结点数据(S104);a) obtaining a DAG node index through the task interface, and obtaining a CACHE node data through the memory access interface according to the DAG node index (S104);
b)将步骤a中获得的CACHE结点数据做SHA3哈希运算后,填充至一个空闲计算单元的临时DAG结点数据模块(S105至S109);b) after the CACHE node data obtained in step a is SHA3 hashed, populating to a temporary DAG node data module of an idle computing unit (S105 to S109);
c)判断计算单元是否完成了256个运算周期,若已完成,将该CACHE结点数据提交给哈希运算模块(步骤e);若未完成,则根据当前计算单元内的临时DAG结点数据通过异或、FNV哈希运算、取模运算等获得一个CACHE结点索引,根据该DAG结点索引从访存端口读取数据(S109至S112);c) determining whether the computing unit has completed 256 operation cycles, and if so, submitting the CACHE node data to the hash operation module (step e); if not, according to the temporary DAG node data in the current calculation unit Obtaining a CACHE node index by XOR, FNV hash operation, modulo operation, etc., and reading data from the memory access port according to the DAG node index (S109 to S112);
d)将访存接口返回的数据与计算单元内的临时DAG结点数据做FNV哈希运算,更新计算单元内的临时DAG结点数据;d) performing FNV hash operation on the data returned by the memory interface and the temporary DAG node data in the computing unit, and updating the temporary DAG node data in the computing unit;
e)哈希运算模块对DAG结点数据做SHA3哈希运算,得到一个 DAG结点数据,将该DAG结点数据传送到任务端口(S113至S114);e) the hash operation module performs a SHA3 hash operation on the DAG node data to obtain a DAG node data, and transmits the DAG node data to the task port (S113 to S114);
4.单元收到任务接口返回的DAG结点数据,并用它来更新存储模块中的MIX数据,然后重复步骤3(S103);4. The unit receives the DAG node data returned by the task interface, and uses it to update the MIX data in the storage module, and then repeats step 3 (S103);
5.MIX压缩模块会通过FNV哈希运算将MIX压缩为CMIX(256位长的随机数,由MIX经多次FNV哈希运算所得),与步骤1中获得的值做拼接操作,提交给哈希运算模块(S115至S116);5. The MIX compression module compresses the MIX into CMIX (a 256-bit random number, which is obtained by MIX through multiple FNV hash operations) through FNV hash operation, and performs the splicing operation with the value obtained in step 1, and submits it to Kazakhstan. Greek operation module (S115 to S116);
6.对步骤5中的数据做压缩、哈希运算等操作,并将符合要求的数据提交给上位机(S116至S117)。6. Perform operations such as compression, hashing, and the like on the data in step 5, and submit the data that meets the requirements to the host computer (S116 to S117).
实施例二Embodiment 2
详细介绍本发明实施例提供的一种工作量证明运算芯片核心计算部件的优化系统。An optimization system for a core computing component of a workload proof computing chip provided by an embodiment of the present invention is described in detail.
参照图4,具体包括:Referring to FIG. 4, specifically, it includes:
一个哈希碰撞单元(S400):由SHA3哈希运算模块(S401),存储模块模块(S402),DAG结点索引生成模块(S403)和FNV哈希运算模块(S404)构成;a hash collision unit (S400): consisting of a SHA3 hash operation module (S401), a storage module module (S402), a DAG node index generation module (S403), and an FNV hash operation module (S404);
多个DAG结点数据生成单元(S5001至S500N):由DAG结点数据加载模块(S501),SHA3哈希运算模块(S408),多个并行计算模块(S5041至S504N),每个计算单元包含一个临时DAG结点数据模块(S5031至S503N)以及CACHE结点索引生成单元(S505)构成。a plurality of DAG node data generating units (S5001 to S500N): a DAG node data loading module (S501), a SHA3 hashing module (S408), and a plurality of parallel computing modules (S5041 to S504N), each of which includes A temporary DAG node data module (S5031 to S503N) and a CACHE node index generating unit (S505) are constructed.
所述一个哈希碰撞单元(S400)和多个DAG结点数据生成单元(S5001至S500N)相连;The one hash collision unit (S400) is connected to the plurality of DAG node data generating units (S5001 to S500N);
所述一个哈希碰撞单元(S400)中的SHA3哈希运算模块(S401)与存储模块模块(S402)相连;The SHA3 hash operation module (S401) in the one hash collision unit (S400) is connected to the storage module module (S402);
所述一个哈希碰撞单元(S400)中的DAG结点索引生成模块(S403)与存储模块模块(S402)相连;The DAG node index generating module (S403) in the one hash collision unit (S400) is connected to the storage module module (S402);
所述一个哈希碰撞单元(S400)中的FNV哈希运算模块(S404)与存储模块模块(S402)相连;The FNV hash operation module (S404) in the one hash collision unit (S400) is connected to the storage module module (S402);
所述多个DAG结点数据生成单元(S5001至S500N)中的DAG结点数据加载模块(S501)与SHA3哈希运算模块(S502)相连;a DAG node data loading module (S501) in the plurality of DAG node data generating units (S5001 to S500N) is connected to the SHA3 hash computing module (S502);
所述多个DAG结点数据生成单元(S5001至S500N)中的SHA3哈希运算模块(S502)与并行计算模块(S5041至S504N)相连;a SHA3 hash operation module (S502) in the plurality of DAG node data generating units (S5001 to S500N) is connected to the parallel computing modules (S5041 to S504N);
所述多个DAG结点数据生成单元(S5001至S500N)中的并行计算模块(S5041至S504N)与CACHE结点索引生成模块(S505)相连。The parallel computing modules (S5041 to S504N) of the plurality of DAG node data generating units (S5001 to S500N) are connected to the CACHE node index generating module (S505).
本实施例中以一个哈希碰撞单元(S400)和多个DAG结点数据生成单元(S5001至S500N)为例介绍,参照图1和图4,在进行ETHASH算法实现时,对一个header_hash值和多个nonce值做FNV哈希运算和拼接操作得出多个MIX值,将这些MIX值存储在片内存储模块中,根据MIX值计算得出更新这些MIX值所需要的DAG结点索引,通过DAG结点索引,并行调用多个DAG结点数据生成单元生成所需的DAG结点数据,每个DAG结点数据生成单元可以并行计算多个DAG结点数据,将DAG结点数据提供给哈希碰撞单元更新MIX的值,生成最终的MIX值后,对其做数据压缩、拼接、FNV哈希运算等操作后,生成最终计算结果,根据该计算结果做工作量证明。In this embodiment, a hash collision unit (S400) and a plurality of DAG node data generating units (S5001 to S500N) are taken as an example. Referring to FIG. 1 and FIG. 4, when performing the ETHASH algorithm, a header_hash value is used. Multiple nonce values are used to perform FNV hash operations and splicing operations to obtain multiple MIX values. These MIX values are stored in the on-chip storage module, and the DAG node index required to update these MIX values is calculated according to the MIX value. DAG node index, in parallel call multiple DAG node data generating units to generate required DAG node data, each DAG node data generating unit can calculate multiple DAG node data in parallel, and provide DAG node data to Kazakhstan After the collision unit updates the value of MIX, and generates the final MIX value, after performing data compression, splicing, FNV hash operation, etc., the final calculation result is generated, and the workload is proved according to the calculation result.
基于本发明上述系统的实施例中,其系统实现方式包括:专用集成系统芯片ASIC、现场可编程门阵列FPGA,但实现方式不限于这些类型。In the embodiment of the above system according to the present invention, the system implementation includes: a dedicated integrated system chip ASIC and a field programmable gate array FPGA, but the implementation manner is not limited to these types.
上面描述的内容可以单独地或者以各种方式组合起来实施,而这些变型方式都在本发明的保护范围之内。The above description may be implemented individually or in combination in various ways, and such modifications are within the scope of the invention.
以上实施例仅用以说明本发明的技术方案而非限制,仅仅参照较佳实施例对本发明进行了详细说明。本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围,均应涵盖在本发明的权利要求范围当中。The above embodiments are only intended to illustrate the technical solutions of the present invention and are not to be construed as limiting the invention. It should be understood by those skilled in the art that the present invention may be modified or equivalently substituted without departing from the spirit and scope of the invention.

Claims (15)

  1. 一种工作量证明运算芯片核心计算部件的优化系统,其特征在于,包括:An optimization system for a core computing component of a workload proof computing chip, characterized in that:
    核心计算部件,包括多个基本部件;a core computing component comprising a plurality of basic components;
    其中,每个基本部件,包括:一个哈希碰撞单元和分别与所述哈希碰撞单元相连的多个DAG结点数据生成单元;Each of the basic components includes: a hash collision unit and a plurality of DAG node data generating units respectively connected to the hash collision unit;
    其中,所述哈希碰撞单元,包括:一个或多个SHA3哈希运算模块、一个或多个存储模块、一个或多个FNV哈希运算模块、一个或多个DAG结点索引生成模块;其中,所述SHA3哈希运算模块、所述FNV哈希运算模块以及所述DAG结点索引生成模块分别与所述存储模块相连;The hash collision unit includes: one or more SHA3 hash operation modules, one or more storage modules, one or more FNV hash operation modules, and one or more DAG node index generation modules; The SHA3 hash operation module, the FNV hash operation module, and the DAG node index generation module are respectively connected to the storage module;
    其中,所述DAG结点数据生成单元,包括:一个或多个DAG结点数据加载模块、一个或多个SHA3哈希运算模块、一个或多个DAG结点数据计算模块、一个或多个CACHE结点索引生成模块;The DAG node data generating unit includes: one or more DAG node data loading modules, one or more SHA3 hash computing modules, one or more DAG node data computing modules, one or more CACHEs Node index generation module;
    其中,所述DAG结点数据加载模块、所述DAG结点数据计算模块分别与所述SHA3哈希运算模块相连;所述CAHCE结点索引生成模块与所述DAG结点数据计算模块相连;The DAG node data loading module and the DAG node data computing module are respectively connected to the SHA3 hash computing module; the CAHCE node index generating module is connected to the DAG node data computing module;
    其中,所述哈希碰撞单元和所述DAG结点数据生成单元均采用分时复用结构设计;或者,所述哈希碰撞单元和所述DAG结点数据生成单元均采用流水线结构设计。The hash collision unit and the DAG node data generation unit are both designed by using a time division multiplexing structure; or the hash collision unit and the DAG node data generation unit are both designed by using a pipeline structure.
  2. 根据权利要求1所述的系统,其特征在于,所述DAG结点数据生成单元的数量为不少于128个。The system according to claim 1, wherein the number of said DAG node data generating units is not less than 128.
  3. 根据权利要求2所述的系统,其特征在于,所述DAG结点数据生成单元数量为1024个。The system according to claim 2, wherein the number of said DAG node data generating units is 1024.
  4. 根据权利要求1所述的系统,其特征在于,多个所述DAG结点数据生成单元对一个所述哈希碰撞单元分时复用。The system according to claim 1, wherein a plurality of said DAG node data generating units are time-multiplexed for one of said hash collision units.
  5. 根据权利要求4所述的系统,其特征在于,对一个所述哈希碰撞单元分时复用的所述DAG结点数据生成单元的数量为64个。The system according to claim 4, wherein the number of said DAG node data generating units that are time-multiplexed for one of said hash collision units is 64.
  6. 根据权利要求1所述的系统,其特征在于,所述DAG结点数 据生成单元包括:一个或者多个临时DAG子计算模块;其中,所述多个临时DAG子计算模块对一个DAG结点数据生成单元分时复用。The system according to claim 1, wherein said DAG node data generating unit comprises: one or more temporary DAG sub-computing modules; wherein said plurality of temporary DAG sub-computing modules pair one DAG node data The generation unit is time-multiplexed.
  7. 根据权利要求1所述的系统,其特征在于,所述DAG结点数据生成单元的流水线级数为不少于8级。The system according to claim 1, wherein the number of pipeline stages of the DAG node data generating unit is not less than eight.
  8. 根据权利要求1所述的系统,其特征在于,所述存储模块为静态随机存取存储器。The system of claim 1 wherein said storage module is a static random access memory.
  9. 一种工作量证明运算芯片核心计算部件的优化方法,基于权利要求1-8任一项所述的系统,其特征在于,包括步骤:A method for optimizing a core computing component of a workload verification computing chip, the system according to any one of claims 1-8, comprising the steps of:
    A、上位机传来的数据经哈希运算获得DAG结点索引并存储;A. The data transmitted from the host computer is hashed to obtain the DAG node index and stored;
    B、对DAG结点索引经哈希运算生成DAG结点数据;B. The DAG node index is hashed to generate DAG node data;
    C、对DAG结点数据进行哈希运算,根据运算结果做工作量证明。C. Hash the DAG node data, and do the workload proof according to the operation result.
  10. 根据权利要求9所述的方法,其特征在于,所述步骤A包括:The method of claim 9 wherein said step A comprises:
    上位机传来的数据经哈希运算同时生成一个或多个DAG结点索引并存储。The data transmitted from the host computer is hashed and simultaneously generates one or more DAG node indexes and stores them.
  11. 根据权利要求10所述的方法,其特征在于,所述DAG结点索引的数量为64个。The method of claim 10 wherein the number of DAG node indices is 64.
  12. 根据权利要求9所述的方法,其特征在于,步骤B所述DAG结点数据为同时生成的一个或多个DAG结点的结点数据。The method according to claim 9, wherein the DAG node data in step B is node data of one or more DAG nodes generated at the same time.
  13. 根据权利要求12所述的方法,其特征在于,步骤B所述DAG结点数据的结点数量为256个。The method according to claim 12, wherein the number of nodes of the DAG node data in step B is 256.
  14. 根据权利要求9所述的方法,其特征在于,所述步骤C包括:The method of claim 9 wherein said step C comprises:
    对DAG结点数据进行哈希运算,同时生成用于工作量证明的一个或多个哈希运算结果,根据所述哈希运算结果进行工作量证明。The DAG node data is hashed, and one or more hash operations results for the workload proof are generated, and the workload proof is performed according to the hash operation result.
  15. 根据权利要求14所述的方法,其特征在于,所述哈希运算结果数量为256个。The method according to claim 14, wherein the number of hash operations is 256.
PCT/CN2019/074499 2018-05-18 2019-02-01 System and method for optimizing core computing components of proof of work operation chip WO2019218730A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810479099.6 2018-05-18
CN201810479099.6A CN108777612B (en) 2018-05-18 2018-05-18 Optimization method and circuit for workload certification operation chip core calculation component

Publications (1)

Publication Number Publication Date
WO2019218730A1 true WO2019218730A1 (en) 2019-11-21

Family

ID=64027184

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/074499 WO2019218730A1 (en) 2018-05-18 2019-02-01 System and method for optimizing core computing components of proof of work operation chip

Country Status (2)

Country Link
CN (1) CN108777612B (en)
WO (1) WO2019218730A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114115789A (en) * 2021-10-20 2022-03-01 北京百度网讯科技有限公司 Chip plug-in implementation method and device, electronic equipment and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108777612B (en) * 2018-05-18 2020-03-20 中科声龙科技发展(北京)有限公司 Optimization method and circuit for workload certification operation chip core calculation component
TWI676134B (en) * 2018-12-03 2019-11-01 資富電子股份有限公司 Accelerated calculating architecture for proof of work in blockchain based on lookup table method
CN114528246A (en) * 2020-11-23 2022-05-24 深圳比特微电子科技有限公司 Operation core, calculation chip and encrypted currency mining machine
CN113296705B (en) * 2021-05-27 2022-09-27 浙江萤火虫区块链科技有限公司 Framework system for parallel computing Poseido Hash in Filecin
CN113282802B (en) * 2021-06-17 2022-06-24 浙江毫微米科技有限公司 Workload certification algorithm optimization method and device, computer equipment and storage medium
CN114006900B (en) * 2021-12-30 2022-04-08 中科声龙科技发展(北京)有限公司 System for realizing directed acyclic graph processing and relay management device
CN114003552B (en) * 2021-12-30 2022-03-29 中科声龙科技发展(北京)有限公司 Workload proving operation method, workload proving chip and upper computer

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462147A (en) * 2013-09-25 2015-03-25 天津书生投资有限公司 Storage method for document
CN105245327A (en) * 2015-08-21 2016-01-13 北京比特大陆科技有限公司 Optimizing method, device and circuit for Hash computing chip of bitcoin proof of work
CN106293892A (en) * 2015-06-26 2017-01-04 阿里巴巴集团控股有限公司 Distributed stream calculates system, method and apparatus
CN107729471A (en) * 2017-10-13 2018-02-23 上海策赢网络科技有限公司 A kind of block chain and its generation method and equipment
CN108777612A (en) * 2018-05-18 2018-11-09 中科声龙科技发展(北京)有限公司 A kind of optimization method and circuit of proof of work operation chip core calculating unit

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106571925B (en) * 2016-10-24 2020-07-10 北京云图科瑞科技有限公司 Method and device for carrying out workload certification on blocks in block chain system
CN106897351B (en) * 2016-12-29 2020-11-10 北京瑞卓喜投科技发展有限公司 Generation method and system of directed acyclic graph block chain
CN107579814A (en) * 2017-08-03 2018-01-12 北京比特大陆科技有限公司 Device, computing chip, the digging ore deposit machine of the computational methods of proof of work
CN107977340A (en) * 2017-12-27 2018-05-01 邵美 A kind of importance ranking method of block chain trade network node

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462147A (en) * 2013-09-25 2015-03-25 天津书生投资有限公司 Storage method for document
CN106293892A (en) * 2015-06-26 2017-01-04 阿里巴巴集团控股有限公司 Distributed stream calculates system, method and apparatus
CN105245327A (en) * 2015-08-21 2016-01-13 北京比特大陆科技有限公司 Optimizing method, device and circuit for Hash computing chip of bitcoin proof of work
CN107729471A (en) * 2017-10-13 2018-02-23 上海策赢网络科技有限公司 A kind of block chain and its generation method and equipment
CN108777612A (en) * 2018-05-18 2018-11-09 中科声龙科技发展(北京)有限公司 A kind of optimization method and circuit of proof of work operation chip core calculating unit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114115789A (en) * 2021-10-20 2022-03-01 北京百度网讯科技有限公司 Chip plug-in implementation method and device, electronic equipment and storage medium
CN114115789B (en) * 2021-10-20 2022-08-23 北京百度网讯科技有限公司 Chip plug-in implementation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN108777612A (en) 2018-11-09
CN108777612B (en) 2020-03-20

Similar Documents

Publication Publication Date Title
WO2019218730A1 (en) System and method for optimizing core computing components of proof of work operation chip
JP6955026B2 (en) Systems and methods for parallel processing blockchain transactions
TWI820124B (en) Computer-implemented method, computing system and non-transitory computer-readable storage medium
CN110268691B (en) Federated blockchain networks with verified blockchain and consensus protocols
TWI728418B (en) Method and system for executing multi-party transaction using smart contract
WO2020143852A2 (en) Distributed blockchain data storage under account model
WO2019179539A2 (en) Shared blockchain data storage
WO2020143853A2 (en) Distributed blockchain data storage under account model
WO2019179538A2 (en) Shared blockchain data storage
JP7165148B2 (en) Method and system for consistent distributed memory pool in blockchain network
US20130326494A1 (en) System and method for distributed patch management
US11182365B2 (en) Systems and methods for distributed storage of data across multiple hash tables
WO2019179258A1 (en) Method and system for workload proof computing chip optimization
US20230401331A1 (en) Secure and scalable private set intersection for large datasets
CN110622488A (en) System and method for managing user interaction with blockchains
CN103365625B (en) The method and system that random value is produced
WO2020098818A2 (en) Taking snapshots of blockchain data
CN109146677A (en) Method, computer system and the readable storage medium storing program for executing of parallel building block chain view
US9607086B2 (en) Providing prevalence information using query data
JP2020522767A (en) Method and device for establishing communication between nodes of a blockchain system
US11418342B2 (en) System and methods for data exchange using a distributed ledger
Takeshita et al. Secure single-server nearly-identical image deduplication
EP3769219A2 (en) Taking snapshots of blockchain data
US20230306506A1 (en) Method and system for providing high-speed storage and retrieval of information
CN116346388A (en) Improved consensus data filtering in spatially demonstrated blockchain systems

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: 19803692

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 19/03/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19803692

Country of ref document: EP

Kind code of ref document: A1