WO2020015633A1 - Method and apparatus for realizing smart contract of blockchain - Google Patents

Method and apparatus for realizing smart contract of blockchain Download PDF

Info

Publication number
WO2020015633A1
WO2020015633A1 PCT/CN2019/096149 CN2019096149W WO2020015633A1 WO 2020015633 A1 WO2020015633 A1 WO 2020015633A1 CN 2019096149 W CN2019096149 W CN 2019096149W WO 2020015633 A1 WO2020015633 A1 WO 2020015633A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
chain
blockchain
smart contract
contract
Prior art date
Application number
PCT/CN2019/096149
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 WO2020015633A1 publication Critical patent/WO2020015633A1/en

Links

Images

Classifications

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

Definitions

  • the present invention relates to data processing technology, and in particular to a method and device for implementing a blockchain smart contract.
  • Smart contracts are one of the main features of blockchain 2.0 and 3.0 applications.
  • the system's TPS throughput
  • Ethereum processes about 15 transactions per second, compared to traditional centralized applications such as VISA or Taobao has tens of thousands or even hundreds of thousands of TPS per second.
  • Traditional blockchains such as our familiar Ethereum platform, in order to ensure decentralization and security, both transaction execution and block consensus rely heavily on the serial processing of consensus nodes.
  • the entire blockchain network has only a single computing performance. The computing power of the entire network cannot be fully utilized, causing a performance bottleneck.
  • the traditional blockchain is a closed computing environment, and smart contracts can only access the internal data of the blockchain.
  • the data on the chain is rapidly expanded, and the blocks are inflated, which ultimately leads to a further decline in transaction performance.
  • the data owner is unwilling to save the data on the chain. Using cryptographic encryption to save will cause the expansion of data and the reduction of smart contract processing capabilities.
  • the existing technology proposes a private transaction scheme based on the Ethereum enterprise blockchain to ensure the privacy of transactions and data.
  • the transaction parties keep the private state tree locally, and the private transactions of the smart contract only access the data in the private state tree. This method ensures the privacy of the data and reduces the size of the public block data.
  • the private state tree requires the data reached by the parties involved in the transaction, which still belongs to the on-chain data.
  • an embodiment of the present invention provides a method for implementing a blockchain smart contract, including:
  • the off-chain computing power provider calculates and processes the off-chain data and provides verification certificates.
  • dividing the data involved in the transaction request into on-chain data and off-chain data includes:
  • the data involved in the current smart contract transaction is divided into on-chain data and off-chain data.
  • the on-chain data includes: data from the distributed ledger of the blockchain when the contract is executed;
  • the off-chain data includes data provided by a database of at least one data provider off-chain when a contract is executed.
  • each data provider uses the MPC algorithm to perform collaborative calculation.
  • the consensus processing of the data on the chain by the common nodes of the blockchain includes:
  • a matching computing power provider calculates the on-chain data and provides a calculation certificate to generate a calculation result; wherein the calculation result includes: transaction information, calculation result, calculation certificate, and contract status change;
  • the distributed ledger is changed for consensus processing.
  • the present invention also provides a device for implementing a blockchain smart contract, including:
  • a request receiving module for receiving a smart contract transaction request initiated by a user
  • a distinguishing module configured to distinguish the data involved in the transaction request into on-chain data and off-chain data
  • On-chain consensus module the consensus nodes of the blockchain perform consensus processing on the data on the chain
  • Off-chain data processing module calculates and processes the off-chain data and provides verification certificates.
  • the distinguishing module includes:
  • a transaction data determining unit configured to determine data related to a current smart contract transaction according to the transaction request
  • the distinguishing unit distinguishes the data involved in the current smart contract transaction into on-chain data and off-chain data according to the source of the data involved in the transaction.
  • the on-chain data includes: data from the distributed ledger of the blockchain when the contract is executed;
  • the off-chain data includes: data provided by at least one data provider off-chain when the contract is executed.
  • each data provider uses the MPC algorithm to perform collaborative calculation.
  • the on-chain consensus module performs consensus processing on the on-chain data source by the consensus nodes of the blockchain including:
  • a matching computing power provider calculates the data on the chain and provides a calculation certificate to generate a calculation result; wherein the calculation result includes: transaction information, calculation result, calculation certificate, and contract status change;
  • the distributed ledger is changed for consensus processing.
  • the present invention also provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the processor implements the above method when the computer program is executed.
  • the present invention also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program for executing the above method.
  • the method and device for implementing smart contracts provided by the present invention support access to heterogeneous data sources, on-chain data sources, off-chain data sources, and hybrid data sources.
  • off-chain data multi-party secure computing (MPC) and verifiable computing (VC) are adopted to ensure data privacy and verify the correctness of the calculation.
  • MPC multi-party secure computing
  • VC verifiable computing
  • FIG. 1 is a flowchart of a method for implementing a blockchain smart contract disclosed in the present invention
  • FIG. 2 is a structural diagram of a blockchain smart contract implementation method disclosed in the present invention.
  • FIG. 3 is a schematic diagram disclosed in an embodiment of the present invention.
  • FIG. 4 is a schematic diagram disclosed in an embodiment of the present invention.
  • FIG. 5 is a diagram of an electronic device disclosed in an embodiment of the present invention.
  • the present invention provides a method for implementing a blockchain smart contract. As shown in FIG. 1, the method includes:
  • Step S101 Receive a smart contract transaction request initiated by a user
  • Step S102 distinguish the data involved in the transaction request into on-chain data and off-chain data
  • Step S103 A consensus node of the blockchain performs consensus processing on the data on the chain;
  • step S104 the off-chain computing power provider performs calculation processing on the off-chain data and provides a verification certificate.
  • the innovation of the technical solution of the present invention is the decoupling of consensus and calculation, so that smart contracts can support access to on-chain data sources and off-chain data sources, that is, settlement of on-chain data and off-chain data that require consensus processing in smart contract requests
  • Decoupling as shown in FIG. 2 is a structural diagram of an embodiment of the present application.
  • the invention decouples consensus from calculation, and enables the system to support both on-chain and off-chain data. From the system architecture, the contract is divided into IO logic related to the state on the chain and computing logic not related to the state on the chain. It is a meta smart contract.
  • the state-related IO logic is processed by the consensus nodes on the blockchain, and the state changes and results are broadcast to the blockchain, and each node writes to the local database after verification;
  • the state-independent calculation logic is distributed to the computing power provider for parallel calculation, which greatly improves the calculation efficiency.
  • an encryption circuit is used to perform multi-party secure calculation of MPC to ensure data privacy.
  • ordinary Boolean circuits can be used for calculation.
  • the circuit logic (whether encrypted or not) can be accelerated using dedicated hardware, on the one hand, to increase the utilization of idle resources, and at the same time to improve computing efficiency.
  • smart contracts are classified into three types in the specific implementation of this embodiment: state contracts, stateless contracts, and hybrid contracts.
  • State contract The process of state contract is similar to the traditional smart contract. As shown in Figure 3, it is a schematic diagram of the state contract execution in this embodiment.
  • the state contract needs to save the state on the chain.
  • the data entered during the execution of the state contract comes from the on-chain distribution.
  • Type ledger each time the contract is executed will cause the contract status to change, and all changes will be recorded in the distributed ledger.
  • the calculation of the contract is divided into multiple sub-tasks and distributed to multiple computing nodes.
  • the contract developer can choose a private computing method to ensure that the data is not disclosed to the computing nodes.
  • the contract developer issues a smart contract to the blockchain, and the user initiates a smart contract transaction request. If the data involved in the smart contract transaction request comes from the chain, the state contract in the embodiment of this application is executed.
  • the specific steps performed by the state contract in this embodiment are as follows:
  • the algorithm provider develops and deploys state contracts
  • the calculation initiator initiates a transaction request and calls a state contract that meets the demand, and its data comes from the chain;
  • the status contract When the status contract receives a transaction request, it will first trigger a special calculation channel contract call, and its role is to pledge a certain asset to the transaction initiator;
  • the contract finds a matching computing power provider, and distributes the request to one or more sub-tasks to the appropriate computing power provider;
  • the computing power provider performs calculations and provides calculation certificates
  • any participant can send a transaction to the calculation channel contract, thereby closing the channel and starting a settlement process, but the calculation channel will not be settled immediately, and a time interval will be started first.
  • Each party can submit an objection to the calculation process;
  • Consensus nodes package transactions, calculation results, calculation proofs, and contract status changes into blocks
  • the block node writes the block to the local ledger.
  • Stateless contracts do not save any state on the chain, as shown in Figure 4, which is a schematic diagram of the execution of state contracts in this embodiment.
  • the data entered during stateless contract execution comes from the off-chain data provider's local database, which can be a single data provider or multiple data providers. If there are multiple data providers, multiple parties use the MPC algorithm to perform collaborative calculations to ensure the ownership of the data by the parties. The actual calculation is divided into multiple subtasks and distributed to multiple computing nodes. The contract developer can choose the privacy calculation method. To ensure that the data is not disclosed to the compute nodes.
  • the execution steps of a stateless contract are as follows:
  • Algorithm provider develops and deploys stateless contracts
  • a stateless contract When a stateless contract receives a transaction request, it will first trigger a special calculation channel contract call, and its role is to pledge a certain asset to the transaction initiator;
  • the contract finds a matching computing power provider, and distributes the request to one or more sub-tasks to the appropriate computing power provider. If there are multiple data providers, the contract developer can choose the privacy calculation. To ensure that the data is not disclosed to the computing nodes: if you choose to use the MPC algorithm for collaborative calculations, ensure the ownership of the data by all parties;
  • the data provider and the computing power provider perform collaborative calculations and provide verifiable calculation certificates
  • any participant can send a transaction to the calculation channel contract, thereby closing the channel and starting a settlement process, but the calculation channel will not be settled immediately, and a time interval will be started first.
  • Each party can submit an objection to the calculation process;
  • Consensus nodes package transactions, calculation results, and calculation certificates into blocks
  • the block node writes the block to the local ledger.
  • Hybrid contracts Allow smart contracts to save state on the chain, and have off-chain data participate in calculations.
  • This type of contract is called a hybrid contract, which means that the data involved in the execution of a smart contract includes both on-chain data and off-chain data providers.
  • the hybrid contract is actually a kind of multi-source data calculation.
  • the consensus node participates in the calculation as the data provider of the on-chain state data.
  • the typical use scenario of a hybrid contract is to save the calculation results of the data off-chain to the chain and participate in the next calculation.
  • the smart contract implementation method provided by the present invention decouples consensus from calculation, so that the consensus part of the smart contract is done on the chain, and the computing part can be processed in parallel by one or more computing nodes, thereby improving the smart contract execution efficiency and throughput the amount.
  • smart contracts can be executed on-chain or on-chain or off-chain at the same time. Executing some functions of smart contracts off-chain or executing complete smart contracts can be distributed and executed in parallel; or within several nodes Between executions, all parties jointly maintain a multi-signature off-chain status. When necessary, they can return to the chain to do consensus and write the state of the chain.
  • off-chain data For the processing of off-chain data or the execution of smart contracts, back to the blockchain through various methods such as verifiable certificates or multi-signature, corresponding verifiable certificates, transaction status or results, and contract changes can be written as needed.
  • the off-chain data involved in the calculation is executed by the off-chain computing power provider, expanding the scope of application of smart contracts, and processing off-chain data. It greatly enhances the business capabilities of smart contracts, and can also be used as a technology for off-chain capacity expansion. At the same time, it can return to the chain, ensuring the same security features as traditional contracts, such as non-repudiation, non-changeability, and reliability.
  • this embodiment designs a Turing complete C-style high-level language for writing smart contracts and compiling them into Boolean circuits.
  • the main features of the smart contract language are as follows:
  • Types of Digit Value range bool 8 Values are 0 and 1 int8 8 -128 ⁇ 127 uint8 8 0 ⁇ 255 int16 16 -32768 ⁇ 32767 uint16 16 0 to 65535 int32 32 -2147483648 ⁇ 2147483647 uint32 32 0 ⁇ 4294967295 int64 64 -9223372036854775808 ⁇ 9223372036854775807 uint64 64 0 ⁇ 18446744073709551615
  • Structure C-like Struct is supported to define structures. Structures allow you to define variables that can store different types of data items.
  • Array supports an array data structure, which can store a fixed-size sequential collection of elements of the same type, and supports multidimensional arrays.
  • a loop statement allows multiple executions of a statement or group of statements.
  • the loop statement looks like this:
  • a function is a set of statements that perform a task together.
  • the function is defined as follows:
  • the invention is mainly applicable to the related products or services of the blockchain, applications or systems with smart contracts, including solutions of public chains or alliance chains.
  • the invention proposes a smart contract method that supports access to on-chain and off-chain data, slows down the expansion of block data, and guarantees data privacy and security.
  • the present invention also provides a device for implementing a blockchain smart contract, including:
  • a request receiving module for receiving a smart contract transaction request initiated by a user
  • a distinguishing module configured to distinguish the data involved in the transaction request into on-chain data and off-chain data
  • On-chain consensus module the consensus nodes of the blockchain perform consensus processing on the data on the chain
  • Off-chain data processing module calculates and processes the off-chain data and provides verification certificates.
  • the distinguishing module includes:
  • a transaction data determining unit configured to determine data related to a current smart contract transaction according to the transaction request
  • the distinguishing unit distinguishes the data involved in the current smart contract transaction into on-chain data and off-chain data according to the source of the data involved in the transaction.
  • An embodiment of the present invention further provides an electronic device.
  • the electronic device may be a desktop computer, a tablet computer, a mobile terminal, or the like. This embodiment is not limited thereto.
  • the electronic device may refer to the implementation of the method of the foregoing embodiment, and its content is incorporated herein, and the repeated description is omitted.
  • FIG. 5 is a schematic block diagram of a system configuration of an electronic device 600 according to an embodiment of the present invention.
  • the electronic device 600 may include a central processing unit 100 and a memory 140; the memory 140 is coupled to the central processing unit 100. It is worth noting that this figure is exemplary; other types of structures can also be used to supplement or replace the structure to implement telecommunication functions or other functions.
  • the blockchain smart contract implementation function may be integrated into the central processor 100.
  • the central processor 100 may be configured to perform the following control: receiving a smart contract transaction request initiated by a user;
  • the off-chain computing power provider calculates and processes the off-chain data and provides verification certificates.
  • the electronic device 600 may further include a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power source 170. It is worth noting that the electronic device 600 does not necessarily need to include all the components shown in FIG. 5; in addition, the electronic device 600 may also include components not shown in FIG. 5, and reference may be made to the prior art.
  • the central processing unit 100 is sometimes referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices.
  • the central processing unit 100 receives input and controls each of the electronic devices 600. Operation of parts.
  • the memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices.
  • the above-mentioned failure-related information can be stored, and a program for executing the related information can also be stored.
  • the central processing unit 100 may execute the program stored in the memory 140 to implement information storage or processing.
  • the input unit 120 provides input to the central processing unit 100.
  • the input unit 120 is, for example, a key or a touch input device.
  • the power source 170 is used to provide power to the electronic device 600.
  • the display 160 is used for displaying display objects such as images and characters.
  • the display may be, for example, an LCD display, but is not limited thereto.
  • the memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, and the like. It may also be a memory that holds information even when power is off, can be selectively erased and is provided with more data, and an example of the memory is sometimes called EPROM or the like.
  • the memory 140 may also be some other type of device.
  • the memory 140 includes a buffer memory 141 (sometimes referred to as a buffer).
  • the memory 140 may include an application / function storage section 142 for storing application programs and function programs or a flow for performing operations of the electronic device 600 through the central processing unit 100.
  • the memory 140 may further include a data storage section 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device.
  • the driver storage section 144 of the memory 140 may include various drivers for the electronic device for communication functions and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).
  • the communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111.
  • a communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
  • multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module.
  • the communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide audio output via the speaker 131 and to receive audio input from the microphone 132, thereby realizing general telecommunication functions.
  • the audio processor 130 may include any suitable buffers, decoders, amplifiers, and the like.
  • the audio processor 130 is also coupled to the central processing unit 100, so that the microphone 132 can be used to record on the unit, and the speaker 131 can be used to play the sound stored on the unit.
  • the present invention also provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the processor implements the above method when the computer program is executed.
  • the present invention also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program for executing the above method.
  • the method and device for implementing smart contracts disclosed by the present invention can support on-chain, off-chain data, or both on-chain and off-chain data.
  • IO logic is responsible for processing on-chain data, including reading data from the chain, performing consensus processing, and Write the result or status after processing to the chain.
  • Computation logic processes out-of-chain data, including computing task publishing and distribution, computing task splitting into multiple subtasks, computing task compilation into Boolean circuits, and acceleration with dedicated hardware, computing nodes accepting tasks for verifiable calculations, returning calculation results, and Verification certificate, calculation result verification, etc.
  • each data provider (consensus node as the on-chain data provider) can jointly perform multi-party secure computing to Get calculation results.
  • This application decouples the consensus of the contract from the calculation.
  • the consensus part is executed on the chain (consensus by the consensus node and written into the blockchain), and the calculation part is distributed to the computing power provider for parallel calculation. This has the advantage of expanding the scope of application of the contract, at the same time speeding up the execution of the contract, and increasing the throughput of the blockchain.
  • the embodiments of the present invention may be provided as a method, a system, or a computer program product. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a particular manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions
  • the device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.

