技术领域technical field
本发明涉及计算机领域,尤其涉及一种智能合约的建立方法、装置、计算设备及存储介质。The present invention relates to the field of computers, in particular to a method, device, computing device and storage medium for establishing an intelligent contract.
背景技术Background technique
通常情况下,不同企业、单位或者个人之间建立业务关系时,为了节省时间、提升效率,电子合约应运而生,签订双方可在互相信任的基础上建立电子合约,使得在执行相应业务时,如果满足电子合约的触发条件,即可自动执行相应操作。例如,银行与客户互相信任,签订信用卡自动还款合约,在还款日,银行可自动从关联的储蓄卡中扣除相应的金额,中间无需客户手动操作,从而提升了效率。Under normal circumstances, when establishing business relationships between different enterprises, units or individuals, in order to save time and improve efficiency, electronic contracts emerge as the times require. Both parties can establish electronic contracts based on mutual trust, so that when performing corresponding business, If the trigger conditions of the electronic contract are met, the corresponding operation can be automatically executed. For example, the bank and the customer trust each other and sign a credit card automatic repayment contract. On the repayment date, the bank can automatically deduct the corresponding amount from the associated savings card without manual operations by the customer, thereby improving efficiency.
但是,由于电子合约是记录在计算机中的可执行代码,是数字化的合约,并且,不同银行,不同地域间的机构之间建立电子合约很可能被其他用户获取,导致用户信息泄露,甚至被黑客攻击或者篡改,进而可能会影响交易记录的安全性以及准确性;且,这种方式的前提是签订双方互相信任,能够让用户完全信任的企业少之又少,因而还会降低电子合约的可适用性。However, since the electronic contract is an executable code recorded in the computer, it is a digital contract, and the establishment of an electronic contract between different banks and institutions in different regions is likely to be obtained by other users, resulting in user information leakage or even being hacked. Attacks or tampering may affect the security and accuracy of transaction records; moreover, the premise of this method is that both parties trust each other, and there are very few companies that can fully trust users, which will also reduce the reliability of electronic contracts. applicability.
综上所述,现有的电子合约存在安全性较低以及可适用性较低等的问题。To sum up, the existing electronic contracts have problems such as low security and low applicability.
发明内容Contents of the invention
本发明实施例提供了一种智能合约的建立方法、装置、计算设备及存储介质,用以解决现有的电子合约的建立方法所存在的安全较低以及可适用性较低等的问题。Embodiments of the present invention provide a method, device, computing device, and storage medium for establishing a smart contract, which are used to solve the problems of low security and low applicability in the existing method for establishing an electronic contract.
本发明实施例提供了一种智能合约的建立方法,适用于部署有第一智能合约的多方参与者的区块链系统;所述方法包括:The embodiment of the present invention provides a method for establishing a smart contract, which is suitable for a blockchain system with multiple participants deployed with a first smart contract; the method includes:
第一参与者向第二参与者发送基于所述第一智能合约的更新请求;所述更新请求中包括所述第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;所述第一参与者与所述第二参与者为所述智能合约的任一参与者;The first participant sends an update request based on the first smart contract to the second participant; the update request includes the public key of the first participant and the second smart contract; the second smart contract is the The smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the transaction authority requested by the first participant to update and the public key of the first participant The mapping relationship between; the first participant and the second participant are any participant of the smart contract;
所述第一参与者若确认接收到的确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约;所述确认匹配响应为所述第二参与者确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时发送的。If the first participant confirms that the received confirmation matching response meets the consensus condition, then update the second smart contract to the smart contract of the blockchain system; the confirmation matching response is the second participant's It is sent when confirming that the second smart contract generated based on the update request matches the second smart contract in the update request.
一种可能的实现方式,所述第一参与者为新加入所述区块链系统的参与者;In a possible implementation, the first participant is a new participant joining the blockchain system;
所述第一参与者向第二参与者发送基于所述第一智能合约的更新请求之前,还包括:Before the first participant sends an update request based on the first smart contract to the second participant, it further includes:
所述第一参与者获取所述第一参与者的密钥对,所述密钥对包括公钥和私钥。The first participant obtains a key pair of the first participant, and the key pair includes a public key and a private key.
一种可能的实现方式,所述第一参与者向第二参与者发送基于所述第一智能合约的更新请求之前,还包括:A possible implementation manner, before the first participant sends an update request based on the first smart contract to the second participant, further includes:
所述第一参与者确认待变更的事务权限并生成所述事务权限映射关系。The first participant confirms the transaction authority to be changed and generates the transaction authority mapping relationship.
一种可能的实现方式,所述方法还包括:A possible implementation, the method also includes:
所述第一参与者接收所述第二参与者发送的基于所述第二智能合约的更新请求;所述更新请求中包括所述第二参与者的公钥和第三智能合约;所述第三智能合约为所述第二参与者基于事务权限映射关系更新所述第二智能合约后的智能合约;所述事务权限映射关系包括所述第二参与者请求更新的事务权限与所述第二参与者的公钥之间的映射关系;The first participant receives an update request based on the second smart contract sent by the second participant; the update request includes the second participant's public key and the third smart contract; the second The third smart contract is the smart contract after the second participant updates the second smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the transaction authority requested by the second participant to update and the second The mapping relationship between public keys of participants;
所述第一参与者若确认接收到的确认匹配响应满足共识条件,则将所述第三智能合约更新为所述区块链系统的智能合约;所述确认匹配响应为所述第一参与者确认基于所述更新请求生成的第三智能合约与所述更新请求中的第三智能合约匹配时发送的。If the first participant confirms that the received confirmation matching response meets the consensus condition, then update the third smart contract to the smart contract of the blockchain system; the confirmation matching response is the first participant's It is sent when it is confirmed that the third smart contract generated based on the update request matches the third smart contract in the update request.
本发明实施例提供了一种智能合约的建立方法,适用于部署有第一智能合约的多方参与者的区块链系统;所述方法包括:The embodiment of the present invention provides a method for establishing a smart contract, which is suitable for a blockchain system with multiple participants deployed with a first smart contract; the method includes:
第二参与者接收第一参与者发送基于所述第一智能合约的更新请求;所述第一参与者与所述第二参与者为所述第一智能合约的任一参与者;所述更新请求中包括所述第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;The second participant receives the update request sent by the first participant based on the first smart contract; the first participant and the second participant are any participant of the first smart contract; the update The request includes the public key of the first participant and the second smart contract; the second smart contract is a smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship; the The transaction authority mapping relationship includes the mapping relationship between the transaction authority requested by the first participant to be updated and the public key of the first participant;
所述第二参与者确认所述事务权限映射关系满足更新规则时,基于所述更新请求生成第二智能合约;When the second participant confirms that the transaction authority mapping relationship satisfies the update rule, a second smart contract is generated based on the update request;
所述第二参与者确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时,向所述区块链的参与者发送确认匹配响应;When the second participant confirms that the second smart contract generated based on the update request matches the second smart contract in the update request, send a confirmation matching response to the participants of the block chain;
所述第二参与者若确认接收到的所述确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约。If the second participant confirms that the received confirmation matching response satisfies the consensus condition, then update the second smart contract to the smart contract of the blockchain system.
本发明实施例提供了一种智能合约的建立装置,适用于部署有第一智能合约的多方参与者的区块链系统;所述装置适用于第一参与者,包括:An embodiment of the present invention provides a device for establishing a smart contract, which is suitable for a multi-participant blockchain system deployed with a first smart contract; the device is suitable for a first participant, including:
发送模块,用于向第二参与者发送基于所述第一智能合约的更新请求;所述更新请求中包括第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;所述第一参与者与所述第二参与者为所述智能合约的任一参与者;A sending module, configured to send an update request based on the first smart contract to the second participant; the update request includes the public key of the first participant and the second smart contract; the second smart contract is the The smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the relationship between the transaction authority requested by the first participant to update and the public key of the first participant The mapping relationship between; the first participant and the second participant are any participant of the smart contract;
确定模块,用于若确认接收到的确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约;所述确认匹配响应为所述第二参与者确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时发送的。A determining module, configured to update the second smart contract to the smart contract of the blockchain system if the received confirmation matching response meets the consensus condition; the confirmation matching response is the confirmation of the second participant Sent when the second smart contract generated based on the update request matches the second smart contract in the update request.
一种可能的实现方式,所述第一参与者为新加入所述区块链系统的参与者;所述装置还包括:In a possible implementation, the first participant is a participant who newly joins the blockchain system; the device also includes:
获取模块,用于所述第一参与者获取所述第一参与者的密钥对,所述密钥对包括公钥和私钥。An obtaining module, configured for the first participant to obtain a key pair of the first participant, where the key pair includes a public key and a private key.
一种可能的实现方式,所述确定模块,还用于确认待变更的事务权限并生成所述事务权限映射关系。In a possible implementation manner, the determination module is further configured to confirm the transaction authority to be changed and generate the transaction authority mapping relationship.
一种可能的实现方式,所述获取模块,还用于接收所述第二参与者发送的基于所述第二智能合约的更新请求;所述更新请求中包括所述第二参与者的公钥和第三智能合约;所述第三智能合约为所述第二参与者基于事务权限映射关系更新所述第二智能合约后的智能合约;所述事务权限映射关系包括所述第二参与者请求更新的事务权限与所述第二参与者的公钥之间的映射关系;In a possible implementation, the obtaining module is further configured to receive an update request based on the second smart contract sent by the second participant; the update request includes the public key of the second participant and a third smart contract; the third smart contract is the smart contract after the second participant updates the second smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the second participant request The mapping relationship between the updated transaction authority and the public key of the second participant;
所述确认模块,还用于若确认接收到的确认匹配响应满足共识条件,则将所述第三智能合约更新为所述区块链系统的智能合约;所述确认匹配响应为所述第一参与者确认基于所述更新请求生成的第三智能合约与所述更新请求中的第三智能合约匹配时发送的。The confirmation module is also used to update the third smart contract to the smart contract of the blockchain system if the received confirmation matching response meets the consensus condition; the confirmation matching response is the first It is sent when the participant confirms that the third smart contract generated based on the update request matches the third smart contract in the update request.
本发明实施例提供了一种智能合约的建立装置,适用于部署有第一智能合约的多方参与者的区块链系统;所述装置适用于第二参与者,包括:An embodiment of the present invention provides a device for establishing a smart contract, which is suitable for a blockchain system with multiple participants deployed with a first smart contract; the device is suitable for a second participant, including:
获取模块,用于接收第一参与者发送基于所述第一智能合约的更新请求;所述第一参与者与所述第二参与者为所述第一智能合约的任一参与者;所述更新请求中包括所述第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;An acquisition module, configured to receive an update request based on the first smart contract sent by the first participant; the first participant and the second participant are any participant of the first smart contract; the The update request includes the public key of the first participant and the second smart contract; the second smart contract is a smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship; The transaction authority mapping relationship includes the mapping relationship between the transaction authority requested by the first participant to be updated and the public key of the first participant;
确认模块,用于确认所述事务权限映射关系满足更新规则时,基于所述更新请求生成第二智能合约;确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时,向所述区块链的参与者发送确认匹配响应;若确认接收到的所述确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约。A confirmation module, configured to generate a second smart contract based on the update request when confirming that the transaction permission mapping relationship satisfies the update rule; confirm that the second smart contract generated based on the update request is consistent with the second smart contract in the update request When the contract is matched, send a confirmation matching response to the participants of the block chain; if it is confirmed that the received confirmation matching response meets the consensus condition, then update the second smart contract to the smart contract of the block chain system contract.
本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行如本发明实施例中任一项所述的方法。An embodiment of the present invention provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make the computer execute any one of the embodiments of the present invention. the method described.
本发明实施例提供了一种智能合约的计算设备,包括:An embodiment of the present invention provides a smart contract computing device, including:
存储器,用于存储程序指令;memory for storing program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行如本发明实施例中任一项所述的方法。The processor is configured to call the program instructions stored in the memory, and execute the method according to any one of the embodiments of the present invention according to the obtained program.
本发明实施例提供了一种智能合约的建立方法、装置、计算设备及存储介质,相比于现有技术,在本发明实施例中,所述智能合约的建立是通过基于共识算法的区块链技术实现的,适用于部署有第一智能合约的多方参与者的区块链系统;所述方法中,通过第一参与者向第二参与者发送基于所述智能合约的更新请求;其中,所述更新请求中包括所述第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限对应的事务与所述第一参与者的公钥之间的映射关系;通过该方法,可以实现对区块链中的每个参与者执行智能合约中的事务时设立权限,有效的保证了个参与者在业务中的利益,进而防止各参与者在执行该智能合约时可能导致的安全隐患,提高数据的保密性,能够保证智能合约中各参与者的安全性以及交易的准确性,提升了智能合约的可适用性。所述第二参与者确认根据所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时,发送确认匹配响应;所述第一参与者若确认接收到的确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约。通过上述方法,可以使得智能合约的更新是基于各参与者的认可后更新的,进而保证了智能合约的安全性。The embodiment of the present invention provides a method, device, computing device, and storage medium for establishing a smart contract. Compared with the prior art, in the embodiment of the present invention, the smart contract is established through a block based on a consensus algorithm Realized by chain technology, it is applicable to the blockchain system of multi-party participants deployed with the first smart contract; in the method, the first participant sends an update request based on the smart contract to the second participant; wherein, The update request includes the public key of the first participant and the second smart contract; the second smart contract is the smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship ; The transaction authority mapping relationship includes the mapping relationship between the transaction corresponding to the transaction authority requested by the first participant to update and the public key of the first participant; Each participant establishes authority when executing the transactions in the smart contract, which effectively guarantees the interests of each participant in the business, thereby preventing potential safety hazards that may be caused by each participant when executing the smart contract, and improving data confidentiality. It can guarantee the security of each participant in the smart contract and the accuracy of the transaction, which improves the applicability of the smart contract. When the second participant confirms that the second smart contract generated according to the update request matches the second smart contract in the update request, send a confirmation match response; if the first participant confirms that the received confirmation match In response to meeting the consensus condition, the second smart contract is updated to be the smart contract of the blockchain system. Through the above method, the smart contract can be updated based on the approval of each participant, thereby ensuring the security of the smart contract.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.
图1所示为本发明实施例中提供的系统架构示意图;FIG. 1 is a schematic diagram of a system architecture provided in an embodiment of the present invention;
图2所示为本发明实施例中提供的智能合约区块链的结构示意图;Fig. 2 is a schematic structural diagram of the smart contract block chain provided in the embodiment of the present invention;
图3所示为本发明实施例中提供的智能合约的交易方法的流程示意图;FIG. 3 is a schematic flow diagram of the transaction method of the smart contract provided in the embodiment of the present invention;
图4所示为本发明实施例中提供的基于智能合约的建立方法的流程示意图;FIG. 4 is a schematic flow diagram of a smart contract-based establishment method provided in an embodiment of the present invention;
图5所示为本发明实施例中提供的智能合约的建立方法的示意图;FIG. 5 is a schematic diagram of a method for establishing a smart contract provided in an embodiment of the present invention;
图6所示为本发明实施例中提供的智能合约的建立方法的示意图;FIG. 6 is a schematic diagram of a method for establishing a smart contract provided in an embodiment of the present invention;
图7所示为本发明实施例中提供的智能合约的建立装置的结构示意图;FIG. 7 is a schematic structural diagram of a device for establishing a smart contract provided in an embodiment of the present invention;
图8所示为本发明实施例中提供的智能合约的建立装置的结构示意图。FIG. 8 is a schematic structural diagram of an apparatus for establishing a smart contract provided in an embodiment of the present invention.
具体实施方式Detailed ways
区块链或者分布式账本网络均为对等网络,即在比特币、以太坊等公链以及Fabric、Corda等联盟链的节点间均通过P2P网络进行通讯和连接,权利均等。相比于现有的电子合约,通过基于共识算法的区块链技术实现智能合约的建立,因而能够保证智能合约的安全性以及准确性;且,区块链技术无需签订双方互相信任即可签订相应的电子合约,因而还能提升智能合约的建立方法的可适用性。以Fabric为例,底层区块链平台可以采用fabric平台,对应的智能合约层可以采用docker技术实现Go语言的编译和执行环境;应用层中包括有各个参与者调用数据服务平台提供的接口,实现应用逻辑。Blockchain or distributed ledger network is a peer-to-peer network, that is, nodes in public chains such as Bitcoin and Ethereum and alliance chains such as Fabric and Corda communicate and connect through P2P networks, with equal rights. Compared with existing electronic contracts, the establishment of smart contracts is realized through blockchain technology based on consensus algorithms, thus ensuring the security and accuracy of smart contracts; moreover, blockchain technology can be signed without mutual trust between the signing parties Corresponding electronic contracts can also improve the applicability of the establishment method of smart contracts. Taking Fabric as an example, the underlying blockchain platform can use the fabric platform, and the corresponding smart contract layer can use docker technology to realize the Go language compilation and execution environment; the application layer includes interfaces provided by each participant to call the data service platform to realize Apply logic.
下面以以太坊为例,对建立在区块链技术上的智能合约进行举例说明。当然也可以采用其他底层平台和对应的编译和执行环境,在此不做限定。The following takes Ethereum as an example to illustrate smart contracts based on blockchain technology. Of course, other underlying platforms and corresponding compilation and execution environments may also be used, which are not limited here.
以太坊(Ethereum)是一个建立在区块链技术之上,去中心化应用平台。它允许任何人在平台中建立和使用通过区块链技术运行的去中心化应用。以太坊平台对底层区块链技术进行了封装,让区块链应用开发者可以直接基于以太坊平台进行开发,开发者只要专注于应用本身的开发,从而大大降低了难度。以太坊上的程序称之为智能合约,它是代码和数据的集合。Ethereum is a decentralized application platform built on blockchain technology. It allows anyone to build and use decentralized applications running on blockchain technology in the platform. The Ethereum platform encapsulates the underlying blockchain technology, allowing blockchain application developers to develop directly based on the Ethereum platform. Developers only need to focus on the development of the application itself, which greatly reduces the difficulty. A program on Ethereum is called a smart contract, which is a collection of code and data.
智能合约可以理解为在区块链上可以自动执行的(由消息驱动的)、以代码形式编写的合同(特殊的交易)。以太坊则更加完备(在计算机科学术语中,称它为是“图灵完备”)。智能合约非常适合对信任、安全和持久性要求较高的应用场景,比如:数字货币、数字资产、投票、保险、金融应用、预测市场、产权所有权管理、物联网、点对点交易等等。Smart contracts can be understood as contracts (special transactions) written in code that can be automatically executed (driven by messages) on the blockchain. Ethereum is even more complete (in computer science terms, it is called "Turing complete"). Smart contracts are very suitable for application scenarios that require high trust, security and durability, such as: digital currency, digital assets, voting, insurance, financial applications, prediction markets, property rights management, Internet of Things, peer-to-peer transactions, etc.
以太坊中有两类账户:外部账户和合约账户。外部账户为私钥控制(由人控制),没有关联任何代码。一个外部账户可以通过私钥对交易进行签名,进而发送消息给另一个外部账户或合约账户。在两个外部账户之间传送消息是价值转移的过程。合约账户被它们的合约代码控制且有代码与之关联。从外部账户到合约账户的消息会激活合约账户的代码,合约账户才会执行相应的操作(比如转移代币,写入内部存储,挖出一个新代币,执行一些运算,发送其它消息,创建一个新的合约等等)。There are two types of accounts in Ethereum: external accounts and contract accounts. External accounts are controlled by private keys (controlled by people) and are not associated with any code. An external account can sign a transaction with a private key, and then send a message to another external account or contract account. Sending a message between two external accounts is the process of value transfer. Contract accounts are controlled by their contract code and have code associated with them. The message from the external account to the contract account will activate the code of the contract account, and the contract account will perform corresponding operations (such as transferring tokens, writing to internal storage, mining a new token, performing some calculations, sending other messages, creating a new contract, etc.).
基于区块链的智能合约构建,即多参与者共同参与制定一份智能合约,包括如下步骤:Blockchain-based smart contract construction, that is, multiple participants participate in the formulation of a smart contract, including the following steps:
步骤一、用户需要先注册成为区块链的用户,区块链返回给用户一对公钥和私钥;公钥做为用户在区块链上的账户地址,私钥做为操作该账户的唯一钥匙。如图1所示,为一个区块链及分布式账本网络,通过每个参与者的公钥代表其在网络内的身份。参与者1的公钥和私钥对为(PK1,SK1);参与者2的公钥和私钥对为(PK2,SK2);参与者3的公钥和私钥对为(PK3,SK3);参与者4的公钥和私钥对为(PK4,SK4)。Step 1. The user needs to register as a user of the blockchain first, and the blockchain returns a pair of public key and private key to the user; the public key is used as the user's account address on the blockchain, and the private key is used as the key to operate the account. unique key. As shown in Figure 1, it is a blockchain and distributed ledger network, and the public key of each participant represents its identity in the network. The public and private key pair of participant 1 is (PK1, SK1); the public and private key pair of participant 2 is (PK2, SK2); the public and private key pair of participant 3 is (PK3, SK3) ; The public key and private key pair of participant 4 is (PK4, SK4).
步骤二、两个或两个以上的用户根据需要,共同商定了一份承诺,承诺中包含了双方的权利和义务;这些权利和义务以电子化的方式,写为机器语言;各参与者分别用各自私钥进行签名;以确保合约的有效性。Step 2. Two or more users agree on a commitment based on their needs, which includes the rights and obligations of both parties; these rights and obligations are electronically written in machine language; each participant Sign with their respective private keys; to ensure the validity of the contract.
步骤三、签名后的智能合约,将会根据其中的承诺内容,通过P2P网络扩散并存入区块链;Step 3. The signed smart contract will be diffused through the P2P network and stored in the blockchain according to the commitment content in it;
步骤四、合约通过P2P的方式在区块链全网中扩散,每个节点都会收到一份;区块链中的验证节点会将收到的合约先保存到内存中,等待新一轮的共识时间,触发对该份合约的共识和处理。Step 4. The contract is diffused in the entire blockchain network through P2P, and each node will receive a copy; the verification node in the blockchain will first save the received contract in the memory, waiting for a new round of Consensus time, which triggers the consensus and processing of the contract.
步骤五、共识时间到达时,验证节点会把最近一段时间内保存的所有合约,一起打包成一个合约集合(set),并算出这个合约集合的Hash值,最后将这个合约集合的Hash值组装成一个区块结构,扩散到全网;其它验证节点收到这个区块结构后,会把里面包含的合约集合的Hash取出来,与自己保存的合约集合进行比较;同时发送一份自己认可的合约集合给其它的验证节点;通过这种多轮的发送和比较;所有的验证节点最终在规定的时间内对最新的合约集合达成一致。Step 5. When the consensus time arrives, the verification node will pack all the contracts saved in the recent period into a contract set (set), calculate the Hash value of this contract set, and finally assemble the Hash value of this contract set into A block structure spreads to the whole network; after other verification nodes receive this block structure, they will take out the Hash of the contract set contained in it, and compare it with the contract set saved by themselves; at the same time, they will send a contract approved by themselves Set to other verification nodes; through this multiple rounds of sending and comparison; all verification nodes finally reach an agreement on the latest contract set within the specified time.
步骤六、最新达成的合约集合会以区块的形式扩散到全网,如图2所示,每个区块包含以下信息:当前区块的Hash值、前一区块的Hash值、达成共识时的时间戳、以及其它描述信息;同时区块链最重要的信息是带有一组已经达成共识的合约集;收到合约集的节点,都会对每条合约进行验证,验证通过的合约才会最终写入区块链中,验证的内容主要是合约参与者的私钥签名是否与账户匹配。Step 6. The newly concluded contract set will spread to the whole network in the form of blocks, as shown in Figure 2, each block contains the following information: the Hash value of the current block, the Hash value of the previous block, and the consensus reached Timestamp and other descriptive information; at the same time, the most important information of the blockchain is a set of contracts that have reached a consensus; the node that receives the contract set will verify each contract, and the contract that passes the verification will be Finally, it is written into the blockchain, and the content of verification is mainly whether the private key signature of the contract participant matches the account.
当把编译好的合约字节码通过外部账号发送交易的形式部署到以太坊区块链上,并使用合约账户的地址来标示这个合约。合约部署之后,当需要调用这个智能合约的方法时只需要向这个合约账户发送消息,通过消息触发后智能合约的代码就会在EVM中执行。When the compiled contract bytecode is deployed to the Ethereum blockchain in the form of sending a transaction through an external account, and the address of the contract account is used to mark the contract. After the contract is deployed, when you need to call the method of the smart contract, you only need to send a message to the contract account, and the code of the smart contract will be executed in the EVM after the message is triggered.
在触发智能合约时,智能合约的执行可以包括:合约参与者,为执行智能合约的相关参与者,通过合约参与者的外部账户发送消息,触发智能合约;合约资源集合,为智能合约执行涉及的参与者资源,比如参与各方账户、拥有的数字财产等;智能合约中的事务主要包含需要发送的数据;而智能合约中的事件则是对这些数据的描述信息。事务及事件信息被智能合约的执行节点接收后,合约资源集合中的资源状态会被更新,进而触发智能合约进行状态机判断。状态机,包括当前资源状态判断、下一步合约事务执行选择等;智能合约系统若确定事件中包含的触发条件满足时,从智能合约的自动状态机自动发出预设的数据资源,以及包括触发条件的事件;合约事务集合,为智能合约的下一步动作或行为集合,控制着智能合约的资产并对接收到的信息进行回应。When triggering a smart contract, the execution of the smart contract can include: contract participants, the relevant participants who execute the smart contract, send messages through the external accounts of the contract participants to trigger the smart contract; Participant resources, such as accounts of participating parties, digital assets owned, etc.; transactions in smart contracts mainly include data that needs to be sent; events in smart contracts are description information for these data. After the transaction and event information is received by the execution node of the smart contract, the resource status in the contract resource set will be updated, and then the smart contract will be triggered to judge the state machine. State machine, including the judgment of the current resource state, the next step of contract transaction execution selection, etc.; if the smart contract system determines that the trigger conditions contained in the event are met, the preset data resources will be automatically issued from the automatic state machine of the smart contract, and the trigger conditions will be included. Events; the collection of contract transactions is the next action or behavior collection of the smart contract, which controls the assets of the smart contract and responds to the received information.
具体的,基于区块链的智能合约的执行可以包括:Specifically, the execution of blockchain-based smart contracts can include:
步骤一、定期检查区块中的智能合约,逐条遍历每个合约内的状态机、事务以及触发条件;将条件满足的事务推送到待验证的队列中,等待共识;未满足触发条件的事务将继续存放在区块链上。Step 1. Regularly check the smart contracts in the block, traverse the state machine, transactions and trigger conditions in each contract one by one; push the transactions that meet the conditions to the queue to be verified, and wait for the consensus; the transactions that do not meet the trigger conditions will be continue to be stored on the blockchain.
步骤二、进入最新轮验证的事务,会扩散到每一个验证节点,与普通区块链交易或事务一样,验证节点首先进行签名验证,确保事务的有效性;验证通过的事务会进入待共识集合,等大多数验证节点达成共识后,事务会成功执行并通知用户。各节点执行智能合约是相互独立的,当各节点执行智能合约完毕时,将彼此验证结果是否一致,验证通过后,将结果返回至用户。Step 2. Transactions that enter the latest round of verification will spread to each verification node. Like ordinary blockchain transactions or transactions, the verification node first performs signature verification to ensure the validity of the transaction; the transaction that passes the verification will enter the waiting consensus set , after the majority of verification nodes reach a consensus, the transaction will be successfully executed and the user will be notified. The execution of the smart contract by each node is independent of each other. When the execution of the smart contract by each node is completed, they will verify whether the results are consistent with each other. After the verification is passed, the result will be returned to the user.
步骤三、事务执行成功后,智能合约的状态机会判断所属合约的状态,当合约包括的所有事务都顺序执行完后,状态机会将合约的状态标记为完成,并从最新的区块中移除该合约;反之将标记为进行中,继续保存在最新的区块中等待下一轮处理,直到处理完毕;整个事务和状态的处理都由区块链底层内置的智能合约系统自动完成,全程透明、不可攥改。Step 3. After the transaction is successfully executed, the state machine of the smart contract judges the state of the contract. When all the transactions included in the contract are executed sequentially, the state machine marks the state of the contract as completed and removes it from the latest block. The contract; otherwise, it will be marked as in progress, and will continue to be stored in the latest block for the next round of processing until the processing is completed; the processing of the entire transaction and state is automatically completed by the smart contract system built into the bottom layer of the blockchain, and the whole process is transparent , can not be changed.
进一步的,为进一步提高安全性,调用请求还可以为非对称加密或对称加密等加密后的调用请求,具体的签名算法在此也不做限定。Furthermore, in order to further improve security, the call request may also be an encrypted call request such as asymmetric encryption or symmetric encryption, and the specific signature algorithm is not limited here.
综上所述,相比于现有的电子合约,通过基于共识算法的区块链技术实现智能合约的建立,因而能够保证智能合约的安全性以及准确性;且,区块链技术无需签订双方互相信任即可签订相应的电子合约,因而还能提升智能合约的建立方法的可适用性。To sum up, compared with the existing electronic contracts, the establishment of smart contracts is realized through blockchain technology based on consensus algorithms, which can ensure the security and accuracy of smart contracts; moreover, blockchain technology does not require both parties to sign Mutual trust can sign the corresponding electronic contract, which can also improve the applicability of the establishment method of the smart contract.
但是,进一步的,从对智能合约的调用角度而言,由于在智能合约中的各参与者权力均等,任何处于网络中的节点均可以调用智能合约中的事务,而不受到任何限制。例如,公有链中不存在任何的权限设置概念;而在联盟链中的只能根据合约的参与者是否加入合约来限定权限。举个例子,在“银联、万达、京东、招商银行”的四方联盟链中,如果某个的合约的参与者只有银联、万达、京东,那么在该智能合约初始化或者说部署该智能合约时,该智能合约就会将银联、万达、京东的三方的公钥进行绑定,意味着只有这三方可以使用该智能合约,招商银行不能使用该合约。但是,在该合约中,存在的多个事务还是可以给每个参与者随意调用或者运行的。2016年,以太坊众筹项目DAO的智能合约中就出现了此类问题,由于编写的智能合约任何人都可以调用其中的所有方法,就有黑客找到了合约的漏洞,直接导致了以太坊的硬分叉。However, further, from the perspective of invoking smart contracts, since all participants in the smart contract have equal rights, any node in the network can call the transactions in the smart contract without any restrictions. For example, there is no concept of authority setting in the public chain; while in the alliance chain, the authority can only be limited according to whether the participants of the contract join the contract. For example, in the four-party alliance chain of "UnionPay, Wanda, JD.com, and China Merchants Bank", if the only participants in a certain contract are UnionPay, Wanda, and JD.com, then when the smart contract is initialized or deployed, The smart contract will bind the public keys of UnionPay, Wanda, and JD.com, which means that only these three parties can use the smart contract, and China Merchants Bank cannot use the contract. However, in this contract, there are multiple transactions that can be called or run by each participant at will. In 2016, such problems occurred in the smart contract of the Ethereum crowdfunding project DAO. Since anyone who wrote the smart contract can call all the methods in it, some hackers found a loophole in the contract, which directly led to the collapse of Ethereum. hard fork.
因此,需要针对各参与者在合约中的事务确定权限,使得各参与者各司其职,保证各方的利益。如图4所示,本申请实施例提供一种智能合约的交易方法,适用于部署有智能合约的多方参与者的区块链系统,包括:Therefore, it is necessary to determine the authority of each participant in the transaction in the contract, so that each participant can perform their duties and ensure the interests of all parties. As shown in Figure 4, the embodiment of the present application provides a smart contract transaction method, which is suitable for a multi-party blockchain system with smart contracts deployed, including:
步骤401:第一参与者向第二参与者发送调用智能合约的事务1的调用请求;Step 401: the first participant sends a call request to call transaction 1 of the smart contract to the second participant;
所述调用请求中还可以包括所述第一参与者根据第一参与者的私钥对事务1生成的签名;The invocation request may also include the signature generated by the first participant for transaction 1 according to the private key of the first participant;
步骤402:第二参与者接收到所述调用请求后,根据所述智能合约中的事务权限映射关系,确认所述第一参与者与事务1的事务权限映射关系是否存在;若是,则执行步骤403;若否,则执行步骤405;Step 402: After receiving the call request, the second participant confirms whether the transaction authority mapping relationship between the first participant and transaction 1 exists according to the transaction authority mapping relationship in the smart contract; if so, execute the step 403; if not, execute step 405;
具体的,第二参与者可以先从事务权限映射关系中提取可以调用事务1的所有公钥{PK1,PK2,PK3},进而确认所述第一参与者与事务1的事务权限映射关系是否存在。其中,所述事务权限映射关系可以为智能合约在部署之前就确定的,也可以为智能合约在执行过程中更新的,在此不做限定,具体生成方法在后面进行详细描述。所述映射关系的示意图可以如图3所示,事务1可以被参与者1,参与者2和参与者3调用。事务2可以被参与者1和参与者4调用,事务n可以被参与者n调用。Specifically, the second participant can first extract all public keys {PK1 , PK2 , PK3 } that can call transaction 1 from the transaction permission mapping relationship, and then confirm the transaction permission mapping between the first participant and transaction 1 Whether the relationship exists. Wherein, the transaction authority mapping relationship can be determined before the smart contract is deployed, or can be updated during the execution of the smart contract, which is not limited here, and the specific generation method will be described in detail later. A schematic diagram of the mapping relationship can be shown in FIG. 3 , and transaction 1 can be invoked by participant 1 , participant 2 and participant 3 . Transaction 2 can be invoked by participant 1 and participant 4, and transaction n can be invoked by participant n.
步骤403:第二参与者确认所述调用请求验证通过,并根据第二参与者的私钥对确认响应生成签名,向全网扩散,广播给第一参与者和其他第二参与者;Step 403: The second participant confirms that the call request is verified, and generates a signature for the confirmation response according to the private key of the second participant, spreads it to the whole network, and broadcasts it to the first participant and other second participants;
具体的,第二参与者从事务权限映射关系中提取可以调用事务1的所有公钥{PK1,PK2,PK3},对所述调用请求的签名进行验证。Specifically, the second participant extracts all public keys {PK1 , PK2 , PK3 } that can invoke transaction 1 from the transaction authority mapping relationship, and verifies the signature of the invocation request.
步骤404:第一参与者若确认接收到的确认响应满足共识条件,则调用事务1;Step 404: If the first participant confirms that the received confirmation response meets the consensus condition, call transaction 1;
步骤405:确定所述调用请求为非法调用,具体的,可以忽略所述调用请求,或者智能合约拒绝所述调用请求。Step 405: Determine that the call request is an illegal call, specifically, the call request can be ignored, or the smart contract rejects the call request.
通过该方法,可以实现对区块链中的每个参与者执行智能合约中的事务时设立权限,有效的保证了个参与者在业务中的利益,进而防止各参与者在执行该智能合约时可能导致的安全隐患,提高数据的保密性,能够保证智能合约中各参与者的安全性以及交易的准确性,提升了智能合约的可适用性。Through this method, it is possible to establish authority for each participant in the blockchain when executing the transaction in the smart contract, effectively guaranteeing the interests of each participant in the business, and preventing each participant from executing the smart contract when executing the smart contract. The potential safety hazards that may be caused can improve the confidentiality of data, ensure the security of each participant in the smart contract and the accuracy of the transaction, and improve the applicability of the smart contract.
针对第二参与者向第一参与者发送智能合约的更新请求的应用场景,所述方法还包括:For the application scenario where the second participant sends an update request of the smart contract to the first participant, the method further includes:
步骤一、所述第一参与者接收所述第二参与者发送的基于所述第二智能合约的更新请求;所述更新请求中包括所述第二参与者的公钥和第三智能合约;所述第三智能合约为所述第二参与者基于事务权限映射关系更新所述第二智能合约后的智能合约;所述事务权限映射关系包括所述第二参与者请求更新的事务权限与所述第二参与者的公钥之间的映射关系;Step 1. The first participant receives an update request based on the second smart contract sent by the second participant; the update request includes the public key of the second participant and the third smart contract; The third smart contract is a smart contract after the second participant updates the second smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the transaction authority requested by the second participant to update and the Describe the mapping relationship between the public keys of the second participant;
步骤二、所述第一参与者若确认接收到的确认匹配响应满足共识条件,则将所述第三智能合约更新为所述区块链系统的智能合约;所述确认匹配响应为所述第一参与者确认基于所述更新请求生成的第三智能合约与所述更新请求中的第三智能合约匹配时发送的。Step 2. If the first participant confirms that the received confirmation matching response satisfies the consensus condition, then update the third smart contract to the smart contract of the blockchain system; the confirmation matching response is the first It is sent when a participant confirms that the third smart contract generated based on the update request matches the third smart contract in the update request.
通过该方法,可以实现对区块链中的每个参与者执行智能合约中的事务时权限的修改都是基于各参与方的同意后更新的,有效的保证了个参与者在业务中的利益,提升了智能合约的可适用性。Through this method, it can be realized that when each participant in the blockchain executes the transactions in the smart contract, the authority modification is updated based on the consent of each participant, which effectively guarantees the interests of each participant in the business , which improves the applicability of smart contracts.
如图5所示,本申请实施例提供一种智能合约的建立方法,适用于部署有第一智能合约的多方参与者的区块链系统;所述方法包括:As shown in Figure 5, the embodiment of the present application provides a method for establishing a smart contract, which is applicable to a multi-party blockchain system with a first smart contract deployed; the method includes:
步骤501:第二参与者接收第一参与者发送基于所述第一智能合约的更新请求;Step 501: The second participant receives an update request based on the first smart contract sent by the first participant;
其中,所述第一参与者与所述第二参与者为所述第一智能合约的任一参与者;所述更新请求中包括所述第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;Wherein, the first participant and the second participant are any participant of the first smart contract; the update request includes the public key of the first participant and the second smart contract; The second smart contract is the smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the transaction authority requested by the first participant to update and the The mapping relationship between the public keys of the first participants;
步骤502:所述第二参与者确认所述事务权限映射关系满足更新规则时,基于所述更新请求生成第二智能合约;Step 502: When the second participant confirms that the transaction authority mapping relationship satisfies the update rule, generate a second smart contract based on the update request;
步骤503:所述第二参与者确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时,向所述区块链的参与者发送确认匹配响应;Step 503: when the second participant confirms that the second smart contract generated based on the update request matches the second smart contract in the update request, send a confirmation matching response to the participants of the blockchain;
步骤504:所述第二参与者若确认接收到的所述确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约。Step 504: If the second participant confirms that the received confirmation matching response satisfies the consensus condition, update the second smart contract to the smart contract of the blockchain system.
如图4和图5中的实施例为在智能合约已部署的情况下更新智能合约的场景,在该场景中,各参与方已设定好每个参与方的事务权限关系。在实际应用中,可能还会涉及到参与方的事务权限需要变更的情况,因此,本申请实施例提供一种事务权限变更的方法,如图6所示,适用于部署有第一智能合约的多方参与者的区块链系统;包括:The embodiments shown in Fig. 4 and Fig. 5 are the scenario of updating the smart contract when the smart contract has been deployed. In this scenario, each participant has already set the transaction authority relationship of each participant. In practical applications, it may also involve the situation that the transaction authority of the participant needs to be changed. Therefore, the embodiment of the present application provides a method for changing the transaction authority, as shown in Figure 6, which is applicable to the deployment of the first smart contract. A blockchain system with multiple participants; including:
步骤601:第一参与者向第二参与者发送基于所述第一智能合约的更新请求;Step 601: the first participant sends an update request based on the first smart contract to the second participant;
其中,所述更新请求中包括所述第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;所述第一参与者与所述第二参与者为所述智能合约的任一参与者。Wherein, the update request includes the public key of the first participant and the second smart contract; the second smart contract is the first smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship Smart contract; the transaction authority mapping relationship includes the mapping relationship between the transaction authority requested by the first participant to update and the public key of the first participant; the first participant and the second participant Any participant of the smart contract.
一种可能的应用场景,可以为在第一智能合约部署完成后,通过第一参与者生成第二智能合约的方式,对第一智能合约进行更新,以增加或删除第一参与者与各事务间的映射关系。A possible application scenario can be to update the first smart contract by generating the second smart contract through the first participant after the deployment of the first smart contract to add or delete the first participant and each transaction mapping relationship between them.
一种可能的实现方式,所述第一参与者为部署第一智能合约后新加入所述区块链系统的参与者;所述第一参与者向第二参与者发送基于所述第一智能合约的更新请求之前,还包括:所述第一参与者获取所述第一参与者的密钥对,所述密钥对包括公钥和私钥。In a possible implementation, the first participant is a participant who newly joins the blockchain system after deploying the first smart contract; the first participant sends the second participant based on the first smart contract Before the contract update request, it further includes: the first participant acquires a key pair of the first participant, and the key pair includes a public key and a private key.
具体的,所述区块链系统或分布式账本网络内加入新的参与者时,新的参与者从本地会自动生成代表其身份的外部账户,即公私钥对(PKnew,SKnew)。Specifically, when a new participant is added to the blockchain system or distributed ledger network, the new participant will automatically generate an external account representing its identity locally, that is, a public-private key pair (PKnew , SKnew ).
一种可能的实现方式,所述第一参与者可以为部署第一智能合约时的参与者,也可以为新加入所述区块链系统的参与者;所述第一参与者向第二参与者发送基于所述第一智能合约的更新请求之前,还包括:所述第一参与者确认待变更的事务权限并生成所述事务权限映射关系。In a possible implementation, the first participant can be a participant when deploying the first smart contract, or a participant who newly joins the blockchain system; Before the party sends the update request based on the first smart contract, it also includes: the first participant confirms the transaction authority to be changed and generates the transaction authority mapping relationship.
在一种具体的实施过程中,第一参与者向第二参与者发送的第二智能合约可以为第一参与者根据事务权限映射关系更新所述第一智能合约后的智能合约的地址;所述地址可以为hash值;第一参与者的公钥可以为hash值,也可以为其他标识方式,在此不做限定。In a specific implementation process, the second smart contract sent by the first participant to the second participant may be the address of the smart contract after the first participant updates the first smart contract according to the transaction authority mapping relationship; The above address can be a hash value; the public key of the first participant can be a hash value, or other identification methods, which are not limited here.
步骤602:所述第二参与者接收所述第一智能合约的更新请求,确认所述事务权限映射关系满足更新规则时,基于所述更新请求生成第二智能合约;Step 602: The second participant receives the update request of the first smart contract, and generates a second smart contract based on the update request when confirming that the transaction authority mapping relationship satisfies the update rule;
步骤603:所述第二参与者确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时,向所述区块链的参与者发送确认匹配响应。Step 603: When the second participant confirms that the second smart contract generated based on the update request matches the second smart contract in the update request, send a confirmation matching response to the participants of the blockchain.
具体的,第二参与者可以根据所述更新请求生成的第二智能合约的地址(hash值)与所述更新请求中的第二智能合约的地址进行匹配,若匹配成功,则确认第二智能合约的合法性。Specifically, the second participant can match the address (hash value) of the second smart contract generated according to the update request with the address of the second smart contract in the update request, and if the match is successful, confirm the second smart contract Legality of the contract.
步骤604:所述第一参与者和所述第二参与者若确认接收到的确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约。Step 604: If the first participant and the second participant confirm that the received confirmation matching response satisfies the consensus condition, update the second smart contract to the smart contract of the blockchain system.
其中,所述确认匹配响应为所述第二参与者确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时发送的。Wherein, the confirmation matching response is sent when the second participant confirms that the second smart contract generated based on the update request matches the second smart contract in the update request.
通过设置每一个参与者只能调用其中的某几个事务权限,以提高各参与者执行该智能合约时的安全性。并且通过上述方法,可以使得智能合约的更新是基于各参与者的认可后更新的,进而保证了智能合约的安全性。By setting that each participant can only invoke some of the transaction permissions, the security of each participant when executing the smart contract is improved. And through the above method, the update of the smart contract can be updated based on the approval of each participant, thereby ensuring the security of the smart contract.
在智能合约的部署过程中,第一参与者将智能合约中的事务与第一参与者的公钥之间建立映射关系,并通过共识算法,使得参与部署智能合约的第二参与者对所述映射关系进行验证,若验证成功,则存储于各参与者的账本中,保证不可篡改。在智能合约部署完成后,建立智能合约中的所有事务与第一参与者和第二参与者的映射关系。During the deployment of the smart contract, the first participant establishes a mapping relationship between the transactions in the smart contract and the public key of the first participant, and through the consensus algorithm, the second participant participating in the deployment of the smart contract has The mapping relationship is verified. If the verification is successful, it will be stored in the ledger of each participant to ensure that it cannot be tampered with. After the deployment of the smart contract is completed, the mapping relationship between all transactions in the smart contract and the first participant and the second participant is established.
具体实施过程中,可以包括以下步骤:The specific implementation process may include the following steps:
步骤一、第一参与者向第二参与者发送基于所述第一参与者的事务权限映射关系的更新请求;所述更新请求中包括所述第一参与者的公钥和第一参与者的事务权限;Step 1. The first participant sends to the second participant an update request based on the transaction authority mapping relationship of the first participant; the update request includes the first participant's public key and the first participant's transaction authority;
其中,所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;Wherein, the transaction authority mapping relationship includes the mapping relationship between the transaction authority requested by the first participant to be updated and the public key of the first participant;
步骤二、所述第一参与者若确认接收到的确认匹配响应满足共识条件,则将所述第一参与者的映射关系加入所述区块链系统的智能合约。Step 2: If the first participant confirms that the received confirmation matching response satisfies the consensus condition, then add the mapping relationship of the first participant to the smart contract of the blockchain system.
其中,所述确认匹配响应为所述第二参与者确认所述第一参与者拥有所述与所述更新请求中的事务权限时发送的。Wherein, the confirmation matching response is sent when the second participant confirms that the first participant has the transaction authority related to the update request.
本申请实施例仅通过对事务权限映射关系的更新,实现了在智能合约的部署过程中,快速的完成对各参与者的事务权限的设置,提高了智能合约的适用度,有效的提高了智能合约的安全性。In the embodiment of the present application, only by updating the transaction authority mapping relationship, the rapid completion of the setting of the transaction authority of each participant in the deployment process of the smart contract has improved the applicability of the smart contract and effectively improved the smart contract. Contract security.
为提高安全性,所述事务权限变更请求还可以包括第一参与者的签名,所述第一参与者的签名为第一参与者根据事务权限变更请求以及第一参与者的私钥生成的;第二参与者可以根据第一参与者的签名,验证所述第一参与者的合法性;若验证成功,则确认所述事务权限变更请求为第一参与者发送的,再对所述事务权限变更请求进行共识算法的验证。所述共识算法可以为平台预先约定的,也可以为各参与者共同约定的,在此不做限定。To improve security, the transaction permission change request may also include the signature of the first participant, and the first participant's signature is generated by the first participant according to the transaction permission change request and the private key of the first participant; The second participant can verify the legitimacy of the first participant according to the signature of the first participant; The change request is verified by the consensus algorithm. The consensus algorithm may be pre-agreed by the platform, or jointly agreed by all participants, which is not limited here.
在一个具体的实施例中,智能合约的第一参与者1为境外汇出机构,第二参与者2为境内转接清算机构和第二参与者3汇入机构3个参与者。以智能合约为跨境汇款查询业务为例,智能合约的建立过程包括:In a specific embodiment, the first participant 1 of the smart contract is an overseas remittance institution, the second participant 2 is a domestic transfer clearing institution and the second participant 3 is a remittance institution. Taking smart contracts as an example of cross-border remittance inquiry business, the establishment process of smart contracts includes:
步骤一、建立各参与者与事务的事务权限映射关系,生成智能合约。Step 1. Establish the transaction authority mapping relationship between each participant and the transaction, and generate a smart contract.
各参与者的所要调用的事务包括5种,即提交汇款、汇款转接、汇款入账、汇款清算、汇款查询。对这5种事务的参与者建立事务权限映射关系,即第一参与者1只能调用提交汇款和汇款查询两种事务,第二参与者2只能调用汇款转接、汇款清算和汇款查询的三种事务,第二参与者3只能调用汇款入账和汇款查询两种事务。There are 5 types of transactions to be invoked by each participant, namely remittance submission, remittance transfer, remittance entry, remittance clearing, and remittance query. Establish a transaction authority mapping relationship for the participants of these five types of transactions, that is, the first participant 1 can only call the two transactions of submitting remittance and remittance query, and the second participant 2 can only call remittance transfer, remittance settlement and remittance query Three kinds of transactions, the second participant 3 can only call two kinds of transactions, remittance entry and remittance query.
在具体实施过程中,所述事务权限映射关系中,包括“提交汇款”事务和第二参与者3的公钥绑定;“汇款转接”事务和第二参与者2的公钥绑定;“汇款入账”事务和第二参与者3公钥绑定;“汇款清算”事务和第二参与者2的公钥绑定;“汇款查询”事务是开放的,任何参与者均可调用。In the specific implementation process, the transaction authority mapping relationship includes the binding of the "submit remittance" transaction with the public key of the second participant 3; the binding of the "remittance transfer" transaction with the public key of the second participant 2; The "remittance into account" transaction is bound to the public key of the second participant 3; the "remittance settlement" transaction is bound to the public key of the second participant 2; the "remittance query" transaction is open and can be invoked by any participant.
步骤二、将所述智能合约部署到各节点。Step 2. Deploy the smart contract to each node.
通过上述方法,可以使得不同功能的参与者仅能调用对应的事务,保证了各参与者在调用该智能合约时,各司其职,有效的提高了智能合约的安全性和适应性。Through the above method, participants with different functions can only call corresponding transactions, which ensures that each participant performs their duties when calling the smart contract, and effectively improves the security and adaptability of the smart contract.
所述智能合约的建立过程还可以包括新的参与者加入区块链的方法,包括:The establishment process of the smart contract may also include a method for new participants to join the block chain, including:
步骤一、第一参与者2向第二参与者1-3和第一参与者1发送基于第一智能合约的更新请求;上述第一参与者2为新的参与者,所述更新请求中包括第一参与者2的公钥和第二智能合约;Step 1. The first participant 2 sends an update request based on the first smart contract to the second participant 1-3 and the first participant 1; the above-mentioned first participant 2 is a new participant, and the update request includes The public key of the first participant 2 and the second smart contract;
其中,所述第二智能合约为第一参与者2基于事务权限映射关系更新第一智能合约后的智能合约;所述事务权限映射关系包括第一参与者2请求更新的事务权限与第一参与者2的公钥之间的映射关系;Wherein, the second smart contract is a smart contract after the first participant 2 updates the first smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the transaction authority requested by the first participant 2 to update and the first participant The mapping relationship between public keys of party 2;
步骤二、所述第一参与者若确认接收到的确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约;所述确认匹配响应为所述第二参与者确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时发送的。Step 2. If the first participant confirms that the received confirmation matching response satisfies the consensus condition, then update the second smart contract to the smart contract of the blockchain system; the confirmation matching response is the first It is sent when the two participants confirm that the second smart contract generated based on the update request matches the second smart contract in the update request.
每个参与者根据更新的第二智能合约,实现了对第一参与者2的事务权限的变更,第一参与者2获得相应权限。Each participant changes the transaction authority of the first participant 2 according to the updated second smart contract, and the first participant 2 obtains the corresponding authority.
以智能合约为跨境汇款查询业务为例,智能合约的执行过程包括:Taking the smart contract as an example of cross-border remittance inquiry business, the execution process of the smart contract includes:
步骤一、第一参与者1发起“提交汇款”事务的调用请求,所述调用请求中包括第一参与者1根据第一参与者1的私钥对所述提交汇款”事务进行签名,该请求会广播至网络内各节点;Step 1. The first participant 1 initiates a call request for the "submit remittance" transaction. The call request includes that the first participant 1 signs the "submit remittance" transaction according to the private key of the first participant 1. The request It will be broadcast to each node in the network;
步骤二、智能合约从映射关系中提取出“提交汇款”事务所对应的公钥对所述调用请求中的签名进行验证,验证通过后,第一参与者1上传的数据存入账本。Step 2: The smart contract extracts the public key corresponding to the "submit remittance" office from the mapping relationship to verify the signature in the call request. After the verification is passed, the data uploaded by the first participant 1 is stored in the ledger.
以智能合约为跨境汇款转接业务为例,智能合约的执行过程包括:Taking the smart contract as an example of cross-border remittance transfer business, the execution process of the smart contract includes:
步骤一、第一参与者1发起“汇款转接”事务的调用请求,所述调用请求中包括第一参与者1根据第一参与者1的私钥对所述“汇款转接”事务进行签名,该请求会广播至网络内各节点;Step 1. The first participant 1 initiates a call request for the "remittance transfer" transaction, and the call request includes that the first participant 1 signs the "remittance transfer" transaction according to the private key of the first participant 1 , the request will be broadcast to each node in the network;
步骤二、节点服务器从映射关系中提取出“汇款转接”事务所对应的公钥对所述调用请求中的签名进行验证,“汇款转接”事务权限映射关系中不存在第一参与者1的公钥,则所述节点服务器确认验证签名,返回错误。Step 2. The node server extracts the public key corresponding to the "remittance transfer" transaction from the mapping relationship to verify the signature in the call request. There is no first participant 1 in the "remittance transfer" transaction authority mapping relationship public key, the node server confirms the verification signature and returns an error.
如图7所示,本申请实施例提供一种智能合约的建立装置,适用于部署有第一智能合约的多方参与者的区块链系统;所述装置适用于第一参与者,包括:As shown in Figure 7, the embodiment of the present application provides a device for establishing a smart contract, which is suitable for a multi-participant blockchain system with a first smart contract deployed; the device is suitable for the first participant, including:
发送模块701,用于向第二参与者发送基于所述第一智能合约的更新请求;所述更新请求中包括第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;所述第一参与者与所述第二参与者为所述智能合约的任一参与者;The sending module 701 is configured to send an update request based on the first smart contract to the second participant; the update request includes the public key of the first participant and the second smart contract; the second smart contract is the The smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the transaction authority requested by the first participant to update and the public key of the first participant The mapping relationship between; the first participant and the second participant are any participant of the smart contract;
确定模块702,用于若确认接收到的确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约;所述确认匹配响应为所述第二参与者确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时发送的。The determining module 702 is configured to update the second smart contract to the smart contract of the blockchain system if the received confirmation matching response meets the consensus condition; the confirmation matching response is the second participant's It is sent when confirming that the second smart contract generated based on the update request matches the second smart contract in the update request.
一种可能的实现方式,所述第一参与者为新加入所述区块链系统的参与者;所述装置还包括:In a possible implementation, the first participant is a participant who newly joins the blockchain system; the device also includes:
获取模块,用于所述第一参与者获取所述第一参与者的密钥对,所述密钥对包括公钥和私钥。An obtaining module, configured for the first participant to obtain a key pair of the first participant, where the key pair includes a public key and a private key.
一种可能的实现方式,确定模块701,还用于确认待变更的事务权限并生成所述事务权限映射关系。A possible implementation manner, the determination module 701 is further configured to confirm the transaction authority to be changed and generate the transaction authority mapping relationship.
一种可能的实现方式,所述获取模块,还用于接收所述第二参与者发送的基于所述第二智能合约的更新请求;所述更新请求中包括所述第二参与者的公钥和第三智能合约;所述第三智能合约为所述第二参与者基于事务权限映射关系更新所述第二智能合约后的智能合约;所述事务权限映射关系包括所述第二参与者请求更新的事务权限与所述第二参与者的公钥之间的映射关系;In a possible implementation, the obtaining module is further configured to receive an update request based on the second smart contract sent by the second participant; the update request includes the public key of the second participant and a third smart contract; the third smart contract is the smart contract after the second participant updates the second smart contract based on the transaction authority mapping relationship; the transaction authority mapping relationship includes the second participant request The mapping relationship between the updated transaction authority and the public key of the second participant;
确认模块702,还用于若确认接收到的确认匹配响应满足共识条件,则将所述第三智能合约更新为所述区块链系统的智能合约;所述确认匹配响应为所述第一参与者确认基于所述更新请求生成的第三智能合约与所述更新请求中的第三智能合约匹配时发送的。The confirmation module 702 is also used to update the third smart contract to the smart contract of the blockchain system if the received confirmation matching response meets the consensus condition; the confirmation matching response is the first participation sent when the third smart contract generated based on the update request matches the third smart contract in the update request.
如图8所示,本申请实施例提供一种智能合约的建立装置,适用于部署有第一智能合约的多方参与者的区块链系统;所述装置适用于第二参与者,包括:As shown in Figure 8, the embodiment of the present application provides a device for establishing a smart contract, which is suitable for a multi-participant blockchain system deployed with a first smart contract; the device is suitable for a second participant, including:
获取模块801,用于接收第一参与者发送基于所述第一智能合约的更新请求;所述第一参与者与所述第二参与者为所述第一智能合约的任一参与者;所述更新请求中包括所述第一参与者的公钥和第二智能合约;所述第二智能合约为所述第一参与者基于事务权限映射关系更新所述第一智能合约后的智能合约;所述事务权限映射关系包括所述第一参与者请求更新的事务权限与所述第一参与者的公钥之间的映射关系;The obtaining module 801 is configured to receive an update request based on the first smart contract sent by the first participant; the first participant and the second participant are any participant of the first smart contract; The update request includes the public key of the first participant and the second smart contract; the second smart contract is the smart contract after the first participant updates the first smart contract based on the transaction authority mapping relationship; The transaction authority mapping relationship includes a mapping relationship between the transaction authority requested by the first participant to be updated and the public key of the first participant;
确认模块802,用于确认所述事务权限映射关系满足更新规则时,基于所述更新请求生成第二智能合约;确认基于所述更新请求生成的第二智能合约与所述更新请求中的第二智能合约匹配时,向所述区块链的参与者发送确认匹配响应;若确认接收到的所述确认匹配响应满足共识条件,则将所述第二智能合约更新为所述区块链系统的智能合约。Confirmation module 802, configured to confirm that the transaction permission mapping relationship satisfies the update rule, generate a second smart contract based on the update request; confirm that the second smart contract generated based on the update request is consistent with the second smart contract in the update request When the smart contract is matched, send a confirmation matching response to the participants of the block chain; if it is confirmed that the received confirmation matching response meets the consensus condition, then update the second smart contract to the block chain system's smart contract.
需要说明的是,本发明实施例中所述的智能合约的建立装置可为一集成装置集成在相应的电子设备中,如PC、平板电脑或者手机等中,也可为一独立设备设置在相应的电子设备之外,本发明实施例对此不作任何限定。It should be noted that the device for establishing a smart contract described in the embodiment of the present invention can be an integrated device integrated in a corresponding electronic device, such as a PC, a tablet computer or a mobile phone, etc., or it can be an independent device installed in a corresponding Except for the electronic equipment, this embodiment of the present invention does not make any limitation thereto.
本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行如上述实施例中所述的任一方法。An embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make the computer execute any one of the above-mentioned embodiments. method.
所述计算机存储介质可以是计算机能够存取的任何可用介质或数据存储设备,包括但不限于磁性存储器(例如软盘、硬盘、磁带、磁光盘(MO)等)、光学存储器(例如CD、DVD、BD、HVD等)、以及半导体存储器(例如ROM、EPROM、EEPROM、非易失性存储器(NAND FLASH)、固态硬盘(SSD))等。The computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor memory (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state disk (SSD)) and the like.
本申请实施例提供一种智能合约的计算设备,包括:An embodiment of the present application provides a smart contract computing device, including:
存储器,用于存储程序指令;memory for storing program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行如上述实施例中所述的任一方法。The processor is configured to call the program instructions stored in the memory, and execute any method as described in the above-mentioned embodiments according to the obtained program.
本领域技术人员应明白,本发明的实施例可提供为方法、装置(设备)、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, devices (devices), or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本发明是参照根据本发明实施例的方法、装置(设备)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While preferred embodiments of the invention have been described, additional changes and modifications to these embodiments can be made by those skilled in the art once the basic inventive concept is appreciated. Therefore, it is intended that the appended claims be construed to cover the preferred embodiment as well as all changes and modifications which fall within the scope of the invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810700792.1ACN109003185B (en) | 2018-06-29 | 2018-06-29 | Intelligent contract establishing method and device, computing equipment and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810700792.1ACN109003185B (en) | 2018-06-29 | 2018-06-29 | Intelligent contract establishing method and device, computing equipment and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN109003185Atrue CN109003185A (en) | 2018-12-14 |
| CN109003185B CN109003185B (en) | 2022-03-22 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810700792.1AActiveCN109003185B (en) | 2018-06-29 | 2018-06-29 | Intelligent contract establishing method and device, computing equipment and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN109003185B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109885612A (en)* | 2018-12-26 | 2019-06-14 | 联动优势科技有限公司 | The synchronization take-effective method and device of block chain intelligence contract |
| CN109934593A (en)* | 2019-03-26 | 2019-06-25 | 众安信息技术服务有限公司 | For realizing the design method and equipment of the block catenary system for supporting multi-signature |
| CN110083604A (en)* | 2019-04-17 | 2019-08-02 | 上海沄界信息科技有限公司 | A kind of data really weigh method and device |
| CN111080292A (en)* | 2019-11-25 | 2020-04-28 | 支付宝(杭州)信息技术有限公司 | Method and device for acquiring block chain transaction signature data |
| CN111445235A (en)* | 2019-01-16 | 2020-07-24 | 延安医链区块链科技有限公司 | Key management method based on medical block chain |
| CN111445234A (en)* | 2019-01-16 | 2020-07-24 | 延安医链区块链科技有限公司 | Intelligent contract program updating system and method based on medical block chain |
| CN111626722A (en)* | 2020-06-01 | 2020-09-04 | 中国联合网络通信集团有限公司 | Cross-border payment method and device |
| CN112084256A (en)* | 2019-06-12 | 2020-12-15 | 国际商业机器公司 | Aggregated machine learning validation for databases |
| CN117172913A (en)* | 2023-10-12 | 2023-12-05 | 广州保德来小额贷款有限公司 | Intelligent contract-based contract change procedure execution method and system |
| US11983608B2 (en) | 2019-06-12 | 2024-05-14 | International Business Machines Corporation | Efficient verification of machine learning applications |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105809062A (en)* | 2016-03-01 | 2016-07-27 | 布比(北京)网络技术有限公司 | Contract construction and execution methods and apparatuses |
| CN106534097A (en)* | 2016-10-27 | 2017-03-22 | 上海亿账通区块链科技有限公司 | Block chain trading based authority control method and system |
| CN106778329A (en)* | 2016-11-28 | 2017-05-31 | 中国银行股份有限公司 | A kind of block chain intelligence contract template dynamic updating method, apparatus and system |
| CN106778109A (en)* | 2016-11-24 | 2017-05-31 | 江苏通付盾科技有限公司 | A kind of certification authority evaluation method and device based on intelligent contract |
| CN107464148A (en)* | 2017-08-23 | 2017-12-12 | 众安信息技术服务有限公司 | A kind of intelligent contract upgrade method and system based on alliance's chain |
| CN107911373A (en)* | 2017-11-24 | 2018-04-13 | 中钞信用卡产业发展有限公司杭州区块链技术研究院 | A kind of block chain right management method and system |
| US20200151718A1 (en)* | 2018-11-27 | 2020-05-14 | Alibaba Group Holding Limited | System and method for improving security of smart contract on blockchain |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105809062A (en)* | 2016-03-01 | 2016-07-27 | 布比(北京)网络技术有限公司 | Contract construction and execution methods and apparatuses |
| CN106534097A (en)* | 2016-10-27 | 2017-03-22 | 上海亿账通区块链科技有限公司 | Block chain trading based authority control method and system |
| CN106778109A (en)* | 2016-11-24 | 2017-05-31 | 江苏通付盾科技有限公司 | A kind of certification authority evaluation method and device based on intelligent contract |
| CN106778329A (en)* | 2016-11-28 | 2017-05-31 | 中国银行股份有限公司 | A kind of block chain intelligence contract template dynamic updating method, apparatus and system |
| CN107464148A (en)* | 2017-08-23 | 2017-12-12 | 众安信息技术服务有限公司 | A kind of intelligent contract upgrade method and system based on alliance's chain |
| CN107911373A (en)* | 2017-11-24 | 2018-04-13 | 中钞信用卡产业发展有限公司杭州区块链技术研究院 | A kind of block chain right management method and system |
| US20200151718A1 (en)* | 2018-11-27 | 2020-05-14 | Alibaba Group Holding Limited | System and method for improving security of smart contract on blockchain |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109885612A (en)* | 2018-12-26 | 2019-06-14 | 联动优势科技有限公司 | The synchronization take-effective method and device of block chain intelligence contract |
| CN109885612B (en)* | 2018-12-26 | 2021-04-20 | 联动优势科技有限公司 | Synchronous validation method and device for intelligent contracts of block chains |
| CN111445235A (en)* | 2019-01-16 | 2020-07-24 | 延安医链区块链科技有限公司 | Key management method based on medical block chain |
| CN111445234A (en)* | 2019-01-16 | 2020-07-24 | 延安医链区块链科技有限公司 | Intelligent contract program updating system and method based on medical block chain |
| CN109934593A (en)* | 2019-03-26 | 2019-06-25 | 众安信息技术服务有限公司 | For realizing the design method and equipment of the block catenary system for supporting multi-signature |
| CN109934593B (en)* | 2019-03-26 | 2023-07-04 | 众安信息技术服务有限公司 | Design method and device for realizing block chain system supporting multiple signatures |
| CN110083604A (en)* | 2019-04-17 | 2019-08-02 | 上海沄界信息科技有限公司 | A kind of data really weigh method and device |
| US11983608B2 (en) | 2019-06-12 | 2024-05-14 | International Business Machines Corporation | Efficient verification of machine learning applications |
| CN112084256A (en)* | 2019-06-12 | 2020-12-15 | 国际商业机器公司 | Aggregated machine learning validation for databases |
| CN111080292B (en)* | 2019-11-25 | 2021-09-10 | 支付宝(杭州)信息技术有限公司 | Method and device for acquiring block chain transaction signature data |
| CN111080292A (en)* | 2019-11-25 | 2020-04-28 | 支付宝(杭州)信息技术有限公司 | Method and device for acquiring block chain transaction signature data |
| CN111626722A (en)* | 2020-06-01 | 2020-09-04 | 中国联合网络通信集团有限公司 | Cross-border payment method and device |
| CN111626722B (en)* | 2020-06-01 | 2023-11-24 | 中国联合网络通信集团有限公司 | A cross-border payment method and device |
| CN117172913A (en)* | 2023-10-12 | 2023-12-05 | 广州保德来小额贷款有限公司 | Intelligent contract-based contract change procedure execution method and system |
| CN117172913B (en)* | 2023-10-12 | 2024-02-13 | 广州保德来小额贷款有限公司 | Intelligent contract-based contract change procedure execution method and system |
| Publication number | Publication date |
|---|---|
| CN109003185B (en) | 2022-03-22 |
| Publication | Publication Date | Title |
|---|---|---|
| CN109003185B (en) | Intelligent contract establishing method and device, computing equipment and storage medium | |
| JP7627330B2 (en) | Blockchain for general computation | |
| JP7624278B2 (en) | Rapid decentralized consensus on the blockchain | |
| JP7697116B2 (en) | Secure Blockchain-Based Consensus | |
| CN109359957B (en) | A secure multi-party computing method and related device | |
| CN109981679B (en) | Method and apparatus for performing transactions in a blockchain network | |
| Islam et al. | A survey on consensus algorithms in blockchain-based applications: Architecture, taxonomy, and operational issues | |
| JP7319961B2 (en) | Computer-implemented systems and methods related to binary blockchains forming a pair of coupled blockchains | |
| CN107592293A (en) | The means of communication, digital certificate management method, device and electronic equipment between block chain node | |
| EP3586493A1 (en) | Method for mining a block in a decentralized blockchain consensus network | |
| US12418422B2 (en) | Blockchain transaction security | |
| US20230042916A1 (en) | System and method for secure peer-to-peer transmission of content in distributed ledger neworks | |
| CN111383114A (en) | Asset information management method and device based on block chain | |
| CN111402033A (en) | Asset information management method and device based on block chain | |
| CN110599331A (en) | Debt charging system, method, device and storage medium based on block chain | |
| CN116975901A (en) | Identity verification method, device, equipment, medium and product based on block chain | |
| CN113221191A (en) | Block chain-based data evidence storage method, device, equipment and storage medium | |
| CN109388923B (en) | A program execution method and device | |
| CN112801659A (en) | Privacy transaction processing method and device based on intelligent contract and storage medium | |
| CN113609519A (en) | Timing method, device and storage medium based on block chain | |
| CA3182400A1 (en) | Method, terminal, and coin register for transmitting electronic coin data sets | |
| CN114936853A (en) | Off-chain transaction protocol and transaction authentication method based on trusted execution environment | |
| CN117061089B (en) | Voting management method, device, equipment and storage medium | |
| KR102671062B1 (en) | Method and system for secret transaction | |
| US20240422011A1 (en) | Non-transferable token |
| 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |