[go: up one dir, main page]

CN117688623A - A trusted computing chip based on blockchain - Google Patents

A trusted computing chip based on blockchain Download PDF

Info

Publication number
CN117688623A
CN117688623A CN202311655506.1A CN202311655506A CN117688623A CN 117688623 A CN117688623 A CN 117688623A CN 202311655506 A CN202311655506 A CN 202311655506A CN 117688623 A CN117688623 A CN 117688623A
Authority
CN
China
Prior art keywords
instruction
execution
smart contract
chip
unit
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202311655506.1A
Other languages
Chinese (zh)
Inventor
陈子祺
田甲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202311655506.1A priority Critical patent/CN117688623A/en
Publication of CN117688623A publication Critical patent/CN117688623A/en
Pending legal-status Critical Current

Links

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/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mathematical Physics (AREA)
  • Storage Device Security (AREA)

Abstract

本申请涉及一种基于区块链的可信计算芯片,包括enclave保护模块、智能合约执行装置和加密模块,enclave保护模块用于构建该芯片上的可信计算环境,保证芯片上所有数据和执行动作的可靠性,包括并不限于智能合约的执行、数据的签名、传感器数据的收集等;解码转化单元接受外部输入的二进制码,利用解码装置将二进制码反解析出合约原语序列,并根据解码装置中预嵌入的原语含义功能,将反解析出的原语序列转换生成指令执行单元所需要的指令代码,指令执行单元的处理结果交由加密协处理器对计算结果进行签名加密。本申请的可信计算芯片能够有效保证芯片在计算过程中的可信度,同时能够有效提升所有图灵完备的智能合约的执行效率,以供服务端调用。

This application relates to a trusted computing chip based on blockchain, including an enclave protection module, a smart contract execution device and an encryption module. The enclave protection module is used to build a trusted computing environment on the chip to ensure all data and execution on the chip. The reliability of actions includes but is not limited to the execution of smart contracts, data signatures, collection of sensor data, etc.; the decoding and conversion unit accepts the binary code input from the outside, uses the decoding device to reversely parse the binary code into the contract primitive sequence, and based on The primitive meaning function pre-embedded in the decoding device converts the deanalyzed primitive sequence into the instruction code required by the instruction execution unit. The processing results of the instruction execution unit are handed over to the encryption coprocessor to sign and encrypt the calculation results. The trusted computing chip of this application can effectively ensure the credibility of the chip in the calculation process, and can effectively improve the execution efficiency of all Turing-complete smart contracts for server calls.

Description

一种基于区块链的可信计算芯片A trusted computing chip based on blockchain

本申请是申请日为2020年7月1日,申请号为202010627750.7,发明名称为:“一种基于区块链的可信计算芯片”的中国发明专利申请的分案申请。This application is a divisional application of a Chinese invention patent application with a filing date of July 1, 2020, an application number of 202010627750.7, and an invention name: “A trusted computing chip based on blockchain”.

技术领域Technical field

本申请涉及一种基于区块链的可信计算芯片,适用于区块链的技术领域。This application relates to a trusted computing chip based on blockchain, which is suitable for the technical field of blockchain.

背景技术Background technique

近年来,区块链技术在应用和探索方面有着不断的进展。比特币作为最初的区块链货币,采用了分布式可信账本存储方式,无需中心服务器即可进行货币交易,在金融货币方面有着天然的优势。紧随其后的代表性项目为以太坊,其基于区块链分布式存储系统之上开发出图灵完备的虚拟引擎,能够在其上编译运行智能合约,即可在去中心化可信系统上执行可计算程序。可信计算单元可以是可信的计算围圈(Enclave),提供隔离执行的应用程序运行环境。In recent years, blockchain technology has made continuous progress in application and exploration. As the original blockchain currency, Bitcoin adopts a distributed trusted ledger storage method and can conduct currency transactions without a central server. It has natural advantages in financial currency. The representative project that followed was Ethereum, which developed a Turing-complete virtual engine based on the blockchain distributed storage system, which can compile and run smart contracts on it, thus creating a decentralized trusted system. execute computable programs. The trusted computing unit can be a trusted computing enclave, which provides an application running environment for isolated execution.

另一方面,随着嵌入式系统的蓬勃发展,越来越多的嵌入式芯片应用于多媒体、网络通讯、视频监控等领域。越广泛的使用意味着越可能成为目标而遭受窃听和攻击。嵌入式系统,特别是用于区块链应用的嵌入式系统在设计时考虑了运行状态的各种安全因素,一般运行时的系统不容易被攻破。而系统的升级过程往往伴随着中断运行、替换系统文件、重新启动等多个环节,极有可能为攻击者提供机会。On the other hand, with the vigorous development of embedded systems, more and more embedded chips are used in fields such as multimedia, network communications, and video surveillance. Wider use means more potential targets for eavesdropping and attack. Embedded systems, especially those used for blockchain applications, are designed with various security factors in the running state in mind. Generally, the system at runtime is not easy to be broken. The system upgrade process is often accompanied by multiple steps such as interrupting operation, replacing system files, and restarting, which is very likely to provide opportunities for attackers.

目前市场上,尚未有针对图灵完备的智能合约虚拟引擎而设计的安全芯片,无法在边缘设备上收集数据并且据此改变区块链上智能合约的状态。与此同时,芯片本身并非一个完整的区块链节点环境,因其需要较大的内存和较高的功耗,也无法做到集成节点。Currently, there is no security chip designed for a Turing-complete smart contract virtual engine on the market, which cannot collect data on edge devices and change the status of smart contracts on the blockchain accordingly. At the same time, the chip itself is not a complete blockchain node environment. Because it requires large memory and high power consumption, it cannot integrate nodes.

发明内容Contents of the invention

本申请目的是提供一种基于区块链的可信计算芯片,能够在边缘设备上的可信计算环境下快速执行或验证智能合约状态,其能够被服务端所信任和调用,保证芯片数据计算和传输的可信度,方便在边缘设备上应用区块链加密和可信技术,能够极大地扩展区块链的应用场景。The purpose of this application is to provide a blockchain-based trusted computing chip that can quickly execute or verify the status of smart contracts in a trusted computing environment on edge devices. It can be trusted and called by the server to ensure chip data calculation. and transmission credibility, which facilitates the application of blockchain encryption and trustworthy technologies on edge devices, which can greatly expand the application scenarios of blockchain.

本申请涉及一种基于区块链的可信计算芯片,包括enclave保护模块、智能合约执行装置和加密模块,所述enclave保护模块用于构建该芯片上的可信计算环境并保护芯片上的所有数据状态和执行动作;This application relates to a trusted computing chip based on blockchain, including an enclave protection module, a smart contract execution device and an encryption module. The enclave protection module is used to build a trusted computing environment on the chip and protect all the devices on the chip. Data status and execution actions;

