WO2020119297A1 - Event processing method and apparatus based on blockchain, and electronic device - Google Patents

Event processing method and apparatus based on blockchain, and electronic device Download PDF

Info

Publication number
WO2020119297A1
WO2020119297A1 PCT/CN2019/113934 CN2019113934W WO2020119297A1 WO 2020119297 A1 WO2020119297 A1 WO 2020119297A1 CN 2019113934 W CN2019113934 W CN 2019113934W WO 2020119297 A1 WO2020119297 A1 WO 2020119297A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
blockchain
transactions
participant
event
Prior art date
Application number
PCT/CN2019/113934
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 WO2020119297A1 publication Critical patent/WO2020119297A1/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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Theoretical Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Disclosed are an event processing method and apparatus based on a blockchain, and an electronic device. When applied to a participant, the method comprises: adding, according to an event in which the participant participates, a corresponding alternative sub-transaction to a waiting queue maintained by the participant (102); generating a corresponding collected transaction on the basis of several alternative sub-transactions selected from the waiting queue (104); and submitting the collected transaction to a blockchain so that the alternative sub-transactions in the collected transaction are respectively processed (106).

Description

基于区块链的事件处理方法及装置、电子设备Block chain-based event processing method and device, and electronic equipment 技术领域Technical field
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种基于区块链的事件处理方法及装置、电子设备。One or more embodiments of this specification relate to the field of blockchain technology, and in particular, to a blockchain-based event processing method and device, and electronic equipment.
背景技术Background technique
在相关技术中,事件的参与方可以针对该事件生成相应的区块链交易,并通过向区块链中提交该区块链交易,使得该区块链交易可以被区块链节点所执行,从而完成该事件的实施。In the related art, the participants of the event can generate a corresponding blockchain transaction for the event and submit the blockchain transaction to the blockchain so that the blockchain transaction can be executed by the blockchain node. Thus completing the implementation of the incident.
发明内容Summary of the invention
有鉴于此,本说明书一个或多个实施例提供一种基于区块链的事件处理方法及装置、电子设备In view of this, one or more embodiments of this specification provide a blockchain-based event processing method and device, and electronic equipment
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:To achieve the above purpose, one or more embodiments of this specification provide technical solutions as follows:
根据本说明书一个或多个实施例的第一方面,提出了一种基于区块链的事件处理方法,应用于参与方,所述方法包括:According to a first aspect of one or more embodiments of this specification, a blockchain-based event processing method is proposed, which is applied to participants, and the method includes:
根据所述参与方所参与的事件,向所述参与方维护的等待队列中添加对应的备选子交易;Add corresponding candidate sub-transactions to the waiting queue maintained by the participant according to the events that the participant participates in;
根据从所述等待队列中选取的若干备选子交易,生成相应的集合交易;Generate a corresponding set transaction according to several candidate sub-transactions selected from the waiting queue;
将所述集合交易提交至区块链,使所述集合交易中的备选子交易被分别予以处理。Submit the aggregate transaction to the blockchain so that the alternative sub-transactions in the aggregate transaction are processed separately.
根据本说明书一个或多个实施例的第二方面,提出了一种基于区块链的事件处理方法,应用于区块链节点,所述方法包括:According to a second aspect of one or more embodiments of the present specification, a blockchain-based event processing method is proposed, which is applied to blockchain nodes. The method includes:
接收参与方提交至区块链的集合交易,所述集合交易中包含从所述参与方维护的等待队列中选取的若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;Receive a set transaction submitted by the participant to the blockchain, the set transaction includes a number of candidate sub-transactions selected from the waiting queue maintained by the participant, the candidate sub-transaction corresponds to the participation of the participant event;
执行所述集合交易,以对所述集合交易中的备选子交易分别予以处理。The aggregate transaction is executed to separately process the candidate sub-transactions in the aggregate transaction.
根据本说明书一个或多个实施例的第三方面,提出了一种基于区块链的事件处理装置,应用于参与方,所述装置包括:According to a third aspect of one or more embodiments of this specification, a blockchain-based event processing device is proposed, which is applied to participants and includes:
添加单元,根据所述参与方所参与的事件,向所述参与方维护的等待队列中添加对应的备选子交易;An adding unit, adding a corresponding alternative sub-transaction to the waiting queue maintained by the participant according to the events that the participant participates in;
生成单元,根据从所述等待队列中选取的若干备选子交易,生成相应的集合交易;The generating unit generates a corresponding set transaction based on several candidate sub-transactions selected from the waiting queue;
提交单元,将所述集合交易提交至区块链,使所述集合交易中的备选子交易被分别予以处理。The submission unit submits the aggregate transaction to the blockchain, so that the alternative sub-transactions in the aggregate transaction are processed separately.
根据本说明书一个或多个实施例的第四方面,提出了一种基于区块链的事件处理装置,应用于区块链节点,所述装置包括:According to a fourth aspect of one or more embodiments of this specification, a blockchain-based event processing device is proposed, which is applied to a blockchain node. The device includes:
接收单元,接收参与方提交至区块链的集合交易,所述集合交易中包含从所述参与方维护的等待队列中选取的若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;The receiving unit receives a set transaction submitted by the participant to the blockchain, and the set transaction includes several candidate sub-transactions selected from the waiting queue maintained by the participant, the candidate sub-transactions correspond to the participation Events in which the party is involved;
执行单元,执行所述集合交易,以对所述集合交易中的备选子交易分别予以处理。The execution unit executes the collective transaction to separately process the candidate sub-transactions in the collective transaction.
根据本说明书一个或多个实施例的第五方面,提出了一种电子设备,包括:According to a fifth aspect of one or more embodiments of this specification, an electronic device is provided, including:
处理器;processor;
用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
其中,所述处理器通过运行所述可执行指令以实现上述第一方面所述的方法。Wherein, the processor implements the method described in the first aspect by running the executable instruction.
根据本说明书一个或多个实施例的第六方面,提出了一种电子设备,包括:According to a sixth aspect of one or more embodiments of this specification, an electronic device is provided, including:
处理器;processor;
用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
其中,所述处理器通过运行所述可执行指令以实现上述第二方面所述的方法。Wherein, the processor executes the executable instruction to implement the method described in the second aspect above.
附图说明BRIEF DESCRIPTION
图1是一示例性实施例提供的一种基于区块链的事件处理方法的流程图。FIG. 1 is a flowchart of a blockchain-based event processing method provided by an exemplary embodiment.
图2是一示例性实施例提供的另一种基于区块链的事件处理方法的流程图。FIG. 2 is a flowchart of another blockchain-based event processing method provided by an exemplary embodiment.
图3是一示例性实施例提供的一种跨境汇款的场景示意图。FIG. 3 is a schematic diagram of a scenario of cross-border remittance provided by an exemplary embodiment.
图4是一示例性实施例的一种跨境汇款过程中的交互示意图。FIG. 4 is a schematic diagram of interaction in a cross-border remittance process according to an exemplary embodiment.
图5是一示例性实施例提供的一种基于密文数值的区块链交易内容的示意图。FIG. 5 is a schematic diagram of a blockchain transaction content based on a ciphertext value provided by an exemplary embodiment.
图6是一示例性实施例提供的一种基于明文数值的区块链交易内容的示意图。6 is a schematic diagram of a block chain transaction content based on plain text values provided by an exemplary embodiment.
图7是一示例性实施例提供的一种统计触发情况的示意图。7 is a schematic diagram of a statistical trigger situation provided by an exemplary embodiment.
图8是一示例性实施例提供的一种设备的结构示意图。8 is a schematic structural diagram of an apparatus provided by an exemplary embodiment.
图9是一示例性实施例提供的一种基于区块链的事件处理装置的框图。9 is a block diagram of an event processing device based on a blockchain provided by an exemplary embodiment.
图10是一示例性实施例提供的另一种设备的结构示意图。10 is a schematic structural diagram of another device provided by an exemplary embodiment.
图11是一示例性实施例提供的另一种基于区块链的事件处理装置的框图。FIG. 11 is a block diagram of another blockchain-based event processing apparatus provided by an exemplary embodiment.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail here, examples of which are shown in the drawings. When referring to the drawings below, unless otherwise indicated, the same numerals in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. In addition, the single step described in this specification may be decomposed into multiple steps for description in other embodiments; and the multiple steps described in this specification may also be combined into a single step in other embodiments. description.
图1是一示例性实施例提供的一种基于区块链的事件处理方法的流程图。如图1所示,该方法应用于参与方,可以包括以下步骤:FIG. 1 is a flowchart of a blockchain-based event processing method provided by an exemplary embodiment. As shown in Fig. 1, this method is applied to participants and may include the following steps:
步骤102,根据所述参与方所参与的事件,向所述参与方维护的等待队列中添加对应的备选子交易。Step 102: Add a corresponding candidate sub-transaction to the waiting queue maintained by the participant according to the event in which the participant participates.
在一实施例中,事件存在多个参与方,每一参与方对应于参与对象,该参与对象可以为个人、企业、组织等,本说明书并不对此进行限制。参与对象存在对应的数字身份,使得承载该数字身份的电子设备相当于被配置为该参与对象所对应的参与方。In one embodiment, there are multiple participants in the event, and each participant corresponds to a participant. The participant may be an individual, an enterprise, an organization, etc. This specification does not limit this. The participating object has a corresponding digital identity, so that the electronic device carrying the digital identity is equivalent to being configured as a participant corresponding to the participating object.
在一实施例中,本说明书的事件可以包括任意类型、覆盖任意场景,比如投票、签订协议、流量分配、转账、跨境汇款等,本说明书并不对此进行限制。以投票为例,描述信息可以包括投票事由和投票选项等信息,而各个参与方向区块链中提交的触发信息 可以包括对投票选项的选择结果,从而触发完成投票操作。In an embodiment, the events in this specification may include any type and cover any scenario, such as voting, signing agreements, traffic distribution, transfers, cross-border remittance, etc. This specification does not limit this. Taking voting as an example, the descriptive information may include information such as voting reasons and voting options, and the trigger information submitted in the blockchain of each participating direction may include the selection result of the voting options, thereby triggering the completion of the voting operation.
在一实施例中,备选子交易中包含事件的描述信息,该描述信息用于描述相关事件的情况,使得该备选子交易被处理时,可以根据该描述信息实施相应的事件。例如,描述信息可以表征相关事件的执行逻辑、所涉及的参与方、对参与方的状态参数的改变方式(如增大或减小状态参数的取值)、变化量等,本说明书并不对此进行限制。实际上,事件的相关内容可由各个参与方之间预先通过任意方式进行沟通,然后由所述任一参与方进行起草该事件的描述信息,使得事件的其他参与方可以根据预先的沟通结果对该描述信息的内容进行查看和确认;当然,所述任一参与方也可以在并未预先沟通的情况下,自行确定事件的其他参与方以及描述信息中的其他内容,本说明书并不对此进行限制。In an embodiment, the candidate sub-transaction contains description information of the event, and the description information is used to describe the situation of the related event, so that when the candidate sub-transaction is processed, the corresponding event can be implemented according to the description information. For example, the description information can characterize the execution logic of related events, the involved parties, the way to change the state parameters of the parties (such as increasing or decreasing the value of the state parameters), the amount of change, etc. Limit it. In fact, the relevant content of the event can be communicated in advance by any participant in any way, and then any of the participants can draft the description information of the event, so that other participants of the event can respond to the View and confirm the content of the description information; of course, any one of the participants can also determine other participants of the event and other content in the description information without prior communication. This manual does not limit this .
在一实施例中,事件的描述信息可由该事件的任一参与方生成,并添加为该任一参与方维护的等待队列中的备选子交易。以及,该任一参与方还将生成的描述信息分享至其他参与方,使得其他参与方对描述信息进行确认。In an embodiment, the description information of the event may be generated by any participant of the event and added as an alternative sub-transaction in the waiting queue maintained by the any participant. And, the any participant also shares the generated description information to other participants, so that the other participants can confirm the description information.
在一实施例中,任一参与方可以将描述信息通过链外通道发送至事件的其他参与方。通过链外通道将描述信息发送至事件的其他参与方,可以实现对描述信息的高效传输。其中,链外通道可以为事件的各个参与方之间建立的加密通道或其他形式的安全通道,以避免发生信息泄露。In an embodiment, any participant can send the description information to other participants of the event through an off-chain channel. Sending the description information to other participants in the event through the off-chain channel can achieve the efficient transmission of the description information. Among them, the off-chain channel may be an encrypted channel or other form of secure channel established between the parties to the event to avoid information leakage.
在一实施例中,任一参与方可以通过向区块链提交一笔交易,并将上述的描述信息包含于该交易中,使得该交易在经过共识后可以被发送至区块链中的所有区块链节点;而事件的每一参与方均可以被配置为区块链中的区块链节点,或者每一参与方可以在区块链中存在对应的区块链节点,使得每一参与方可以通过自身或对应的区块链节点所维护的区块链账本(区块链账本包含区块链的全量交易数据),获得上述交易及其包含的描述信息,从而使得上述的描述信息被同步至事件的其他参与方。In an embodiment, any participant can submit a transaction to the blockchain and include the above description information in the transaction, so that the transaction can be sent to all the blockchain after consensus Blockchain node; and each participant of the event can be configured as a blockchain node in the blockchain, or each participant can have a corresponding blockchain node in the blockchain, so that each participant The party can obtain the above transaction and the description information it contains through the blockchain ledger maintained by itself or the corresponding blockchain node (the blockchain ledger contains the entire transaction data of the blockchain), so that the above description information is Synchronize to other parties in the event.
步骤104,根据从所述等待队列中选取的若干备选子交易,生成相应的集合交易。Step 104: Generate a corresponding set transaction based on several candidate sub-transactions selected from the waiting queue.
在一实施例中,集合交易中可以包含多个备选子交易,每一备选子交易分别对应于上述参与方所参与的一个事件,使得该集合交易被提交至区块链后,所包含的多个备选子交易均可以在区块链中被处理,从而使得这些备选子交易对应的多个事件被实施。可见,通过在集合交易中包含多个备选子交易,使得这些备选子交易被批量提交至区块链,可以减少向区块链提交的交易数量,无需针对每一备选子交易均生成一笔区块链交易,有助于降低资源消耗、提升处理效率。In an embodiment, the set transaction may include multiple alternative sub-transactions, each of which corresponds to an event in which the above-mentioned parties participate, so that the set transaction is included after being submitted to the blockchain. Multiple alternative sub-transactions can be processed in the blockchain, so that multiple events corresponding to these alternative sub-transactions are implemented. It can be seen that by including multiple alternative sub-transactions in the set transaction, these alternative sub-transactions are submitted to the blockchain in batches, which can reduce the number of transactions submitted to the blockchain without generating for each alternative sub-transaction A blockchain transaction helps reduce resource consumption and improve processing efficiency.
在一实施例中,可以在所述等待队列中的备选子交易达到预设数量时,选取所述等待队列中已存在的备选子交易(即预设数量的备选子交易),以生成相应的集合交易。在另一实施例中,可以按照预设时长周期性地选取所述等待队列中已存在的备选子交易,以生成相应的集合交易;当然,每一集合交易的容量可以存在最大限制,使得同一周期内选取的备选子交易的数量存在相应的最大值,超出的部分可以延期至下一周期进行选取。当然,还可以通过其他的预设规则来选取备选子交易,本说明书并不对此进行限制。In an embodiment, when the candidate sub-transactions in the waiting queue reach a preset number, the candidate sub-transactions already existing in the waiting queue (ie, a preset number of candidate sub-transactions) may be selected to: Generate the corresponding aggregate transaction. In another embodiment, the alternative sub-transactions that already exist in the waiting queue may be selected periodically according to a preset duration to generate a corresponding set transaction; of course, the capacity of each set transaction may have a maximum limit, such that There is a corresponding maximum value for the number of candidate sub-transactions selected in the same period, and the excess can be postponed to the next period for selection. Of course, alternative sub-transactions can also be selected through other preset rules, which are not limited in this specification.
在一实施例中,等待队列中的备选子交易可以按照添加时刻进行依次排列,而每次可以从前向后依次选取各个备选子交易,使得在先生成的备选子交易可以被优先选取。当然,参与方也可以根据实际需求,比如事件的紧急程度、事件的优先级等,对等待队列中的备选子交易实施与顺序无关的选取操作;或者,等待队列本身就可以按照上述的紧急程度、优先级等进行排列,这样依然可以视为依次选取。In an embodiment, the candidate sub-transactions in the waiting queue can be arranged in order according to the time of addition, and each candidate sub-transaction can be selected in sequence from front to back each time, so that the previously generated candidate sub-transactions can be selected preferentially . Of course, the participants can also implement the order-independent selection operation on the alternative sub-transactions in the waiting queue according to the actual needs, such as the urgency of the event, the priority of the event, etc.; or, the waiting queue itself can follow the above-mentioned emergency Sort by degree, priority, etc., so that it can still be regarded as one by one.
在一实施例中,参与方可以按照生成顺序为各个合并交易添加编号,使各个合并交易在区块链中被按照对应编号的大小进行依次处理。换言之,区块链交易在收到参与方提交的合并交易后,需要读取合并交易所包含的编号;如果编号与先前处理的合并交易的编号连续,比如最新处理的合并交易的编号为99、当前收到的合并交易的编号为100,则可以对该编号为100的合并交易进行处理;如果编号之间并不连续,比如最新处理的合并交易的编号为99、当前收到的合并交易的编号为101,则区块链节点需要等待并优先处理编号为100的合并交易,然后才能处理编号为101的合并交易。由于每条交易被执行后都可能导致该参与方的状态参数发生变化,而在后交易的执行需要依赖于先前交易执行后的状态参数的取值,因而需要确保各个合并交易被按照对应编号的大小进行依次处理,以使得各个合并交易均能够正确执行。In an embodiment, the participants may add numbers to each merged transaction in the order of generation, so that each merged transaction is processed sequentially in the blockchain according to the size of the corresponding number. In other words, after receiving the merger transaction submitted by the participant, the blockchain transaction needs to read the number included in the merger exchange; if the number is continuous with the number of the previously processed merger transaction, for example, the latest processed merger transaction number is 99, If the number of the merged transaction currently received is 100, the merged transaction with the number of 100 can be processed; if the numbers are not continuous, for example, the number of the latest merged transaction processed is 99, the current received merged transaction If the number is 101, the blockchain node needs to wait and give priority to the merge transaction with the number 100 before it can process the merge transaction with the number 101. After each transaction is executed, the state parameters of the participant may change, and the execution of subsequent transactions depends on the value of the state parameters after the execution of the previous transaction, so it is necessary to ensure that each merged transaction is The size is processed sequentially so that each merged transaction can be executed correctly.
步骤106,将所述集合交易提交至区块链,使所述集合交易中的备选子交易被分别予以处理。Step 106: Submit the aggregate transaction to the blockchain, so that the alternative sub-transactions in the aggregate transaction are processed separately.
在一实施例中,在所述事件对应的备选子交易中,包含所述事件的所有参与方对所述事件的多方触发信息;其中,当所述多方触发信息通过验证时,所述事件对应的备选子交易在区块链中被触发执行。多方触发信息代表了事件的所有参与方对于描述信息的认可,并希望触发事件的执行。例如,事件的任一参与方生成描述信息并发送至其他参与方后,其他参与方可以确认描述信息的内容、通过自身的身份密钥对描述信息生成签名并将该签名返回至该任一参与方,而多方触发信息中可以包含描述信息和事件的各个参与方分别生成的签名;每一签名属于相应的参与方提供的确认信息,而如果采用密文 数值,该确认信息还将包含对密文数值的证明信息,这在下文中将详细描述。总之,本实施例中由事件的任一参与方组织形成多方触发信息后,只需要将任一参与方向自身维护的等待队列中添加相应的备选子交易,并向区块链提交包含该备选子交易的集合交易,而其他参与方则不需要实施类似处理;相应地,区块链节点可以在多方触发信息通过验证后,针对该任一参与方提交的备选子交易进行处理。In an embodiment, the candidate sub-transaction corresponding to the event includes multi-party trigger information for the event from all parties involved in the event; wherein, when the multi-party trigger information passes verification, the event The corresponding alternative sub-transaction is triggered to execute in the blockchain. Multi-party trigger information represents the approval of all participants in the event for the description information and hopes to trigger the execution of the event. For example, after any participant of the event generates description information and sends it to other participants, the other participants can confirm the content of the description information, generate a signature on the description information through their own identity key, and return the signature to any participant The multi-party trigger information can contain the description information and the signatures generated by each participant of the event; each signature belongs to the confirmation information provided by the corresponding participant, and if the cipher text value is used, the confirmation information will also contain the password Proof information for text values, which will be described in detail below. In short, after the multi-party trigger information is formed by any participant organization of the event in this embodiment, it is only necessary to add a corresponding alternative sub-transaction to the waiting queue maintained by any participant direction itself, and submit to the blockchain containing the backup Collective transactions of sub-transactions, and other participants do not need to implement similar processing; accordingly, the blockchain node can process the alternative sub-transactions submitted by any participant after the trigger information of multiple parties is verified.
在一实施例中,在事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。单方触发信息表明相应的参与方对事件的描述信息予以确认,希望触发事件的执行;而事件的每一参与方都需要分别向区块链提交单方触发信息,使得区块链节点基于所有参与方分别提交的单方触发信息,确定是否应当执行相应的备选子交易所指示的事件。例如,事件的任一参与方生成描述信息并提供至其他参与方后,不仅该任一参与方需要向自身维护的等待队列中添加相应的备选子交易,每一其他参与方在对描述信息予以确认后,也分别向自身维护的等待队列中添加相应的备选子交易;以及,每一参与方分别基于自身维护的等待队列生成集合交易,从而通过将集合交易提交至区块链,使得上述的单方触发信息被提交至区块链,以供区块链节点进行验证。单方触发信息中可以包含描述信息和相应参与方对描述信息生成的签名;签名属于相应参与方提供的确认信息,而如果采用密文数值,确认信息还包含证明信息,这在下文中将详细描述。通过由各个参与方分别向区块链提交单方触发信息,而非某一参与方提交多方触发信息,不仅可以对处理压力进行分担、防止单个参与方的处理压力过大,还可使各个参与方根据自身的实际情况(如处理压力、优先级管理等)对所参与的各个事件进行选择性地处理甚至批量处理。In an embodiment, the candidate sub-transaction corresponding to the event includes the single-party trigger information of the participant on the event; wherein, when all participants of the event submit to the blockchain When the unilateral trigger information of the event is all verified, the alternative sub-transaction corresponding to the event is triggered to execute in the blockchain. The unilateral trigger information indicates that the corresponding participant confirms the description information of the event, hoping to trigger the execution of the event; and each participant of the event needs to submit the unilateral trigger information to the blockchain separately, so that the blockchain node is based on all participants Unilateral trigger information submitted separately to determine whether the event indicated by the corresponding alternative sub-exchange should be executed. For example, after any participant of the event generates description information and provides it to other participants, not only does any participant need to add corresponding alternative sub-transactions to the waiting queue maintained by itself, each other participant After being confirmed, the corresponding alternative sub-transactions are also added to the waiting queue maintained by themselves; and, each participant generates a set transaction based on the waiting queue maintained by itself, so that by submitting the set transaction to the blockchain, the The above unilateral trigger information is submitted to the blockchain for verification by the blockchain nodes. The unilateral trigger information can contain description information and the signature generated by the corresponding participant on the description information; the signature belongs to the confirmation information provided by the corresponding participant, and if the cipher text value is used, the confirmation information also contains the certification information, which will be described in detail below. By submitting the single-party trigger information to the blockchain separately from each participant, instead of submitting the multi-party trigger information to a certain party, not only can the processing pressure be shared, and the processing pressure of a single participant can be prevented from being too large, but also to each participant According to their own actual situation (such as processing pressure, priority management, etc.), each event involved is selectively processed or even processed in batches.
在一实施例中,事件的描述信息可以包括变化量,而所述事件可以用于使各个参与方在区块链上对应记录的状态参数按照所述变化量发生取值变化,比如增大取值、减小取值等。其中,根据事件的类型或场景差异,相应的状态参数也可能不同,比如转账或跨境汇款场景下的状态参数可以为参与方的账户余额,再比如流量分配场景下的状态参数可以为参与方持有的剩余流量的数额,本说明书并不对此进行限制。In an embodiment, the description information of the event may include the amount of change, and the event may be used to cause the state parameters correspondingly recorded on the blockchain by each participant to change according to the amount of change, such as increasing the amount of change. Value, decrease value, etc. Among them, the corresponding state parameters may also be different according to the type of event or the difference in the scene. For example, the state parameter in the scenario of transfer or cross-border remittance can be the account balance of the participant, and the state parameter in the scenario of traffic distribution can be the participant. This manual does not limit the amount of remaining flow.
在一实施例中,各个参与方对应的状态参数的取值、所述变化量可以为明文数值。区块链中的区块链节点分别维护有区块链账本,该区块链账本中记录有全量交易数据,使得区块链节点可以获知各个参与方对应的状态参数的取值;进一步地,所述任一参与方可以向区块链提交一笔交易,该交易包含上述的触发信息,使得该交易经过共识后可 以被基于所述任一参与方对应的状态参数的取值、上述的变化量而执行,使得该任一参与方对应的状态参数可以基于该变化量而实现取值变化。In an embodiment, the value of the state parameter corresponding to each participant and the amount of change may be a plain text value. The blockchain nodes in the blockchain maintain a blockchain ledger, which records the full amount of transaction data, so that the blockchain node can learn the value of the state parameters corresponding to each participant; further, Any one of the parties can submit a transaction to the blockchain, the transaction contains the above trigger information, so that the transaction can be based on the value of the state parameter corresponding to the any of the parties after the consensus, the above changes Execution, so that the state parameter corresponding to any one of the participants can be changed based on the amount of change.
在一实施例中,各个参与方对应的状态参数的取值、所述变化量分别为基于同态加密算法或同态承诺算法计算得到的密文数值。对于同态加密算法而言,可以采用任意类型的同态加密算法,只要确保该同态加密算法能够满足加法同态,使得即便处于密文状态下,仍然能够使得状态参数的取值增加或减少该变化量;对于该同态加密算法为加法同态加密算法或全同态加密算法,本说明书并不对此进行限制。对于同态承诺算法而言,当采用相关技术中的Pedersen承诺机制时,可以为未加密数据确定一随机数,并基于该随机数与未加密数据进行计算得到相应的承诺数据,该承诺数据可以被作为上述的密文数值。In an embodiment, the value of the state parameter corresponding to each participant and the amount of change are ciphertext values calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm, respectively. For the homomorphic encryption algorithm, any type of homomorphic encryption algorithm can be used, as long as the homomorphic encryption algorithm can satisfy the addition homomorphism, so that even in the ciphertext state, the value of the state parameter can still be increased or decreased The amount of change; for this homomorphic encryption algorithm is an additive homomorphic encryption algorithm or a fully homomorphic encryption algorithm, this specification does not limit this. For the homomorphic commitment algorithm, when using the Pedersen commitment mechanism in the related technology, a random number can be determined for the unencrypted data, and the corresponding commitment data can be calculated based on the random number and the unencrypted data. The commitment data can be Used as the ciphertext value above.
在一实施例中,当状态参数的取值、变化量为密文数值时,参与方需要提供相关的证明信息,以使得区块链节点在执行相关交易时,能够确定交易的合法有效性。例如,参与方需要给出对变化量的证明,以表明该变化量处于正确数值区间,譬如[0,2 64)。再例如,当事件用于使得某一参与方对应的状态参数按照该变化量发生取值减小时,即交易目的是使得该某一参与方的状态参数的取值减小该变化量,该某一参与方需要给出对状态参数的取值与变化量的证明,以表明状态参数的取值不小于取值减小量(该取值减小量与上述的变化量等值)。 In an embodiment, when the value and change of the state parameter are ciphertext values, the participant needs to provide relevant proof information so that the blockchain node can determine the legal validity of the transaction when performing the relevant transaction. For example, the participant needs to give a proof of the amount of change to show that the amount of change is in the correct numerical range, such as [0,2 64 ). As another example, when the event is used to make the value of the state parameter corresponding to a certain party decrease according to the change, that is, the purpose of the transaction is to make the value of the state parameter of the certain party reduce the change, the certain A participant needs to provide proof of the value and change of the state parameter to indicate that the value of the state parameter is not less than the value decrease (the value decrease is equivalent to the above change).
在一实施例中,可以采用相关技术中的区间证明(Range Proof)技术,譬如Bulletproofs方案或Borromean环签名方案等,生成上述的证明信息,本说明书并不对此进行限制。In an embodiment, the Range Proof technology in related technologies, such as the Bulletproofs scheme or the Borromean ring signature scheme, can be used to generate the above-mentioned certification information, which is not limited in this specification.
在一实施例中,任一参与方在生成描述信息时,该描述信息中的变化量可以为密文数值。比如当变化量的明文数值为t1时,若采用Pedersen承诺机制,可以根据该明文数值t1与随机数r1生成相应的密文承诺T1,而描述信息中可以包含该T1、t1和r1,使得事件的其他参与方可以验证密文承诺T1与明文数值t1、随机数r1之间的对应关系。其中,描述信息中可以对明文数值t1和随机数r1进行加密保护,比如当描述信息需要被发送至参与方X时,可以采用该参与方X的数字身份对应的身份公钥进行加密,分别得到加密后的Enc_X(t1)、Enc_X(r1)并添加至描述信息中,因而只有参与方X能够通过自身的身份私钥对Enc_X(t1)、Enc_X(r1)进行解密得到上述的明文数值t1和随机数r1,显著提升了数据安全性。当然,除了采用公钥加密方式之外,还可以采用相关技术中的其他任意加密方式,比如数字信封等,本说明书并不对此进行限制。In an embodiment, when any participant generates description information, the amount of change in the description information may be a ciphertext value. For example, when the plaintext value of the change is t1, if the Pedersen commitment mechanism is adopted, the corresponding ciphertext commitment T1 can be generated according to the plaintext value t1 and the random number r1, and the description information can include the T1, t1, and r1, so that the event The other participants can verify the correspondence between the ciphertext commitment T1 and the plaintext value t1 and random number r1. Among them, the description information can encrypt and protect the plain text value t1 and the random number r1. For example, when the description information needs to be sent to the participant X, the identity public key corresponding to the digital identity of the participant X can be used to encrypt The encrypted Enc_X(t1) and Enc_X(r1) are added to the description information, so only the participant X can decrypt Enc_X(t1) and Enc_X(r1) through their own identity private keys to obtain the above plaintext values t1 and The random number r1 significantly improves data security. Of course, in addition to the public key encryption method, any other encryption method in the related art, such as a digital envelope, can also be used, which is not limited in this specification.
在一实施例中,当存在多个其他参与方时,描述信息可以分别包含对应于各个其他参与方的加密后数据。例如,当其他参数方包括参与方X和参与方Y时,可以根据参与方X的身份公钥对明文数值t1、随机数r1分别加密得到Enc_X(t1)、Enc_X(r1),以及根据参与方Y的身份公钥对明文数值t1、随机数r1分别加密得到Enc_Y(t1)、Enc_Y(r1),并将Enc_X(t1)、Enc_X(r1)、Enc_Y(t1)和Enc_Y(r1)均添加至描述信息中,使得所述任一参与方只需要准备一份描述信息并分别发送至各个其他参与方,而无需针对每一其他参与方准备不同的描述信息。当然,所述任一参与方可以针对每一其他参与方准备不同的描述信息,比如在发送至参与方X的描述信息中包含Enc_X(t1)和Enc_X(r1),而在发送至参与方Y的描述信息中包含Enc_Y(t1)和Enc_Y(r1),本说明书并不对此进行限制。In an embodiment, when there are multiple other parties, the description information may respectively include encrypted data corresponding to each other party. For example, when other parameter parties include participant X and participant Y, the plaintext value t1 and random number r1 can be encrypted according to participant X's identity public key to obtain Enc_X(t1), Enc_X(r1), and according to the participant Y's identity public key encrypts the plaintext value t1 and the random number r1 to obtain Enc_Y(t1), Enc_Y(r1), and adds Enc_X(t1), Enc_X(r1), Enc_Y(t1) and Enc_Y(r1) to In the description information, any one of the participants only needs to prepare one piece of description information and send it to each other participant separately, without preparing different description information for each other participant. Of course, any one of the participants can prepare different description information for each other participant. For example, the description information sent to participant X includes Enc_X(t1) and Enc_X(r1), and is sent to participant Y The description information contains Enc_Y(t1) and Enc_Y(r1), which is not limited in this manual.
在一实施例中,针对描述信息中包含的密文状态的变化量,集合交易中可以包括第一证明信息,该第一证明信息用于证明所述变化量处于正确数值区间。当任一参与方生成事件的描述信息时,该任一参与方还可以生成第一证明信息,使得无论是生成多方触发信息或单方触发信息,均不需要其他参与方针对该变化量的取值而生成其他的证明信息。当然,每一参与方也可以分别为对应的变化量(各个参与方对应的变化量可能不同;例如在跨境汇款场景中,可能基于不同货币类型而导致变化量的取值存在差异)生成第一证明信息,本说明书并不对此进行限制。In an embodiment, for the change amount of the ciphertext state included in the description information, the set transaction may include first proof information, and the first proof information is used to prove that the change amount is in a correct numerical range. When any participant generates the description information of the event, any participant can also generate the first certification information, so that no matter whether it is generating multi-party trigger information or single-party trigger information, no other participation policy needs to take the value of the change And generate other certification information. Of course, each participant can also generate the corresponding change amount (the change amount corresponding to each participant may be different; for example, in a cross-border remittance scenario, the value of the change amount may be different based on different currency types). One proof information, this manual does not limit this.
在一实施例中,如果所述事件用于使事件的某一参与方(可能存在多个类似的参与方)对应的状态参数按照所述变化量发生取值减小,那么集合交易中需要包含第二证明信息,该第二证明信息用于证明该某一参与方对应的状态参数的取值不小于取值减小量。对于多方触发信息而言,事件的每一参与方可以在确定自身的状态参数会按照所述变化量发生取值减小的情况下,分别生成相应的第二证明信息并提供至上述的任一参与方,由该任一参与方组织形成多方触发信息;或者,可以统一由该任一参与方生成第二证明信息,无需各个参与方单独生成。对于单方触发信息而言,可由生成该单方触发信息的参与方为自身生成第二证明信息。In an embodiment, if the event is used to reduce the value of the state parameter corresponding to a certain participant of the event (there may be multiple similar participants) according to the change amount, the aggregate transaction needs to be included Second proof information, which is used to prove that the value of the state parameter corresponding to a certain participant is not less than the value reduction. For the multi-party trigger information, each participant of the event can generate corresponding second certification information and provide it to any of the above, when it is determined that its own state parameter will decrease according to the change amount. Participants, the multi-party trigger information is formed by any one of the parties; alternatively, the second certification information can be generated by the one of the parties in a unified manner, without the need for each participant to generate separately. For the unilateral trigger information, the participant that generates the unilateral trigger information can generate second certification information for itself.
在一实施例中,当某一参与方为自身生成第二证明信息时,该参与方首先根据自身参与的其他事件,对自身对应的状态参数进行取值更新,然后根据取值更新后的状态参数生成第二证明信息。例如,当状态参数的取值、变化量为密文数值,且所述事件用于使得该参与方对应的状态参数按照该变化量发生取值减小时,该参与方需要根据先前已处理的交易,确定自身对应的状态参数的取值,从而生成正确的第二证明信息,以确保相关事件能够被顺利执行。In an embodiment, when a participant generates second certification information for itself, the participant first updates the value of its corresponding state parameter according to other events in which it participates, and then according to the updated state of the value The parameter generates second proof information. For example, when the value and change of the state parameter are ciphertext values, and the event is used to cause the state parameter corresponding to the participant to decrease in value according to the change, the participant needs to be based on the previously processed transaction To determine the value of the corresponding state parameter to generate the correct second proof information to ensure that the relevant event can be successfully executed.
例如,区块链节点在收到各个参与方提交的集合交易后,提取集合交易中包含的备选子交易,并针对备选子交易包含的触发信息(多方触发信息或单方触发信息)进行确认和验证。当多方触发信息包含事件的所有参与方分别对应的确认信息,或者该事件的所有参与方均已提交了相应的单方触发信息(每一单方触发信息分别包含相应参与方的确认信息)时,如果该多方触发信息或所有的单方触发信息均已通过验证,那么可以将该事件标记为成功状态;类似地,可以将未通过验证的事件标记为失败状态,将未在有效时间段内收到所有参与方对应的确认信息的事件标记为超时状态等,然后将各个事件的状态提交至区块链中。以事件的某一参与方为例,该参与方在提交集合交易之前,可以通过查询区块链账本上的交易记录,确定自身参与的各个事件的状态,比如对于失败状态或超时状态的交易,需要对状态参数的取值进行相应的恢复(比如该参与方为汇款方时,需要对相应的账户余额进行回滚),对于成功状态的交易需要更新状态参数(比如该参与方为收款方时,需要对相应的转账金额进行收款、增加至账户余额中),然后根据状态参数的更新后取值,生成相关事件的第二证明信息(确保第二证明信息是基于状态参数的最新取值而生成),然后生成并提交上述集合交易。For example, after receiving the aggregate transaction submitted by each participant, the blockchain node extracts the alternative sub-transactions included in the aggregate transaction and confirms the trigger information (multi-party trigger information or unilateral trigger information) included in the alternative sub-transaction And verification. When the multi-party trigger information contains the confirmation information corresponding to all the participants of the event, or all the participants in the event have submitted the corresponding single-party trigger information (each single-party trigger information contains the corresponding participant's confirmation information), if If the multi-party trigger information or all single-party trigger information has been verified, then the event can be marked as a success status; similarly, the event that failed verification can be marked as a failure status, and all the events will not be received within the valid time period. The event of the confirmation information corresponding to the participant is marked as a timeout state, etc., and then the state of each event is submitted to the blockchain. Taking an participant of an event as an example, before submitting a collective transaction, the participant can query the transaction records on the blockchain ledger to determine the status of each event in which it participates, for example, for a transaction that fails or times out, The value of the status parameter needs to be restored accordingly (for example, if the participant is a remittance party, the corresponding account balance needs to be rolled back), and the status parameter needs to be updated for a successful transaction (for example, the participant is the payee At the time, you need to collect the corresponding transfer amount and add it to the account balance), and then take the updated value of the status parameter to generate the second proof information of the relevant event (ensure that the second proof information is based on the latest status parameter Value), and then generate and submit the above set of transactions.
在一实施例中,当所述事件包括转账事件时,所述事件的参与方包括:汇款方和收款方,所述变化量包括:转账额,所述状态参数包括:账户余额;换言之,相当于从汇款方向收款方实施转账操作,使得汇款方的账户余额减少相应的转账额、收款方的账户余额增加相应的转账额。例如,描述信息中可以包含汇款方的账户地址、收款方的账户地址、转账额(承诺值)、转账额明文(加密状态)、随机数(加密状态)等,以表明从汇款方的账户地址向收款方的账户地址转移该转账额。In an embodiment, when the event includes a transfer event, the participants of the event include: a sender and a receiver, the amount of change includes: a transfer amount, and the status parameter includes: account balance; in other words, It is equivalent to the transfer operation from the remittance to the beneficiary, so that the account balance of the remitter reduces the corresponding transfer amount, and the account balance of the beneficiary increases the corresponding transfer amount. For example, the description information may include the sender's account address, the recipient's account address, the transfer amount (commitment value), the transfer amount in plain text (encrypted state), random number (encrypted state), etc., to indicate the account from the sender The address transfers the transfer amount to the payee's account address.
在一实施例中,当所述事件包括第一汇款事件时,所述事件的参与方包括:汇款方、中继方、收款方,所述变化量包括:所述汇款方与所述中继方之间基于第一类型资产的第一转账额、所述中继方与所述收款方之间基于第二类型资产的第二转账额,所述状态参数包括:账户余额;换言之,相当于在汇款方与中继方之间转移第一类型的资产(如港币)、资产额为第一转账额,并且在中继方与收款方之间转移第二类型的资产(如美元)、资产额为第二转账额,且根据第一类型与第二类型的资产之间的汇率,使得第一转账额与第二转账额对应的资产价值基本一致,那么最终相当于汇款方的账户余额减少了第一转账额(第一类型的资产)、收款方的账户余额增加了第二转账额(第二类型的资产),而中继方的账户余额增加了第一转账额(第一类型的资产)且减少了第二转账额(第二类型的资产)、在资产价值上相当于未发生变化。In an embodiment, when the event includes a first remittance event, the participants of the event include: a remittance party, a relay party, and a beneficiary party, and the variation includes: the remittance party and the middle party The first transfer amount between the relay parties based on the first type of assets and the second transfer amount between the relay party and the payee based on the second type of assets, the status parameters include: account balance; in other words, Equivalent to transferring the first type of assets (such as Hong Kong dollars) between the sender and the relay, the amount of the asset is the first transfer amount, and transferring the second type of assets (such as the US dollar) between the relay and the receiver ). The asset amount is the second transfer amount, and according to the exchange rate between the first type and the second type of assets, the asset value corresponding to the first transfer amount and the second transfer amount is basically the same. The account balance is reduced by the first transfer amount (the first type of asset), the payee's account balance is increased by the second transfer amount (the second type of asset), and the relay party's account balance is increased by the first transfer amount ( The first type of assets) and reduced the second transfer amount (the second type of assets), which means that the asset value has not changed.
在一实施例中,当所述事件包括第二汇款事件时,所述事件的参与方包括:汇款方、n个中继方、收款方,所述变化量包括:所述汇款方与第1个中继方之间基于第一类型资产的转账额、第i-1个中继方与第i个中继方之间基于第i类型资产的转账额、第n个中继方与所述收款方之间基于第n+1类型资产的转账额,所述状态参数包括:账户余额;其中,1<i≤n。当n=1时,本实施例的第二汇款事件相当于上述实施例的第一汇款事件,此处不再赘述。当n>1时,由于存在多个中继方,因而相比于上述实施例的第一汇款事件而言,还包含多个中继方之间的资产转移过程;以n=2为例,事件的参与方包括汇款方、中继方1、中继方2、收款方,其中:在汇款方与中继方1之间转移第一类型的资产(如港币)、资产额为第一转账额,在中继方1与中继方2之间转移第二类型的资产(如欧元)、资产额为第二转账额,在中继方2与收款方之间转移第三类型的资产(如美元)、资产额为第三转账额,且根据第一类型与第二类型的资产之间的汇率1、第二类型与第三类型的资产之间的汇率2,使得第一转账额、第二转账额与第三转账额对应的资产价值基本一致,那么最终相当于汇款方的账户余额减少了第一转账额(第一类型的资产)、收款方的账户余额增加了第三转账额(第三类型的资产),而中继方1的账户余额增加了第一转账额(第一类型的资产)且减少了第二转账额(第二类型的资产)、在资产价值上相当于未发生变化,中继方2的账户余额增加了第二转账额(第二类型的资产)且减少了第三转账额(第三类型的资产)、在资产价值上相当于未发生变化。In an embodiment, when the event includes a second remittance event, the participants of the event include: a remittance party, n relay parties, and a payee, and the variation includes: the remittance party and the first Transfer amount based on the first type of asset between 1 relay party, transfer amount based on the i type asset between the i-1th relay party and the ith relay party, the nth relay party and all Describe the transfer amount based on the n+1th type of assets between the payees. The status parameters include: account balance; where 1<i≤n. When n=1, the second remittance event of this embodiment is equivalent to the first remittance event of the foregoing embodiment, and details are not described herein again. When n>1, since there are multiple relay parties, compared with the first remittance event of the above embodiment, it also includes the asset transfer process between multiple relay parties; taking n=2 as an example, Participants in the event include the remittance party, relay party 1, relay party 2, and receiver. Among them: the transfer of the first type of assets (such as Hong Kong dollars) between the remittance party and relay party 1, the amount of assets is the first Transfer amount, transfer the second type of assets (such as Euros) between Relay 1 and Relay 2, the amount of the asset is the second transfer amount, and transfer the third type between Relay 2 and the payee The assets (such as US dollars) and the amount of assets are the third transfer amount, and the first transfer is based on the exchange rate 1 between the first type and second type assets, and the exchange rate 2 between the second type and third type assets Amount, the second transfer amount and the asset value corresponding to the third transfer amount are basically the same, then the account balance of the sender is reduced by the first transfer amount (the first type of asset), and the account balance of the payee is increased by Three transfers (the third type of assets), while the account balance of relay 1 increases the first transfer (the first type of assets) and reduces the second transfer (the second type of assets), the asset value The above is equivalent to no change, and the account balance of relay 2 has increased the second transfer amount (second type of assets) and reduced the third transfer amount (third type of assets), which is equivalent to no occurrence in asset value Variety.
在一实施例中,当状态参数的取值、变化量采用密文数值时,所述集合交易中包含的备选子交易还设定有变化前状态值、变化后状态值,使得所述备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;其中,所述状态变化量、所述变化前状态值和所述变化后状态值分别为基于同态加密算法或同态承诺算法计算得到的密文数值。相应地,当区块链节点对集合交易中包含的各个备选子交易进行验证时,需要确保相邻的备选子交易满足:前一备选子交易对应的变化后状态值与后一备选子交易对应的变化前状态值相同,否则将判定为验证失败。In an embodiment, when the value of the state parameter and the amount of change are ciphertext values, the alternative sub-transactions included in the set transaction are also set with a state value before change and a state value after change, so that the backup After the selected sub-transaction is processed, the state parameter of the participant changes from the pre-change state value to the post-change state value via the state change amount; wherein, the state change amount, the pre-change state The value and the changed state value are ciphertext values calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm, respectively. Correspondingly, when the blockchain node verifies each alternative sub-transaction included in the set transaction, it is necessary to ensure that the adjacent alternative sub-transactions meet: the changed state value and the latter backup corresponding to the previous alternative sub-transaction The state value before the change corresponding to the sub-transaction is the same, otherwise it will be judged as verification failure.
与图1所示实施例相对应地,图2是一示例性实施例提供的另一种基于区块链的事件处理方法的流程图。如图2所示,该方法应用于区块链节点,可以包括以下步骤:Corresponding to the embodiment shown in FIG. 1, FIG. 2 is a flowchart of another blockchain-based event processing method provided by an exemplary embodiment. As shown in Figure 2, this method is applied to blockchain nodes and can include the following steps:
步骤202,接收参与方提交至区块链的集合交易,所述集合交易中包含从所述参与方维护的等待队列中选取的若干备选子交易,所述备选子交易对应于所述参与方所参与 的事件。Step 202: Receive a set transaction submitted by a participant to the blockchain, where the set transaction includes several candidate sub-transactions selected from a waiting queue maintained by the participant, and the candidate sub-transaction corresponds to the participation Events that the party is involved in.
在一实施例中,事件存在多个参与方,每一参与方对应于参与对象,该参与对象可以为个人、企业、组织等,本说明书并不对此进行限制。参与对象存在对应的数字身份,使得承载该数字身份的电子设备相当于被配置为该参与对象所对应的参与方。In one embodiment, there are multiple participants in the event, and each participant corresponds to a participant. The participant may be an individual, an enterprise, an organization, etc. This specification does not limit this. The participating object has a corresponding digital identity, so that the electronic device carrying the digital identity is equivalent to being configured as a participant corresponding to the participating object.
在一实施例中,本说明书的事件可以包括任意类型、覆盖任意场景,比如投票、签订协议、流量分配、转账、跨境汇款等,本说明书并不对此进行限制。以投票为例,描述信息可以包括投票事由和投票选项等信息,而各个参与方向区块链中提交的触发信息可以包括对投票选项的选择结果,从而触发完成投票操作。In an embodiment, the events in this specification may include any type and cover any scenario, such as voting, signing agreements, traffic distribution, transfers, cross-border remittance, etc. This specification does not limit this. Taking voting as an example, the descriptive information may include information such as voting reasons and voting options, and the trigger information submitted in the blockchain of each participating direction may include the selection result of the voting options, thereby triggering the completion of the voting operation.
在一实施例中,备选子交易中包含事件的描述信息,该描述信息用于描述相关事件的情况,使得该备选子交易被处理时,可以根据该描述信息实施相应的事件。例如,描述信息可以表征相关事件的执行逻辑、所涉及的参与方、对参与方的状态参数的改变方式(如增大或减小状态参数的取值)、变化量等,本说明书并不对此进行限制。实际上,事件的相关内容可由各个参与方之间预先通过任意方式进行沟通,然后由所述任一参与方进行起草该事件的描述信息,使得事件的其他参与方可以根据预先的沟通结果对该描述信息的内容进行查看和确认;当然,所述任一参与方也可以在并未预先沟通的情况下,自行确定事件的其他参与方以及描述信息中的其他内容,本说明书并不对此进行限制。In an embodiment, the candidate sub-transaction contains description information of the event, and the description information is used to describe the situation of the related event, so that when the candidate sub-transaction is processed, the corresponding event can be implemented according to the description information. For example, the description information can characterize the execution logic of related events, the involved parties, the way to change the state parameters of the parties (such as increasing or decreasing the value of the state parameters), the amount of change, etc. Limit it. In fact, the relevant content of the event can be communicated in advance by any participant in any way, and then any of the participants can draft the description information of the event, so that other participants of the event can respond to the View and confirm the content of the description information; of course, any one of the participants can also determine other participants of the event and other content in the description information without prior communication. This manual does not limit this .
在一实施例中,事件的描述信息可由该事件的任一参与方生成,并添加为该任一参与方维护的等待队列中的备选子交易。以及,该任一参与方还将生成的描述信息分享至其他参与方,使得其他参与方对描述信息进行确认。In an embodiment, the description information of the event may be generated by any participant of the event and added as an alternative sub-transaction in the waiting queue maintained by the any participant. And, the any participant also shares the generated description information to other participants, so that the other participants can confirm the description information.
在一实施例中,任一参与方可以将描述信息通过链外通道发送至事件的其他参与方。通过链外通道将描述信息发送至事件的其他参与方,可以实现对描述信息的高效传输。其中,链外通道可以为事件的各个参与方之间建立的加密通道或其他形式的安全通道,以避免发生信息泄露。In an embodiment, any participant can send the description information to other participants of the event through an off-chain channel. Sending the description information to other participants in the event through the off-chain channel can achieve the efficient transmission of the description information. Among them, the off-chain channel may be an encrypted channel or other form of secure channel established between the parties to the event to avoid information leakage.
在一实施例中,任一参与方可以通过向区块链提交一笔交易,并将上述的描述信息包含于该交易中,使得该交易在经过共识后可以被发送至区块链中的所有区块链节点;而事件的每一参与方均可以被配置为区块链中的区块链节点,或者每一参与方可以在区块链中存在对应的区块链节点,使得每一参与方可以通过自身或对应的区块链节点所维护的区块链账本(区块链账本包含区块链的全量交易数据),获得上述交易及其包含的描述信息,从而使得上述的描述信息被同步至事件的其他参与方。In an embodiment, any participant can submit a transaction to the blockchain and include the above description information in the transaction, so that the transaction can be sent to all the blockchain after consensus Blockchain node; and each participant of the event can be configured as a blockchain node in the blockchain, or each participant can have a corresponding blockchain node in the blockchain, so that each participant The party can obtain the above transaction and the description information it contains through the blockchain ledger maintained by itself or the corresponding blockchain node (the blockchain ledger contains the entire transaction data of the blockchain), so that the above description information is Synchronize to other parties in the event.
在一实施例中,集合交易中可以包含多个备选子交易,每一备选子交易分别对应于上述参与方所参与的一个事件,使得该集合交易被提交至区块链后,所包含的多个备选子交易均可以在区块链中被处理,从而使得这些备选子交易对应的多个事件被实施。可见,通过在集合交易中包含多个备选子交易,使得这些备选子交易被批量提交至区块链,可以减少向区块链提交的交易数量,无需针对每一备选子交易均生成一笔区块链交易,有助于降低资源消耗、提升处理效率。In an embodiment, the set transaction may include multiple alternative sub-transactions, each of which corresponds to an event in which the above-mentioned parties participate, so that the set transaction is included after being submitted to the blockchain. Multiple alternative sub-transactions can be processed in the blockchain, so that multiple events corresponding to these alternative sub-transactions are implemented. It can be seen that by including multiple alternative sub-transactions in the set transaction, these alternative sub-transactions are submitted to the blockchain in batches, which can reduce the number of transactions submitted to the blockchain without generating for each alternative sub-transaction A blockchain transaction helps reduce resource consumption and improve processing efficiency.
在一实施例中,可以在所述等待队列中的备选子交易达到预设数量时,选取所述等待队列中已存在的备选子交易(即预设数量的备选子交易),以生成相应的集合交易。在另一实施例中,可以按照预设时长周期性地选取所述等待队列中已存在的备选子交易,以生成相应的集合交易;当然,每一集合交易的容量可以存在最大限制,使得同一周期内选取的备选子交易的数量存在相应的最大值,超出的部分可以延期至下一周期进行选取。当然,还可以通过其他的预设规则来选取备选子交易,本说明书并不对此进行限制。In an embodiment, when the candidate sub-transactions in the waiting queue reach a preset number, the candidate sub-transactions already existing in the waiting queue (ie, a preset number of candidate sub-transactions) may be selected to: Generate the corresponding aggregate transaction. In another embodiment, the alternative sub-transactions that already exist in the waiting queue may be selected periodically according to a preset duration to generate a corresponding set transaction; of course, the capacity of each set transaction may have a maximum limit, such that There is a corresponding maximum value for the number of candidate sub-transactions selected in the same period, and the excess can be postponed to the next period for selection. Of course, alternative sub-transactions can also be selected through other preset rules, which are not limited in this specification.
在一实施例中,等待队列中的备选子交易可以按照添加时刻进行依次排列,而每次可以从前向后依次选取各个备选子交易,使得在先生成的备选子交易可以被优先选取。当然,参与方也可以根据实际需求,比如事件的紧急程度、事件的优先级等,对等待队列中的备选子交易实施与顺序无关的选取操作;或者,等待队列本身就可以按照上述的紧急程度、优先级等进行排列,这样依然可以视为依次选取。In an embodiment, the candidate sub-transactions in the waiting queue can be arranged in order according to the time of addition, and each candidate sub-transaction can be selected in sequence from front to back each time, so that the previously generated candidate sub-transactions can be selected preferentially . Of course, the participants can also implement the order-independent selection operation on the alternative sub-transactions in the waiting queue according to the actual needs, such as the urgency of the event, the priority of the event, etc.; or, the waiting queue itself can follow the above-mentioned emergency Sort by degree, priority, etc., so that it can still be regarded as one by one.
在一实施例中,参与方可以按照生成顺序为各个合并交易添加编号,使各个合并交易在区块链中被按照对应编号的大小进行依次处理。换言之,区块链交易在收到参与方提交的合并交易后,需要读取合并交易所包含的编号;如果编号与先前处理的合并交易的编号连续,比如最新处理的合并交易的编号为99、当前收到的合并交易的编号为100,则可以对该编号为100的合并交易进行处理;如果编号之间并不连续,比如最新处理的合并交易的编号为99、当前收到的合并交易的编号为101,则区块链节点需要等待并优先处理编号为100的合并交易,然后才能处理编号为101的合并交易。由于每条交易被执行后都可能导致该参与方的状态参数发生变化,而在后交易的执行需要依赖于先前交易执行后的状态参数的取值,因而需要确保各个合并交易被按照对应编号的大小进行依次处理,以使得各个合并交易均能够正确执行。In an embodiment, the participants may add numbers to each merged transaction in the order of generation, so that each merged transaction is processed sequentially in the blockchain according to the size of the corresponding number. In other words, after receiving the merger transaction submitted by the participant, the blockchain transaction needs to read the number included in the merger exchange; if the number is continuous with the number of the previously processed merger transaction, for example, the latest processed merger transaction number is 99, If the number of the merged transaction currently received is 100, the merged transaction with the number of 100 can be processed; if the numbers are not continuous, for example, the number of the latest merged transaction processed is 99, the current received merged transaction If the number is 101, the blockchain node needs to wait and give priority to the merge transaction with the number 100 before it can process the merge transaction with the number 101. After each transaction is executed, the state parameters of the participant may change, and the execution of subsequent transactions depends on the value of the state parameters after the execution of the previous transaction, so it is necessary to ensure that each merged transaction is The size is processed sequentially so that each merged transaction can be executed correctly.
步骤204,执行所述集合交易,以对所述集合交易中的备选子交易分别予以处理。In step 204, the aggregate transaction is executed to separately process the candidate sub-transactions in the aggregate transaction.
在一实施例中,在所述事件对应的备选子交易中,包含所述事件的所有参与方对所述事件的多方触发信息;其中,当所述多方触发信息通过验证时,所述事件对应的备选 子交易在区块链中被触发执行。多方触发信息代表了事件的所有参与方对于描述信息的认可,并希望触发事件的执行。例如,事件的任一参与方生成描述信息并发送至其他参与方后,其他参与方可以确认描述信息的内容、通过自身的身份密钥对描述信息生成签名并将该签名返回至该任一参与方,而多方触发信息中可以包含描述信息和事件的各个参与方分别生成的签名;每一签名属于相应的参与方提供的确认信息,而如果采用密文数值,该确认信息还将包含对密文数值的证明信息,这在下文中将详细描述。总之,本实施例中由事件的任一参与方组织形成多方触发信息后,只需要将任一参与方向自身维护的等待队列中添加相应的备选子交易,并向区块链提交包含该备选子交易的集合交易,而其他参与方则不需要实施类似处理;相应地,区块链节点可以在多方触发信息通过验证后,针对该任一参与方提交的备选子交易进行处理。In an embodiment, the candidate sub-transaction corresponding to the event includes multi-party trigger information for the event from all parties involved in the event; wherein, when the multi-party trigger information passes verification, the event The corresponding alternative sub-transaction is triggered to execute in the blockchain. Multi-party trigger information represents the approval of all participants in the event for the description information and hopes to trigger the execution of the event. For example, after any participant of the event generates description information and sends it to other participants, the other participants can confirm the content of the description information, generate a signature on the description information through their own identity key, and return the signature to any participant The multi-party trigger information can contain the description information and the signatures generated by each participant of the event; each signature belongs to the confirmation information provided by the corresponding participant, and if the cipher text value is used, the confirmation information will also contain the password Proof information for text values, which will be described in detail below. In short, after the multi-party trigger information is formed by any participant organization of the event in this embodiment, it is only necessary to add a corresponding alternative sub-transaction to the waiting queue maintained by any participant direction itself, and submit to the blockchain containing the backup Collective transactions of sub-transactions, and other participants do not need to implement similar processing; accordingly, the blockchain node can process the alternative sub-transactions submitted by any participant after the trigger information of multiple parties is verified.
在一实施例中,在事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。单方触发信息表明相应的参与方对事件的描述信息予以确认,希望触发事件的执行;而事件的每一参与方都需要分别向区块链提交单方触发信息,使得区块链节点基于所有参与方分别提交的单方触发信息,确定是否应当执行相应的备选子交易所指示的事件。例如,事件的任一参与方生成描述信息并提供至其他参与方后,不仅该任一参与方需要向自身维护的等待队列中添加相应的备选子交易,每一其他参与方在对描述信息予以确认后,也分别向自身维护的等待队列中添加相应的备选子交易;以及,每一参与方分别基于自身维护的等待队列生成集合交易,从而通过将集合交易提交至区块链,使得上述的单方触发信息被提交至区块链,以供区块链节点进行验证。单方触发信息中可以包含描述信息和相应参与方对描述信息生成的签名;签名属于相应参与方提供的确认信息,而如果采用密文数值,确认信息还包含证明信息,这在下文中将详细描述。通过由各个参与方分别向区块链提交单方触发信息,而非某一参与方提交多方触发信息,不仅可以对处理压力进行分担、防止单个参与方的处理压力过大,还可使各个参与方根据自身的实际情况(如处理压力、优先级管理等)对所参与的各个事件进行选择性地处理甚至批量处理。In an embodiment, the candidate sub-transaction corresponding to the event includes the single-party trigger information of the participant on the event; wherein, when all participants of the event submit to the blockchain When the unilateral trigger information of the event is all verified, the alternative sub-transaction corresponding to the event is triggered to execute in the blockchain. The unilateral trigger information indicates that the corresponding participant confirms the description information of the event, hoping to trigger the execution of the event; and each participant of the event needs to submit the unilateral trigger information to the blockchain separately, so that the blockchain node is based on all participants Unilateral trigger information submitted separately to determine whether the event indicated by the corresponding alternative sub-exchange should be executed. For example, after any participant of the event generates description information and provides it to other participants, not only does any participant need to add corresponding alternative sub-transactions to the waiting queue maintained by itself, each other participant After being confirmed, the corresponding alternative sub-transactions are also added to the waiting queue maintained by themselves; and, each participant generates a set transaction based on the waiting queue maintained by itself, so that by submitting the set transaction to the blockchain, the The above unilateral trigger information is submitted to the blockchain for verification by the blockchain nodes. The unilateral trigger information can contain description information and the signature generated by the corresponding participant on the description information; the signature belongs to the confirmation information provided by the corresponding participant, and if the cipher text value is used, the confirmation information also contains the certification information, which will be described in detail below. By submitting the single-party trigger information to the blockchain separately from each participant, instead of submitting the multi-party trigger information to a certain party, not only can the processing pressure be shared, and the processing pressure of a single participant can be prevented from being too large, but also to each participant According to their own actual situation (such as processing pressure, priority management, etc.), each event involved is selectively processed or even processed in batches.
在一实施例中,事件的描述信息可以包括变化量,而所述事件可以用于使各个参与方在区块链上对应记录的状态参数按照所述变化量发生取值变化,比如增大取值、减小取值等。其中,根据事件的类型或场景差异,相应的状态参数也可能不同,比如转账或跨境汇款场景下的状态参数可以为参与方的账户余额,再比如流量分配场景下的状态参数可以为参与方持有的剩余流量的数额,本说明书并不对此进行限制。In an embodiment, the description information of the event may include the amount of change, and the event may be used to cause the state parameters correspondingly recorded on the blockchain by each participant to change according to the amount of change, such as increasing the amount of change. Value, decrease value, etc. Among them, the corresponding state parameters may also be different according to the type of event or the difference in the scene. For example, the state parameter in the scenario of transfer or cross-border remittance can be the account balance of the participant, and the state parameter in the scenario of traffic distribution can be the participant. This manual does not limit the amount of remaining flow.
在一实施例中,各个参与方对应的状态参数的取值、所述变化量可以为明文数值。区块链中的区块链节点分别维护有区块链账本,该区块链账本中记录有全量交易数据,使得区块链节点可以获知各个参与方对应的状态参数的取值;进一步地,所述任一参与方可以向区块链提交一笔交易,该交易包含上述的触发信息,使得该交易经过共识后可以被基于所述任一参与方对应的状态参数的取值、上述的变化量而执行,使得该任一参与方对应的状态参数可以基于该变化量而实现取值变化。In an embodiment, the value of the state parameter corresponding to each participant and the amount of change may be a plain text value. The blockchain nodes in the blockchain maintain a blockchain ledger, which records the full amount of transaction data, so that the blockchain node can learn the value of the state parameters corresponding to each participant; further, Any one of the parties can submit a transaction to the blockchain, the transaction contains the above trigger information, so that the transaction can be based on the value of the state parameter corresponding to the any of the parties after the consensus, the above changes Execution, so that the state parameter corresponding to any one of the participants can be changed based on the amount of change.
在一实施例中,各个参与方对应的状态参数的取值、所述变化量分别为基于同态加密算法或同态承诺算法计算得到的密文数值。对于同态加密算法而言,可以采用任意类型的同态加密算法,只要确保该同态加密算法能够满足加法同态,使得即便处于密文状态下,仍然能够使得状态参数的取值增加或减少该变化量;对于该同态加密算法为加法同态加密算法或全同态加密算法,本说明书并不对此进行限制。对于同态承诺算法而言,当采用相关技术中的Pedersen承诺机制时,可以为未加密数据确定一随机数,并基于该随机数与未加密数据进行计算得到相应的承诺数据,该承诺数据可以被作为上述的密文数值。In an embodiment, the value of the state parameter corresponding to each participant and the amount of change are ciphertext values calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm, respectively. For the homomorphic encryption algorithm, any type of homomorphic encryption algorithm can be used, as long as the homomorphic encryption algorithm can satisfy the addition homomorphism, so that even in the ciphertext state, the value of the state parameter can still be increased or decreased The amount of change; for this homomorphic encryption algorithm is an additive homomorphic encryption algorithm or a fully homomorphic encryption algorithm, this specification does not limit this. For the homomorphic commitment algorithm, when using the Pedersen commitment mechanism in the related technology, a random number can be determined for the unencrypted data, and the corresponding commitment data can be calculated based on the random number and the unencrypted data. The commitment data can be Used as the ciphertext value above.
在一实施例中,当状态参数的取值、变化量为密文数值时,参与方需要提供相关的证明信息,以使得区块链节点在执行相关交易时,能够确定交易的合法有效性。例如,参与方需要给出对变化量的证明,以表明该变化量处于正确数值区间,譬如[0,2 64)。再例如,当事件用于使得某一参与方对应的状态参数按照该变化量发生取值减小时,即交易目的是使得该某一参与方的状态参数的取值减小该变化量,该某一参与方需要给出对状态参数的取值与变化量的证明,以表明状态参数的取值不小于取值减小量(该取值减小量与上述的变化量等值)。 In an embodiment, when the value of the state parameter and the amount of change are ciphertext values, the participant needs to provide relevant proof information so that the blockchain node can determine the legal validity of the transaction when performing the relevant transaction. For example, the participant needs to give a proof of the amount of change to show that the amount of change is in the correct numerical range, such as [0,2 64 ). As another example, when the event is used to make the value of the state parameter corresponding to a certain party decrease according to the change, that is, the purpose of the transaction is to make the value of the state parameter of the certain party reduce the change, the certain A participant needs to provide proof of the value and change of the state parameter to indicate that the value of the state parameter is not less than the value decrease (the value decrease is equivalent to the above change).
在一实施例中,可以采用相关技术中的区间证明(Range Proof)技术,譬如Bulletproofs方案或Borromean环签名方案等,生成上述的证明信息,本说明书并不对此进行限制。In an embodiment, the Range Proof technology in related technologies, such as the Bulletproofs scheme or the Borromean ring signature scheme, can be used to generate the above-mentioned certification information, which is not limited in this specification.
在一实施例中,任一参与方在生成描述信息时,该描述信息中的变化量可以为密文数值。比如当变化量的明文数值为t1时,若采用Pedersen承诺机制,可以根据该明文数值t1与随机数r1生成相应的密文承诺T1,而描述信息中可以包含该T1、t1和r1,使得事件的其他参与方可以验证密文承诺T1与明文数值t1、随机数r1之间的对应关系。其中,描述信息中可以对明文数值t1和随机数r1进行加密保护,比如当描述信息需要被发送至参与方X时,可以采用该参与方X的数字身份对应的身份公钥进行加密,分 别得到加密后的Enc_X(t1)、Enc_X(r1)并添加至描述信息中,因而只有参与方X能够通过自身的身份私钥对Enc_X(t1)、Enc_X(r1)进行解密得到上述的明文数值t1和随机数r1,显著提升了数据安全性。当然,除了采用公钥加密方式之外,还可以采用相关技术中的其他任意加密方式,比如数字信封等,本说明书并不对此进行限制。In an embodiment, when any participant generates description information, the amount of change in the description information may be a ciphertext value. For example, when the plaintext value of the change is t1, if the Pedersen commitment mechanism is adopted, the corresponding ciphertext commitment T1 can be generated according to the plaintext value t1 and the random number r1, and the description information can include the T1, t1, and r1, so that the event The other participants can verify the correspondence between the ciphertext commitment T1 and the plaintext value t1 and random number r1. Among them, the description information can encrypt and protect the plain text value t1 and the random number r1. For example, when the description information needs to be sent to the participant X, the identity public key corresponding to the digital identity of the participant X can be used to encrypt The encrypted Enc_X(t1) and Enc_X(r1) are added to the description information, so only the participant X can decrypt Enc_X(t1) and Enc_X(r1) through their own identity private key to obtain the above plaintext values t1 and The random number r1 significantly improves data security. Of course, in addition to the public key encryption method, any other encryption method in the related art, such as a digital envelope, can also be used, which is not limited in this specification.
在一实施例中,当存在多个其他参与方时,描述信息可以分别包含对应于各个其他参与方的加密后数据。例如,当其他参数方包括参与方X和参与方Y时,可以根据参与方X的身份公钥对明文数值t1、随机数r1分别加密得到Enc_X(t1)、Enc_X(r1),以及根据参与方Y的身份公钥对明文数值t1、随机数r1分别加密得到Enc_Y(t1)、Enc_Y(r1),并将Enc_X(t1)、Enc_X(r1)、Enc_Y(t1)和Enc_Y(r1)均添加至描述信息中,使得所述任一参与方只需要准备一份描述信息并分别发送至各个其他参与方,而无需针对每一其他参与方准备不同的描述信息。当然,所述任一参与方可以针对每一其他参与方准备不同的描述信息,比如在发送至参与方X的描述信息中包含Enc_X(t1)和Enc_X(r1),而在发送至参与方Y的描述信息中包含Enc_Y(t1)和Enc_Y(r1),本说明书并不对此进行限制。In an embodiment, when there are multiple other parties, the description information may respectively include encrypted data corresponding to each other party. For example, when other parameter parties include participant X and participant Y, the plaintext value t1 and random number r1 can be encrypted according to participant X's identity public key to obtain Enc_X(t1), Enc_X(r1), and according to the participant The identity public key of Y encrypts the plaintext value t1 and the random number r1 to obtain Enc_Y(t1), Enc_Y(r1), and adds Enc_X(t1), Enc_X(r1), Enc_Y(t1) and Enc_Y(r1) to In the description information, any one of the participants only needs to prepare one piece of description information and send it to each other participant separately, without preparing different description information for each other participant. Of course, any one of the participants can prepare different description information for each other participant. For example, the description information sent to participant X includes Enc_X(t1) and Enc_X(r1), and is sent to participant Y The description information contains Enc_Y(t1) and Enc_Y(r1), which is not limited in this manual.
在一实施例中,针对描述信息中包含的密文状态的变化量,集合交易中可以包括第一证明信息,该第一证明信息用于证明所述变化量处于正确数值区间。当任一参与方生成事件的描述信息时,该任一参与方还可以生成第一证明信息,使得无论是生成多方触发信息或单方触发信息,均不需要其他参与方针对该变化量的取值而生成其他的证明信息。当然,每一参与方也可以分别为对应的变化量(各个参与方对应的变化量可能不同;例如在跨境汇款场景中,可能基于不同货币类型而导致变化量的取值存在差异)生成第一证明信息,本说明书并不对此进行限制。In an embodiment, for the change amount of the ciphertext state included in the description information, the set transaction may include first proof information, and the first proof information is used to prove that the change amount is in a correct numerical range. When any participant generates the description information of the event, any participant can also generate the first certification information, so that no matter whether it is generating multi-party trigger information or single-party trigger information, no other participation policy needs to take the value of the change And generate other certification information. Of course, each participant can also generate the corresponding change amount (the change amount corresponding to each participant may be different; for example, in a cross-border remittance scenario, the value of the change amount may be different based on different currency types). One proof information, this manual does not limit this.
在一实施例中,如果所述事件用于使事件的某一参与方(可能存在多个类似的参与方)对应的状态参数按照所述变化量发生取值减小,那么集合交易中需要包含第二证明信息,该第二证明信息用于证明该某一参与方对应的状态参数的取值不小于取值减小量。对于多方触发信息而言,事件的每一参与方可以在确定自身的状态参数会按照所述变化量发生取值减小的情况下,分别生成相应的第二证明信息并提供至上述的任一参与方,由该任一参与方组织形成多方触发信息;或者,可以统一由该任一参与方生成第二证明信息,无需各个参与方单独生成。对于单方触发信息而言,可由生成该单方触发信息的参与方为自身生成第二证明信息。In an embodiment, if the event is used to reduce the value of the state parameter corresponding to a certain participant of the event (there may be multiple similar participants) according to the change amount, the aggregate transaction needs to be included Second proof information, which is used to prove that the value of the state parameter corresponding to a certain participant is not less than the value reduction. For the multi-party trigger information, each participant of the event can generate corresponding second certification information and provide it to any of the above, when it is determined that its own state parameter will decrease according to the change amount. Participants, the multi-party trigger information is formed by any one of the parties; alternatively, the second certification information can be generated by the one of the parties in a unified manner, without the need for each participant to generate separately. For the unilateral trigger information, the participant that generates the unilateral trigger information can generate second certification information for itself.
在一实施例中,当某一参与方为自身生成第二证明信息时,该参与方首先根据自身参与的其他事件,对自身对应的状态参数进行取值更新,然后根据取值更新后的状态参 数生成第二证明信息。例如,当状态参数的取值、变化量为密文数值,且所述事件用于使得该参与方对应的状态参数按照该变化量发生取值减小时,该参与方需要根据先前已处理的交易,确定自身对应的状态参数的取值,从而生成正确的第二证明信息,以确保相关事件能够被顺利执行。In an embodiment, when a participant generates second certification information for itself, the participant first updates the value of its corresponding state parameter according to other events in which it participates, and then according to the updated state of the value The parameter generates second proof information. For example, when the value and change of the state parameter are ciphertext values, and the event is used to cause the state parameter corresponding to the participant to decrease in value according to the change, the participant needs to be based on the previously processed transaction To determine the value of the corresponding state parameter to generate the correct second proof information to ensure that the relevant event can be successfully executed.
例如,区块链节点在收到各个参与方提交的集合交易后,提取集合交易中包含的备选子交易,并针对备选子交易包含的触发信息(多方触发信息或单方触发信息)进行确认和验证。当多方触发信息包含事件的所有参与方分别对应的确认信息,或者该事件的所有参与方均已提交了相应的单方触发信息(每一单方触发信息分别包含相应参与方的确认信息)时,如果该多方触发信息或所有的单方触发信息均已通过验证,那么可以将该事件标记为成功状态;类似地,可以将未通过验证的事件标记为失败状态,将未在有效时间段内收到所有参与方对应的确认信息的事件标记为超时状态等,然后将各个事件的状态提交至区块链中。以事件的某一参与方为例,该参与方在提交集合交易之前,可以通过查询区块链账本上的交易记录,确定自身参与的各个事件的状态,比如对于失败状态或超时状态的交易,需要对状态参数的取值进行相应的恢复(比如该参与方为汇款方时,需要对相应的账户余额进行回滚),对于成功状态的交易需要更新状态参数(比如该参与方为收款方时,需要对相应的转账金额进行收款、增加至账户余额中),然后根据状态参数的更新后取值,生成相关事件的第二证明信息(确保第二证明信息是基于状态参数的最新取值而生成),然后生成并提交上述集合交易。For example, after receiving the aggregate transaction submitted by each participant, the blockchain node extracts the alternative sub-transactions included in the aggregate transaction and confirms the trigger information (multi-party trigger information or unilateral trigger information) included in the alternative sub-transaction And verification. When the multi-party trigger information contains the confirmation information corresponding to all the participants of the event, or all the participants in the event have submitted the corresponding single-party trigger information (each single-party trigger information contains the corresponding participant's confirmation information), if If the multi-party trigger information or all single-party trigger information has been verified, then the event can be marked as a success status; similarly, the event that failed verification can be marked as a failure status, and all the events will not be received within the valid time period. The event of the confirmation information corresponding to the participant is marked as a timeout state, etc., and then the state of each event is submitted to the blockchain. Taking an participant of an event as an example, before submitting a collective transaction, the participant can query the transaction records on the blockchain ledger to determine the status of each event in which it participates, for example, for a transaction that fails or times out, The value of the status parameter needs to be restored accordingly (for example, if the participant is a remittance party, the corresponding account balance needs to be rolled back), and the status parameter needs to be updated for a successful transaction (for example, the participant is the payee At the time, you need to collect the corresponding transfer amount and add it to the account balance), and then take the updated value of the status parameter to generate the second proof information of the relevant event (ensure that the second proof information is based on the latest status parameter Value), and then generate and submit the above set of transactions.
在一实施例中,当所述事件包括转账事件时,所述事件的参与方包括:汇款方和收款方,所述变化量包括:转账额,所述状态参数包括:账户余额;换言之,相当于从汇款方向收款方实施转账操作,使得汇款方的账户余额减少相应的转账额、收款方的账户余额增加相应的转账额。例如,描述信息中可以包含汇款方的账户地址、收款方的账户地址、转账额(承诺值)、转账额明文(加密状态)、随机数(加密状态)等,以表明从汇款方的账户地址向收款方的账户地址转移该转账额。In an embodiment, when the event includes a transfer event, the participants of the event include: a sender and a receiver, the amount of change includes: a transfer amount, and the status parameter includes: account balance; in other words, It is equivalent to the transfer operation from the remittance to the beneficiary, so that the account balance of the remitter reduces the corresponding transfer amount, and the account balance of the beneficiary increases the corresponding transfer amount. For example, the description information may include the sender's account address, the recipient's account address, the transfer amount (commitment value), the transfer amount in plain text (encrypted state), random number (encrypted state), etc., to indicate the account from the sender The address transfers the transfer amount to the payee's account address.
在一实施例中,当所述事件包括第一汇款事件时,所述事件的参与方包括:汇款方、中继方、收款方,所述变化量包括:所述汇款方与所述中继方之间基于第一类型资产的第一转账额、所述中继方与所述收款方之间基于第二类型资产的第二转账额,所述状态参数包括:账户余额;换言之,相当于在汇款方与中继方之间转移第一类型的资产(如港币)、资产额为第一转账额,并且在中继方与收款方之间转移第二类型的资产(如美元)、资产额为第二转账额,且根据第一类型与第二类型的资产之间的汇率,使得第一 转账额与第二转账额对应的资产价值基本一致,那么最终相当于汇款方的账户余额减少了第一转账额(第一类型的资产)、收款方的账户余额增加了第二转账额(第二类型的资产),而中继方的账户余额增加了第一转账额(第一类型的资产)且减少了第二转账额(第二类型的资产)、在资产价值上相当于未发生变化。In an embodiment, when the event includes a first remittance event, the participants of the event include: a remittance party, a relay party, and a beneficiary party, and the variation includes: the remittance party and the middle party The first transfer amount between the relay parties based on the first type of assets and the second transfer amount between the relay party and the payee based on the second type of assets, the status parameters include: account balance; in other words, Equivalent to transferring the first type of assets (such as Hong Kong dollars) between the sender and the relay, the amount of the asset is the first transfer amount, and transferring the second type of assets (such as the US dollar) between the relay and the receiver ). The asset amount is the second transfer amount, and according to the exchange rate between the first type and the second type of assets, the asset value corresponding to the first transfer amount and the second transfer amount is basically the same. The account balance is reduced by the first transfer amount (the first type of asset), the payee's account balance is increased by the second transfer amount (the second type of asset), and the relay party's account balance is increased by the first transfer amount ( The first type of assets) and reduced the second transfer amount (the second type of assets), which means that the asset value has not changed.
在一实施例中,当所述事件包括第二汇款事件时,所述事件的参与方包括:汇款方、n个中继方、收款方,所述变化量包括:所述汇款方与第1个中继方之间基于第一类型资产的转账额、第i-1个中继方与第i个中继方之间基于第i类型资产的转账额、第n个中继方与所述收款方之间基于第n+1类型资产的转账额,所述状态参数包括:账户余额;其中,1<i≤n。当n=1时,本实施例的第二汇款事件相当于上述实施例的第一汇款事件,此处不再赘述。当n>1时,由于存在多个中继方,因而相比于上述实施例的第一汇款事件而言,还包含多个中继方之间的资产转移过程;以n=2为例,事件的参与方包括汇款方、中继方1、中继方2、收款方,其中:在汇款方与中继方1之间转移第一类型的资产(如港币)、资产额为第一转账额,在中继方1与中继方2之间转移第二类型的资产(如欧元)、资产额为第二转账额,在中继方2与收款方之间转移第三类型的资产(如美元)、资产额为第三转账额,且根据第一类型与第二类型的资产之间的汇率1、第二类型与第三类型的资产之间的汇率2,使得第一转账额、第二转账额与第三转账额对应的资产价值基本一致,那么最终相当于汇款方的账户余额减少了第一转账额(第一类型的资产)、收款方的账户余额增加了第三转账额(第三类型的资产),而中继方1的账户余额增加了第一转账额(第一类型的资产)且减少了第二转账额(第二类型的资产)、在资产价值上相当于未发生变化,中继方2的账户余额增加了第二转账额(第二类型的资产)且减少了第三转账额(第三类型的资产)、在资产价值上相当于未发生变化。In an embodiment, when the event includes a second remittance event, the participants of the event include: a remittance party, n relay parties, and a payee, and the variation includes: the remittance party and the first Transfer amount based on the first type of asset between 1 relay party, transfer amount based on the i type asset between the i-1th relay party and the ith relay party, the nth relay party and all Describe the transfer amount based on the n+1th type of assets between the payees. The status parameters include: account balance; where 1<i≤n. When n=1, the second remittance event of this embodiment is equivalent to the first remittance event of the foregoing embodiment, and details are not described herein again. When n>1, since there are multiple relay parties, compared with the first remittance event of the above embodiment, it also includes the asset transfer process between multiple relay parties; taking n=2 as an example, Participants in the event include the remittance party, relay party 1, relay party 2, and receiver. Among them: the transfer of the first type of assets (such as Hong Kong dollars) between the remittance party and relay party 1, the amount of assets is the first Transfer amount, transfer the second type of assets (such as Euros) between Relay 1 and Relay 2, the amount of the asset is the second transfer amount, and transfer the third type between Relay 2 and the payee The assets (such as US dollars) and the amount of assets are the third transfer amount, and the first transfer is based on the exchange rate 1 between the first type and second type assets, and the exchange rate 2 between the second type and third type assets Amount, the second transfer amount and the asset value corresponding to the third transfer amount are basically the same, then the account balance of the sender is reduced by the first transfer amount (the first type of asset), and the account balance of the payee is increased by Three transfers (the third type of assets), while the account balance of relay 1 increases the first transfer (the first type of assets) and reduces the second transfer (the second type of assets), the asset value The above is equivalent to no change, and the account balance of relay 2 has increased the second transfer amount (second type of assets) and reduced the third transfer amount (third type of assets), which is equivalent to no occurrence in asset value Variety.
在一实施例中,当状态参数的取值、变化量采用密文数值时,所述集合交易中包含的备选子交易还设定有变化前状态值、变化后状态值,使得所述备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;其中,所述状态变化量、所述变化前状态值和所述变化后状态值分别为基于同态加密算法或同态承诺算法计算得到的密文数值。相应地,当区块链节点对集合交易中包含的各个备选子交易进行验证时,需要确保相邻的备选子交易满足:前一备选子交易对应的变化后状态值与后一备选子交易对应的变化前状态值相同,否则将判定为验证失败。In an embodiment, when the value of the state parameter and the amount of change are ciphertext values, the alternative sub-transactions included in the set transaction are also set with a state value before change and a state value after change, so that the backup After the selected sub-transaction is processed, the state parameter of the participant changes from the pre-change state value to the post-change state value via the state change amount; wherein, the state change amount, the pre-change state The value and the changed state value are ciphertext values calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm, respectively. Correspondingly, when the blockchain node verifies each alternative sub-transaction included in the set transaction, it is necessary to ensure that the adjacent alternative sub-transactions meet: the changed state value and the latter backup corresponding to the previous alternative sub-transaction The state value before the change corresponding to the sub-transaction is the same, otherwise it will be judged as verification failure.
为了便于理解,下面以跨境汇款场景为例,对本说明书一个或多个实施例的技术方案进行说明。基于本说明书的技术方案,每一机构可以分别对自身所参与的若干汇款交易(相当于上述的备选子交易)合并为一笔区块链交易(相当于上述的集合交易),并通过向区块链提交该区块链交易,实现对若干汇款交易的批量提交和处理。下面将首先对单笔汇款交易的生成与处理过程进行描述,然后扩展至多笔汇款交易的批量处理。For ease of understanding, the following uses the cross-border remittance scenario as an example to describe the technical solutions of one or more embodiments of this specification. Based on the technical scheme of this specification, each institution can separately merge several remittance transactions (equivalent to the above-mentioned alternative sub-transactions) in which it participates into a blockchain transaction (equivalent to the above-mentioned collective transaction), and through the The blockchain submits the blockchain transaction to realize the batch submission and processing of several remittance transactions. The following will first describe the process of generating and processing a single remittance transaction, and then expand to the batch processing of multiple remittance transactions.
图3是一示例性实施例提供的一种跨境汇款的场景示意图。如图3所示,假定由用户1向用户2进行区块链汇款;其中,本说明书中的“用户”可以表现为所登录的用户账号,而该用户账号实际可以归属于个人或组织,本说明书并不对此进行限制。假定用户1在国家A的机构1处开设有客户资金账户1、用户2在国家B的机构4处开设有客户资金账户2,本说明书可以在机构1与机构4之间无法直接实施跨境汇款的情况下,通过机构2与机构3的协助而在区块链上实现该跨境汇款的操作。FIG. 3 is a schematic diagram of a scenario of cross-border remittance provided by an exemplary embodiment. As shown in FIG. 3, it is assumed that the user 1 transfers the blockchain to the user 2; among them, the "user" in this specification can be represented as a logged-in user account, and the user account can actually belong to an individual or organization. The manual does not limit this. Assuming that user 1 opens a customer funds account at institution 1 in country A 1, and user 2 opens a customer fund account 2 at institution 4 in country B, this specification can not directly implement cross-border remittances between institution 1 and institution 4. In the case of, through the assistance of institutions 2 and 3, the cross-border remittance operation is implemented on the blockchain.
机构1、机构2、机构3和机构4分别存在对应的设备1、设备2、设备3和设备4,并通过在设备1~4上运行区块链的客户端程序,使得设备1~4被配置为相应的区块链节点;相应地,机构1~4可以通过设备1~4实现与区块链相关的操作。例如,机构1~4可以分别通过设备1~4向区块链提交相应的区块链交易;再例如,设备1~4分别维护有区块链上的全量交易数据,即区块链账本,使得机构1~4可以分别据此查询和维护各个区块链账户的余额数据,比如机构1对应的区块链账户Y1持有1000港币,机构2对应的区块链账户Y2持有2500港币和4200欧元,机构3对应的区块链账户Y3持有3000欧元和2000美元,机构4对应的区块链账户Y4持有1500美元等。Institution 1, institution 2, institution 3 and institution 4 have corresponding equipment 1, equipment 2, equipment 3 and equipment 4, respectively, and by running the client program of the blockchain on equipment 1 to 4, equipment 1 to 4 are Configured as a corresponding blockchain node; accordingly, institutions 1 to 4 can implement operations related to the blockchain through devices 1 to 4. For example, institutions 1 to 4 can submit corresponding blockchain transactions to the blockchain through devices 1 to 4; for another example, devices 1 to 4 respectively maintain full transaction data on the blockchain, that is, blockchain ledger, Institutions 1 to 4 can query and maintain the balance data of each blockchain account accordingly. For example, the blockchain account Y1 corresponding to institution 1 holds 1000 HKD, and the blockchain account Y2 corresponding to institution 2 holds 2500 HKD and 4,200 Euros, the Blockchain account Y3 corresponding to Institution 3 holds 3,000 Euros and $2,000, and the Blockchain account Y4 corresponding to Institution 4 holds $1,500.
出于隐私保护等方面的考虑,区块链账户Y1~Y4的余额数据往往并非以明文形式进行维护,而是采用对应的密文数据。以区块链账户Y1为例,在区块链账本中可以被记录为(currency_1,PC(a,r_a),Enc_A(a),Enc_A(r_a)),其中:currency_1表示货币类型为港币,a表示港币数额为1000,r_a为a对应的随机数,PC(a,r_a)是通过Pedersen承诺机制对a和r_a进行计算得到的密文形式的承诺值,Enc_A(a)、Enc_A(r_a)分别为a和r_a的密文取值(比如可以采用机构1的身份公钥进行加密,或者可以采用其他任意形式的加密算法)。区块链账户Y2可以被记录为(currency_1,PC(b1,r_b1),Enc_B(b1),Enc_B(r_b1))、(currency_2,PC(b2,r_b2),Enc_B(b2),Enc_B(r_b2)),其中:b1表示港币数额为2500、r_b1为b1对应的随机数,currency_2表示货币类型为欧元,b2表示欧元数额为4200、r_b2为b2对应的随机数。区块链账户Y3可以被记录为(currency_2,PC(c1,r_c1),Enc_C(c1),Enc_C(r_c1))、(currency_3,PC(c2,r_c2),Enc_C(c2),Enc_C(r_c2)),其中: c1表示港币欧元为3000、r_c1为c1对应的随机数,currency_3表示货币类型为美元,c2表示美元数额为2000、r_c2为c2对应的随机数。区块链账户Y4可以被记录为(currency_3,PC(d,r_d),Enc_D(d),Enc_D(r_d)),其中d表示美元数额为1500、r_d为d对应的随机数。For privacy protection and other considerations, the balance data of the blockchain accounts Y1 to Y4 are often not maintained in the form of plain text, but the corresponding cipher text data is used. Taking the blockchain account Y1 as an example, it can be recorded as (currency_1, PC(a, r_a), Enc_A(a), Enc_A(r_a)) in the blockchain ledger, where: currency_1 means the currency type is Hong Kong dollar, a It means that the amount of Hong Kong dollar is 1000, r_a is the random number corresponding to a, PC(a, r_a) is the commitment value in the form of ciphertext calculated by Pedersen commitment mechanism for a and r_a, Enc_A(a), Enc_A(r_a) respectively Take values for the ciphertext of a and r_a (for example, you can use the identity public key of organization 1 for encryption, or you can use any other form of encryption algorithm). The blockchain account Y2 can be recorded as (currency_1, PC(b1, r_b1), Enc_B(b1), Enc_B(r_b1)), (currency_2, PC(b2, r_b2), Enc_B(b2), Enc_B(r_b2)) , Where: b1 means the amount of HKD is 2500, r_b1 is the random number corresponding to b1, currency_2 means the currency type is Euro, b2 means the amount of Euro is 4200, and r_b2 is the random number corresponding to b2. Blockchain account Y3 can be recorded as (currency_2, PC(c1, r_c1), Enc_C(c1), Enc_C(r_c1)), (currency_3, PC(c2, r_c2), Enc_C(c2), Enc_C(r_c2)) , Where: c1 indicates that the Hong Kong dollar is 3000, r_c1 is the random number corresponding to c1, currency_3 indicates the currency type is USD, c2 indicates the amount of USD is 2000, and r_c2 is the random number corresponding to c2. The blockchain account Y4 can be recorded as (currency_3, PC(d, r_d), Enc_D(d), Enc_D(r_d)), where d represents the amount of USD 1500 and r_d is the random number corresponding to d.
基于图3所示的汇款场景,图4是一示例性实施例的一种跨境汇款过程中的交互示意图。如图4所示,跨境汇款的交互过程可以包括以下步骤:Based on the remittance scenario shown in FIG. 3, FIG. 4 is a schematic diagram of interaction in a cross-border remittance process according to an exemplary embodiment. As shown in Figure 4, the interactive process of cross-border remittance can include the following steps:
步骤401,设备1起草汇款交易tx_i。In step 401, the device 1 drafts a remittance transaction tx_i.
在一实施例中,假定用户1希望向用户2汇款500港币,该用户1可以通过在机构1处的客户资金账户1提供该500港币,而用户2可以通过在机构4处的客户资金账户2收取按一定汇率计算后的美元。In an embodiment, suppose that user 1 wishes to send 500 HKD to user 2. This user 1 can provide the 500 HKD through customer funds account 1 at institution 1, and user 2 can use customer funds account 2 at institution 4 Charge the US dollar calculated at a certain exchange rate.
在一实施例中,机构1可以从用户1对应的客户资金账户1中扣取500港币;以及,机构1需要在自身与机构4之间确定出汇款路由,比如图4中的汇款路由为“机构1→机构2→机构3→机构4”,使得机构1可以向机构2转入500港币、机构2可以向机构3转入56欧元(相当于500港币)、机构3可以向机构4转入64美元(相当于56欧元、500港币),并最终由机构4向用户2对应的客户资金账户2转入64美元,从而完成汇款操作。其中,机构1从客户资金账户1扣取500港币、机构4向客户资金账户2转入64美元属于链外操作,而机构1~机构4之间则通过区块链实现链上资金转移。In an embodiment, the institution 1 may deduct 500 Hong Kong dollars from the customer funds account 1 corresponding to the user 1; and, the institution 1 needs to determine the remittance route between itself and the institution 4, for example, the remittance route in FIG. 4 is “ Institution 1→Institution 2→Institution 3→Institution 4”, so that Institution 1 can transfer 500 HKD to Institution 2, Institution 2 can transfer 56 Euros (equivalent to 500 HKD) to Institution 3, Institution 3 can transfer to Institution 4 64 US dollars (equivalent to 56 euros, 500 Hong Kong dollars), and finally the institution 4 transfers 64 US dollars to the customer funds account 2 corresponding to user 2 to complete the remittance operation. Among them, Institution 1 deducts 500 Hong Kong dollars from customer funds account 1, Institution 4 transfers US$64 to customer funds account 2 is an off-chain operation, and institutions 1 to 4 realize the on-chain funds transfer through the blockchain.
在一实施例中,在上述的汇款路由“机构1→机构2→机构3→机构4”中,机构1与机构4之间存在2个中继方为机构3和机构4;而在其他实施例中,中继方的数量可以为1个、3个或3个以上,本说明书并不对此进行限制。In one embodiment, in the above remittance route “institution 1→institution 2→institution 3→institution 4”, there are two relay parties between organization 1 and organization 4 as organization 3 and organization 4; while in other implementations In the example, the number of relay parties may be one, three, or more than three, and this specification does not limit this.
针对已经确定的上述汇款路由,以及各个机构之间的汇款金额,设备1起草的汇款交易tx_i可以包括以下汇款交易详情:交易id为tx_i,区块链账户Y1的地址Z1、区块链账户Y2的地址Z2、区块链账户Y3的地址Z3、区块链账户Y4的地址Z4,与交易金额相关的密文信息{(currency_1,PC(t1,r_t1),Enc_B(t1),Enc_B(r_t1),Enc_C(t1),Enc_C(r_t1),Enc_D(t1),Enc_D(r_t1)),(currency_2,PC(t2,r_t2),Enc_B(t2),Enc_B(r_t2),Enc_C(t2),Enc_C(r_t2),Enc_D(t2),Enc_D(r_t2)),(currency_3,PC(t3,r_t3),Enc_B(t3),Enc_B(r_t3),Enc_C(t3),Enc_C(r_t3),Enc_D(t3),Enc_D(r_t3)),rate1,rate2,time,…},针对交易金额t1、t2、t3的区间证明RP_t1、RP_t2、RP_t3等。For the above-mentioned remittance route and the amount of remittance between various institutions, the remittance transaction tx_i drafted by the device 1 may include the following remittance transaction details: the transaction id is tx_i, the address Z1 of the blockchain account Y1, and the blockchain account Y2 Address Z2, blockchain account Y3 address Z3, blockchain account Y4 address Z4, cipher text information related to the transaction amount {(currency_1, PC(t1, r_t1), Enc_B(t1), Enc_B(r_t1) ,Enc_C(t1),Enc_C(r_t1),Enc_D(t1),Enc_D(r_t1)),(currency_2,PC(t2,r_t2),Enc_B(t2),Enc_B(r_t2),Enc_C(t2),Enc_C(r_t2 ),Enc_D(t2),Enc_D(r_t2)),(currency_3,PC(t3,r_t3),Enc_B(t3),Enc_B(r_t3),Enc_C(t3),Enc_C(r_t3),Enc_D(t3),Enc_D( r_t3)), rate1, rate2, time, ...}, prove RP_t1, RP_t2, RP_t3, etc. for the interval of the transaction amount t1, t2, t3.
其中,地址Z1~Z4用于表明本次汇款事件的参与方,以使得后续从该地址Z1~Z4对应的区块链账户Y1~Y4实施转账汇款。Among them, the addresses Z1 to Z4 are used to indicate the participants of this remittance event, so that the subsequent transfer and remittance will be made from the blockchain accounts Y1 to Y4 corresponding to the addresses Z1 to Z4.
在(currency_1,PC(t1,r_t1),Enc_B(t1),Enc_B(r_t1),Enc_C(t1),Enc_C(r_t1),Enc_D(t1),Enc_D(r_t1))中,t1表示从地址Z1向地址Z2的转账金额(如上述的500港币),r_t1为该金额t1对应的随机数,PC(t1,r_t1)为基于金额t1和随机数r_t1计算得到的承诺值,Enc_B(t1)表示用机构2的身份公钥对金额t1进行加密后的密文数值、Enc_C(t1)表示用机构3的身份公钥对金额t1进行加密后的密文数值、Enc_D(t1)表示用机构4的身份公钥对金额t1进行加密后的密文数值;类似地,Enc_B(r_t1)、Enc_C(r_t1)、Enc_D(r_t1)分别为通过机构2、机构3、机构4的身份公钥对金额t1进行加密后的密文数值。(currency_2,PC(t2,r_t2),Enc_B(t2),Enc_B(r_t2),Enc_C(t2),Enc_C(r_t2),Enc_D(t2),Enc_D(r_t2))和(currency_3,PC(t3,r_t3),Enc_B(t3),Enc_B(r_t3),Enc_C(t3),Enc_C(r_t3),Enc_D(t3),Enc_D(r_t3))的情况类似,此处不再赘述。rate1、rate2分别为currency_1与currency_2的汇率、currency_2与currency_3的汇率。time为交易时刻。以及,还可能存在一些其他的交易所需数据,这可以参考相关技术中的方案,此处不再一一列举。In (currency_1, PC(t1, r_t1), Enc_B(t1), Enc_B(r_t1), Enc_C(t1), Enc_C(r_t1), Enc_D(t1), Enc_D(r_t1)), t1 means from address Z1 to address The transfer amount of Z2 (such as the above 500 Hong Kong dollars), r_t1 is the random number corresponding to the amount t1, PC(t1, r_t1) is the commitment value calculated based on the amount t1 and the random number r_t1, Enc_B(t1) indicates the institution 2 The ciphertext value of the amount t1 encrypted by the identity public key of the ID, Enc_C(t1) means the ciphertext value of the amount t1 encrypted by the identity public key of the institution 3, and Enc_D(t1) means the identity public key of the institution 4 The ciphertext value after encrypting the amount t1; similarly, Enc_B(r_t1), Enc_C(r_t1), and Enc_D(r_t1) are the amounts of t1 encrypted by the identity public keys of institution 2, institution 3, and institution 4, respectively Cipher text value. (currency_2,PC(t2,r_t2),Enc_B(t2),Enc_B(r_t2),Enc_C(t2),Enc_C(r_t2),Enc_D(t2),Enc_D(r_t2)) and (currency_3,PC(t3,r_t3) , Enc_B(t3), Enc_B(r_t3), Enc_C(t3), Enc_C(r_t3), Enc_D(t3), Enc_D(r_t3)) The situation is similar, so I won’t repeat them here. rate1 and rate2 are the exchange rate of currency_1 and currency_2, and the exchange rate of currency_2 and currency_3 respectively. time is the trading moment. And, there may be some other data required for the transaction, which can be referred to the scheme in the related art, which will not be listed here one by one.
RP_t1、RP_t2、RP_t3分别为对应于交易金额t1、t2、t3的区间证明,以分别用于证明交易金额t1、t2、t3处于正确数值区间,比如1≤t1<2 64、1≤t2<2 64、1≤t3<2 64。其中,设备1可以通过相关技术中的零知识证明技术生成上述的区间证明,本说明书并不对此进行限制。 RP_t1, RP_t2, and RP_t3 are the interval proofs corresponding to the transaction amounts t1, t2, and t3, respectively, to prove that the transaction amounts t1, t2, and t3 are in the correct numerical range, for example, 1≤t1<2 64 , 1≤t2<2 64 , 1≤t3<2 64 . Among them, the device 1 can generate the above-mentioned interval proof through the zero-knowledge proof technique in the related art, which is not limited in this specification.
而如果采用明文数值,那么在汇款交易tx_i的汇款交易详情中,上述与交易金额相关的密文信息可以被替换为与交易金额相关的明文信息,比如{(currency_1,t1),(currency_2,t2),(currency_3,t3),rate1,rate2,time,…},且无需包含上述的区间证明RP_t1、RP_t2、RP_t3等内容。If the plain text value is used, in the remittance transaction details of the remittance transaction tx_i, the above cipher text information related to the transaction amount can be replaced with plain text information related to the transaction amount, such as {(currency_1,t1),(currency_2,t2 ),(currency_3,t3),rate1,rate2,time,...}, and does not need to include the above-mentioned interval proofs RP_t1, RP_t2, RP_t3, etc.
步骤402a~402c,设备1将汇款交易详情分别同步至设备2、设备3和设备4。In steps 402a to 402c, device 1 synchronizes the details of the remittance transaction to device 2, device 3, and device 4, respectively.
在一实施例中,设备1可以通过机构1的身份私钥对汇款交易详情进行签名后,通过链外(或称为,链下)通道分别发送至设备2~设备4,以实现数据同步。In an embodiment, the device 1 may sign the details of the remittance transaction through the identity private key of the organization 1, and then send them to the device 2 to the device 4 through an off-chain (or referred to as off-chain) channel to achieve data synchronization.
在一实施例中,设备1~设备4分别运行有区块链的客户端程序,使得设备1~设备4分别被配置为区块链中的区块链节点;或者,设备1~设备4在区块链中分别存在对应的区块链节点,本说明书并不对此进行限制。其中,区块链中的每一区块链节点分别维护有内容统一的区块链账本,区块链账本中记录有全量的区块链数据。因此,设备 1可以生成一笔交易,该交易的内容包含上述汇款交易tx_i的汇款交易详情,并将该交易提交至区块链中;相应地,当该交易通过共识后,可以被发送至区块链中的各个区块链节点,以供各个区块链节点更新自身维护的区块链账本。因此,设备1、设备2、设备3和设备4可以分别通过自身对应的区块链节点所维护的区块链账本,获知设备1提交的上述交易,从而获取该交易中包含的上述汇款交易tx_i的汇款交易详情。In an embodiment, device 1 to device 4 respectively run a client program of the blockchain, so that device 1 to device 4 are respectively configured as blockchain nodes in the blockchain; or, device 1 to device 4 are There are corresponding blockchain nodes in the blockchain, and this specification does not limit this. Among them, each blockchain node in the blockchain maintains a unified blockchain ledger, and the blockchain ledger records a full amount of blockchain data. Therefore, device 1 can generate a transaction that contains the remittance transaction details of the above remittance transaction tx_i, and submit the transaction to the blockchain; accordingly, when the transaction passes consensus, it can be sent to the district Each blockchain node in the blockchain is used by each blockchain node to update its maintained blockchain ledger. Therefore, device 1, device 2, device 3, and device 4 can be informed of the above transaction submitted by device 1 through the blockchain ledger maintained by their corresponding blockchain nodes, so as to obtain the above remittance transaction tx_i included in the transaction Details of the remittance transaction.
当然,设备1还可能通过其他方式将汇款交易数据同步至设备2~设备4,本说明书并不对此进行限制。Of course, the device 1 may also synchronize the remittance transaction data to the device 2 to the device 4 in other ways, which is not limited in this specification.
步骤403a,设备1将汇款交易详情对应的汇款交易tx_i添加至自身的本地队列1。In step 403a, the device 1 adds the remittance transaction tx_i corresponding to the remittance transaction details to its own local queue 1.
在一实施例中,当设备1通过链外通道发送汇款交易详情时,设备1可以直接向本地队列1添加汇款交易tx_i;当然,设备1可以等待设备2~设备4对汇款交易详情确认完毕并返回相应的确认响应后,才向本地队列1添加汇款交易tx_i,以确保设备2~设备4均参与至该汇款交易tx_i。In an embodiment, when the device 1 sends the remittance transaction details through the off-chain channel, the device 1 can directly add the remittance transaction tx_i to the local queue 1; of course, the device 1 can wait for the device 2 to the device 4 to confirm the details of the remittance transaction and After the corresponding confirmation response is returned, the remittance transaction tx_i is added to the local queue 1 to ensure that devices 2 to 4 all participate in the remittance transaction tx_i.
在一实施例中,当设备1通过区块链将汇款交易详情同步至设备2~设备4时,设备1同样会收到区块链上同步的该汇款交易详情,那么设备1既可以对该汇款交易详情进行验证(验证过程可参考步骤403b),并在通过验证后将汇款交易tx_i添加至本地队列1,也可以在确定该汇款交易详情对应于汇款交易tx_i、该汇款交易tx_i由该设备1自身起草并提交至区块链时,略去对汇款交易详情的验证过程,而直接添加至本地队列1。In an embodiment, when the device 1 synchronizes the details of the remittance transaction to the device 2 to the device 4 through the blockchain, the device 1 will also receive the details of the remittance transaction synchronized on the blockchain. Remittance transaction details are verified (for verification process, please refer to step 403b), and after verification, add the remittance transaction tx_i to the local queue 1, or confirm that the remittance transaction details correspond to the remittance transaction tx_i, the remittance transaction tx_i is determined by the device 1 When drafting and submitting to the blockchain itself, the verification process of the details of the remittance transaction is omitted, and it is directly added to the local queue 1.
步骤403b,设备2对收到的汇款交易详情进行验证后,将其添加至自身的本地队列2。In step 403b, after verifying the details of the received remittance transaction, the device 2 adds it to its own local queue 2.
在一实施例中,设备2在收到汇款交易详情后,需要实施验证操作,包括:设备2通过自身的身份私钥对汇款交易详情包含的Enc_B(t1)、Enc_B(r_t1)、Enc_B(t2)、Enc_B(r_t2)、Enc_B(t3)、Enc_B(r_t3)进行解密,得到相应的金额t1与随机数r_t1、金额t2与随机数r_t2、金额t3与随机数r_t3,并分别验证PC(t1,r_t1)=r_t1G+t1H、PC(t2,r_t2)=r_t2G+t2H、PC(t3,r_t3)=r_t3G+t3H是否成立,其中G、H为系统参数;设备2验证currency_1与currency_2之间的汇率是否为rate1、currency_2与currency_3之间的汇率是否为rate2;设备2验证区间证明RP_t1、RP_t2、RP_t3是否正确等。在确定汇款交易详情通过验证后,设备2可以向自身维护的本地队列2添加相应的汇款交易tx_i, 并且向设备1返回确认响应、以表明接受相应的汇款交易。In an embodiment, after receiving the details of the remittance transaction, the device 2 needs to implement a verification operation, including: the device 2 uses its own private key to identify the Enc_B(t1), Enc_B(r_t1), and Enc_B(t2) contained in the details of the remittance transaction. ), Enc_B(r_t2), Enc_B(t3), Enc_B(r_t3) to decrypt, get the corresponding amount t1 and random number r_t1, amount t2 and random number r_t2, amount t3 and random number r_t3, and verify PC(t1, r_t1)=r_t1G+t1H, PC(t2,r_t2)=r_t2G+t2H, PC(t3,r_t3)=r_t3G+t3H is established, where G and H are system parameters; device 2 verifies whether the exchange rate between currency_1 and currency_2 Is the exchange rate between rate1, currency_2 and currency_3 is rate2; Device 2 verifies that the interval proves that RP_t1, RP_t2, RP_t3 are correct, etc. After determining that the details of the remittance transaction have been verified, the device 2 may add the corresponding remittance transaction tx_i to the local queue 2 maintained by itself, and return a confirmation response to the device 1 to indicate that the corresponding remittance transaction is accepted.
当然,如果采用明文数值,那么可以省略上述的解密、承诺值验证、区间证明验证等操作,比如仅对各个参与方的区块链账户的地址、t1、t2、t3、rate1、rate2的取值进行核对。Of course, if the plain text value is used, the above decryption, commitment value verification, interval proof verification and other operations can be omitted, for example, only the addresses, t1, t2, t3, rate1, and rate2 of each participant’s blockchain account Check it.
步骤403c-403d,设备3-4分别对收到的汇款交易详情进行验证后,将其添加至自身的本地队列3-4。Steps 403c-403d, after verifying the details of the received remittance transaction, the device 3-4 adds it to its own local queue 3-4.
在一实施例中,设备3、设备4所实施的操作与设备2相类似,此处不再一一赘述。In an embodiment, the operations performed by the device 3 and the device 4 are similar to those of the device 2, and are not repeated here.
至此,汇款交易tx_i已经被设备1~设备4分别添加至各自维护的本地队列1~4中。类似地,当设备1~设备4分别参与到其他的汇款交易(并不一定为设备1~设备4同时参与的汇款交易)时,同样可以采用类似于对上述汇款交易tx_i的处理方式,向相应的本地队列中添加汇款交易,以用于下述步骤中的交易聚合与批量处理。So far, the remittance transaction tx_i has been added to the local queues 1 to 4 maintained by devices 1 to 4 respectively. Similarly, when devices 1 to 4 participate in other remittance transactions (not necessarily the remittance transactions that device 1 to device 4 participate in at the same time), the processing method similar to the above remittance transaction tx_i can also be adopted. The remittance transaction is added to the local queue for the transaction aggregation and batch processing in the following steps.
步骤404a,设备1根据本地队列1中的汇款交易,聚合生成交易TX_a,并在签名后提交至区块链。In step 404a, the device 1 aggregates the transaction TX_a according to the remittance transaction in the local queue 1, and submits it to the blockchain after signing.
如上文所述,与汇款交易tx_i相类似的,机构1还可以参与其他的汇款交易,比如当某一用户需要通过机构1向另一用户进行汇款时,设备1可以通过类似于上述步骤的方式,起草相应的汇款交易、将汇款交易详情发送至其他各个机构进行验证、向本地队列1中添加相应的汇款交易tx_i。同时,机构1还可以作为一些汇款交易的中继方(类似于机构2-3在上述实施例中的角色)或收款方(类似于机构4在上述实施例中的角色),使得该机构1可以通过设备1接收这些汇款交易的汇款方(类似于机构1在上述实施例中的角色)发送的汇款交易详情,并在验证通过后向本地队列1中添加相应的汇款交易。As mentioned above, similar to the remittance transaction tx_i, the institution 1 can also participate in other remittance transactions. For example, when a user needs to remit money to another user through the institution 1, the device 1 can use a method similar to the above steps , Draft the corresponding remittance transaction, send the details of the remittance transaction to other institutions for verification, and add the corresponding remittance transaction tx_i to the local queue 1. At the same time, institution 1 can also act as a relay party for some remittance transactions (similar to the role of institution 2-3 in the above-mentioned embodiment) or a payee (similar to the role of institution 4 in the above-mentioned embodiment), making the institution 1 The device 1 can receive the remittance transaction details sent by the remittance party (similar to the role of the institution 1 in the above embodiment) of these remittance transactions, and add the corresponding remittance transaction to the local queue 1 after the verification is passed.
因此,设备1维护的本地队列1中包含机构1所参与的诸多汇款交易。而设备1可以按照预定义的交易选择规则,每次从本地队列1中选取一个或多个汇款交易,并对被选取的汇款交易进行聚合,生成一笔区块链交易。Therefore, the local queue 1 maintained by the device 1 contains many remittance transactions in which the institution 1 participates. The device 1 can select one or more remittance transactions from the local queue 1 each time according to the predefined transaction selection rules, and aggregate the selected remittance transactions to generate a blockchain transaction.
例如,图5是一示例性实施例提供的一种基于密文数值的区块链交易内容的示意图。如图5所示,假定设备1每次选取4个汇款交易并聚合为一笔区块链交易,比如汇款交易tx_11、tx_12、tx_13、tx_14被聚合为区块链交易TX_1,汇款交易tx_21、tx_22、tx_23、tx_24被聚合为区块链交易TX_2,汇款交易tx_31、tx_32、tx_33、tx_34被聚合 为区块链交易TX_3。在设备1生成的每一区块链交易中,分别包含设备1设定的顺序编号seq和与各个汇款交易相关的信息。For example, FIG. 5 is a schematic diagram of a blockchain transaction content based on a ciphertext value provided by an exemplary embodiment. As shown in FIG. 5, assume that device 1 selects 4 remittance transactions and aggregates them into a blockchain transaction, for example, remittance transactions tx_11, tx_12, tx_13, and tx_14 are aggregated into blockchain transactions TX_1, and remittance transactions tx_21, tx_22 , Tx_23, tx_24 are aggregated into blockchain transactions TX_2, remittance transactions tx_31, tx_32, tx_33, tx_34 are aggregated into blockchain transactions TX_3. Each blockchain transaction generated by the device 1 includes the sequence number seq set by the device 1 and information related to each remittance transaction.
顺序编号seq与各个区块链交易的生成顺序相关。比如区块链交易TX_1的seq取值为99、区块链交易TX_2的seq取值为100、区块链交易TX_3的seq取值为101,表明区块链交易TX_1早于区块链交易TX_2生成、区块链交易TX_2早于区块链交易TX_3生成。相应的,区块链节点在收到设备1提交的各个区块链交易后,会按照seq取值从小到大的顺序依次对各个区块链交易进行处理,比如先处理区块链交易TX_1、再处理区块链交易TX_2、然后处理区块链交易TX_3。The sequence number seq is related to the generation order of each blockchain transaction. For example, the seq value of the blockchain transaction TX_1 is 99, the seq value of the blockchain transaction TX_2 is 100, and the seq value of the blockchain transaction TX_3 is 101, indicating that the blockchain transaction TX_1 is earlier than the blockchain transaction TX_2 Generation, blockchain transaction TX_2 is generated earlier than blockchain transaction TX_3. Correspondingly, after receiving each blockchain transaction submitted by device 1, the blockchain node will process each blockchain transaction in the order of seq from small to large, such as first processing the blockchain transaction TX_1, Then process the blockchain transaction TX_2, and then process the blockchain transaction TX_3.
与各个汇款交易相关的信息可以包括:区块链交易的起始状态余额、区块链交易的结束状态余额、每一汇款交易的起始状态余额、每一汇款交易的交易额、每一汇款交易的结束状态(即临时状态)余额、每一汇款交易的证明信息等。The information related to each remittance transaction may include: the initial state balance of the blockchain transaction, the end state balance of the blockchain transaction, the initial state balance of each remittance transaction, the transaction amount of each remittance transaction, each remittance The balance of the transaction's end status (that is, the temporary status), the proof information of each remittance transaction, etc.
以区块链交易TX_1为例。区块链交易TX_1的起始状态余额为PC(100)、区块链交易TX_1结束状态余额为PC(80)、汇款交易tx_11的起始状态余额为PC(100)、汇款交易tx_11的交易额为待汇入的PC(10)、汇款交易tx_11的结束状态余额为PC(110)、汇款交易tx_11的证明信息包括PC(10)、PC(110)分别属于正确数值区间的区间证明,汇款交易tx_12~tx_14的相关内容可以参考图5,此处不再一一例举。Take the blockchain transaction TX_1 as an example. The initial balance of the blockchain transaction TX_1 is PC (100), the final balance of the blockchain transaction TX_1 is PC (80), the initial balance of the remittance transaction tx_11 is PC (100), and the transaction amount of the remittance transaction tx_11 For the PC (10) to be remitted, the end status balance of the remittance transaction tx_11 is PC (110), and the proof information of the remittance transaction tx_11 includes the interval proof that the PC (10) and PC (110) belong to the correct numerical range, For the related content of tx_12 to tx_14, please refer to FIG. 5, and no more examples will be given here.
需要指出的是:当机构1在该区块链交易中包含的若干汇款交易中作为汇款方或中继方时,机构1会将自身对应的区块链账户Y1的账户余额减去对应的转账金额(汇款方仅转出资金;中继方既可接收转入资金又需要转出资金,这里是针对转出资金的操作而描述),并基于更新后的汇款金额继续参与后续的汇款交易。当该区块链交易被提交至区块链后,如果机构1作为汇款方或中继方的某一汇款交易成功执行,机构1无需调整区块链账户Y1;如果机构1作为汇款方或中继方的某一汇款交易未成功执行,机构1需要对区块链账户Y1的账户余额进行回滚调节。而当上述的区块链交易中包含机构1作为收款方或中继方(收款方仅转入资金;中继方既可接收转入资金又需要转出资金,这里是针对转入资金的操作而描述)的汇款交易时,如果该汇款交易成功执行,机构1需要向区块链账户Y1中增加相应资金、实现收款,如果汇款交易未成功执行,机构1无需调整区块链账户Y1。相应地,区块链节点在收到并处理设备1提交的区块链交易时,可以针对区块链交易所包含的汇款交易是否能够成功执行,对各个汇款交易进行状态标记,比如交易为成功状态、失败状态、超时状态等。It should be noted that when institution 1 acts as a remittance or relay party in several remittance transactions included in this blockchain transaction, institution 1 will subtract the corresponding account transfer from its corresponding blockchain account Y1 account balance Amount (the remittance party only transfers out the funds; the relay party can receive the transferred funds and need to transfer out the funds, which is described here for the operation of the transferred funds), and continue to participate in the subsequent remittance transactions based on the updated remittance amount. After the blockchain transaction is submitted to the blockchain, if institution 1 as a remittance or relay party successfully executes a remittance transaction, institution 1 does not need to adjust the blockchain account Y1; if institution 1 acts as a remittance party or If a remittance transaction of the successor is not successfully executed, the institution 1 needs to adjust the balance of the account of the blockchain account Y1. When the above-mentioned blockchain transaction includes institution 1 as the payee or the relay party (the payee only transfers funds; the relay party can receive the transferred funds and need to transfer the funds, here is for the transferred funds During the remittance transaction, if the remittance transaction is successfully executed, the institution 1 needs to add the corresponding funds to the blockchain account Y1 to realize the collection. If the remittance transaction is not successfully executed, the institution 1 does not need to adjust the blockchain account Y1. Correspondingly, when the blockchain node receives and processes the blockchain transaction submitted by the device 1, it can mark the status of each remittance transaction according to whether the remittance transaction included in the blockchain exchange can be successfully executed, such as the transaction is successful Status, failure status, timeout status, etc.
因此,对于上述“区块链交易TX_1的起始状态余额为PC(100)”而言,设备1 在聚合生成区块链交易TX_1时,并不直接将区块链账户Y1的余额取值设定为区块链交易TX_1的起始状态余额,而是需要先确定出设备1先前提交的区块链交易中可能造成金额变化的汇款交易,包括:机构1作为中继方或收款方的汇款交易被标记为成功状态时产生的金额增加(收款)、机构1作为汇款方或中继方的汇款交易被标记为失败状态或超时状态时产生的金额增加(对已扣除的转账金额进行回滚)等。以及,设备1进一步根据区块链账户Y1的余额取值(已扣除先前提交的汇款交易的转账金额、尚未收款)与上述可能造成金额变化的汇款交易实际产生的金额变化值,计算得到相应的起始状态余额为PC(100);同样,设备1应当基于该起始状态余额PC(100),分别为区块链交易TX_1包含的各个汇款交易生成相应的区间证明。Therefore, for the above "Blockchain transaction TX_1's initial state balance is PC(100)", when device 1 aggregates and generates blockchain transaction TX_1, it does not directly set the value of the balance of the blockchain account Y1 It is determined as the initial balance of the blockchain transaction TX_1, but it is necessary to determine the remittance transaction that may cause the amount change in the blockchain transaction previously submitted by the device 1, including: the institution 1 acts as a relay or payee The increase in the amount of money generated when the remittance transaction is marked as successful (receipt), and the increase in the amount of money when the remittance transaction of institution 1 as the sender or relay is marked as failed or overtime (for the deducted transfer amount) Rollback) etc. And, the device 1 further calculates the corresponding value based on the value of the balance of the blockchain account Y1 (the transfer amount of the previously submitted remittance transaction has been deducted, the unreceived payment) and the actual amount change value of the above remittance transaction that may cause the amount change The initial state balance of is PC (100); similarly, the device 1 should generate corresponding interval proofs for each remittance transaction included in the blockchain transaction TX_1 based on the initial state balance PC (100).
再例如,图6是一示例性实施例提供的一种基于明文数值的区块链交易内容的示意图。如图6所示,假定设备1每次选取4个汇款交易并聚合为一笔区块链交易,比如汇款交易tx_11、tx_12、tx_13、tx_14被聚合为区块链交易TX_1,汇款交易tx_21、tx_22、tx_23、tx_24被聚合为区块链交易TX_2,汇款交易tx_31、tx_32、tx_33、tx_34被聚合为区块链交易TX_3。在设备1生成的每一区块链交易中,分别包含设备1设定的顺序编号seq和与各个汇款交易相关的信息。For another example, FIG. 6 is a schematic diagram of a block chain transaction content based on plain text values provided by an exemplary embodiment. As shown in FIG. 6, assume that device 1 selects 4 remittance transactions and aggregates them into a blockchain transaction, for example, remittance transactions tx_11, tx_12, tx_13, and tx_14 are aggregated into blockchain transactions TX_1, and remittance transactions tx_21, tx_22 , Tx_23, tx_24 are aggregated into blockchain transactions TX_2, remittance transactions tx_31, tx_32, tx_33, tx_34 are aggregated into blockchain transactions TX_3. Each blockchain transaction generated by the device 1 includes the sequence number seq set by the device 1 and information related to each remittance transaction.
其中,顺序编号seq的作用与图5所示实施例相同,此处不再赘述。与各个汇款交易相关的信息可以包括:区块链交易的起始状态余额、区块链交易的结束状态余额、每一汇款交易的交易额;而由于采用明文数据的原因,因此不再需要图5所示实施例中的每一汇款交易的起始状态余额、每一汇款交易的结束状态(即临时状态)余额、每一汇款交易的证明信息等内容,区块链节点直接根据各个明文数值进行比较或计算即可。The sequence number seq has the same function as the embodiment shown in FIG. 5 and will not be repeated here. The information related to each remittance transaction can include: the initial state balance of the blockchain transaction, the end state balance of the blockchain transaction, and the transaction amount of each remittance transaction; and because of the use of plain text data, no longer need a picture In the embodiment shown in FIG. 5, the initial state balance of each remittance transaction, the balance of the end state of each remittance transaction (that is, the temporary state), the proof information of each remittance transaction, etc., the blockchain node directly according to each clear text value Just compare or calculate.
步骤404b-c,设备2-3根据本地队列2-3中的汇款交易,分别聚合生成交易TX_b、TX_c,并在签名后分别提交至区块链。In steps 404b-c, the device 2-3 aggregates and generates transactions TX_b and TX_c according to the remittance transactions in the local queue 2-3, and submits them to the blockchain after signing.
在一实施例中,与设备1相类似的,设备2可以从本地队列2中选取一个或多个汇款交易,以聚合生成相应的区块链交易。假定设备2在某一次选取的汇款交易中包含上述的汇款交易tx_i,并据此生成了相应的区块链交易TX_b。In an embodiment, similar to the device 1, the device 2 may select one or more remittance transactions from the local queue 2 to aggregate and generate corresponding blockchain transactions. It is assumed that the device 2 includes the above-mentioned remittance transaction tx_i in a certain selected remittance transaction, and accordingly generates a corresponding blockchain transaction TX_b.
在一实施例中,与设备1相类似的,设备3可以从本地队列3中选取一个或多个汇款交易,以聚合生成相应的区块链交易。假定设备3在某一次选取的汇款交易中包含上述的汇款交易tx_i,并据此生成了相应的区块链交易TX_c。In an embodiment, similar to the device 1, the device 3 may select one or more remittance transactions from the local queue 3 to aggregate and generate corresponding blockchain transactions. It is assumed that the device 3 includes the above-mentioned remittance transaction tx_i in a certain selected remittance transaction, and accordingly generates a corresponding blockchain transaction TX_c.
步骤404d,设备4根据本地队列4中的汇款交易,分别聚合生成交易TX_d, 并在签名后提交至区块链。In step 404d, the device 4 aggregates and generates the transaction TX_d according to the remittance transaction in the local queue 4, and submits it to the blockchain after signing.
在一实施例中,与设备1相类似的,设备4可以从本地队列4中选取一个或多个汇款交易,以聚合生成相应的区块链交易。假定设备4在某一次选取的汇款交易中包含上述的汇款交易tx_i,并据此生成了相应的区块链交易TX_d。In an embodiment, similar to the device 1, the device 4 may select one or more remittance transactions from the local queue 4 to aggregate and generate corresponding blockchain transactions. It is assumed that the device 4 includes the above-mentioned remittance transaction tx_i in a certain selected remittance transaction, and accordingly generates a corresponding blockchain transaction TX_d.
需要指出的是:设备1~设备4可以根据实际情况选择生成相应的区块链交易,而并不一定立即对汇款交易tx_i进行处理;换言之,设备1~设备4实际上是异步地向区块链提交汇款交易tx_i(被包含于相应的区块链交易中),使得该汇款交易tx_i的执行被分配至由设备1~设备4分别进行触发,促使设备1~设备4在参与大量汇款交易的情况下,可以对所参与的汇款交易进行批量生成区块链交易,从而减少区块链交易的生成和提交数量,有助于降低处理负担、提升处理效率。It should be pointed out that device 1 to device 4 can choose to generate the corresponding blockchain transaction according to the actual situation, and it does not necessarily process the remittance transaction tx_i immediately; in other words, device 1 to device 4 are actually asynchronous to the block The chain submits the remittance transaction tx_i (included in the corresponding blockchain transaction), so that the execution of the remittance transaction tx_i is allocated to be triggered by the device 1 to the device 4 respectively, prompting the device 1 to the device 4 to participate in a large number of remittance transactions In this case, blockchain transactions can be generated in batches for participating remittance transactions, thereby reducing the number of blockchain transactions generated and submitted, which helps reduce processing burden and improve processing efficiency.
步骤405,区块链节点对收到的区块链交易进行处理,以验证区块链交易中包含的各笔汇款交易。Step 405: The blockchain node processes the received blockchain transaction to verify each remittance transaction included in the blockchain transaction.
步骤406,标记汇款交易tx_i。Step 406, mark the remittance transaction tx_i.
在一实施例中,由于每一机构会不断向区块链提交区块链交易,而在先提交的区块链交易所包含的汇款交易,会影响在后提交的区块链交易所包含的汇款交易,因而区块链节点在接收每一机构提交的区块链交易后,需要读取所接收到的区块链交易中包含的顺序编号seq,并按照顺序编号seq的大小,依次处理来自相应机构的区块链交易。例如,当区块链节点接收到设备1提交的区块链交易TX_a时,读取其中包含的顺序编号seq为100;而如果区块链节点已处理的最近一笔区块链交易的顺序编号seq为98,那么区块链节点需要等待设备1提交的顺序编号seq为99的区块链交易,并在该顺序编号为99的区块链交易被处理后,才对上述顺序编号为100的区块链交易进行处理。In one embodiment, since each institution will continuously submit blockchain transactions to the blockchain, the remittance transactions included in the previously submitted blockchain exchange will affect the inclusion of blockchain transactions included in the subsequent submission. Remittance transactions, therefore, after receiving the blockchain transaction submitted by each institution, the blockchain node needs to read the sequence number seq contained in the received blockchain transaction, and process the Blockchain transactions of corresponding institutions. For example, when a blockchain node receives the TX_a blockchain transaction submitted by device 1, it reads the sequence number seq contained in it as 100; and if the sequence number of the latest blockchain transaction that the blockchain node has processed seq is 98, then the blockchain node needs to wait for the blockchain transaction with the sequence number seq of 99 submitted by the device 1, and only after the blockchain transaction with the sequence number 99 is processed, the sequence number is 100. Blockchain transactions are processed.
在一实施例中,区块链节点在收到设备1~4分别提交的区块链交易后,可以分别提取每一区块链交易中包含的汇款交易,并分别针对每一汇款交易实施单独验证。验证操作可以包括:验证签名是否正确;验证汇款交易中对于上述“可能造成金额变化的汇款交易”实际产生的金额变化值的计算是否正确、区间证明是否正确;资金转移的转出额与转入额是否一致等,此处不再一一赘述。In one embodiment, after receiving the blockchain transactions submitted by devices 1 to 4, the blockchain nodes can separately extract the remittance transactions included in each blockchain transaction and implement separate measures for each remittance transaction verification. The verification operation may include: verifying the signature is correct; verifying that the calculation of the actual amount change value of the above "remittance transaction that may cause the amount change" in the remittance transaction is correct, the interval is proved to be correct; the transfer amount and transfer in of the fund transfer Whether the amount is consistent, etc., will not repeat them one by one here.
在一实施例中,除了对每一区块链交易中包含的汇款交易单独实施验证之外,如果汇款交易的执行由汇款方、中继方、收款方等参与方同时参与触发,因而区块链节点还需要验证汇款交易的各个参与方是否都实施了触发(即提交了包含该汇款交易的区 块链交易)。例如,图7是一示例性实施例提供的一种统计触发情况的示意图。如图7所示,基于区块链的原生功能或智能合约所提供的扩展功能,区块链节点可以分别记录机构1~机构4所提交的区块链交易,比如机构1提交的区块链交易TX_a、TX_*,机构2提交的区块链交易TX_*、TX_b、TX_#,机构3提交的区块链交易TX_*、TX_c,机构4提交的区块链交易TX_d等;以及,区块链节点可以提取出各个区块链交易中包含的汇款交易,并分别针对各个汇款交易的参与方(汇款交易详情中包含汇款方、中继方、收款方的信息)进行统计:当收到相应参与方提交的区块链交易中包含该汇款交易,且该汇款交易通过了上述的单独验证时,可以将该参与方标记为“OK”。In one embodiment, in addition to separately verifying the remittance transaction included in each blockchain transaction, if the execution of the remittance transaction is triggered by participants such as the remittance party, relay party, and payee at the same time, the area The blockchain node also needs to verify whether each participant of the remittance transaction has implemented the trigger (that is, the blockchain transaction containing the remittance transaction has been submitted). For example, FIG. 7 is a schematic diagram of a statistical trigger situation provided by an exemplary embodiment. As shown in FIG. 7, based on the native functions of the blockchain or the extended functions provided by smart contracts, blockchain nodes can separately record the blockchain transactions submitted by institutions 1 to 4, such as the blockchain submitted by institution 1. Transaction TX_a, TX_*, Blockchain transaction TX_*, TX_b, TX_# submitted by Institution 2, Blockchain transaction TX_*, TX_c submitted by Institution 3, Blockchain transaction TX_d submitted by Institution 4, etc.; and, Block The chain node can extract the remittance transactions included in each blockchain transaction and make statistics for the participants of each remittance transaction (the details of the remittance transaction include the information of the remittance, relay, and recipient): when received When the remittance transaction is included in the blockchain transaction submitted by the corresponding participant, and the remittance transaction passes the above-mentioned separate verification, the participant may be marked as "OK".
比如,由于设备1提交的区块链交易TX_a中包含汇款交易tx_i,如果区块链交易TX_a中对应于汇款交易tx_i的内容通过验证,那么区块链节点可以标记为如图6所示的“Y1:OK”;类似地,如果区块链节点还分别针对机构2~机构4标记为“Y2:OK”、“Y3:OK”、“Y4:OK”等,那么区块链节点可以确定该汇款交易tx_i已经得到所有参与方的确认,可以将该汇款交易tx_i标记为成功状态。For example, since the blockchain transaction TX_a submitted by device 1 contains the remittance transaction tx_i, if the content of the blockchain transaction TX_a corresponding to the remittance transaction tx_i is verified, then the blockchain node can be marked as shown in Figure 6 " Y1:OK"; similarly, if the blockchain nodes are also marked as "Y2:OK", "Y3:OK", "Y4:OK", etc. for institutions 2 to 4, respectively, then the blockchain nodes can determine the The remittance transaction tx_i has been confirmed by all participants, and the remittance transaction tx_i can be marked as a successful status.
再比如,由于仅设备1、设备2和设备3提交的区块链交易中包含汇款交易tx_*的相关信息,因而即便这些信息都已经通过单独验证,区块链节点仍然仅能够为该汇款交易tx_*添加标记“Y1:OK”、“Y2:OK”、“Y3:OK”,而需要继续等待设备4提交的区块链交易。As another example, since only the blockchain transactions submitted by device 1, device 2, and device 3 contain information about the remittance transaction tx_*, even if the information has been individually verified, the blockchain node can still only be used for the remittance transaction tx_* adds tags "Y1:OK", "Y2:OK", "Y3:OK", and needs to continue to wait for the blockchain transaction submitted by device 4.
又比如,由于仅设备2提交的区块链交易中包含汇款交易tx_#的相关信息,因而即便相关信息已经通过单独验证,区块链节点仍然仅能够为该汇款交易tx_#添加标记“Y2:OK”,而需要继续等待设备1、设备3和设备4提交的区块链交易。For another example, because only the blockchain transaction submitted by device 2 contains relevant information of the remittance transaction tx_#, even if the relevant information has been individually verified, the blockchain node can only add the tag “Y2:” to the remittance transaction tx_#: "OK", and need to continue to wait for the blockchain transaction submitted by device 1, device 3 and device 4.
仍以汇款交易tx_i为例,如果机构1~机构4中的任一参与方未能够在交易时刻到达之前提交包含该汇款交易tx_i的区块链交易,那么区块链节点会将该汇款交易tx_i标记为超时状态,使其无法被成功执行。如果机构1~机构4中的任一参与方虽然提及了包含该汇款交易tx_i的区块链交易,但由于金额累加详情出错或区间证明出错等原因而未通过单独验证,那么区块链节点会将该汇款交易tx_i标记为失败状态,使其无法被成功执行。Still taking the remittance transaction tx_i as an example, if any participant in the institution 1 to institution 4 fails to submit a blockchain transaction containing the remittance transaction tx_i before the transaction time arrives, the blockchain node will send the remittance transaction tx_i Marked as a timeout status, so that it cannot be successfully executed. If any of the participants in Institution 1 to Institution 4 mentioned a blockchain transaction containing the remittance transaction tx_i, but failed to pass the separate verification due to errors in the amount accumulation details or the interval certification error, then the blockchain node The remittance transaction tx_i will be marked as failed, so that it cannot be successfully executed.
当汇款交易tx_i或其他汇款交易被区块链节点添加了成功状态、失败状态或超时状态等标记时,机构1~机构4在后续生成区块链交易时,可以参考这些状态生成相应的金额累加详情、生成余额充足的区间证明等,这与上文中在步骤404a~404d中描述的过程相类似,此处不再赘述。When the remittance transaction tx_i or other remittance transactions are added with a success status, failure status, or timeout status flag by the blockchain node, Institution 1 to Institution 4 can refer to these statuses to generate the corresponding amount accumulation when they subsequently generate blockchain transactions Details, generating interval proofs with sufficient balance, etc. are similar to the processes described in steps 404a to 404d above, and will not be repeated here.
在确认汇款交易tx_i被成功执行后,机构1在链外收取用户1的500港币、向机构2转出500港币,机构2收取机构1转入的500港币、向机构3转出56欧元,机构3收取机构2转入的56欧元、向机构4转出64美元,机构4收取机构3转入的64美元、在链外向用户1转入64美元,相当于机构1~4收支平衡、由用户1向用户2完成了500港币的汇款操作。After confirming that the remittance transaction tx_i was successfully executed, Institution 1 collected 500 HKD from user 1 outside the chain, and transferred 500 HKD to institution 2, and institution 2 received 500 HKD from institution 1, and transferred 56 to institution 3, and the institution 3 Collecting 56 euros transferred into institution 2 and transferring 64 dollars to institution 4, agency 4 charging 64 dollars transferred into institution 3 and transferring 64 dollars to user 1 outside the chain, which is equivalent to the balance of expenditures of institutions 1 to 4. User 1 completes the remittance operation of 500 HKD to user 2.
而表现在区块链账本上的数据变化为:机构1对应的区块链账户Y1更新为(currency_1,PC(a-t1,r_a-r_t1),Enc_A(a-t1),Enc_A(r_a-r_t1))、减少了500港币;机构2对应的区块链账户Y2更新为:(currency_1,PC(b1+t1,r_b1+r_t1),Enc_B(b1+t1),Enc_B(r_b1+r_t1))、(currency_2,PC(b2-t2,r_b2-r_t2),Enc_B(b2-t2),Enc_B(r_b2-r_t2)),增加了500港币、减少了56欧元;机构3对应的区块链账户Y3更新为:(currency_2,PC(c1+t2,r_c1+r_t2),Enc_C(c1+t2),Enc_C(r_c1+r_t2))、(currency_3,PC(c2-t3,r_c2-r_t3),Enc_C(c2-t3),Enc_C(r_c2-r_t3)),增加了56欧元、减少了64美元;机构4对应的区块链账户Y4更新为:(currency_3,PC(d+t3,r_d+r_t3),Enc_D(d+t3),Enc_D(r_d+r_t3))、增加了64美元。The data changes on the blockchain ledger are: The blockchain account Y1 corresponding to institution 1 is updated to (currency_1, PC(a-t1, r_a-r_t1), Enc_A(a-t1), Enc_A(r_a-r_t1 )), a reduction of 500 Hong Kong dollars; the blockchain account Y2 corresponding to Institution 2 is updated to: (currency_1, PC(b1+t1, r_b1+r_t1), Enc_B(b1+t1), Enc_B(r_b1+r_t1)), ( currency_2,PC(b2-t2,r_b2-r_t2),Enc_B(b2-t2),Enc_B(r_b2-r_t2)), increased by 500 Hong Kong dollars, reduced by 56 Euros; the corresponding blockchain account Y3 of Institution 3 is updated to: (currency_2,PC(c1+t2,r_c1+r_t2),Enc_C(c1+t2),Enc_C(r_c1+r_t2)),(currency_3,PC(c2-t3,r_c2-r_t3),Enc_C(c2-t3), Enc_C(r_c2-r_t3)), increased by 56 euros and reduced by 64 dollars; the corresponding blockchain account Y4 of institution 4 is updated to: (currency_3,PC(d+t3,r_d+r_t3),Enc_D(d+t3) , Enc_D(r_d+r_t3)), increased by 64 dollars.
需要指出的是:设备1~设备4所提交的区块链交易中,并不一定每条汇款交易都由所有参与方共同实施触发操作;譬如,至少一条汇款交易可以采用相关技术中的技术方案,即由某一参与方收集所有参与方对汇款交易的交易详情信息的确认信息、生成交易所需的区间证明等(即生成上述实施例中所述的多方触发信息),并仅由该某一参与方提交包含该汇款交易的区块链交易。It should be pointed out that: in the blockchain transactions submitted by device 1 to device 4, not every remittance transaction is necessarily triggered by all participants; for example, at least one remittance transaction can use the technical solutions in related technologies , That is, a participant collects confirmation information of transaction details of all participants for remittance transactions, generates interval proofs required by the transaction, etc. (that is, generates the multi-party trigger information described in the above embodiment), and only the certain A participant submits a blockchain transaction containing the remittance transaction.
图8是一示例性实施例提供的一种设备的示意结构图。请参考图8,在硬件层面,该设备包括处理器802、内部总线804、网络接口806、内存808以及非易失性存储器810,当然还可能包括其他业务所需要的硬件。处理器802从非易失性存储器810中读取对应的计算机程序到内存808中然后运行,在逻辑层面上形成基于区块链的事件处理装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。FIG. 8 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 8. At the hardware level, the device includes a processor 802, an internal bus 804, a network interface 806, a memory 808, and a non-volatile memory 810. Of course, it may include hardware required for other services. The processor 802 reads the corresponding computer program from the non-volatile memory 810 into the memory 808 and then runs it to form a blockchain-based event processing device at a logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as a logic device or a combination of software and hardware, etc., that is to say, the execution body of the following processing flow is not limited to each The logic unit may also be a hardware or logic device.
请参考图9,在软件实施方式中,该基于区块链的事件处理装置应用于参与方,可以包括:Please refer to FIG. 9. In the software implementation, the blockchain-based event processing device is applied to the participants, and may include:
添加单元901,根据所述参与方所参与的事件,向所述参与方维护的等待队列中添加对应的备选子交易;The adding unit 901 adds corresponding candidate sub-transactions to the waiting queue maintained by the participant according to the events participated by the participant;
生成单元902,根据从所述等待队列中选取的若干备选子交易,生成相应的集合交易;The generating unit 902 generates corresponding set transactions according to several candidate sub-transactions selected from the waiting queue;
提交单元903,将所述集合交易提交至区块链,使所述集合交易中的备选子交易被分别予以处理。The submission unit 903 submits the aggregate transaction to the blockchain, so that the alternative sub-transactions in the aggregate transaction are processed separately.
可选的,所述生成单元902具体用于:Optionally, the generating unit 902 is specifically configured to:
当所述等待队列中的备选子交易达到预设数量时,选取所述等待队列中已存在的备选子交易,以生成相应的集合交易;When the number of candidate sub-transactions in the waiting queue reaches a preset number, the candidate sub-transactions already in the waiting queue are selected to generate a corresponding set transaction;
或者,按照预设时长周期性地选取所述等待队列中已存在的备选子交易,以生成相应的集合交易。Alternatively, the candidate sub-transactions that already exist in the waiting queue are periodically selected according to a preset duration to generate corresponding aggregate transactions.
可选的,还包括:Optional, also includes:
添加单元904,按照生成顺序为各个集合交易添加相应的编号,以使各个集合交易在区块链中被按照对应的编号大小进行依次处理。The adding unit 904 adds corresponding numbers to each set transaction according to the generation order, so that each set transaction is sequentially processed according to the corresponding number size in the blockchain.
可选的,所述集合交易中包含的备选子交易设定有对应的状态变化量,使得所述备选子交易被处理后,所述参与方的状态参数基于所述状态变化量而发生相应的数值变化。Optionally, the candidate sub-transactions included in the set transaction are set with corresponding state changes, so that after the candidate sub-transactions are processed, the state parameter of the participant occurs based on the state change The corresponding value changes.
可选的,所述状态变化量为明文数值。Optionally, the state change amount is a plain text value.
可选的,所述集合交易中包含的备选子交易还设定有变化前状态值、变化后状态值,使得所述备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;Optionally, the alternative sub-transactions included in the set transaction are also set with a pre-change state value and a post-change state value, so that after the alternative sub-transaction is processed, the state parameter of the participant is determined by the The state value before change changes to the state value after change through the state change amount;
其中,所述状态变化量、所述变化前状态值和所述变化后状态值分别为基于同态加密算法或同态承诺算法计算得到的密文数值。The state change amount, the state value before the change, and the state value after the change are ciphertext values calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm, respectively.
可选的,Optional,
当被选取的备选子交易用于使所述参与方的状态值增大时,所述集合交易还包含:第一证明信息,所述第一证明信息用于证明状态值增大量处于正确数值区间;When the selected candidate sub-transaction is used to increase the state value of the participant, the set transaction also includes: first proof information, and the first proof information is used to prove that the increase in state value is at the correct value Interval
当被选取的备选子交易用于使所述参与方的状态值减小时,所述集合交易还包含:第二证明信息,所述第二证明信息用于证明状态值减小量、所述被选取的备选子交易对应的变化后状态值均处于所述正确数值区间。When the selected candidate sub-transaction is used to reduce the state value of the participant, the set transaction also includes: second proof information, the second proof information is used to prove the state value reduction amount, the The changed state values corresponding to the selected candidate sub-transactions are all in the correct value range.
可选的,当所述集合交易包含多个备选子交易时,相邻的备选子交易满足:前一备选子交易对应的变化后状态值与后一备选子交易对应的变化前状态值相同。Optionally, when the set transaction includes multiple alternative sub-transactions, the adjacent alternative sub-transactions satisfy: the post-change state value corresponding to the previous alternative sub-transaction and the pre-change change corresponding to the latter alternative sub-transaction The status value is the same.
可选的,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。Optionally, the candidate sub-transaction corresponding to the event includes unilateral trigger information of the participant on the event; wherein, when all participants of the event submit to the blockchain for the When the unilateral trigger information of the event is all verified, the alternative sub-transaction corresponding to the event is triggered to execute in the blockchain.
可选的,在所述事件对应的备选子交易中,包含所述事件的所有参与方对所述事件的多方触发信息;其中,当所述多方触发信息通过验证时,所述事件对应的备选子交易在区块链中被触发执行。Optionally, the candidate sub-transaction corresponding to the event includes multi-party trigger information for the event from all parties involved in the event; wherein, when the multi-party trigger information passes verification, the event corresponding to the event Alternative sub-transactions are triggered to execute in the blockchain.
图10是一示例性实施例提供的一种设备的示意结构图。请参考图10,在硬件层面,该设备包括处理器1002、内部总线1004、网络接口1006、内存1008以及非易失性存储器1010,当然还可能包括其他业务所需要的硬件。处理器1002从非易失性存储器1010中读取对应的计算机程序到内存1008中然后运行,在逻辑层面上形成基于区块链的事件处理装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。FIG. 10 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 10. At the hardware level, the device includes a processor 1002, an internal bus 1004, a network interface 1006, a memory 1008, and a non-volatile memory 1010. Of course, it may include hardware required for other services. The processor 1002 reads the corresponding computer program from the non-volatile memory 1010 into the memory 1008 and then runs it to form a blockchain-based event processing device at a logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as a logic device or a combination of software and hardware, etc., that is to say, the execution body of the following processing flow is not limited to each The logic unit may also be a hardware or logic device.
请参考图11,在软件实施方式中,该基于区块链的事件处理装置应用于区块链节点,可以包括:Please refer to FIG. 11. In a software implementation, the blockchain-based event processing device is applied to a blockchain node, and may include:
接收单元1101,接收参与方提交至区块链的集合交易,所述集合交易中包含从所述参与方维护的等待队列中选取的若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;The receiving unit 1101 receives a collective transaction submitted by a participant to the blockchain, and the collective transaction includes several alternative sub-transactions selected from a waiting queue maintained by the participant, and the alternative sub-transactions correspond to the Events involved by the participants;
执行单元1102,执行所述集合交易,以对所述集合交易中的备选子交易分别予以处理。The execution unit 1102 executes the collective transaction to separately process the candidate sub-transactions in the collective transaction.
可选的,还包括:Optional, also includes:
提取单元1103,提取所述集合交易中包含的编号,所述编号由所述参与方按照生成顺序而添加;The extracting unit 1103 extracts the serial number included in the aggregate transaction, and the serial number is added by the participant in the order of generation;
处理单元1104,按照对应的编号大小对所述参与方提交的各个集合交易进行依次处理。The processing unit 1104 sequentially processes each set transaction submitted by the participant according to the corresponding number size.
可选的,所述集合交易中包含的备选子交易设定有对应的状态变化量,使得所 述备选子交易被处理后,所述参与方的状态参数基于所述状态变化量而发生相应的数值变化。Optionally, the candidate sub-transactions included in the set transaction are set with corresponding state changes, so that after the candidate sub-transactions are processed, the state parameter of the participant occurs based on the state change The corresponding value changes.
可选的,所述状态变化量为明文数值。Optionally, the state change amount is a plain text value.
可选的,所述集合交易中包含的备选子交易还设定有变化前状态值、变化后状态值,使得所述备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;Optionally, the alternative sub-transactions included in the set transaction are also set with a pre-change state value and a post-change state value, so that after the alternative sub-transaction is processed, the state parameter of the participant is determined by the The state value before change changes to the state value after change through the state change amount;
其中,所述状态变化量、所述变化前状态值和所述变化后状态值分别为基于同态加密算法或同态承诺算法计算得到的密文数值。The state change amount, the state value before the change, and the state value after the change are ciphertext values calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm, respectively.
可选的,Optional,
当被选取的备选子交易用于使所述参与方的状态值增大时,所述集合交易还包含:第一证明信息,所述第一证明信息用于证明状态值增大量处于正确数值区间;When the selected candidate sub-transaction is used to increase the state value of the participant, the set transaction also includes: first proof information, and the first proof information is used to prove that the increase in state value is at the correct value Interval
当被选取的备选子交易用于使所述参与方的状态值减小时,所述集合交易还包含:第二证明信息,所述第二证明信息用于证明状态值减小量、所述被选取的备选子交易对应的变化后状态值均处于所述正确数值区间。When the selected candidate sub-transaction is used to reduce the state value of the participant, the set transaction also includes: second proof information, the second proof information is used to prove the state value reduction amount, the The changed state values corresponding to the selected candidate sub-transactions are all in the correct value range.
可选的,当所述集合交易包含多个备选子交易时,相邻的备选子交易满足:前一备选子交易对应的变化后状态值与后一备选子交易对应的变化前状态值相同。Optionally, when the set transaction includes multiple alternative sub-transactions, the adjacent alternative sub-transactions satisfy: the post-change state value corresponding to the previous alternative sub-transaction and the pre-change change corresponding to the latter alternative sub-transaction The status value is the same.
可选的,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。Optionally, the candidate sub-transaction corresponding to the event includes unilateral trigger information of the participant on the event; wherein, when all participants of the event submit to the blockchain for the When the unilateral trigger information of the event is all verified, the alternative sub-transaction corresponding to the event is triggered to execute in the blockchain.
可选的,在所述事件对应的备选子交易中,包含所述事件的所有参与方对所述事件的多方触发信息;其中,当所述多方触发信息通过验证时,所述事件对应的备选子交易在区块链中被触发执行。Optionally, the candidate sub-transaction corresponding to the event includes multi-party trigger information for the event from all parties involved in the event; wherein, when the multi-party trigger information passes verification, the event corresponding to the event Alternative sub-transactions are triggered to execute in the blockchain.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The system, device, module or unit explained in the above embodiments may be specifically implemented by a computer chip or entity, or implemented by a product with a certain function. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.
本说明书提出了一种计算机可读介质,其上存储有计算机指令,该指令被处理 器执行时实现本说明书的技术方案,比如上述任一实施例的基于区块链的事件处理方法,此处不再一一赘述。This specification proposes a computer-readable medium on which computer instructions are stored. When the instructions are executed by a processor, the technical solution of this specification is implemented, such as the blockchain-based event processing method of any of the above embodiments, here I will not repeat them one by one.
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory, random access memory (RAM) and/or non-volatile memory in computer-readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including permanent and non-permanent, removable and non-removable media, can store information by any method or technology. The information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. As defined in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also includes Other elements not explicitly listed, or include elements inherent to this process, method, commodity, or equipment. Without more restrictions, the element defined by the sentence "include one..." does not exclude that there are other identical elements in the process, method, commodity, or equipment that includes the element.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上 下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only, and is not intended to limit one or more embodiments of this specification. The singular forms "a", "said" and "the" used in one or more embodiments of the present specification and the appended claims are also intended to include the majority forms unless the context clearly indicates other meanings. It should also be understood that the term "and/or" as used herein refers to and includes any or all possible combinations of one or more associated listed items.
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although one or more embodiments in this specification may use the terms first, second, third, etc. to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to a determination".
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。The above are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. Anything within the spirit and principle of one or more embodiments of this specification, Any modifications, equivalent replacements, improvements, etc., should be included within the scope of protection of one or more embodiments of this specification.