Abstract

The present invention provides a method and apparatus for realizing a smart contract of a blockchain. The method comprises: receiving a smart contract trading request initiated by a user; dividing data involved in the trading request into on-chain data and off-chain data; a consensus node of a blockchain performing consensus processing on on-chain data; and an off-chain computing power provider performing computation processing on off-chain data and providing a verification proof. According to the present invention, access to a heterogeneous data source, an on-chain data source, an off-chain data source and a hybrid data source is supported, and the consensus and calculation of a smart contract are decoupled from each other, thereby improving execution efficiency and the throughput capacity and greatly enhancing the service capability of the smart contract.

Description

一种区块链智能合约实现方法及装置Method and device for implementing blockchain smart contract 技术领域Technical field
本发明涉及数据处理技术,具体的讲是一种区块链智能合约实现方法及装置。The present invention relates to data processing technology, and in particular to a method and device for implementing a blockchain smart contract.
背景技术Background technique
智能合约是区块链2.0及3.0应用的主要特征之一,然而,系统的TPS(吞吐量)普遍偏低,比如以太坊每秒大概处理15笔交易,相比于传统中心化应用如VISA或淘宝每秒上万乃至数十万的TPS,存在着很大的差距,不能满足应用需求。究其原因,传统区块链如我们熟悉的以太坊平台中,为了保障去中心化和安全,交易执行和区块共识都严重依赖共识节点串行处理,整个区块链网络只有单机的计算性能,全网算力不能充分利用,造成性能瓶颈。Smart contracts are one of the main features of blockchain 2.0 and 3.0 applications. However, the system's TPS (throughput) is generally low. For example, Ethereum processes about 15 transactions per second, compared to traditional centralized applications such as VISA or Taobao has tens of thousands or even hundreds of thousands of TPS per second. There is a big gap and cannot meet the application requirements. The reason is that traditional blockchains such as our familiar Ethereum platform, in order to ensure decentralization and security, both transaction execution and block consensus rely heavily on the serial processing of consensus nodes. The entire blockchain network has only a single computing performance. The computing power of the entire network cannot be fully utilized, causing a performance bottleneck.
同时,传统区块链是一个封闭的计算环境,智能合约只能访问区块链内部数据。一方面导致链上数据急剧扩张,区块膨胀,最终导致交易性能进一步下降。另一方面基于数据主权和数据隐私考虑,数据拥有方不愿意将数据保存到链上,使用密码学加密保存会导致数据的扩张和智能合约处理能力的降低。At the same time, the traditional blockchain is a closed computing environment, and smart contracts can only access the internal data of the blockchain. On the one hand, the data on the chain is rapidly expanded, and the blocks are inflated, which ultimately leads to a further decline in transaction performance. On the other hand, based on data sovereignty and data privacy considerations, the data owner is unwilling to save the data on the chain. Using cryptographic encryption to save will cause the expansion of data and the reduction of smart contract processing capabilities.
现有技术基于以太坊的企业区块链提出私有交易的方案,用于保证交易和数据的隐私。交易相关方在本地保存私有状态树,智能合约的私有交易只访问私有状态树中的数据。这种方式保证了数据的隐私,也降低了公有区块数据的规模。但是私有状态树需要交易相关方达成共识的数据,仍然属于链上数据。The existing technology proposes a private transaction scheme based on the Ethereum enterprise blockchain to ensure the privacy of transactions and data. The transaction parties keep the private state tree locally, and the private transactions of the smart contract only access the data in the private state tree. This method ensures the privacy of the data and reduces the size of the public block data. However, the private state tree requires the data reached by the parties involved in the transaction, which still belongs to the on-chain data.
目前,智能合约从外部服务获取数据的方式为:由第三方将数据推送进区块链,而不是由智能合约将数据拉取进去。这种被动接收数据的方式,与外部的交互依赖于第三方,如何保证第三方和数据的可信,目前的解决方案是采用预言机,主流的预言机方案有以下两种:Reality Keys:提供一个可以自动检查和加密预言提交的预言机方案。Oraclize:是一个可证明的诚实的预言机服务,依赖于TLS公证(TLSnotary),提供一个可证明的诚实从互联网页面安全获取信息的能力,可以让智能合约可以访问互联网,获取有价值的信息。At present, the way for smart contracts to obtain data from external services is that the data is pushed into the blockchain by a third party, rather than being pulled by the smart contract. This passive way of receiving data depends on a third party for external interaction. How to ensure the credibility of the third party and the data, the current solution is to use oracles. There are two mainstream oracle solutions: Reality Keys: Provide A oracle scheme that can automatically check and encrypt oracle submissions. Oraclize: It is a provable and honest oracle service that relies on TLS notarization and provides a provable and honest ability to securely obtain information from Internet pages, allowing smart contracts to access the Internet and obtain valuable information.
但是现有技术的预言机方案还是让智能合约被动接受数据,同时其还是引入的第三方,最终导致智能合约的应用范围有限,同时数据的可信度也是有限度的。However, the oracle solution of the prior art still allows smart contracts to passively accept data. At the same time, it is also a third party introduced, which ultimately leads to a limited scope of application of smart contracts and limited data credibility.
发明内容Summary of the invention
为提高区块链智能合约的处理能力,本发明实施例提供了一种区块链智能合约实现方法,包括:In order to improve the processing capacity of a blockchain smart contract, an embodiment of the present invention provides a method for implementing a blockchain smart contract, including:
接收用户发起的智能合约交易请求;Receive smart contract transaction requests initiated by users;
将所述交易请求涉及的数据区分为链上数据和链下数据;Distinguish the data involved in the transaction request into on-chain data and off-chain data;
由区块链的共识节点对所述链上数据进行共识处理;Consensus processing of the data on the chain by consensus nodes of the blockchain;
由链下的算力提供方对链下数据进行计算处理并提供验证证明。The off-chain computing power provider calculates and processes the off-chain data and provides verification certificates.
本发明实施例中,将所述交易请求涉及的数据区分为链上数据和链下数据包括:In the embodiment of the present invention, dividing the data involved in the transaction request into on-chain data and off-chain data includes:
根据所述交易请求确定当前智能合约交易涉及的数据;Determining the data involved in the current smart contract transaction according to the transaction request;
根据交易涉及的数据的来源将当前智能合约交易涉及的数据区分为链上数据和链下数据。According to the source of the data involved in the transaction, the data involved in the current smart contract transaction is divided into on-chain data and off-chain data.
本发明实施例中,所述链上数据包括:执行合约时来自区块链的分布式账本的数据;In the embodiment of the present invention, the on-chain data includes: data from the distributed ledger of the blockchain when the contract is executed;
所述链下数据包括:执行合约时由链下的至少一个数据提供方的数据库提供的数据。The off-chain data includes data provided by a database of at least one data provider off-chain when a contract is executed.
本发明实施例中,所述的数据提供方包括多个数据提供方时,各数据提供方利用MPC算法进行协同计算。In the embodiment of the present invention, when the data provider includes multiple data providers, each data provider uses the MPC algorithm to perform collaborative calculation.
本发明实施例中,所述的由区块链的共节点对所述链上数据进行共识处理包括:In the embodiment of the present invention, the consensus processing of the data on the chain by the common nodes of the blockchain includes:
根据交易请求从所述分布式账本上的获取链上数据;Obtaining on-chain data from the distributed ledger according to a transaction request;
根据合约请求由匹配的算力提供方对所述链上数据进行计算并提供计算证明生成计算结果;其中,所述计算结果包括:交易信息、计算结果、计算证明、合约状态变更;According to the contract request, a matching computing power provider calculates the on-chain data and provides a calculation certificate to generate a calculation result; wherein the calculation result includes: transaction information, calculation result, calculation certificate, and contract status change;
根据所述计算结果变更所述分布式账本进行共识处理。According to the calculation result, the distributed ledger is changed for consensus processing.
同时,本发明还提供一种区块链智能合约实现装置,包括:At the same time, the present invention also provides a device for implementing a blockchain smart contract, including:
请求接收模块,用于接收用户发起的智能合约交易请求;A request receiving module for receiving a smart contract transaction request initiated by a user;
区分模块,用于将所述交易请求涉及的数据区分为链上数据和链下数据;A distinguishing module, configured to distinguish the data involved in the transaction request into on-chain data and off-chain data;
链上共识模块,由区块链的共识节点对所述链上数据进行共识处理;On-chain consensus module, the consensus nodes of the blockchain perform consensus processing on the data on the chain;
链下数据处理模块,由链下的算力提供方对链下数据进行计算处理并提供验证证明。Off-chain data processing module. The off-chain computing power provider calculates and processes the off-chain data and provides verification certificates.
本发明实施例中,所述的区分模块包括:In the embodiment of the present invention, the distinguishing module includes:
交易数据确定单元,用于根据所述交易请求确定当前智能合约交易涉及的数据;A transaction data determining unit, configured to determine data related to a current smart contract transaction according to the transaction request;
区分单元,根据交易涉及的数据的来源将当前智能合约交易涉及的数据区分为链上数据和链下数据。The distinguishing unit distinguishes the data involved in the current smart contract transaction into on-chain data and off-chain data according to the source of the data involved in the transaction.
本发明实施例中,链上数据包括:执行合约时来自区块链的分布式账本的数据;链下数据包括:执行合约时由链下的至少一个数据提供方提供的数据。In the embodiment of the present invention, the on-chain data includes: data from the distributed ledger of the blockchain when the contract is executed; the off-chain data includes: data provided by at least one data provider off-chain when the contract is executed.
本发明实施例中,所述的数据提供方包括多个数据提供方时,各数据提供方利用MPC算法进行协同计算。In the embodiment of the present invention, when the data provider includes multiple data providers, each data provider uses the MPC algorithm to perform collaborative calculation.
本发明实施例中,所述的链上共识模块由区块链的共识节点对所述链上数据源进行共识处理包括:In the embodiment of the present invention, the on-chain consensus module performs consensus processing on the on-chain data source by the consensus nodes of the blockchain including:
根据交易请求从所述分布式账本上的获取链上数据;Obtaining on-chain data from the distributed ledger according to a transaction request;
根据合约请求由匹配的算力提供方对链上数据进行计算并提供计算证明生成计算结果;其中,所述计算结果包括:交易信息、计算结果、计算证明、合约状态变更;According to the contract request, a matching computing power provider calculates the data on the chain and provides a calculation certificate to generate a calculation result; wherein the calculation result includes: transaction information, calculation result, calculation certificate, and contract status change;
根据所述计算结果变更所述分布式账本进行共识处理。According to the calculation result, the distributed ledger is changed for consensus processing.
同时,本发明还提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述方法。At the same time, the present invention also provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor implements the above method when the computer program is executed.
同时,本发明还提供一种计算机可读存储介质,计算机可读存储介质存储有执行上述方法的计算机程序。At the same time, the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program for executing the above method.
本发明提出的智能合约的实现方法及装置,支持访问异构数据源,链上数据源、链下数据源、混合数据源。对于链下数据,采用多方安全计算(MPC)和可验证计算(VC)的方式保证数据的隐私和验证计算的正确性。The method and device for implementing smart contracts provided by the present invention support access to heterogeneous data sources, on-chain data sources, off-chain data sources, and hybrid data sources. For off-chain data, multi-party secure computing (MPC) and verifiable computing (VC) are adopted to ensure data privacy and verify the correctness of the calculation.
为让本发明的上述和其他目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附图式,作详细说明如下。In order to make the above and other objects, features, and advantages of the present invention more comprehensible, the preferred embodiments are described below in detail with the accompanying drawings, as follows.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without paying creative labor.
图1本发明公开的区块链智能合约实现方法的流程图;FIG. 1 is a flowchart of a method for implementing a blockchain smart contract disclosed in the present invention;
图2为本发明公开的区块链智能合约实现方法的结构图;FIG. 2 is a structural diagram of a blockchain smart contract implementation method disclosed in the present invention;
图3为本发明实施例公开的示意图;3 is a schematic diagram disclosed in an embodiment of the present invention;
图4为本发明实施例公开的示意图FIG. 4 is a schematic diagram disclosed in an embodiment of the present invention
图5为本发明实施例公开的电子设备图。FIG. 5 is a diagram of an electronic device disclosed in an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In the following, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明提供一种区块链智能合约实现方法,如图1所示,方法包括:The present invention provides a method for implementing a blockchain smart contract. As shown in FIG. 1, the method includes:
步骤S101,接收用户发起的智能合约交易请求;Step S101: Receive a smart contract transaction request initiated by a user;
步骤S102,将交易请求涉及的数据区分为链上数据和链下数据;Step S102, distinguish the data involved in the transaction request into on-chain data and off-chain data;
步骤S103,由区块链的共识节点对所述链上数据进行共识处理;Step S103: A consensus node of the blockchain performs consensus processing on the data on the chain;
步骤S104,由链下的算力提供方对链下数据进行计算处理并提供验证证明。In step S104, the off-chain computing power provider performs calculation processing on the off-chain data and provides a verification certificate.
本发明技术方案的创新是共识与计算解耦,使得智能合约能同时支持链上数据源、链下数据源的访问,即将智能合约请求中需要共识处理的链上数据和链下数据的结算进行解耦,如图2所示为本申请一实施方式的结构图。The innovation of the technical solution of the present invention is the decoupling of consensus and calculation, so that smart contracts can support access to on-chain data sources and off-chain data sources, that is, settlement of on-chain data and off-chain data that require consensus processing in smart contract requests Decoupling, as shown in FIG. 2 is a structural diagram of an embodiment of the present application.
本发明将共识与计算解耦,并使得系统能够同时支持链上及链下数据,从系统架构上将合约分为与链上状态有关的IO逻辑和与链上状态无关的计算逻辑,并称之为元智能合约。The invention decouples consensus from calculation, and enables the system to support both on-chain and off-chain data. From the system architecture, the contract is divided into IO logic related to the state on the chain and computing logic not related to the state on the chain. It is a meta smart contract.
与状态有关的IO逻辑在区块链上由共识节点进行处理,并将状态变化和结果广播到区块链,各节点验证后写入到本地数据库;The state-related IO logic is processed by the consensus nodes on the blockchain, and the state changes and results are broadcast to the blockchain, and each node writes to the local database after verification;
与状态无关的计算逻辑部分,分发给算力提供方进行并行计算,大大提高计算效率。更进一步,本发明实施例中使用加密电路进行多方安全计算MPC,保障数据的隐私。本申请实施例中,对于不需要保护数据隐私,可以使用普通的布尔电路计算。电路逻辑(无论是否加密,都可以)可以使用专用硬件进行加速,一方面提高闲置资源的使用率,同时提高计算效率。The state-independent calculation logic is distributed to the computing power provider for parallel calculation, which greatly improves the calculation efficiency. Furthermore, in the embodiment of the present invention, an encryption circuit is used to perform multi-party secure calculation of MPC to ensure data privacy. In the embodiment of the present application, for protecting data privacy, ordinary Boolean circuits can be used for calculation. The circuit logic (whether encrypted or not) can be accelerated using dedicated hardware, on the one hand, to increase the utilization of idle resources, and at the same time to improve computing efficiency.
本发明实施例中,根据数据来源的不同,本实施例具体实施中把智能合约分为三类:状态合约、无状态合约以及混合合约。In the embodiment of the present invention, according to different data sources, smart contracts are classified into three types in the specific implementation of this embodiment: state contracts, stateless contracts, and hybrid contracts.
状态合约:状态合约处理过程类似传统智能合约,如图3所示,为本实施例中的状态合约执行的示意图,状态合约需要在链上保存状态,状态合约执行时输入的数据来自链上分布式账本,每次合约执行会导致合约的状态变更,所有变更均会被记录在分布式账本中。合约的计算拆分成多个子任务分发给多个计算节点,合约开发者可以选择隐私计算的方式,保证数据不透露给计算节点。State contract: The process of state contract is similar to the traditional smart contract. As shown in Figure 3, it is a schematic diagram of the state contract execution in this embodiment. The state contract needs to save the state on the chain. The data entered during the execution of the state contract comes from the on-chain distribution. Type ledger, each time the contract is executed will cause the contract status to change, and all changes will be recorded in the distributed ledger. The calculation of the contract is divided into multiple sub-tasks and distributed to multiple computing nodes. The contract developer can choose a private computing method to ensure that the data is not disclosed to the computing nodes.
合约开发者发布智能合约到区块链中,用户发起智能合约交易请求,若该智能合约交易请求涉及的数据均来自链上,则执行本申请实施例中的状态合约。本实施例中的状态合约执行的具体步骤如下:The contract developer issues a smart contract to the blockchain, and the user initiates a smart contract transaction request. If the data involved in the smart contract transaction request comes from the chain, the state contract in the embodiment of this application is executed. The specific steps performed by the state contract in this embodiment are as follows:
1.算法提供方开发并部署状态合约;1. The algorithm provider develops and deploys state contracts;
2.计算发起方发起交易请求,调用满足需求的某个状态合约,其数据来源于链上;2. The calculation initiator initiates a transaction request and calls a state contract that meets the demand, and its data comes from the chain;
3.状态合约收到交易请求,会首先触发一个特殊的计算通道合约调用,其作用是对交易发起方做一定资产的质押;3. When the status contract receives a transaction request, it will first trigger a special calculation channel contract call, and its role is to pledge a certain asset to the transaction initiator;
4.合约根据交易请求,查找与之匹配的算力提供方,将请求分发给一个或多个子任务给到合适的算力提供方;4. According to the transaction request, the contract finds a matching computing power provider, and distributes the request to one or more sub-tasks to the appropriate computing power provider;
5.算力提供方进行计算并提供计算证明;5. The computing power provider performs calculations and provides calculation certificates;
6.计算结束后,可由任何参与方往计算通道合约发送一个交易,从而关闭这个通道并启动一个结算过程,但计算通道不会马上进行结算,会先启动一个时间区间,在该区间内任何参与方均可以对计算过程提交异议申述;6. After the calculation is completed, any participant can send a transaction to the calculation channel contract, thereby closing the channel and starting a settlement process, but the calculation channel will not be settled immediately, and a time interval will be started first. Each party can submit an objection to the calculation process;
7.任务结束且完成结算之后将剩余的资产返回给交易发起方;7. After the task is completed and the settlement is completed, return the remaining assets to the transaction initiator;
8.共识节点将交易、计算结果、计算证明、合约状态变更等打包成区块;8. Consensus nodes package transactions, calculation results, calculation proofs, and contract status changes into blocks;
9.区块节点将区块写入本地账本。9. The block node writes the block to the local ledger.
无状态合约:无状态合约在链上不保存任何状态,如图4所示,为本实施例中的状态合约执行的示意图。无状态合约执行时输入的数据来自链下数据提供方本地数据库,可以是单个数据提供方,也可以是多个数据提供方。如果是多个数据提供方,则多方使用MPC算法进行协同计算,保证各方对数据的所有权,实际的计算拆分成多个子任务分发给多个计算节点,合约开发者可以选择隐私计算的方式,保证数据不透露给计算节点。本实施例中,无状态合约的执行步骤如下:Stateless contracts: Stateless contracts do not save any state on the chain, as shown in Figure 4, which is a schematic diagram of the execution of state contracts in this embodiment. The data entered during stateless contract execution comes from the off-chain data provider's local database, which can be a single data provider or multiple data providers. If there are multiple data providers, multiple parties use the MPC algorithm to perform collaborative calculations to ensure the ownership of the data by the parties. The actual calculation is divided into multiple subtasks and distributed to multiple computing nodes. The contract developer can choose the privacy calculation method. To ensure that the data is not disclosed to the compute nodes. In this embodiment, the execution steps of a stateless contract are as follows:
1.算法提供方开发并部署无状态合约;1. Algorithm provider develops and deploys stateless contracts;
2.计算发起方发起交易请求,调用满足需求的某个无状态合约,其数据来源于链下;2. Calculate the initiator to initiate a transaction request and call a stateless contract that meets the demand, and its data comes from off-chain;
3.无状态合约收到交易请求,会首先触发一个特殊的计算通道合约调用,其作用是对交易发起方做一定资产的质押;3. When a stateless contract receives a transaction request, it will first trigger a special calculation channel contract call, and its role is to pledge a certain asset to the transaction initiator;
4.合约根据交易请求,查找与之匹配的算力提供方,将请求分发给一个或多个子任务给到合适的算力提供方,如果是多个数据提供方,合约开发者可以选择隐私计算的方式,以保证数据不透露给计算节点:如选择使用MPC算法进行协同计算,保证各方对数据的所有权;4. According to the transaction request, the contract finds a matching computing power provider, and distributes the request to one or more sub-tasks to the appropriate computing power provider. If there are multiple data providers, the contract developer can choose the privacy calculation. To ensure that the data is not disclosed to the computing nodes: if you choose to use the MPC algorithm for collaborative calculations, ensure the ownership of the data by all parties;
5.数据提供方与算力提供方进行协同计算,并提供可验证计算证明;5. The data provider and the computing power provider perform collaborative calculations and provide verifiable calculation certificates;
6.计算结束后,可由任何参与方往计算通道合约发送一个交易,从而关闭这个通道并启动一个结算过程,但计算通道不会马上进行结算,会先启动一个时间区间,在该区间内任何参与方均可以对计算过程提交异议申述;6. After the calculation is completed, any participant can send a transaction to the calculation channel contract, thereby closing the channel and starting a settlement process, but the calculation channel will not be settled immediately, and a time interval will be started first. Each party can submit an objection to the calculation process;
7.任务结束且完成结算之后将剩余的资产返回给交易发起方;7. After the task is completed and the settlement is completed, return the remaining assets to the transaction initiator;
8.共识节点将交易、计算结果、计算证明打包成区块;8. Consensus nodes package transactions, calculation results, and calculation certificates into blocks;
9.区块节点将区块写入本地账本。9. The block node writes the block to the local ledger.
混合合约:允许智能合约在链上保存状态,又有链下数据参与计算,这类合约称为混合合约,即智能合约执行涉及的数据既包括链上数据也包括链下的数据提供方。混合合约其实 是一种多源数据计算,共识节点作为链上状态数据的数据提供方参与计算。混合合约典型的使用场景是把链下的数据计算结果保存到链上,并参与到下一次的计算中。Hybrid contracts: Allow smart contracts to save state on the chain, and have off-chain data participate in calculations. This type of contract is called a hybrid contract, which means that the data involved in the execution of a smart contract includes both on-chain data and off-chain data providers. The hybrid contract is actually a kind of multi-source data calculation. The consensus node participates in the calculation as the data provider of the on-chain state data. The typical use scenario of a hybrid contract is to save the calculation results of the data off-chain to the chain and participate in the next calculation.
本发明提供的智能合约的实现方式,将共识与计算解耦,使得智能合约的共识部分链上做,而计算部分可以被一个或多个算力节点并行处理,从而提高智能合约执行效率和吞吐量。相应的,智能合约可以单独在链上或者单独链下或者同时链上链下执行,链下执行智能合约部分功能或者执行完整的智能合约,可以是分布式并行执行;或者在几个节点内部之间执行,各参与方共同维护一份多签名的链下状态。都在有必要时可以回到链上做共识和写入链状态等。The smart contract implementation method provided by the present invention decouples consensus from calculation, so that the consensus part of the smart contract is done on the chain, and the computing part can be processed in parallel by one or more computing nodes, thereby improving the smart contract execution efficiency and throughput the amount. Correspondingly, smart contracts can be executed on-chain or on-chain or off-chain at the same time. Executing some functions of smart contracts off-chain or executing complete smart contracts can be distributed and executed in parallel; or within several nodes Between executions, all parties jointly maintain a multi-signature off-chain status. When necessary, they can return to the chain to do consensus and write the state of the chain.
对于链下数据的处理或智能合约的执行,通过可验证证明或多签名等多种方式,回到区块链,相应的可验证证明、交易的状态或结果、合约的变更等可以根据需要写入区块链,通过将智能合约执行过程中的共识与计算的解耦,将计算涉及的链下数据由链下的算力提供方执行,扩展智能合约的应用范围,可以处理链下数据,大大增强了智能合约的业务能力,也可以作为链下扩容的一种技术,同时可以回到链上,保证了和传统合约相同的安全特性,如不可抵赖,不可更改,可靠性等特性。For the processing of off-chain data or the execution of smart contracts, back to the blockchain through various methods such as verifiable certificates or multi-signature, corresponding verifiable certificates, transaction status or results, and contract changes can be written as needed. Into the blockchain, by decoupling the consensus and calculation during the execution of smart contracts, the off-chain data involved in the calculation is executed by the off-chain computing power provider, expanding the scope of application of smart contracts, and processing off-chain data. It greatly enhances the business capabilities of smart contracts, and can also be used as a technology for off-chain capacity expansion. At the same time, it can return to the chain, ensuring the same security features as traditional contracts, such as non-repudiation, non-changeability, and reliability.
为降低开发者门槛,本实施例设计了图灵完备C风格的高级语言,用于编写智能合约,并编译成布尔电路。本实施例中,智能合约语言主要特性如下:In order to lower the threshold for developers, this embodiment designs a Turing complete C-style high-level language for writing smart contracts and compiling them into Boolean circuits. In this embodiment, the main features of the smart contract language are as follows:
1.数据类型:1. Data type:
1.1基本数据类型,如表1所示:1.1 Basic data types, as shown in Table 1:
表1Table 1
类型Types of 位数Digit 数值范围 Value range
boolbool 88 取值为0和1Values are 0 and 1
int8int8 88 -128~127-128 ~ 127
uint8 uint8 88 0~2550 ~ 255
int16int16 1616 -32768~32767-32768 ~ 32767
uint16uint16 1616 0~655350 to 65535
int32int32 3232 -2147483648~2147483647-2147483648 ~ 2147483647
uint32uint32 3232 0~42949672950 ~ 4294967295
int64int64 6464 -9223372036854775808~9223372036854775807-9223372036854775808 ~ 9223372036854775807
uint64uint64 6464 0~184467440737095516150 ~ 18446744073709551615
1.2自定义数据类型:1.2 Custom data types:
结构:支持类C语言的Struct,来定义结构体。结构体允许定义可存储不同类型数据项的变量。Structure: C-like Struct is supported to define structures. Structures allow you to define variables that can store different types of data items.
数组:支持数组数据结构,它可以存储一个固定大小的相同类型元素的顺序集合,可支持多维数组。Array: supports an array data structure, which can store a fixed-size sequential collection of elements of the same type, and supports multidimensional arrays.
2.运算符:2. Operator:
算术运算符如表2所示:The arithmetic operators are shown in Table 2:
表2Table 2
运算符Operator 描述description
++ 把两个操作数相加Add two operands
-- 从第一个操作数中减去第二个操作数Subtract the second operand from the first operand
* 把两个操作数相乘Multiply two operands
// 分子除以分母Numerator divided by denominator
% 取模运算符,整除后的余数Modulo operator, remainder after division
2.2关系运算符:2.2 Relational Operators:
本实施例中,运算符及对应的描述如下表3所示:In this embodiment, the operators and corresponding descriptions are shown in Table 3 below:
表3table 3
Figure PCTCN2019096149-appb-000001
Figure PCTCN2019096149-appb-000001
2.3位运算符,如表4所示:2.3-bit operators, as shown in Table 4:
表4Table 4
Figure PCTCN2019096149-appb-000002
Figure PCTCN2019096149-appb-000002
Figure PCTCN2019096149-appb-000003
Figure PCTCN2019096149-appb-000003
2.4赋值运算符,如表5所示:2.4 Assignment operators, as shown in Table 5:
表5table 5
Figure PCTCN2019096149-appb-000004
Figure PCTCN2019096149-appb-000004
3.控制语句:3. Control statement:
条件判断语句,如表6所示:Condition judgment statement, as shown in Table 6:
表6Table 6
Figure PCTCN2019096149-appb-000005
Figure PCTCN2019096149-appb-000005
3.2循环语句3.2 loop statements
循环语句允许多次执行一个语句或语句组,循环语句如下所示:A loop statement allows multiple executions of a statement or group of statements. The loop statement looks like this:
for(int32i=0;i<max;i++)for (int32i = 0; i <max; i ++)
{{
}}
4.函数定义:4. Function definition:
函数是一组一起执行一个任务的语句。函数定义如下:A function is a set of statements that perform a task together. The function is defined as follows:
functionreturn_typefoo(paramtype1 name1,paramtype2 name2,paramtype3[5]name3){functionreturn_typefoo (paramtype1 name1, paramtype2 name2, paramtype3 [5] name3) {
return blah;return
}}
本发明主要适用于区块链的相关产品或者服务、具有智能合约的应用或系统,包括公链或联盟链的方案。本发明提出一种的智能合约方法,支持访问链上链下数据,减缓区块数据的扩张,保证数据的隐私安全。The invention is mainly applicable to the related products or services of the blockchain, applications or systems with smart contracts, including solutions of public chains or alliance chains. The invention proposes a smart contract method that supports access to on-chain and off-chain data, slows down the expansion of block data, and guarantees data privacy and security.
同时,本发明还提供一种区块链智能合约实现装置,包括:At the same time, the present invention also provides a device for implementing a blockchain smart contract, including:
请求接收模块,用于接收用户发起的智能合约交易请求;A request receiving module for receiving a smart contract transaction request initiated by a user;
区分模块,用于将所述交易请求涉及的数据区分为链上数据和链下数据;A distinguishing module, configured to distinguish the data involved in the transaction request into on-chain data and off-chain data;
链上共识模块,由区块链的共识节点对所述链上数据进行共识处理;On-chain consensus module, the consensus nodes of the blockchain perform consensus processing on the data on the chain;
链下数据处理模块,由链下的算力提供方对链下数据进行计算处理并提供验证证明。Off-chain data processing module. The off-chain computing power provider calculates and processes the off-chain data and provides verification certificates.
本发明实施例中,所述的区分模块包括:In the embodiment of the present invention, the distinguishing module includes:
交易数据确定单元,用于根据所述交易请求确定当前智能合约交易涉及的数据;A transaction data determining unit, configured to determine data related to a current smart contract transaction according to the transaction request;
区分单元,根据交易涉及的数据的来源将当前智能合约交易涉及的数据区分为链上数据和链下数据。The distinguishing unit distinguishes the data involved in the current smart contract transaction into on-chain data and off-chain data according to the source of the data involved in the transaction.
对本领域技术人员而言,根据前述关于方法的实施例可以清楚获知本发明实施例中区块链智能合约实现装置的实现手段,因此,在此不再对装置的实施例作进一步赘述。For those skilled in the art, according to the foregoing embodiments of the method, the implementation means of the blockchain smart contract implementation device in the embodiments of the present invention can be clearly known, and therefore, the device embodiments are not further described here.
本发明实施例还提供一种电子设备,该电子设备可以是台式计算机、平板电脑及移动终端等,本实施例不限于此。在本实施例中,该电子设备可以参照前述实施例方法的实施,其内容被合并于此,重复之处不再赘述。An embodiment of the present invention further provides an electronic device. The electronic device may be a desktop computer, a tablet computer, a mobile terminal, or the like. This embodiment is not limited thereto. In this embodiment, the electronic device may refer to the implementation of the method of the foregoing embodiment, and its content is incorporated herein, and the repeated description is omitted.
图5为本发明实施例的电子设备600的系统构成的示意框图。如图5所示,该电子设备600可以包括中央处理器100和存储器140;存储器140耦合到中央处理器100。值得注意的是,该图是示例性的;还可以使用其他类型的结构,来补充或代替该结构,以实现电信功能或其他功能。FIG. 5 is a schematic block diagram of a system configuration of an electronic device 600 according to an embodiment of the present invention. As shown in FIG. 5, the electronic device 600 may include a central processing unit 100 and a memory 140; the memory 140 is coupled to the central processing unit 100. It is worth noting that this figure is exemplary; other types of structures can also be used to supplement or replace the structure to implement telecommunication functions or other functions.
一实施例中,区块链智能合约实现功能可以被集成到中央处理器100中。其中,中央处理器100可以被配置为进行如下控制:接收用户发起的智能合约交易请求;In one embodiment, the blockchain smart contract implementation function may be integrated into the central processor 100. The central processor 100 may be configured to perform the following control: receiving a smart contract transaction request initiated by a user;
将所述交易请求涉及的数据区分为链上数据和链下数据;Distinguish the data involved in the transaction request into on-chain data and off-chain data;
由区块链的共识节点对所述链上数据进行共识处理;Consensus processing of the data on the chain by consensus nodes of the blockchain;
由链下的算力提供方对链下数据进行计算处理并提供验证证明。The off-chain computing power provider calculates and processes the off-chain data and provides verification certificates.
如图5所示,该电子设备600还可以包括:通信模块110、输入单元120、音频处理单元130、显示器160、电源170。值得注意的是,电子设备600也并不是必须要包括图5中所示的所有部件;此外,电子设备600还可以包括图5中没有示出的部件,可以参考现有技术。As shown in FIG. 5, the electronic device 600 may further include a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power source 170. It is worth noting that the electronic device 600 does not necessarily need to include all the components shown in FIG. 5; in addition, the electronic device 600 may also include components not shown in FIG. 5, and reference may be made to the prior art.
如图5所示,中央处理器100有时也称为控制器或操作控件,可以包括微处理器或其他处理器装置和/或逻辑装置,该中央处理器100接收输入并控制电子设备600的各个部件的操作。As shown in FIG. 5, the central processing unit 100 is sometimes referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processing unit 100 receives input and controls each of the electronic devices 600. Operation of parts.
其中,存储器140,例如可以是缓存器、闪存、硬驱、可移动介质、易失性存储器、非易失性存储器或其它合适装置中的一种或更多种。可储存上述与失败有关的信息,此外还可存储执行有关信息的程序。并且中央处理器100可执行该存储器140存储的该程序,以实现信息存储或处理等。The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. The above-mentioned failure-related information can be stored, and a program for executing the related information can also be stored. In addition, the central processing unit 100 may execute the program stored in the memory 140 to implement information storage or processing.
输入单元120向中央处理器100提供输入。该输入单元120例如为按键或触摸输入装置。电源170用于向电子设备600提供电力。显示器160用于进行图像和文字等显示对象的显示。该显示器例如可为LCD显示器,但并不限于此。The input unit 120 provides input to the central processing unit 100. The input unit 120 is, for example, a key or a touch input device. The power source 170 is used to provide power to the electronic device 600. The display 160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
该存储器140可以是固态存储器,例如,只读存储器(ROM)、随机存取存储器(RAM)、SIM卡等。还可以是这样的存储器,其即使在断电时也保存信息,可被选择性地擦除且设有更多数据,该存储器的示例有时被称为EPROM等。存储器140还可以是某种其它类型的装置。存储器140包括缓冲存储器141(有时被称为缓冲器)。存储器140可以包括应用/功能存储部142,该应用/功能存储部142用于存储应用程序和功能程序或用于通过中央处理器100执行电子设备600的操作的流程。The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, and the like. It may also be a memory that holds information even when power is off, can be selectively erased and is provided with more data, and an example of the memory is sometimes called EPROM or the like. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage section 142 for storing application programs and function programs or a flow for performing operations of the electronic device 600 through the central processing unit 100.
存储器140还可以包括数据存储部143,该数据存储部143用于存储数据,例如联系人、数字数据、图片、声音和/或任何其他由电子设备使用的数据。存储器140的驱动程序存储部144可以包括电子设备的用于通信功能和/或用于执行电子设备的其他功能(如消息传送应用、通讯录应用等)的各种驱动程序。The memory 140 may further include a data storage section 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage section 144 of the memory 140 may include various drivers for the electronic device for communication functions and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).
通信模块110即为经由天线111发送和接收信号的发送机/接收机110。通信模块(发送机/接收机)110耦合到中央处理器100,以提供输入信号和接收输出信号,这可以和常规移动通信终端的情况相同。The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111. A communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
基于不同的通信技术,在同一电子设备中,可以设置有多个通信模块110,如蜂窝网络模块、蓝牙模块和/或无线局域网模块等。通信模块(发送机/接收机)110还经由音频处理器130耦合到扬声器131和麦克风132,以经由扬声器131提供音频输出,并接收来自麦克风132的音频输入,从而实现通常的电信功能。音频处理器130可以包括任何合适的缓冲器、解码器、放大器等。另外,音频处理器130还耦合到中央处理器100,从而使得可以通过麦克风132能够在本机上录音,且使得可以通过扬声器131来播放本机上存储的声音。Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module. The communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide audio output via the speaker 131 and to receive audio input from the microphone 132, thereby realizing general telecommunication functions. The audio processor 130 may include any suitable buffers, decoders, amplifiers, and the like. In addition, the audio processor 130 is also coupled to the central processing unit 100, so that the microphone 132 can be used to record on the unit, and the speaker 131 can be used to play the sound stored on the unit.
同时,本发明还提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述方法。At the same time, the present invention also provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor implements the above method when the computer program is executed.
同时,本发明还提供一种计算机可读存储介质,计算机可读存储介质存储有执行上述方法的计算机程序。At the same time, the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program for executing the above method.
本发明公开的的智能合约的实现方法及装置可以支持链上、链下数据或同时支持链上链下数据,IO逻辑负责处理链上数据,包括从链上读取数据、进行共识处理,并将处理之后的结果或状态写入到链上。计算逻辑处理链外数据,包括计算任务发布与分发、计算任务拆分成多个子任务、计算任务编译成布尔电路及使用专用硬件加速、算力节点接受任务进行可验证计算、返回计算结果和可验证证明、计算结果验证等。The method and device for implementing smart contracts disclosed by the present invention can support on-chain, off-chain data, or both on-chain and off-chain data. IO logic is responsible for processing on-chain data, including reading data from the chain, performing consensus processing, and Write the result or status after processing to the chain. Computation logic processes out-of-chain data, including computing task publishing and distribution, computing task splitting into multiple subtasks, computing task compilation into Boolean circuits, and acceleration with dedicated hardware, computing nodes accepting tasks for verifiable calculations, returning calculation results, and Verification certificate, calculation result verification, etc.
如果涉及到多个数据源(包括链上数据、链下多个数据方提供的数据),为了保证数据隐私,各个数据提供方(共识节点作为链上数据提供方)可以联合进行多方安全计算来获得计算结果。If multiple data sources are involved (including on-chain data and data provided by multiple data parties off the chain), in order to ensure data privacy, each data provider (consensus node as the on-chain data provider) can jointly perform multi-party secure computing to Get calculation results.
本申请将合约的共识与计算解耦,共识部分在链上执行(由共识节点共识,并写入区块链),计算部分分发到算力提供方进行并行计算。这样的好处是:扩展了合约的应用范围,同时加快合约的执行速度,提高区块链的吞吐量。This application decouples the consensus of the contract from the calculation. The consensus part is executed on the chain (consensus by the consensus node and written into the blockchain), and the calculation part is distributed to the computing power provider for parallel calculation. This has the advantage of expanding the scope of application of the contract, at the same time speeding up the execution of the contract, and increasing the throughput of the blockchain.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as a method, a system, or a computer program product. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and combinations of processes and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, so that the instructions generated by the processor of the computer or other programmable data processing device are used to generate instructions Means for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a particular manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions The device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编 程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
本发明中应用了具体实施例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The principles and implementations of the present invention are described by applying specific embodiments in the present invention. The descriptions of the above embodiments are only used to help understand the method of the present invention and its core ideas; meanwhile, for a person of ordinary skill in the art, The idea of the invention will change in both the specific implementation and the scope of application. In summary, the content of this description should not be construed as a limitation on the present invention.