智能合约执行装置包括合约原语的解码转化单元和指令执行单元;The smart contract execution device includes a decoding and conversion unit of contract primitives and an instruction execution unit;

所述解码转化单元接受外部输入的二进制码,利用解码装置将所述二进制码反解析出合约原语序列,并根据所述解码装置中预嵌入的原语含义功能,将反解析出的原语序列转换生成所述指令执行单元所需要的指令代码;The decoding and conversion unit accepts the binary code input from the outside, uses the decoding device to de-parse the binary code into a sequence of contract primitives, and converts the de-parsed primitives according to the primitive meaning function pre-embedded in the decoding device. Sequence conversion generates instruction codes required by the instruction execution unit;

所述加密模块包括加密协处理器,所述指令执行单元的处理结果交由所述加密协处理器对计算结果进行签名加密。The encryption module includes an encryption co-processor, and the processing results of the instruction execution unit are handed over to the encryption co-processor to sign and encrypt the calculation results.

优选地,所述指令执行单元包括寄存器堆和执行组件,所述执行组件与所述寄存器堆和外置的内存连接。Preferably, the instruction execution unit includes a register file and an execution component, and the execution component is connected to the register file and an external memory.

其中,所述执行组件包括指令读取单元、指令解码单元、算术逻辑运算单元、内存读写单元和寄存器读写单元;所述指令读取单元从合约原语的解码转化单元中接受输出的指令代码作为需要执行的底层指令,所述指令解码单元根据指令的结构码解析出指令的类别,所述算术逻辑运算单元根据输入的指令代码进行运算,通过操作至少一个寄存器进行整形算术逻辑运算,所述内存读写单元操作所述内存,读取或修改所述内存中的数据,所述寄存器读写单元操作所述寄存器堆,读取或修改寄存器堆中各寄存器的数据。Among them, the execution component includes an instruction reading unit, an instruction decoding unit, an arithmetic and logical operation unit, a memory reading and writing unit, and a register reading and writing unit; the instruction reading unit accepts the output instructions from the decoding and conversion unit of the contract primitive. The code serves as the underlying instruction that needs to be executed. The instruction decoding unit parses the instruction type according to the structural code of the instruction. The arithmetic and logical operation unit performs operations according to the input instruction code and performs integer arithmetic and logical operations by operating at least one register. The memory reading and writing unit operates the memory and reads or modifies the data in the memory. The register reading and writing unit operates the register file and reads or modifies the data of each register in the register file.

其中,所述寄存器堆包括PC指令计数器,所述PC指令计数器引导读取指令的索引或者被跳转指令修改设置。所述寄存器堆还包括控制和状态寄存器以及计算预留寄存器。Wherein, the register file includes a PC instruction counter, and the PC instruction counter guides the index of the read instruction or is modified and set by a jump instruction. The register file also includes control and status registers and computationally reserved registers.

其中,所述加密协处理器提供非对称加密方法,根据其内部写入的硬件密钥的唯一身份标识对执行结果进行非对称加密,生成签名并输出。所述密钥在制造过程中被随机写入所述可信计算芯片上,以用于所述可信计算芯片的身份标识,所述密钥包括不可访问的私钥和可被读取以用于服务端验证的公钥。Wherein, the encryption coprocessor provides an asymmetric encryption method, performs asymmetric encryption on the execution result according to the unique identity of the hardware key written inside it, generates a signature and outputs it. The key is randomly written on the trusted computing chip during the manufacturing process to be used for the identity of the trusted computing chip. The key includes an inaccessible private key and a readable key. The public key verified on the server side.

其中,所述可信计算芯片分成可信区域和不可信区域;当所述可信计算芯片在执行多用户智能合约时,芯片在机器模式下为多个智能合约执行程序配置各自的软硬件资源,可信区域中的多个智能合约执行程序之间相互隔离;当存在多用户可信智能合约时,运行在所述可信计算芯片上的多个智能合约执行程序中的一个应用程序访问其他可信智能合约程序的受保护资源时,需要提供相应的私钥或者私钥签名后的访问指令,由安全监视器进行验证和仲裁以确定其对其他可信应用程序及资源的访问权限。Wherein, the trusted computing chip is divided into a trusted area and an untrusted area; when the trusted computing chip executes a multi-user smart contract, the chip configures respective software and hardware resources for multiple smart contract execution programs in machine mode. , multiple smart contract execution programs in the trusted area are isolated from each other; when there are multi-user trusted smart contracts, one application program among the multiple smart contract execution programs running on the trusted computing chip accesses other When using protected resources of a trusted smart contract program, the corresponding private key or access instructions signed by the private key need to be provided, and the security monitor will verify and arbitrate to determine its access rights to other trusted applications and resources.

其中,所述可信计算芯片在执行智能合约时,每个可信智能合约执行程序使用安全监视器分配的软硬件资源,将应用程序代码放置在可信区域,访问受保护的物理内存、调用安全监视器分配的处理器内核资源,并将智能合约的执行结果写入受保护的物理内存中,由安全监管者负责智能合约执行结果的后续处理。Among them, when the trusted computing chip executes a smart contract, each trusted smart contract execution program uses the software and hardware resources allocated by the security monitor to place the application code in the trusted area, access protected physical memory, and call The security monitor allocates processor core resources and writes the execution results of the smart contract into protected physical memory. The security supervisor is responsible for the subsequent processing of the smart contract execution results.

其中,所述可信计算芯片的保护机制包括物理内存保护,通过设置可信区域和不可信区域,通过直接物理地址保护芯片物理内存或者通过虚拟内存系统保护物理内存;或者Wherein, the protection mechanism of the trusted computing chip includes physical memory protection, by setting trusted areas and untrusted areas, protecting the physical memory of the chip through direct physical addresses or protecting the physical memory through a virtual memory system; or

所述可信计算芯片的保护机制包括处理器内核保护、软硬件资源保护以及信任基保护,机器模式下配置每个用户程序可以访问的处理器内核资源、软硬件资源和信任基,当发生异常时,控制权移交给机器模式进行访问权限的鉴定和授权。The protection mechanism of the trusted computing chip includes processor core protection, software and hardware resource protection, and trust base protection. In machine mode, the processor core resources, software and hardware resources, and trust base that each user program can access are configured. When an exception occurs, , control is transferred to the machine mode for authentication and authorization of access rights.

本申请通过引入硬件上的指令集合及硬件加速,能够大大提高智能合约的执行效率,并有效减小功耗;通过随机的私钥硬件写入方法,保证每一个芯片的标识是独一无二且无法伪造篡改;通过所设计的内存保护指令和enclave内存保护方法,保障芯片上的计算过程是可信的。在以上可信计算环境中,通过内置的加密函数将合约的执行结果签名输出,能够防止在网络传输过程中数据被第三方伪造,而服务端也能够通过预设的芯片白名单来获取到真实边缘设备中收集到的数据或者合约的执行状态。By introducing hardware instruction sets and hardware acceleration, this application can greatly improve the execution efficiency of smart contracts and effectively reduce power consumption; through a random private key hardware writing method, it ensures that the identity of each chip is unique and cannot be forged. Tampering; through the designed memory protection instructions and enclave memory protection method, the calculation process on the chip is guaranteed to be trustworthy. In the above trusted computing environment, the execution result of the contract is signed and output through the built-in encryption function, which can prevent the data from being forged by a third party during the network transmission process, and the server can also obtain the real information through the preset chip whitelist. The data collected in the edge device or the execution status of the contract.

本申请从数据的生成、计算、内存更改到网络传输各个步骤都完整设计有可信计算的解决方案,能够在将区块链技术应用到边缘设备的同时,最大限度的保证芯片计算的可信性。因此,本申请的可信计算芯片能够有效保证芯片在计算过程中的可信度,同时能够有效提升所有图灵完备的智能合约的执行效率,以供服务端调用。This application is fully designed with a trusted computing solution in every step from data generation, calculation, memory modification to network transmission. It can apply blockchain technology to edge devices while maximizing the trustworthiness of chip computing. sex. Therefore, the trusted computing chip of this application can effectively ensure the credibility of the chip in the calculation process, and can effectively improve the execution efficiency of all Turing-complete smart contracts for server calls.

附图说明Description of the drawings

图1显示了本申请可信计算芯片的模型结构图。Figure 1 shows the model structure diagram of the trusted computing chip of this application.

图2显示了本申请可信计算芯片中的智能合约执行装置的模型结构图。Figure 2 shows the model structure diagram of the smart contract execution device in the trusted computing chip of this application.

图3显示了本申请可信计算芯片中的指令执行单元的模型结构图。Figure 3 shows a model structure diagram of the instruction execution unit in the trusted computing chip of this application.

图4显示了本申请可信计算单元的内部逻辑示意图。Figure 4 shows the internal logic diagram of the trusted computing unit of this application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚明白,下文中将结合附图对本申请的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the purpose, technical solutions and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, as long as there is no conflict, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other.

根据本申请的一种基于区块链的可信计算芯片,主要包括三个模块,分别是enclave保护模块、智能合约执行装置和加密模块。A trusted computing chip based on blockchain according to this application mainly includes three modules, namely an enclave protection module, a smart contract execution device and an encryption module.

enclave保护模块用于构建该芯片上的可信计算环境,监督并保证所有在芯片上数据和执行动作的可靠性,包括并不限于芯片内部数据的安全,同外部软硬件的信息交流等。该保护模块涉及软硬件协同操作,主要通过设计芯片上的硬件保护指令,来保证芯片执行过程中对于内存数据的维护,不允许通过绕开硬件保护指令的方式篡改内存;通过设计的enclave软件保护方法,保证芯片指令执行过程中内存数据的稳定性,不允许其他应用篡改另一个应用使用的内存数据。芯片上的数据存储状态,包括不限于缓存、寄存器,由该模块控制和维护,芯片同外部内存、服务端、硬盘等的数据访问动作亦由本模块构建可信交互环境。The enclave protection module is used to build a trusted computing environment on the chip, supervise and ensure the reliability of all data and execution actions on the chip, including but not limited to the security of data within the chip, information exchange with external software and hardware, etc. This protection module involves the collaborative operation of software and hardware. It mainly ensures the maintenance of memory data during the execution of the chip by designing hardware protection instructions on the chip. It is not allowed to tamper with the memory by bypassing the hardware protection instructions; it is protected by the designed enclave software. This method ensures the stability of memory data during the execution of chip instructions and does not allow other applications to tamper with the memory data used by another application. The data storage status on the chip, including but not limited to cache and registers, is controlled and maintained by this module. The data access actions between the chip and external memory, server, hard disk, etc. are also controlled by this module to build a trusted interactive environment.

具体地,芯片执行应用程序前,由拥有更高权限的安全监管者设置应用程序的enclave参数,其中涉及到设置内存保护参数的硬件指令,非法用户访问和篡改enclave的数据时,需要通过指令访问控制和状态寄存器(CSR),该访问由于没有授权,会导致向安全监视器(SM)发出一个异常中断,以此方式保护内存的访问与篡改。Specifically, before the chip executes the application, the security supervisor with higher authority sets the enclave parameters of the application, which involves hardware instructions for setting memory protection parameters. When illegal users access and tamper with the enclave data, they need to access through instructions. Control and Status Register (CSR), this access without authorization will cause an exception interrupt to be sent to the Security Monitor (SM), thus protecting the memory from access and tampering.

智能合约执行装置受到enclave保护模块监督,保证所有的计算都是可信且安全的,其主要作用为解析并执行芯片输入的智能合约二进制码。优选地,可以提供一种热插拔解码装置,其上储存有智能合约二进制码对应的合约执行模块底层指令集合。The smart contract execution device is supervised by the enclave protection module to ensure that all calculations are trustworthy and safe. Its main function is to parse and execute the smart contract binary code input by the chip. Preferably, a hot-swappable decoding device can be provided, on which a set of underlying instructions of the contract execution module corresponding to the smart contract binary code is stored.

智能合约执行装置包括两部分,解码转化单元和指令执行单元。解码转化单元根据可以热插拔的解码装置读取其中的合约原语对应码,转换生成执行单元所需要的底层指令代码。指令执行单元采用通用流水线设计和RISC-V精简指令集,读取、解析并执行底层指令代码。优选地,指令执行单元默认采用256位整形数据计算操作,不支持浮点操作,这能够极大加速指令的执行效率和简化解析逻辑。The smart contract execution device consists of two parts, the decoding and conversion unit and the instruction execution unit. The decoding and conversion unit reads the corresponding code of the contract primitive according to the hot-swappable decoding device, and converts it to generate the underlying instruction code required by the execution unit. The instruction execution unit adopts a universal pipeline design and RISC-V simplified instruction set to read, parse and execute the underlying instruction code. Preferably, the instruction execution unit uses 256-bit integer data calculation operations by default and does not support floating point operations, which can greatly accelerate the execution efficiency of instructions and simplify the parsing logic.

加密模块包括加密协处理器,加密协处理器提供非对称加密方法,使用内置的密钥对给定输入数据签名。而在服务端可以根据芯片的公钥对数据进行验证。需要注意的是,该过程并不可逆。在不同需求情况下,原数据可能需要和签名一同传输至服务端。The cryptographic module includes a cryptographic coprocessor that provides an asymmetric cryptographic method for signing given input data using a built-in key. On the server side, the data can be verified based on the public key of the chip. It is important to note that this process is not reversible. Under different requirements, the original data may need to be transmitted to the server together with the signature.