Claims (23)

  1. 一种基于区块链的事件处理方法,应用于参与方,所述方法包括:A blockchain-based event processing method applied to participants. The method includes:
    根据所述参与方所参与的事件,向所述参与方维护的等待队列中添加对应的备选子交易;Add corresponding candidate sub-transactions to the waiting queue maintained by the participant according to the events that the participant participates in;
    根据从所述等待队列中选取的若干备选子交易,生成相应的集合交易;Generate a corresponding set transaction according to several candidate sub-transactions selected from the waiting queue;
    将所述集合交易提交至区块链,使所述集合交易中的备选子交易被分别予以处理。Submit the aggregate transaction to the blockchain so that the alternative sub-transactions in the aggregate transaction are processed separately.
  2. 根据权利要求1所述的方法,所述根据从所述等待队列中选取的若干备选子交易,生成相应的集合交易,包括:The method according to claim 1, said generating a corresponding set transaction based on a number of candidate sub-transactions selected from the waiting queue, comprising:
    当所述等待队列中的备选子交易达到预设数量时,选取所述等待队列中已存在的备选子交易,以生成相应的集合交易;When the number of candidate sub-transactions in the waiting queue reaches a preset number, the candidate sub-transactions already in the waiting queue are selected to generate a corresponding set transaction;
    或者,按照预设时长周期性地选取所述等待队列中已存在的备选子交易,以生成相应的集合交易。Alternatively, the candidate sub-transactions that already exist in the waiting queue are periodically selected according to a preset duration to generate corresponding aggregate transactions.
  3. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    按照生成顺序为各个集合交易添加相应的编号,以使各个集合交易在区块链中被按照对应的编号大小进行依次处理。Add corresponding numbers to each set transaction in the order of generation, so that each set transaction is processed sequentially in the blockchain according to the corresponding number size.
  4. 根据权利要求1所述的方法,所述集合交易中包含的备选子交易设定有对应的状态变化量,使得所述备选子交易被处理后,所述参与方的状态参数基于所述状态变化量而发生相应的数值变化。According to the method of claim 1, the alternative sub-transactions included in the aggregate transaction are set with corresponding state changes, so that after the alternative sub-transactions are processed, the state parameters of the participants are based on the The amount of state changes and the corresponding numerical change occurs.
  5. 根据权利要求4所述的方法,所述状态变化量为明文数值。The method according to claim 4, wherein the state change amount is a plain text value.
  6. 根据权利要求4所述的方法,所述集合交易中包含的备选子交易还设定有变化前状态值、变化后状态值,使得所述备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;According to the method of claim 4, the alternative sub-transactions included in the aggregate transaction are also set with a pre-change state value and a post-change state value, so that after the alternative sub-transaction is processed, the participant’s The state parameter changes from the state value before the change to the state value after the change through the state change amount;
    其中,所述状态变化量、所述变化前状态值和所述变化后状态值分别为基于同态加密算法或同态承诺算法计算得到的密文数值。The state change amount, the state value before the change, and the state value after the change are ciphertext values calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm, respectively.
  7. 根据权利要求6所述的方法,The method according to claim 6,
    当被选取的备选子交易用于使所述参与方的状态值增大时,所述集合交易还包含:第一证明信息,所述第一证明信息用于证明状态值增大量处于正确数值区间;When the selected candidate sub-transaction is used to increase the state value of the participant, the set transaction also includes: first proof information, and the first proof information is used to prove that the increase in state value is at the correct value Interval
    当被选取的备选子交易用于使所述参与方的状态值减小时,所述集合交易还包含:第二证明信息,所述第二证明信息用于证明状态值减小量、所述被选取的备选子交易对应的变化后状态值均处于所述正确数值区间。When the selected candidate sub-transaction is used to reduce the state value of the participant, the set transaction also includes: second proof information, the second proof information is used to prove the state value reduction amount, the The changed state values corresponding to the selected candidate sub-transactions are all in the correct value range.
  8. 根据权利要求6所述的方法,当所述集合交易包含多个备选子交易时,相邻的 备选子交易满足:前一备选子交易对应的变化后状态值与后一备选子交易对应的变化前状态值相同。The method according to claim 6, when the set transaction includes multiple alternative sub-transactions, the adjacent alternative sub-transactions satisfy: the changed state value corresponding to the previous alternative sub-transaction and the latter alternative sub-transaction The state value before the change corresponding to the transaction is the same.
  9. 根据权利要求1所述的方法,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。The method according to claim 1, wherein the candidate sub-transaction corresponding to the event includes unilateral triggering information of the participant on the event; wherein, when all participants of the event separately submit to the blockchain When the submitted unilateral trigger information for the event passes verification, the alternative sub-transaction corresponding to the event is triggered to execute in the blockchain.
  10. 根据权利要求1所述的方法,在所述事件对应的备选子交易中,包含所述事件的所有参与方对所述事件的多方触发信息;其中,当所述多方触发信息通过验证时,所述事件对应的备选子交易在区块链中被触发执行。The method according to claim 1, wherein the candidate sub-transaction corresponding to the event contains multi-party trigger information for all the parties to the event; wherein, when the multi-party trigger information passes verification, The alternative sub-transaction corresponding to the event is triggered to execute in the blockchain.
  11. 一种基于区块链的事件处理方法,应用于区块链节点,所述方法包括:A blockchain-based event processing method applied to blockchain nodes. The method includes:
    接收参与方提交至区块链的集合交易,所述集合交易中包含从所述参与方维护的等待队列中选取的若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;Receive a set transaction submitted by the participant to the blockchain, the set transaction includes a number of candidate sub-transactions selected from the waiting queue maintained by the participant, the candidate sub-transaction corresponds to the participation of the participant event;
    执行所述集合交易,以对所述集合交易中的备选子交易分别予以处理。The aggregate transaction is executed to separately process the candidate sub-transactions in the aggregate transaction.
  12. 根据权利要求11所述的方法,还包括:The method of claim 11, further comprising:
    提取所述集合交易中包含的编号,所述编号由所述参与方按照生成顺序而添加;Extract the serial number included in the aggregate transaction, and the serial number is added by the participant in the order of generation;
    按照对应的编号大小对所述参与方提交的各个集合交易进行依次处理。The collective transactions submitted by the participants are sequentially processed according to the corresponding number size.
  13. 根据权利要求11所述的方法,所述集合交易中包含的备选子交易设定有对应的状态变化量,使得所述备选子交易被处理后,所述参与方的状态参数基于所述状态变化量而发生相应的数值变化。According to the method of claim 11, the alternative sub-transactions included in the set transaction are set with corresponding state changes, so that after the alternative sub-transactions are processed, the state parameters of the participants are based on the The amount of state changes and the corresponding numerical change occurs.
  14. 根据权利要求13所述的方法,所述状态变化量为明文数值。The method according to claim 13, wherein the state change amount is a plain text value.
  15. 根据权利要求13所述的方法,所述集合交易中包含的备选子交易还设定有变化前状态值、变化后状态值,使得所述备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;According to the method of claim 13, the alternative sub-transactions included in the aggregate transaction are also set with a pre-change state value and a post-change state value, so that after the alternative sub-transaction is processed, the participant’s The state parameter changes from the state value before the change to the state value after the change through the state change amount;
    其中,所述状态变化量、所述变化前状态值和所述变化后状态值分别为基于同态加密算法或同态承诺算法计算得到的密文数值。The state change amount, the state value before the change, and the state value after the change are ciphertext values calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm, respectively.
  16. 根据权利要求15所述的方法,The method according to claim 15,
    当被选取的备选子交易用于使所述参与方的状态值增大时,所述集合交易还包含:第一证明信息,所述第一证明信息用于证明状态值增大量处于正确数值区间;When the selected candidate sub-transaction is used to increase the state value of the participant, the set transaction also includes: first proof information, and the first proof information is used to prove that the increase in state value is at the correct value Interval
    当被选取的备选子交易用于使所述参与方的状态值减小时,所述集合交易还包含:第二证明信息,所述第二证明信息用于证明状态值减小量、所述被选取的备选子交易对应的变化后状态值均处于所述正确数值区间。When the selected candidate sub-transaction is used to reduce the state value of the participant, the set transaction also includes: second proof information, the second proof information is used to prove the state value reduction amount, the The changed state values corresponding to the selected candidate sub-transactions are all in the correct value range.
  17. 根据权利要求15所述的方法,当所述集合交易包含多个备选子交易时,相邻的备选子交易满足:前一备选子交易对应的变化后状态值与后一备选子交易对应的变化前状态值相同。The method according to claim 15, when the set transaction includes multiple alternative sub-transactions, the adjacent alternative sub-transactions satisfy: the changed state value corresponding to the previous alternative sub-transaction and the latter alternative sub-transaction The state value before the change corresponding to the transaction is the same.
  18. 根据权利要求11所述的方法,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。The method according to claim 11, wherein the candidate sub-transaction corresponding to the event includes unilateral triggering information of the participant on the event; wherein, when all participants of the event separately submit to the blockchain When the submitted unilateral trigger information for the event passes verification, the alternative sub-transaction corresponding to the event is triggered to execute in the blockchain.
  19. 根据权利要求11所述的方法,在所述事件对应的备选子交易中,包含所述事件的所有参与方对所述事件的多方触发信息;其中,当所述多方触发信息通过验证时,所述事件对应的备选子交易在区块链中被触发执行。The method according to claim 11, wherein the candidate sub-transaction corresponding to the event includes multi-party trigger information of all the parties to the event on the event; wherein, when the multi-party trigger information passes verification, The alternative sub-transaction corresponding to the event is triggered to execute in the blockchain.
  20. 一种基于区块链的事件处理装置,应用于参与方,所述装置包括:An event processing device based on blockchain, applied to participants, the device includes:
    添加单元,根据所述参与方所参与的事件,向所述参与方维护的等待队列中添加对应的备选子交易;An adding unit, adding a corresponding alternative sub-transaction to the waiting queue maintained by the participant according to the events that the participant participates in;
    生成单元,根据从所述等待队列中选取的若干备选子交易,生成相应的集合交易;The generating unit generates a corresponding set transaction based on several candidate sub-transactions selected from the waiting queue;
    提交单元,将所述集合交易提交至区块链,使所述集合交易中的备选子交易被分别予以处理。The submission unit submits the aggregate transaction to the blockchain, so that the alternative sub-transactions in the aggregate transaction are processed separately.
  21. 一种基于区块链的事件处理装置,应用于区块链节点,所述装置包括:A blockchain-based event processing device applied to blockchain nodes, the device includes:
    接收单元,接收参与方提交至区块链的集合交易,所述集合交易中包含从所述参与方维护的等待队列中选取的若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;The receiving unit receives a set transaction submitted by the participant to the blockchain, and the set transaction includes several candidate sub-transactions selected from the waiting queue maintained by the participant, the candidate sub-transactions correspond to the participation Events in which the party is involved;
    执行单元,执行所述集合交易,以对所述集合交易中的备选子交易分别予以处理。The execution unit executes the collective transaction to separately process the candidate sub-transactions in the collective transaction.
  22. 一种电子设备,包括:An electronic device, including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-10中任一项所述的方法。Wherein, the processor executes the executable instruction to implement the method according to any one of claims 1-10.
  23. 一种电子设备,包括:An electronic device, including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求11-19中任一项所述的方法。Wherein, the processor executes the executable instruction to implement the method according to any one of claims 11-19.