Claims (12)

  1. 一种区块链智能合约实现方法,其特征在于,所述的方法包括:A method for implementing a blockchain smart contract, characterized in that the method includes:
    接收用户发起的智能合约交易请求;Receive smart contract transaction requests initiated by users;
    将所述交易请求涉及的数据区分为链上数据和链下数据;Distinguish the data involved in the transaction request into on-chain data and off-chain data;
    由区块链的共识节点对所述链上数据进行共识处理;Consensus processing of the data on the chain by consensus nodes of the blockchain;
    由链下的算力提供方对链下数据进行计算处理并提供验证证明。The off-chain computing power provider calculates and processes the off-chain data and provides verification certificates.
  2. 如权利要求1所述的区块链智能合约实现方法,其特征在于,将所述交易请求涉及的数据区分为链上数据和链下数据包括:The method for implementing a smart contract of a blockchain according to claim 1, wherein distinguishing the data involved in the transaction request into on-chain data and off-chain data comprises:
    根据所述交易请求确定当前智能合约交易涉及的数据;Determining the data involved in the current smart contract transaction according to the transaction request;
    根据交易涉及的数据的来源将当前智能合约交易涉及的数据区分为链上数据和链下数据。According to the source of the data involved in the transaction, the data involved in the current smart contract transaction is divided into on-chain data and off-chain data.
  3. 如权利要求2所述的区块链智能合约实现方法,其特征在于,The method for implementing a blockchain smart contract according to claim 2, wherein:
    所述链上数据包括:执行合约时来自区块链的分布式账本的数据;The on-chain data includes: data from the distributed ledger of the blockchain when the contract is executed;
    所述链下数据包括:执行合约时由链下的至少一个数据提供方提供的数据。The off-chain data includes data provided by at least one data provider off-chain when a contract is executed.
  4. 如权利要求3所述的区块链智能合约实现方法,其特征在于,所述的数据提供方包括多个数据提供方时,各数据提供方利用MPC算法进行协同计算。The method for implementing a blockchain smart contract according to claim 3, wherein when the data provider includes a plurality of data providers, each data provider uses the MPC algorithm for collaborative calculation.
  5. 如权利要求3所述的区块链智能合约实现方法,其特征在于,所述的由区块链的共节点对所述链上数据进行共识处理包括:The method for implementing a blockchain smart contract according to claim 3, wherein the consensus processing of the data on the chain by the common nodes of the blockchain comprises:
    根据交易请求从所述分布式账本上的获取链上数据;Obtaining on-chain data from the distributed ledger according to a transaction request;
    根据合约请求由匹配的算力提供方对所述链上数据进行计算并提供计算证明生成计算结果;其中,所述计算结果包括:交易信息、计算结果、计算证明、合约状态变更;According to the contract request, a matching computing power provider calculates the on-chain data and provides a calculation certificate to generate a calculation result; wherein the calculation result includes: transaction information, calculation result, calculation certificate, and contract status change;
    根据所述计算结果变更所述分布式账本进行共识处理。According to the calculation result, the distributed ledger is changed for consensus processing.
  6. 一种区块链智能合约实现装置,其特征在于,所述的装置包括:A blockchain smart contract implementation device, characterized in that the device includes:
    请求接收模块,用于接收用户发起的智能合约交易请求;A request receiving module for receiving a smart contract transaction request initiated by a user;
    区分模块,用于将所述交易请求涉及的数据区分为链上数据和链下数据;A distinguishing module, configured to distinguish the data involved in the transaction request into on-chain data and off-chain data;
    链上共识模块,由区块链的共识节点对所述链上数据进行共识处理;On-chain consensus module, the consensus nodes of the blockchain perform consensus processing on the data on the chain;
    链下数据处理模块,由链下的算力提供方对链下数据进行计算处理并提供验证证明。Off-chain data processing module. The off-chain computing power provider calculates and processes the off-chain data and provides verification certificates.
  7. 如权利要求6所述的区块链智能合约实现装置,其特征在于,所述的区分模块包括:The device for implementing a blockchain smart contract according to claim 6, wherein the distinguishing module comprises:
    交易数据确定单元,用于根据所述交易请求确定当前智能合约交易涉及的数据;A transaction data determining unit, configured to determine data related to a current smart contract transaction according to the transaction request;
    区分单元,根据交易涉及的数据的来源将当前智能合约交易涉及的数据区分为链上数据和链下数据。The distinguishing unit distinguishes the data involved in the current smart contract transaction into on-chain data and off-chain data according to the source of the data involved in the transaction.
  8. 如权利要求7所述的区块链智能合约实现装置,其特征在于,The device for implementing a blockchain smart contract according to claim 7, wherein:
    所述链上数据包括:执行合约时来自区块链的分布式账本的数据;The on-chain data includes: data from the distributed ledger of the blockchain when the contract is executed;
    所述链下数据包括:执行合约时由链下的至少一个数据提供方提供的数据。The off-chain data includes data provided by at least one data provider off-chain when a contract is executed.
  9. 如权利要求8所述的区块链智能合约实现装置,其特征在于,所述的数据提供方包括多个数据提供方时,各数据提供方利用MPC算法进行协同计算。The device for implementing a blockchain smart contract according to claim 8, wherein, when the data provider includes a plurality of data providers, each data provider uses the MPC algorithm to perform collaborative calculation.
  10. 如权利要求8所述的区块链智能合约实现装置,其特征在于,所述的链上共识模块由区块链的共识节点对所述链上数据源进行共识处理包括:The device for implementing a blockchain smart contract according to claim 8, wherein the on-chain consensus module performs consensus processing on the on-chain data source by a consensus node of the blockchain, comprising:
    根据交易请求从所述分布式账本上的获取链上数据;Obtaining on-chain data from the distributed ledger according to a transaction request;
    根据合约请求由匹配的算力提供方对所述链上数据进行计算并提供计算证明生成计算结果;其中,所述计算结果包括:交易信息、计算结果、计算证明、合约状态变更;According to the contract request, a matching computing power provider calculates the on-chain data and provides a calculation certificate to generate a calculation result; wherein the calculation result includes: transaction information, calculation result, calculation certificate, and contract status change;
    根据所述计算结果变更所述分布式账本进行共识处理。According to the calculation result, the distributed ledger is changed for consensus processing.
  11. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至5任一所述方法。A computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements any one of claims 1 to 5 when the computer program is executed. method.
  12. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有执行权利要求1至5任一所述方法的计算机程序。A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program that executes the method according to any one of claims 1 to 5.
PCT/CN2019/096149 2018-07-18 2019-07-16 Method and apparatus for realizing smart contract of blockchain WO2020015633A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810790407.7 2018-07-18
CN201810790407.7A CN108694669A (en) 2018-07-18 2018-07-18 A kind of block chain intelligence contract implementation method and device

Publications (1)

Publication Number Publication Date
WO2020015633A1 true WO2020015633A1 (en) 2020-01-23

Family

ID=63850074

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/096149 WO2020015633A1 (en) 2018-07-18 2019-07-16 Method and apparatus for realizing smart contract of blockchain

Country Status (2)

Country Link
CN (1) CN108694669A (en)
WO (1) WO2020015633A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112600887A (en) * 2020-12-03 2021-04-02 中国联合网络通信集团有限公司 Computing power management method and device
CN114297643A (en) * 2022-03-10 2022-04-08 众连智能科技有限公司 Defense method and device of intelligent contract and storage medium
WO2022105349A1 (en) * 2020-11-19 2022-05-27 国网区块链科技(北京)有限公司 Blockchain-based electricity charge settlement method and system for energy storage power station

Families Citing this family (39)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108694669A (en) * 2018-07-18 2018-10-23 矩阵元技术(深圳)有限公司 A kind of block chain intelligence contract implementation method and device
CN109598599A (en) * 2018-10-26 2019-04-09 阿里巴巴集团控股有限公司 A kind of refund processing method, device and equipment based on block chain
CN112381646A (en) * 2018-10-31 2021-02-19 创新先进技术有限公司 Privacy transaction based on block chain and application method and device thereof
CN109558750B (en) * 2018-11-30 2021-11-02 北京八分量信息科技有限公司 Data processing system and method based on secure multi-party computing
CN109582737A (en) * 2018-11-30 2019-04-05 北京八分量信息科技有限公司 A kind of battery data management system and method based on multi-party computations
CN109446273B (en) * 2018-12-04 2022-07-22 深圳前海环融联易信息科技服务有限公司 Data synchronization method and device of block chain, computer equipment and storage medium
SG11201906754SA (en) * 2018-12-13 2019-08-27 Alibaba Group Holding Ltd Off-chain smart contract service based on trusted execution environment
CN110020543B (en) 2018-12-21 2020-09-15 阿里巴巴集团控股有限公司 Data processing method and device based on block chain
CN110009337B (en) 2018-12-21 2020-04-21 阿里巴巴集团控股有限公司 Data processing method and device based on block chain
CN109885612B (en) * 2018-12-26 2021-04-20 联动优势科技有限公司 Synchronous validation method and device for intelligent contracts of block chains
CN109889498B (en) * 2019-01-16 2021-10-29 余炀 Calculation verification method and system based on block chain
CN109829718B (en) * 2019-01-30 2022-12-23 缀初网络技术(上海)有限公司 Block chain multi-level framework based on storage application scene and operation method thereof
CN111612453A (en) * 2019-02-22 2020-09-01 北京趣块远扬科技有限公司 Decentralized transaction method and device based on block chain and electronic equipment
CN109886687B (en) * 2019-02-28 2023-12-05 矩阵元技术(深圳)有限公司 Result verification method and system for realizing secure multiparty calculation based on blockchain
CN110033243B (en) * 2019-03-06 2023-01-10 华南师范大学 Main chain evidence storing method, system and storage medium based on block chain intelligent contract
WO2020210979A1 (en) * 2019-04-16 2020-10-22 华为技术有限公司 Blockchain-network-based joint learning method and joint learning device
CN110335037A (en) * 2019-04-19 2019-10-15 矩阵元技术(深圳)有限公司 Method of commerce, device and the storage medium calculated based on block chain and Secure
CN110298190A (en) * 2019-04-19 2019-10-01 矩阵元技术(深圳)有限公司 Decentralization Secure data processing method, device and storage medium
WO2020215195A1 (en) * 2019-04-23 2020-10-29 云图有限公司 Blockchain smart contract realization method and apparatus, computer device and storage medium
CN110111104A (en) * 2019-04-23 2019-08-09 矩阵元技术(深圳)有限公司 Block chain intelligence contract implementation method, device, computer equipment and storage medium
CN110149323B (en) * 2019-05-06 2020-07-10 山东公链信息科技有限公司 Processing device with ten-million-level TPS (platform secure protocol) contract processing capacity
CN110288179A (en) * 2019-05-10 2019-09-27 深圳壹账通智能科技有限公司 Administering method and device, computer equipment, the storage medium of alliance's chain
CN110414977A (en) * 2019-06-12 2019-11-05 阿里巴巴集团控股有限公司 A kind of method and apparatus to lock an account in block chain
US11405181B2 (en) * 2019-07-12 2022-08-02 Microsoft Technology Licensing, Llc Lightweight blockchain based on split-trust
CN110442456B (en) * 2019-08-06 2023-02-28 上海浦东发展银行股份有限公司信用卡中心 Multi-channel load balancing method based on Hyperridge-fabric
CN110544092B (en) * 2019-08-22 2022-04-01 杭州趣链科技有限公司 Dynamic newly-added multi-type database data operation chaining method for block chain
CN110851127B (en) * 2019-10-28 2023-10-24 杭州趣链科技有限公司 Universal evidence-storing method based on blockchain
CN110942300B (en) * 2019-11-14 2023-04-14 杭州复杂美科技有限公司 Transfer certificate submitting method, device and storage medium
CN111061713A (en) * 2019-12-11 2020-04-24 北京时代云链信息科技有限公司 Block chain data fusion method, device, equipment and storage medium
CN111311255B (en) * 2020-01-19 2023-07-25 杭州云象网络技术有限公司 Intelligent contract formalization verification and error correction method based on prophetic machine
CN112199701A (en) * 2020-03-18 2021-01-08 支付宝(杭州)信息技术有限公司 Contract calling method and device
CN111666337B (en) * 2020-05-19 2023-04-25 武汉理工大学 Patent technology conversion operation platform and transaction method based on blockchain technology
CN111737011B (en) * 2020-07-31 2021-01-29 支付宝(杭州)信息技术有限公司 Method and device for realizing secure multi-party computation
CN112184434A (en) * 2020-09-02 2021-01-05 上海树图区块链研究院 Block chain system, data interaction and processing method, node and storage medium
CN112927083A (en) * 2021-03-30 2021-06-08 上海万向区块链股份公司 Block chain-based batch settlement method, system and medium
CN112801797A (en) * 2021-03-30 2021-05-14 支付宝(杭州)信息技术有限公司 Method and apparatus for processing ticket data using a down-link trusted device
CN113065167A (en) * 2021-04-06 2021-07-02 北京瑞卓喜投科技发展有限公司 Method and device for updating downlink data authorization prediction machine and electronic equipment
CN113064729A (en) * 2021-04-16 2021-07-02 上海边界智能科技有限公司 Safe multi-party computing method based on block chain technology
CN114048264A (en) * 2021-09-28 2022-02-15 中诚区块链研究院(南京)有限公司 Consensus intelligent contract algorithm

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169765A (en) * 2017-05-11 2017-09-15 电子科技大学 A kind of method adjusted into Mobile state of being known together based on business degree of belief to block chain
US20180041345A1 (en) * 2015-01-30 2018-02-08 Enrico Maim Systems and methods for managing networked commitments of secure entities
CN108200203A (en) * 2018-02-06 2018-06-22 北京奇虎科技有限公司 Block catenary system based on double-layer network
CN108282539A (en) * 2018-02-06 2018-07-13 北京奇虎科技有限公司 Decentralization storage system based on double-layer network
CN108694669A (en) * 2018-07-18 2018-10-23 矩阵元技术(深圳)有限公司 A kind of block chain intelligence contract implementation method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976231A (en) * 2016-06-24 2016-09-28 深圳前海微众银行股份有限公司 Asset management method based on intelligent block chain contracts and nodes
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN107657438B (en) * 2017-09-18 2020-12-04 联动优势科技有限公司 Block chain generation method, data verification method, node and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180041345A1 (en) * 2015-01-30 2018-02-08 Enrico Maim Systems and methods for managing networked commitments of secure entities
CN107169765A (en) * 2017-05-11 2017-09-15 电子科技大学 A kind of method adjusted into Mobile state of being known together based on business degree of belief to block chain
CN108200203A (en) * 2018-02-06 2018-06-22 北京奇虎科技有限公司 Block catenary system based on double-layer network
CN108282539A (en) * 2018-02-06 2018-07-13 北京奇虎科技有限公司 Decentralization storage system based on double-layer network
CN108694669A (en) * 2018-07-18 2018-10-23 矩阵元技术(深圳)有限公司 A kind of block chain intelligence contract implementation method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022105349A1 (en) * 2020-11-19 2022-05-27 国网区块链科技(北京)有限公司 Blockchain-based electricity charge settlement method and system for energy storage power station
CN112600887A (en) * 2020-12-03 2021-04-02 中国联合网络通信集团有限公司 Computing power management method and device
CN114297643A (en) * 2022-03-10 2022-04-08 众连智能科技有限公司 Defense method and device of intelligent contract and storage medium
CN114297643B (en) * 2022-03-10 2022-07-08 众连智能科技有限公司 Defense method and device of intelligent contract and storage medium