加密模块中的密钥管理方法为:在区块链可信计算芯片的制造过程中,在硬件层面上随机写入用于身份标识的密钥。密钥包括私钥和公钥,私钥不被其他模块所访问,公钥可被读取,用于服务端的芯片白名单标识或者数据验证。硬件层面上随机写入的密钥相较于传统硬盘存储密钥的方法在安全性上有着巨大的提升,硬盘是与芯片相隔离的,第三方能够在未经芯片允许的情况下窃取硬盘数据,而芯片内置的密钥则能够完全防止这一点。另外,密钥存储在芯片上,能够通过权限管理控制其访问用户,同之前的enclave构建的可信计算环境配合,能够无缝地保护芯片上私钥的安全,任何人都不能读取到芯片上唯一的内置标识,唯一只能通过公钥来标识芯片身份。公私钥的配对是非对称的,即私钥可以生成公钥,而公钥无法逆推私钥。The key management method in the encryption module is: during the manufacturing process of the blockchain trusted computing chip, the key used for identity identification is randomly written at the hardware level. The key includes a private key and a public key. The private key is not accessible by other modules, and the public key can be read and used for chip whitelist identification or data verification on the server side. Keys written randomly at the hardware level are a huge improvement in security compared to the traditional hard drive method of storing keys. The hard drive is isolated from the chip, and third parties can steal hard drive data without the permission of the chip. , and the key built into the chip can completely prevent this. In addition, the key is stored on the chip, and its access users can be controlled through permission management. In conjunction with the trusted computing environment built by the previous enclave, it can seamlessly protect the security of the private key on the chip, and no one can read the chip. The unique built-in identification on the chip can only identify the chip identity through the public key. The pairing of public and private keys is asymmetric, that is, the private key can generate the public key, but the public key cannot reverse the private key.

实施例Example

如图1-3所示,本申请的可信计算芯片100包括加密协处理器200、enclave保护模块201和智能合约执行装置202。其中,智能合约执行装置202利用可插拔配置的合约原语解码装置203将输入的二进制码合约原语扩展底层指令集合逻辑并生成底层指令执行序列。针对不同图灵完备的智能合约配置不同的解码装置,即可实现自定义加载合约代码的功能,便于芯片的移植或者智能合约的升级。智能合约执行装置202包括合约原语的解码转化单元301和指令执行单元302。As shown in Figures 1-3, the trusted computing chip 100 of the present application includes an encryption coprocessor 200, an enclave protection module 201 and a smart contract execution device 202. Among them, the smart contract execution device 202 uses the pluggable configured contract primitive decoding device 203 to extend the input binary code contract primitives to the underlying instruction set logic and generate the underlying instruction execution sequence. Configuring different decoding devices for different Turing-complete smart contracts can realize the function of custom loading contract code, which facilitates chip transplantation or smart contract upgrades. The smart contract execution device 202 includes a contract primitive decoding and conversion unit 301 and an instruction execution unit 302.

解码转化单元301接受芯片外部输入的二进制码,该二进制码为图灵完备的智能合约代码,编译后可部署在虚拟引擎中执行的二进制序列。解码转化单元301将该二进制码反解析出合约原语序列,并根据外置热插拔的解码装置203中预嵌入的原语含义功能,将反解析出的原语序列转换成芯片底层的指令集表述。其中,不同虚拟引擎支持的智能合约设计不同,对应的解码装置中参数配置也会有所区分,只要根据芯片底层指令能够设计出等价的合约原语功能即可。The decoding and conversion unit 301 accepts the binary code input from the outside of the chip. The binary code is a Turing-complete smart contract code. After compilation, the binary code can be deployed and executed in the virtual engine. The decoding and conversion unit 301 reversely parses the binary code into a contract primitive sequence, and converts the reversely parsed primitive sequence into instructions at the bottom of the chip based on the primitive meaning function pre-embedded in the external hot-swappable decoding device 203 Set expression. Among them, the smart contract designs supported by different virtual engines are different, and the parameter configurations in the corresponding decoding devices will also be different. As long as equivalent contract primitive functions can be designed according to the underlying instructions of the chip.

解码转化单元301能够统计输入代码消耗的合约代码需要的计算量(GAS),目的是为了解决图灵完备语言不停机问题。合约代码不停机问题理论上不可能存在解决办法,所以该模块会预设一个GAS最大值,例如1000万,超出这个最大值之后,解码转化单元会立即中断解码过程,并返回错误结果,可以通过设置GAS溢出错误寄存器位来实现。The decoding and conversion unit 301 can count the calculation amount (GAS) required by the contract code consumed by the input code, in order to solve the problem of non-stopping of Turing complete languages. There is no theoretical solution to the problem of non-stop contract code, so this module will preset a maximum GAS value, such as 10 million. After exceeding this maximum value, the decoding and conversion unit will immediately interrupt the decoding process and return an error result. You can pass Set the GAS overflow error register bit to achieve this.

指令执行单元302采用通用计算单元(CPU)设计方案,包括多级流水线处理模块,能够加快指令执行耗时和增强并行计算能力。此外,本单元底层通过实现RISC-V精简指令集,理论上是图灵完备的计算设备,能够处理通用计算机中所能够处理的大部分问题。指令集主要包括跳转指令、整形算数运算指令、寄存器读写指令和内存读写指令。The instruction execution unit 302 adopts a general computing unit (CPU) design and includes a multi-stage pipeline processing module, which can speed up instruction execution time and enhance parallel computing capabilities. In addition, the bottom layer of this unit implements the RISC-V reduced instruction set, which is theoretically a Turing-complete computing device that can handle most of the problems that can be handled by a general-purpose computer. The instruction set mainly includes jump instructions, integer arithmetic operation instructions, register read and write instructions and memory read and write instructions.

指令执行单元302包括寄存器堆402和执行组件,执行组件与寄存器堆402和内存401连接,通过对寄存器堆402和内存401数据接口的读写访问来进行计算。The instruction execution unit 302 includes a register file 402 and an execution component. The execution component is connected to the register file 402 and the memory 401, and performs calculations through read and write access to the data interfaces of the register file 402 and the memory 401.

其中,寄存器堆402包括PC指令计数器400,还可以包括控制和状态寄存器、计算预留寄存器等(图中未示出)。PC指令计数器400用于引导读取指令的索引或者被跳转指令修改设置。控制和状态寄存器用于记录指令执行的各种状态,包括不限于数据溢出、中断位、序列是否为空等。计算预留寄存器主要用于算术逻辑运算单元,进行快速256位整形数据计算。The register file 402 includes the PC instruction counter 400, and may also include control and status registers, calculation reserved registers, etc. (not shown in the figure). The PC instruction counter 400 is used to guide the index of the read instruction or to be modified by a jump instruction. The control and status registers are used to record various statuses of instruction execution, including but not limited to data overflow, interrupt bits, whether the sequence is empty, etc. The calculation reserved register is mainly used for arithmetic and logic operation units to perform fast 256-bit integer data calculations.

执行组件分为多个计算设备单元,方便流水并行并充分利用芯片的计算能力。该模块顺序包括指令读取单元403、指令解码单元404、算术逻辑运算单元405、内存读写单元406、寄存器读写单元407。The execution component is divided into multiple computing device units to facilitate pipeline parallelization and make full use of the chip's computing power. The module sequence includes an instruction reading unit 403, an instruction decoding unit 404, an arithmetic and logical operation unit 405, a memory reading and writing unit 406, and a register reading and writing unit 407.

指令读取单元403:从合约原语的解码转化单元中接受输出作为需要执行的底层指令。优选的,指令读取单元内部设置有缓存模块,可一次性接受大量的指令序列,防止指令遗漏的情况。Instruction reading unit 403: accepts the output from the decoding and conversion unit of the contract primitive as the underlying instruction that needs to be executed. Preferably, a cache module is provided inside the instruction reading unit, which can accept a large number of instruction sequences at one time to prevent missing instructions.

指令解码单元404:根据指令的结构码解析出指令的类别,不同的指令类别可能会涉及到后续单元不一致的处理逻辑。其中,跳转指令根据计算结果修改PC指令计数器的值实现二进制程序的逻辑判断功能,本指令需要在流水线第五段才能知晓计算结果,故而流水期后会出现四个空泡,无指令执行。在本实施例中,采用提前预测的处理方法来尽量减少跳转指令带来的无效耗时,默认采用指令计数器加一(无跳转)的预测逻辑,如果出现跳转,则再将后续刷入的4条指令作废,输入结果不做任何处理,并更新指令计数器,更新执行指令序列。整形算数运算指令为整形操作加减乘除计算,其中除法运算不产生余数和小数,这是以太坊中虚拟引擎中所限制的,整形运算操作数据均为256位。寄存器读写指令将操作寄存器堆中的数据,内存读写指令操作内存数据,读取内存状态或者写入执行结果。Instruction decoding unit 404: parses the instruction type according to the structure code of the instruction. Different instruction types may involve inconsistent processing logic in subsequent units. Among them, the jump instruction modifies the value of the PC instruction counter based on the calculation result to implement the logical judgment function of the binary program. This instruction needs to be in the fifth section of the pipeline to know the calculation result. Therefore, four bubbles will appear after the pipeline period, and no instructions are executed. In this embodiment, an advance prediction processing method is used to minimize the ineffective time-consuming caused by jump instructions. By default, the prediction logic of adding one instruction counter (no jump) is used. If a jump occurs, subsequent flashes will be executed. The four input instructions are invalidated, the input results are not processed in any way, the instruction counter is updated, and the execution instruction sequence is updated. The integer arithmetic operation instructions are integer operations, addition, subtraction, multiplication and division. The division operation does not produce remainders and decimals. This is restricted by the virtual engine in Ethereum. The integer arithmetic operation data are all 256 bits. The register read and write instructions will operate the data in the register file, and the memory read and write instructions will operate the memory data, read the memory status or write the execution result.

算术逻辑运算单元405:该单元是指令执行单元的核心组成部分,主要功能是根据输入进行二进制的算术和逻辑运算,通过操作至少一个寄存器,进行整形算术逻辑运算,如加减乘(不包含除法)、取反、位操作等。本单元为底层电子逻辑电路设计,通常在一个时钟周期内完成操作。Arithmetic and logical operation unit 405: This unit is the core component of the instruction execution unit. Its main function is to perform binary arithmetic and logical operations according to the input. By operating at least one register, it can perform integer arithmetic and logical operations, such as addition, subtraction, multiplication (excluding division). ), negation, bit operations, etc. This unit is designed for the underlying electronic logic circuit and usually completes its operation within one clock cycle.

内存读写单元406:该单元主要操作芯片外置的内存401,读取或修改内存数据。Memory read and write unit 406: This unit mainly operates the memory 401 external to the chip and reads or modifies memory data.

寄存器读写单元407:该单元主要操作寄存器堆402,读取或修改寄存器堆中各寄存器的数据。因为指令执行可能需要设置不同寄存器内部的数据,比如跳转指令需要设置PC计数器,数据溢出需要设置寄存器溢出位等。Register read and write unit 407: This unit mainly operates the register file 402, reading or modifying the data of each register in the register file. Because instruction execution may require setting data inside different registers, for example, jump instructions require setting the PC counter, data overflow requires setting the register overflow bit, etc.

执行组件顺序依次调用上述五个模块,在每一个时钟周期上升段,按照PC计数器中的索引读取指令缓存中的指令到指令读取单元。指令解码单元、算术逻辑运算单元、内存读写单元、寄存器读写单元则分别读取上一单元的处理结果。在时钟周期下降段,各个单元将执行结果输出。以上构建了多级流水线结构,能够充分利用芯片硬件性能,并减少过多的能耗损失。The execution component calls the above five modules in sequence, and in the rising segment of each clock cycle, reads the instructions in the instruction cache to the instruction fetch unit according to the index in the PC counter. The instruction decoding unit, arithmetic and logical operation unit, memory reading and writing unit, and register reading and writing unit respectively read the processing results of the previous unit. During the falling portion of the clock cycle, each unit will output the execution results. The above constructs a multi-stage pipeline structure, which can fully utilize the chip hardware performance and reduce excessive energy consumption losses.

最后,指令执行单元302的处理结果交由加密协处理器200对计算结果进行签名。加密协处理器200根据其内部硬件密钥的唯一标识对执行结果进行非对称加密,生成签名并输出。优选的,加密协处理器302可配置是否将输入执行结果一起交由输出,便于不同应用场景中可能的元数据需求。Finally, the processing result of the instruction execution unit 302 is handed over to the encryption coprocessor 200 to sign the calculation result. The encryption coprocessor 200 asymmetrically encrypts the execution result based on the unique identification of its internal hardware key, generates a signature, and outputs it. Preferably, the encryption coprocessor 302 can configure whether to hand over the input execution results to the output together to facilitate possible metadata requirements in different application scenarios.

如图4所示,本申请所涉及的可信计算单元由模块600所描述。该模块分成了3种工作模式:用户模式、管理员模式和机器模式。其中601、602为用户模式,603、604为管理员模式,605为机器模式。可信计算单元将芯片分成了两种区域,一种是不可信区域601、603,一种是可信区域602、604。本申请的可信计算芯片限制不可信区域内的用户、代码和程序只能访问自己的软硬件资源。As shown in Figure 4, the trusted computing unit involved in this application is described by module 600. This module is divided into 3 working modes: user mode, administrator mode and machine mode. Among them, 601 and 602 are user mode, 603 and 604 are administrator mode, and 605 is machine mode. The trusted computing unit divides the chip into two areas, one is the untrusted area 601 and 603, and the other is the trusted area 602 and 604. The trusted computing chip of this application restricts users, codes and programs in the untrusted area to only access their own software and hardware resources.