PCT/CN2019/113934 2018-12-14 2019-10-29 Event processing method and apparatus based on blockchain, and electronic device WO2020119297A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811530103.3A CN110009316A (en) 2018-12-14 2018-12-14 Event-handling method and device, electronic equipment based on block chain
CN201811530103.3 2018-12-14

Publications (1)

Publication Number Publication Date
WO2020119297A1 true WO2020119297A1 (en) 2020-06-18

Family

ID=67165136

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/113934 WO2020119297A1 (en) 2018-12-14 2019-10-29 Event processing method and apparatus based on blockchain, and electronic device

Country Status (3)

Country Link
CN (1) CN110009316A (en)
TW (1) TWI705691B (en)
WO (1) WO2020119297A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110009316A (en) * 2018-12-14 2019-07-12 阿里巴巴集团控股有限公司 Event-handling method and device, electronic equipment based on block chain
MY192336A (en) 2019-07-23 2022-08-17 Advanced New Technologies Co Ltd Managing transactions on blockchain networks
CN110689344B (en) * 2019-08-30 2021-04-09 创新先进技术有限公司 Method and apparatus for concurrently executing transactions in a blockchain
CN116260707B (en) * 2023-05-15 2023-10-10 安徽中科晶格技术有限公司 Block chain node disaster recovery method, device and equipment based on consensus and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170193464A1 (en) * 2015-12-18 2017-07-06 Justin SHER Protocol utilizing bitcoin blockchain for maintaining independently proposed and approved set contents
CN107273455A (en) * 2017-05-31 2017-10-20 深圳前海微众银行股份有限公司 Block chain data access method and device
CN107704269A (en) * 2017-10-16 2018-02-16 中国银行股份有限公司 A kind of method and system based on block chain generation block
CN108520412A (en) * 2018-04-18 2018-09-11 北京天德科技有限公司 A kind of settle accounts calculation transaction towards block chain divides the design method of account algorithm
CN108776897A (en) * 2018-06-05 2018-11-09 腾讯科技(深圳)有限公司 Data processing method, device, server and computer readable storage medium
CN108876384A (en) * 2018-09-19 2018-11-23 联动优势科技有限公司 A kind of processing method and processing device of transaction data
CN110009316A (en) * 2018-12-14 2019-07-12 阿里巴巴集团控股有限公司 Event-handling method and device, electronic equipment based on block chain

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11941588B2 (en) * 2015-11-06 2024-03-26 Cable Television Laboratories, Inc. Systems and methods for blockchain virtualization and scalability
KR101950912B1 (en) * 2016-08-01 2019-02-21 서강대학교산학협력단 Verification system and method for transaction based block chain
CN106982205B (en) * 2017-03-01 2020-05-19 中钞信用卡产业发展有限公司杭州区块链技术研究院 Block chain-based digital asset processing method and device
CN108241979B (en) * 2017-12-20 2021-03-16 深圳壹账通智能科技有限公司 Multi-account book transfer method based on block chain, electronic device and readable storage medium
CN108320228A (en) * 2018-03-07 2018-07-24 物数(上海)信息科技有限公司 Transregional piece of chain transaction in assets method, platform, equipment and storage medium
CN108600161A (en) * 2018-03-12 2018-09-28 成都零光量子科技有限公司 A kind of fair efficient block chain common recognition method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170193464A1 (en) * 2015-12-18 2017-07-06 Justin SHER Protocol utilizing bitcoin blockchain for maintaining independently proposed and approved set contents
CN107273455A (en) * 2017-05-31 2017-10-20 深圳前海微众银行股份有限公司 Block chain data access method and device
CN107704269A (en) * 2017-10-16 2018-02-16 中国银行股份有限公司 A kind of method and system based on block chain generation block
CN108520412A (en) * 2018-04-18 2018-09-11 北京天德科技有限公司 A kind of settle accounts calculation transaction towards block chain divides the design method of account algorithm
CN108776897A (en) * 2018-06-05 2018-11-09 腾讯科技(深圳)有限公司 Data processing method, device, server and computer readable storage medium
CN108876384A (en) * 2018-09-19 2018-11-23 联动优势科技有限公司 A kind of processing method and processing device of transaction data
CN110009316A (en) * 2018-12-14 2019-07-12 阿里巴巴集团控股有限公司 Event-handling method and device, electronic equipment based on block chain