Also Published As

Publication number Publication date
CN108694669A (en) 2018-10-23

Similar Documents

Publication Publication Date Title
WO2020015633A1 (en) Method and apparatus for realizing smart contract of blockchain
WO2020207090A1 (en) Blockchain-based data processing system and method, computing device and storage medium
KR102419050B1 (en) Blockchain balance adjustment method and device, and electronic device
EP3465516B1 (en) Cryptographic applications for a blockchain system
JP6827564B2 (en) Performing parallel execution of transactions in a distributed ledger system
WO2018214898A1 (en) Method and device for writing service data in block chain system
US20230028606A1 (en) Method and apparatus for vertical federated learning
US11106487B2 (en) Performing parallel execution of transactions in a distributed ledger system
TW201822033A (en) Resource processing method and apparatus
CN109299336A (en) Data back up method, device, storage medium and calculating equipment
TW201935383A (en) Asset management method and apparatus, and electronic device
CA3057388C (en) Methods and devices for processing certificates in blockchain system
CN111309745B (en) Virtual resource processing method and device, electronic equipment and storage medium
WO2020155811A1 (en) Block chain intelligent contract execution method, device and electronic apparatus
US11310244B2 (en) Information sharing methods, apparatuses, and devices
CN111131412A (en) Method and system for computing nodes by 5G mobile terminal, mobile terminal and cloud server
JP2022554202A (en) INTERACTIVE AGGREGATE SIGNATURE METHOD, EQUIPMENT AND STORAGE MEDIUM
WO2021109718A1 (en) Verification method and apparatus based on block chain system
TW202103035A (en) Data interaction method and apparatus, and electronic device
CN110599175A (en) Block processing method and related equipment
TWI737164B (en) Data interaction method, device, server and electronic equipment
CN110009492A (en) Block chain method of commerce and device, electronic equipment, storage medium
WO2020211075A1 (en) Decentralized secure multi-party data processing method and device, and storage medium
CN112860805A (en) Block chain data interaction method and system
US20220413808A1 (en) System and Method for Executing A Process Workflow

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19837134

Country of ref document: EP

Kind code of ref document: A1