在可信计算芯片内,硬件提供安全原语和接口。对于拥有最高权限的可信软件组件(如bootloader,SM)分配以最小的责任,即让其只负责可信区域。同时,将剩余的应用程序分成可信应用与不可信应用,并将可信应用程序推送到可信区域,其所涉及的内存、指令和软硬件资源采用了保护机制,以防止不可信应用非法访问。可信计算芯片首先进入机器模式,享有最高的操作权限,配置整个软硬件系统,加载智能合约执行装置所对应的用户智能合约执行程序,分配程序所需要的物理受保护内存(PMP)以及其他受保护的硬件资源。Within a trusted computing chip, hardware provides security primitives and interfaces. Assign the smallest responsibility to the trusted software component (such as bootloader, SM) with the highest authority, that is, let it only be responsible for the trusted area. At the same time, the remaining applications are divided into trusted applications and untrusted applications, and trusted applications are pushed to the trusted area. The memory, instructions, and software and hardware resources involved are protected by a protection mechanism to prevent untrusted applications from being illegal. access. The trusted computing chip first enters the machine mode, enjoys the highest operating authority, configures the entire software and hardware system, loads the user smart contract execution program corresponding to the smart contract execution device, allocates the physical protected memory (PMP) required by the program and other protected Protected hardware resources.

区块链智能合约可信计算芯片在执行多用户智能合约情况下,芯片在机器模式下为多个智能合约执行程序配置各自的软硬件资源,可信区域602中的多个智能合约执行程序之间不能互相访问、互相隔离,同时其他的不可信应用程序也不能访问这些可信区域的程序、内存数据等受保护内容。When the blockchain smart contract trusted computing chip executes a multi-user smart contract, the chip configures respective software and hardware resources for multiple smart contract execution programs in machine mode. Among the multiple smart contract execution programs in the trusted area 602 They cannot access each other and are isolated from each other. At the same time, other untrusted applications cannot access protected content such as programs and memory data in these trusted areas.

当存在多用户可信智能合约情况下,运行在区块链智能合约可信计算芯片上的多个智能合约执行程序中应用程序0~应用程序N中的一个程序访问其他可信智能合约程序的受保护资源时,需要提供相应的私钥或者私钥签名后的访问指令,由安全监视器(SM)605进行验证和仲裁以确定其对其他某个或者多个可信应用程序及资源的访问权限。When there is a multi-user trusted smart contract, one of the multiple smart contract execution programs running on the trusted computing chip of the blockchain smart contract, application 0 to application N, accesses other trusted smart contract programs. When resources are protected, the corresponding private key or access instructions signed by the private key need to be provided, and the security monitor (SM) 605 will verify and arbitrate to determine its access to one or more other trusted applications and resources. permissions.

区块链智能合约可信计算芯片在执行智能合约时,每个可信智能合约执行程序使用SM分配的软硬件资源,将应用程序代码放置在可信区域,访问受保护的物理内存、调用SM分配的处理器内核资源,并将智能合约的执行结果写入受保护的物理内存中,由安全监管者负责进一步的智能合约执行结果的分发与广播等后续处理。When the blockchain smart contract trusted computing chip executes smart contracts, each trusted smart contract execution program uses the software and hardware resources allocated by SM to place the application code in the trusted area, access protected physical memory, and call SM Allocate processor core resources and write the execution results of the smart contract into protected physical memory. The security supervisor is responsible for further subsequent processing such as distribution and broadcast of the smart contract execution results.

可信应用程序的保护机制包括了区块链智能合约可信计算芯片的物理内存保护,不可信的用户、代码和程序只能访问自己的内存,允许机器模式指定每个用户模式下的用户、代码、和程序可以访问的物理内存。任何的非法越界访问都将发生异常,此时的控制权被移交给机器模式进行访问权限鉴定和授权。在物理内存的保护机制中,通过设置可信区域和不可信区域可以通过直接物理地址保护芯片物理内存,也可以通过虚拟内存系统保护物理内存。在采用虚拟内存系统时,芯片内的地址都是虚拟地址,要访问物理内存,必须通过地址转换单元将虚拟地址转换为真正的物理地址。The protection mechanism of trusted applications includes the physical memory protection of the trusted computing chip of the blockchain smart contract. Untrusted users, codes and programs can only access their own memory, allowing machine mode to specify users in each user mode. code, and the physical memory that the program can access. Any illegal cross-border access will cause an exception, and the control at this time is transferred to the machine mode for access permission authentication and authorization. In the physical memory protection mechanism, by setting the trusted area and the untrusted area, the chip physical memory can be protected through direct physical address, and the physical memory can also be protected through the virtual memory system. When using a virtual memory system, the addresses in the chip are all virtual addresses. To access physical memory, the virtual address must be converted into a real physical address through an address conversion unit.

智能合约可信计算芯片的可信应用程序保护机制还包括了处理器内核保护606、软硬件资源保护607以及信任基保护608,机器模式下配置每个用户程序可以访问的处理器内核资源、软硬件资源和信任基。任何的非法越界访问都将发生异常,此时的控制权被移交给机器模式进行访问权限鉴定和授权。The trusted application protection mechanism of the smart contract trusted computing chip also includes processor core protection 606, software and hardware resource protection 607, and trust base protection 608. In machine mode, configure the processor core resources and software that each user program can access. Hardware resources and trust base. Any illegal cross-border access will cause an exception, and the control at this time is transferred to the machine mode for access permission authentication and authorization.

本申请所设计的智能合约执行过程、智能合约在可信计算芯片内执行时的保护方法和机制,以及可信计算芯片在执行智能合约时所涉及到的芯片设计的特征、需求等如上描述构成了本申请专利的主体。本申请能够在边缘设备中集成区块链虚拟引擎功能,从而在真实环境中能够快速高效地执行或验证智能合约结果并上传到区块链中。此外,芯片的enclave协议设计保证了数据在设备中计算的可信度,本申请的加密协处理器能够保证数据在网络传输过程中的有效性,防止第三方设备在中间盗取信息或者伪造虚假数据给服务端。The smart contract execution process designed in this application, the protection methods and mechanisms when the smart contract is executed in the trusted computing chip, and the characteristics and requirements of the chip design involved in the execution of the smart contract by the trusted computing chip are as described above. The subject matter of this patent application. This application can integrate the blockchain virtual engine function in the edge device, so that the smart contract results can be quickly and efficiently executed or verified in the real environment and uploaded to the blockchain. In addition, the enclave protocol design of the chip ensures the credibility of data calculation in the device. The encryption co-processor of this application can ensure the validity of data during network transmission and prevent third-party devices from stealing information or forging false information in the middle. data to the server.