Also Published As

Publication number Publication date
TWI705691B (en) 2020-09-21
TW202023236A (en) 2020-06-16
CN110009316A (en) 2019-07-12

Similar Documents

Publication Publication Date Title
TWI724460B (en) Block chain-based event processing method and device, and electronic equipment
US10861016B2 (en) Event processing method, apparatus and electronic device based on blockchain technology
WO2020119298A1 (en) Event processing method and apparatus based on blockchain, and electronic device
CN109242485B (en) Block chain transaction method and device and electronic equipment
EP3748901B1 (en) System and method for information protection
EP3745637B1 (en) System and method for information protection
WO2020119297A1 (en) Event processing method and apparatus based on blockchain, and electronic device
CN109359971B (en) Block chain transaction method and device and electronic equipment
CN109544129B (en) Block chain transaction method and device and electronic equipment
TW202008272A (en) Block-chain transaction method and device, and electronic device
CN113568946A (en) Method, system and apparatus for managing transactions in multiple blockchain networks
CN113595734A (en) Method, system and apparatus for managing transactions in multiple blockchain networks
CN113595733A (en) Method, system and apparatus for managing transactions in multiple blockchain networks
CN110009323A (en) Block chain method of commerce and device, electronic equipment, storage medium
WO2000022787A2 (en) Method, system, and computer program product for providing enhanced electronic mail services

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

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

Country of ref document: EP

Kind code of ref document: A1