虽然本申请所揭露的实施方式如上,但所述的内容只是为了便于理解本申请而采用的实施方式,并非用以限定本申请。任何本申请所属技术领域内的技术人员,在不脱离本申请所揭露的精神和范围的前提下,可以在实施的形式上及细节上作任何的修改与变化,但本申请的专利保护范围,仍须以所附的权利要求书所界定的范围为准。Although the embodiments disclosed in the present application are as above, the described contents are only used to facilitate the understanding of the present application and are not intended to limit the present application. Any skilled person in the technical field to which this application belongs can make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application. However, the scope of patent protection of this application shall not The scope defined by the appended claims shall prevail.

Claims (10)

1.一种智能合约执行装置,包括合约原语的解码转化单元和指令执行单元,其特征在于,所述解码转化单元接受外部输入的二进制码,利用解码装置将所述二进制码反解析出合约原语序列,并根据所述解码装置中预嵌入的原语含义功能,将反解析出的原语序列转换生成所述指令执行单元所需要的指令代码。1. A smart contract execution device, including a decoding and conversion unit of contract primitives and an instruction execution unit, characterized in that the decoding and conversion unit accepts an externally input binary code and uses a decoding device to reversely parse the binary code out of the contract Primitive sequence, and according to the primitive meaning function pre-embedded in the decoding device, the reversely parsed primitive sequence is converted into the instruction code required by the instruction execution unit. 2.根据权利要求1所述的智能合约执行装置,其特征在于,所述解码装置是外置热插拔的合约原语解码装置。2. The smart contract execution device according to claim 1, wherein the decoding device is an external hot-swappable contract primitive decoding device. 3.根据权利要求2所述的智能合约执行装置,其特征在于,利用可插拔配置的所述合约原语解码装置将输入的二进制码合约原语扩展底层指令集合逻辑并生成底层指令执行序列。3. The smart contract execution device according to claim 2, characterized in that the contract primitive decoding device in a pluggable configuration is used to extend the input binary code contract primitives to the underlying instruction set logic and generate the underlying instruction execution sequence. . 4.根据权利要求1-3中任一项所述的智能合约执行装置,其特征在于,所述指令执行单元包括寄存器堆和执行组件,所述执行组件与所述寄存器堆和外置的内存连接。4. The smart contract execution device according to any one of claims 1 to 3, characterized in that the instruction execution unit includes a register file and an execution component, and the execution component is connected to the register file and an external memory. connect. 5.根据权利要求4所述的智能合约执行装置,其特征在于,所述执行组件包括指令读取单元、指令解码单元、算术逻辑运算单元、内存读写单元和寄存器读写单元;其中,5. The smart contract execution device according to claim 4, wherein the execution component includes an instruction reading unit, an instruction decoding unit, an arithmetic and logical operation unit, a memory reading and writing unit, and a register reading and writing unit; wherein, 所述指令读取单元从合约原语的解码转化单元中接受输出的指令代码作为需要执行的底层指令,The instruction reading unit receives the output instruction code from the decoding and conversion unit of the contract primitive as the underlying instruction that needs to be executed, 所述指令解码单元根据指令的结构码解析出指令的类别,The instruction decoding unit parses the instruction type according to the instruction's structure code, 所述算术逻辑运算单元根据输入的指令代码进行运算,通过操作至少一个寄存器进行整形算术逻辑运算,The arithmetic and logical operation unit performs operations according to the input instruction code, and performs shaping arithmetic and logical operations by operating at least one register, 所述内存读写单元操作所述内存,读取或修改所述内存中的数据,The memory reading and writing unit operates the memory and reads or modifies the data in the memory, 所述寄存器读写单元操作所述寄存器堆,读取或修改寄存器堆中各寄存器的数据。The register reading and writing unit operates the register file and reads or modifies the data of each register in the register file. 6.根据权利要求4所述的智能合约执行装置,其特征在于,所述寄存器堆包括PC指令计数器,所述PC指令计数器引导读取指令的索引或者被跳转指令修改设置。6. The smart contract execution device according to claim 4, wherein the register file includes a PC instruction counter, and the PC instruction counter guides the index of the read instruction or is modified by a jump instruction. 7.根据权利要求6所述的智能合约执行装置,其特征在于,所述寄存器堆还包括控制和状态寄存器以及计算预留寄存器。7. The smart contract execution device according to claim 6, wherein the register file further includes a control and status register and a calculation reserved register. 8.一种基于区块链的可信计算芯片,其特征在于,包括enclave保护模块和智能合约执行装置,所述enclave保护模块用于构建芯片上的可信计算环境并保护芯片上的所有数据状态和执行动作,所述智能合约执行装置是根据权利要求1-7中任一项所述的智能合约执行装置。8. A trusted computing chip based on blockchain, characterized by including an enclave protection module and a smart contract execution device. The enclave protection module is used to build a trusted computing environment on the chip and protect all data on the chip. status and execution actions, the smart contract execution device is the smart contract execution device according to any one of claims 1-7. 9.根据权利要求8所述的可信计算芯片,其特征在于,还包括加密模块,所述加密模块包括加密协处理器,所述加密协处理器提供非对称加密方法,根据其内部写入的硬件密钥的唯一身份标识对执行结果进行非对称加密,生成签名并输出,所述密钥包括不可访问的私钥和可被读取以用于服务端验证的公钥。9. The trusted computing chip according to claim 8, further comprising an encryption module, the encryption module includes an encryption co-processor, the encryption co-processor provides an asymmetric encryption method, according to its internal writing The execution result is asymmetrically encrypted using the unique identity of the hardware key, and a signature is generated and output. The key includes an inaccessible private key and a public key that can be read for server-side verification. 10.根据权利要求9所述的可信计算芯片,其特征在于,所述可信计算芯片分成可信区域和不可信区域;10. The trusted computing chip according to claim 9, characterized in that the trusted computing chip is divided into a trusted area and an untrusted area; 当所述可信计算芯片在执行多用户智能合约时,芯片在机器模式下为多个智能合约执行程序配置各自的软硬件资源,可信区域中的多个智能合约执行程序之间相互隔离;When the trusted computing chip executes a multi-user smart contract, the chip configures respective software and hardware resources for multiple smart contract execution programs in machine mode, and the multiple smart contract execution programs in the trusted area are isolated from each other; 当存在多用户可信智能合约时,运行在所述可信计算芯片上的多个智能合约执行程序中的一个应用程序访问其他可信智能合约程序的受保护资源时,需要提供相应的私钥或者私钥签名后的访问指令,由安全监视器进行验证和仲裁以确定其对其他可信应用程序及资源的访问权限。When there is a multi-user trusted smart contract, when an application program among the multiple smart contract execution programs running on the trusted computing chip accesses the protected resources of other trusted smart contract programs, it needs to provide the corresponding private key. Or the access instructions signed by the private key are verified and arbitrated by the security monitor to determine its access rights to other trusted applications and resources.
CN202311655506.1A 2020-07-01 2020-07-01 A trusted computing chip based on blockchain Pending CN117688623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311655506.1A CN117688623A (en) 2020-07-01 2020-07-01 A trusted computing chip based on blockchain

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010627750.7A CN111931251B (en) 2020-07-01 2020-07-01 Trusted computing chip based on blockchain
CN202311655506.1A CN117688623A (en) 2020-07-01 2020-07-01 A trusted computing chip based on blockchain

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202010627750.7A Division CN111931251B (en) 2020-07-01 2020-07-01 Trusted computing chip based on blockchain

Publications (1)

Publication Number Publication Date
CN117688623A true CN117688623A (en) 2024-03-12

Family

ID=73317677

Family Applications (3)

Application Number Title Priority Date Filing Date
CN202010627750.7A Active CN111931251B (en) 2020-07-01 2020-07-01 Trusted computing chip based on blockchain
CN202311655499.5A Pending CN117688622A (en) 2020-07-01 2020-07-01 Trusted computing chip based on blockchain
CN202311655506.1A Pending CN117688623A (en) 2020-07-01 2020-07-01 A trusted computing chip based on blockchain

Family Applications Before (2)

Application Number Title Priority Date Filing Date
CN202010627750.7A Active CN111931251B (en) 2020-07-01 2020-07-01 Trusted computing chip based on blockchain
CN202311655499.5A Pending CN117688622A (en) 2020-07-01 2020-07-01 Trusted computing chip based on blockchain

Country Status (1)

Country Link
CN (3) CN111931251B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112613049B (en) * 2020-12-18 2024-04-26 杭州前云数据技术有限公司 Unified cloud storage system based on block chain and method for realizing data security
CN112769758B (en) * 2020-12-21 2022-04-29 浙江大学 Credible Internet of things gas meter based on block chain and credible method of local and cloud
CN112905238A (en) * 2021-02-08 2021-06-04 北京微芯区块链与边缘计算研究院 Intelligent contract executor and method for block chain and block chain operation system
CN112883436A (en) * 2021-02-08 2021-06-01 北京微芯区块链与边缘计算研究院 Chip device special for intelligent contract, execution method and block chain link point device
CN112906068B (en) * 2021-03-18 2024-03-12 上海零数众合信息科技有限公司 Block chain external agent technology calculation control method
CN112906073A (en) * 2021-03-18 2021-06-04 上海能链众合科技有限公司 Method for realizing block chain secret calculation general model
US20220321332A1 (en) * 2021-03-30 2022-10-06 International Business Machines Corporation Post-quantum cryptography secured execution environments for edge devices
CN113886857A (en) * 2021-10-21 2022-01-04 上海万向区块链股份公司 RISC-V hardware and software security system applied to blockchain network
CN114615070B (en) * 2022-03-21 2024-04-19 中国人民解放军国防科技大学 Network security event capture method and device based on trusted execution environment

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8452988B2 (en) * 2006-07-24 2013-05-28 Michael Sujue Wang Secure data storage for protecting digital content
US10230529B2 (en) * 2015-07-31 2019-03-12 Microsft Technology Licensing, LLC Techniques to secure computation data in a computing environment
US10761877B2 (en) * 2017-07-21 2020-09-01 Intel Corporation Apparatuses, methods, and systems for blockchain transaction acceleration
US11405373B2 (en) * 2018-09-07 2022-08-02 Honeywell International, Inc. Blockchain-based secured multicast communications
CN110033368B (en) * 2018-11-30 2020-07-07 阿里巴巴集团控股有限公司 Method for realizing privacy protection in block chain
CN110032883B (en) * 2019-01-31 2020-05-29 阿里巴巴集团控股有限公司 Method, system and node for realizing privacy protection in block chain
CN110825363B (en) * 2019-11-01 2024-05-17 北京知道创宇信息技术股份有限公司 Intelligent contract acquisition method and device, electronic equipment and storage medium
CN111125697B (en) * 2019-11-14 2022-03-04 北京理工大学 Intelligent contract defect triggerability detection method and system based on defect abstract
CN111027690B (en) * 2019-11-26 2023-08-04 陈子祺 Combined processing device, chip and method for performing deterministic inference
CN212966171U (en) * 2020-07-01 2021-04-13 陈子祺 Credible computing chip based on block chain

Also Published As

Publication number Publication date
CN111931251B (en) 2024-01-12
CN117688622A (en) 2024-03-12
CN111931251A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN117688623A (en) A trusted computing chip based on blockchain
Nunes et al. {VRASED}: A verified {Hardware/Software}{Co-Design} for remote attestation
CN112005237B (en) Secure collaboration between processors and processing accelerators in a secure zone
Yan et al. Confidentiality support over financial grade consortium blockchain
US10148442B2 (en) End-to-end security for hardware running verified software
Fletcher et al. A secure processor architecture for encrypted computation on untrusted programs
KR101504857B1 (en) System and method for supporting jit in a secure system with randomly allocated memory ranges
US20150058997A1 (en) System and Method for Self-Protecting Data
Wang et al. Hybridchain: A novel architecture for confidentiality-preserving and performant permissioned blockchain using trusted execution environment
US12058126B2 (en) Network management using trusted execution environments
CN113704041A (en) Secure debugging of FPGA designs
CN212966171U (en) Credible computing chip based on block chain
Shepherd et al. Trusted Execution Environments
WO2023045744A1 (en) Reinforcement method, registration method, running method, electronic device and storage medium
US12147532B2 (en) Performance monitoring unit of a processor deterring tampering of counter configuration and enabling verifiable data sampling
Mofrad et al. Securing big data scientific workflows via trusted heterogeneous environments
Tarkhani Secure programming with dispersed compartments
Costan et al. Security challenges and opportunities in adaptive and reconfigurable hardware
Zhao et al. A critical-path-based vulnerability detection method for tx. origin dependency of smart contract
Gligor et al. Requirements for root of trust establishment
CN119135333B (en) A trusted contract pre-running system and method based on FPGA
Ciani et al. Unleashing OpenTitan's Potential: a Silicon-Ready Embedded Secure Element for Root of Trust and Cryptographic Offloading
Lombardi et al. Towards a gpu cloud: Benefits and security issues
Mihalcea Prototyping Memory Integrity Tree Algorithms for Internet of Things Devices
Faree et al. Protecting security-sensitive data using program transformation and trusted execution environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40101996

Country of ref document: HK