WO2020119298A1 - 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
WO2020119298A1
WO2020119298A1 PCT/CN2019/113960 CN2019113960W WO2020119298A1 WO 2020119298 A1 WO2020119298 A1 WO 2020119298A1 CN 2019113960 W CN2019113960 W CN 2019113960W WO 2020119298 A1 WO2020119298 A1 WO 2020119298A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
transactions
value
blockchain
sub
Prior art date
Application number
PCT/CN2019/113960
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 WO2020119298A1 publication Critical patent/WO2020119298A1/en

Links

Images

Classifications

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

Definitions

  • One or more embodiments of this specification relate to the field of terminal technology, and in particular, to a blockchain-based event processing method and device, and electronic equipment.
  • 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.
  • the blockchain transaction can be executed by the blockchain node.
  • one or more embodiments of this specification provide a blockchain-based event processing method and device, and electronic equipment.
  • a blockchain-based event processing method which is applied to participants, and the method includes:
  • a corresponding alternative sub-transaction is generated, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transaction is set with a corresponding state change amount to use
  • the value of the state parameter and the state change are the ciphertext value calculated based on the homomorphic encryption algorithm or A commitment value calculated based on the homomorphic commitment algorithm;
  • unified certification information is generated to prove that the state parameter passes through the multiple backup
  • the value after selecting the child transaction is in the correct value range
  • a blockchain-based event processing method is proposed, which is applied to blockchain nodes.
  • the method includes:
  • the set transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the alternative sub-transaction is set A corresponding state change amount is set for the state parameter of the participant to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are based on the same
  • the ciphertext value calculated by the homomorphic encryption algorithm or the promise value calculated based on the homomorphic commitment algorithm
  • the unified certification information corresponding to multiple candidate sub-transactions that are adjacent and corresponding events in the collective transaction are used to reduce the value of the state parameter, Verify whether the value of the state parameter after passing through the plurality of candidate sub-transactions is in the correct value interval;
  • a processing method for the multiple candidate sub-transactions is determined.
  • a blockchain-based event processing device which is applied to participants and includes:
  • the first generating unit generates corresponding alternative sub-transactions according to the events in which the participant participates, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transactions are set with corresponding states
  • the amount of change is used to make the state parameter of the participant change correspondingly based on the amount of state change, and the value of the state parameter and the amount of state change are calculated based on a homomorphic encryption algorithm, respectively The cipher text value or the promise value calculated based on the homomorphic promise algorithm;
  • the second generating unit generates unified proof information for multiple candidate sub-transactions that are adjacent and corresponding events in the set transaction to reduce the value of the state parameter, to prove that the state parameter is passing The value after the multiple candidate sub-transactions is in the correct value interval;
  • the submission unit submits the aggregate transaction to the blockchain, so that the candidate sub-transactions included in the aggregate transaction are processed in sequence.
  • a blockchain-based event processing device which is applied to a blockchain node.
  • the device includes:
  • the receiving unit receives a collective transaction submitted by a participant to the blockchain, and the collective transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the alternative The sub-transaction is set with a corresponding state change amount for the participant's state parameter to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are It is the ciphertext value calculated based on the homomorphic encryption algorithm or the promised value calculated based on the homomorphic commitment algorithm;
  • the first obtaining unit obtains unified certification information in the collective transaction, the unified certification information corresponding to multiple adjacent and corresponding events in the collective transaction are used to reduce the multiple values of the state parameter Select a sub-transaction to verify whether the value of the status parameter after the multiple candidate sub-transactions is in the correct value interval;
  • the determining unit determines the processing method for the multiple candidate sub-transactions according to the verification result.
  • an electronic device including:
  • Memory for storing processor executable instructions
  • the processor executes the executable instruction to implement the method described in the first aspect above.
  • an electronic device including:
  • Memory for storing processor executable instructions
  • the processor executes the executable instruction to implement the method described in the second aspect above.
  • FIG. 1 is a flowchart of a blockchain-based event processing method provided by an exemplary embodiment.
  • FIG. 2 is a flowchart of another blockchain-based event processing method provided by an exemplary embodiment.
  • FIG. 3 is a schematic diagram of a scenario of cross-border remittance provided by an exemplary embodiment.
  • FIG. 4 is a schematic diagram of interaction in a cross-border remittance process according to an exemplary embodiment.
  • FIG. 5 is a schematic diagram of content of a blockchain transaction provided by an exemplary embodiment.
  • FIG. 6 is a schematic diagram of a statistical trigger situation provided by an exemplary embodiment.
  • FIG. 7 is a schematic structural diagram of an apparatus provided by an exemplary embodiment.
  • FIG. 8 is a block diagram of a blockchain-based event processing device provided by an exemplary embodiment.
  • FIG. 9 is a schematic structural diagram of another device provided by an exemplary embodiment.
  • FIG. 10 is a block diagram of another blockchain-based event processing apparatus provided by an exemplary embodiment.
  • the steps of the corresponding method are not necessarily performed in the order shown and described in this specification.
  • the method may include more or fewer steps than described in this specification.
  • 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.
  • 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:
  • Step 102 Generate a corresponding alternative sub-transaction according to the event that the participant participates, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transaction is set with a corresponding state change amount , So that the state parameter of the participant changes correspondingly based on the state change, and the value of the state parameter and the state change are the secrets calculated based on the homomorphic encryption algorithm, respectively.
  • 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.
  • the descriptive information may include information such as voting reasons and voting options
  • 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.
  • 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.
  • 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.
  • 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 state changes, etc. This is restricted.
  • 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 .
  • 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.
  • 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.
  • 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.
  • 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.
  • the amount of state change in the description information may be a ciphertext value or a commitment value.
  • the plaintext value of the state change is t1
  • the corresponding ciphertext commitment T1 can be generated according to the plaintext value t1 and the random number r1
  • the description information can include the T1, t1, and r1, so that The other participants of the event can verify the correspondence between the ciphertext commitment T1 and the plaintext value t1 and the random number r1.
  • the description information can encrypt and protect the plain text value t1 and the random number r1.
  • 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.
  • any other encryption method in the related art such as a digital envelope, can also be used, which is not limited in this specification.
  • the description information may respectively include encrypted data corresponding to each other party.
  • 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
  • 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.
  • 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.
  • the participant may maintain a waiting queue, which contains candidate sub-transactions corresponding to each event in which the participant participates; and by selecting several candidate sub-transactions from the waiting queue, Generate the corresponding aggregate transaction.
  • the aggregate transaction may contain multiple alternative sub-transactions, each of which corresponds to an event in which the above-mentioned parties participate, so that after the aggregate transaction is submitted to the blockchain, the multiple alternative sub-transactions included All transactions can be processed in the blockchain, so that multiple events corresponding to these alternative sub-transactions are implemented.
  • the candidate sub-transactions in the waiting queue may be selected to: Generate the corresponding aggregate transaction.
  • 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.
  • alternative sub-transactions can also be selected through other preset rules, which are not limited in this specification.
  • 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 .
  • 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.
  • the description information of the event may include a state change amount
  • the event may be used to cause the state parameters correspondingly recorded on the blockchain by various parties to change in value according to the state change amount, such as increasing Large values, reduced values, etc.
  • the corresponding state parameters may also be different according to the type of event or the difference in the scene.
  • the state parameter in the scenario of transfer or cross-border remittance can be the account balance of the participant
  • the state parameter in the scenario of traffic distribution can be the participant. This manual does not limit the amount of remaining flow.
  • Step 104 For multiple candidate sub-transactions that are adjacent and corresponding events in the set transaction are used to reduce the value of the state parameter, generate unified proof information to prove that the state parameter passes through the The value after multiple alternative sub-transactions is in the correct value range.
  • the multiple candidate sub-transactions described above can generate only one unified certification information without having to separately and individually generate corresponding certification information, which helps simplify the certification information and improve Processing efficiency.
  • "for multiple candidate sub-transactions that are used to reduce the value of the state parameter for adjacent and corresponding events in the set transaction" does not necessarily mean that only The multiple alternative sub-transactions generate unified certification information. If there are other alternative sub-transactions arranged before the multiple alternative sub-transactions in the collective transaction, the other alternative sub-transactions will also affect the status parameters. The value has an impact, so the unified certification information is also related to the other alternative sub-transactions.
  • the state parameter needs to experience the other alternative sub-exchanges before undergoing the multiple alternative sub-transactions
  • the value of is changed, and the unified proof information is used to prove that the value of the state parameter after the joint action of the other candidate sub-transaction and the multiple candidate sub-transactions is in the correct value interval.
  • unified proof information can be generated for the three consecutive alternative sub-transactions of the fifth, sixth, and seventh.
  • the state parameter is not only affected by three consecutive "subtracted” alternative sub-transactions.
  • the effect is also affected by four other alternative sub-transactions.
  • the unified proof information is used to prove that the state parameter has a value change under the action of the seven alternative sub-transactions, and the changed value is in the correct numerical range. .
  • the above “corresponding events are all used to reduce the value of the state parameter of multiple alternative sub-transactions” may be just adjacent to each other, and no special sorting process is implemented, which makes In some cases, multiple eligible alternative sub-transactions may not be set adjacent to each other, resulting in the inability to use this manual to generate unified certification information. It may also prevent multiple eligible alternative sub-transactions from being arranged completely continuously. Split into multiple groups, then each group can still generate unified certification information separately, but it is impossible to generate a unified certification information for multiple eligible sub-transactions.
  • the manner in which the value of the state parameter is adjusted by the event corresponding to each selected candidate sub-transaction can be identified ;
  • the at least two alternative sub-transactions may be arranged adjacently in the set transaction.
  • the participant may Proof information is separately generated for it to prove that the value of the state parameter after the multiple alternative sub-transactions is in the correct value interval.
  • the value of the state parameter corresponding to each participant and the state change amount are respectively a ciphertext value calculated based on a homomorphic encryption algorithm or a promise value calculated based on a homomorphic commitment algorithm.
  • a 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 in the state for this homomorphic encryption algorithm is an additive homomorphic encryption algorithm or a fully homomorphic encryption algorithm, this specification does not limit this.
  • the homomorphic commitment algorithm when using the Pedersen commitment mechanism in the related art, a random number can be determined for the unencrypted data, and the corresponding commitment value can be calculated based on the random number and the unencrypted data.
  • the participant when the value of the state parameter and the amount of state change are the ciphertext value or the promised value, the participant needs to provide relevant proof information so that the blockchain node can determine the transaction Legal validity.
  • an event is used to make the value of a state parameter corresponding to a participant decrease according to the state change, that is, the purpose of the transaction is to make the value of the state parameter of the participant decrease the amount of state change, such as
  • the above unified certification information is used to prove that the value of the participant's state parameter is sufficient to implement multiple adjacent "reduced" types of alternative sub-transactions in the above set transaction (that is, the value of the state parameter is not less than the phase
  • the sum of the corresponding state changes of the neighboring multiple "reduced" types of candidate sub-exchanges when the value of the state parameter and the amount of state change are the ciphertext value or the promised value, the participant needs to provide relevant proof information so that the blockchain node can determine the transaction Legal validity.
  • an event is used to make the value of a
  • the set transaction may include a pre-change state value and a post-change state value respectively corresponding to each candidate sub-transaction to match the state change amount set in each candidate sub-transaction, so that each backup
  • 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 pre-change state value and the post-change state value
  • the state value is a ciphertext value calculated based on the homomorphic encryption algorithm or a promise value calculated based on the homomorphic commitment algorithm, respectively.
  • the unified proof information can be used to prove that in the above-mentioned adjacent multiple “decrease” type alternative sub-transactions, the state value of the last alternative sub-transaction after the change is not less than 0.
  • the independent proof information is used to prove that the state change amount set in the corresponding candidate sub-transaction is within the correct value interval.
  • the independent proof information can be used to indicate that the corresponding state change is in the correct numerical range, such as [0,264).
  • the Range Proof technology in related technologies can be used to generate the above-mentioned certification information, which is not limited in this specification.
  • Step 106 Submit the aggregate transaction to the blockchain, so that the candidate sub-transactions included in the aggregate transaction are processed in sequence.
  • 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.
  • 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.
  • 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.
  • 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.
  • each participant of the event 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 or the promise value is used, the confirmation information also contains the certification information, which is described above It has been described in detail.
  • 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:
  • Step 202 Receive a collective transaction submitted by a participant to the blockchain, and the collective transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the alternative The sub-transaction is set with a corresponding state change amount for the participant's state parameter to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are It is the ciphertext value calculated based on the homomorphic encryption algorithm or the commitment value calculated based on the homomorphic commitment algorithm.
  • 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.
  • the descriptive information may include information such as voting reasons and voting options
  • 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.
  • 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.
  • 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.
  • 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 state changes, etc. This is restricted.
  • 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 .
  • 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.
  • 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.
  • 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.
  • 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.
  • the amount of state change in the description information may be a ciphertext value or a commitment value.
  • the plaintext value of the state change is t1
  • the corresponding ciphertext commitment T1 can be generated according to the plaintext value t1 and the random number r1
  • the description information can include the T1, t1, and r1, so that The other participants of the event can verify the correspondence between the ciphertext commitment T1 and the plaintext value t1 and the random number r1.
  • the description information can encrypt and protect the plain text value t1 and the random number r1.
  • 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.
  • any other encryption method in the related art such as a digital envelope, can also be used, which is not limited in this specification.
  • the description information may respectively include encrypted data corresponding to each other party.
  • 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
  • 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.
  • 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.
  • the participant may maintain a waiting queue, which contains candidate sub-transactions corresponding to each event in which the participant participates; and by selecting several candidate sub-transactions from the waiting queue, Generate the corresponding aggregate transaction.
  • the aggregate transaction may contain multiple alternative sub-transactions, each of which corresponds to an event in which the above-mentioned parties participate, so that after the aggregate transaction is submitted to the blockchain, the multiple alternative sub-transactions included All transactions can be processed in the blockchain, so that multiple events corresponding to these alternative sub-transactions are implemented.
  • the candidate sub-transactions in the waiting queue may be selected to: Generate the corresponding aggregate transaction.
  • 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.
  • alternative sub-transactions can also be selected through other preset rules, which are not limited in this specification.
  • 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 .
  • 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 and the priority of the event; or, the waiting queue itself can be Sort by degree, priority, etc., so that it can still be regarded as one by one.
  • the description information of the event may include a state change amount
  • the event may be used to cause the state parameters correspondingly recorded on the blockchain by various parties to change in value according to the state change amount, such as increasing Large values, reduced values, etc.
  • the corresponding state parameters may also be different according to the type of event or the difference in the scene.
  • the state parameter in the scenario of transfer or cross-border remittance can be the account balance of the participant
  • the state parameter in the scenario of traffic distribution can be the participant. This manual does not limit the amount of remaining flow.
  • Step 204 Obtain unified certification information in the collective transaction, and the unified certification information corresponds to multiple alternatives that are adjacent and corresponding events in the collective transaction are used to reduce the value of the state parameter Transaction to verify whether the value of the status parameter after the multiple candidate sub-transactions is in the correct value interval.
  • the multiple candidate sub-transactions described above can generate only one unified certification information without having to separately and individually generate corresponding certification information, which helps simplify the certification information and improve Processing efficiency.
  • "for multiple candidate sub-transactions that are used to reduce the value of the state parameter for adjacent and corresponding events in the set transaction" does not necessarily mean that only The multiple alternative sub-transactions generate unified certification information. If there are other alternative sub-transactions arranged before the multiple alternative sub-transactions in the collective transaction, the other alternative sub-transactions will also affect the status parameters. The value has an impact, so the unified certification information is also related to the other alternative sub-transactions.
  • the state parameter needs to experience the other alternative sub-exchanges before undergoing the multiple alternative sub-transactions
  • the value of is changed, and the unified proof information is used to prove that the value of the state parameter after the joint action of the other candidate sub-transaction and the multiple candidate sub-transactions is in the correct value interval.
  • unified proof information can be generated for the three consecutive alternative sub-transactions of the fifth, sixth, and seventh.
  • the state parameter is not only affected by three consecutive "subtracted” alternative sub-transactions.
  • the effect is also affected by four other alternative sub-transactions.
  • the unified proof information is used to prove that the state parameter has a value change under the action of the seven alternative sub-transactions, and the changed value is in the correct numerical range. .
  • the above “corresponding events are all used to reduce the value of the state parameter of multiple alternative sub-transactions” may be just adjacent to each other, and no special sorting process is implemented, which makes In some cases, multiple eligible alternative sub-transactions may not be set adjacent to each other, resulting in the inability to use this manual to generate unified certification information. It may also prevent multiple eligible alternative sub-transactions from being arranged completely continuously. Split into multiple groups, then each group can still generate unified certification information separately, but it is impossible to generate a unified certification information for multiple eligible sub-transactions.
  • the manner in which the value of the state parameter is adjusted by the event corresponding to each selected candidate sub-transaction can be identified ;
  • the at least two alternative sub-transactions may be arranged adjacently in the set transaction.
  • the participant may Proof information is separately generated for it to prove that the value of the state parameter after the multiple alternative sub-transactions is in the correct value interval.
  • the value of the state parameter corresponding to each participant and the state change amount are respectively a ciphertext value calculated based on a homomorphic encryption algorithm or a promise value calculated based on a homomorphic commitment algorithm.
  • a 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 in the state for this homomorphic encryption algorithm is an additive homomorphic encryption algorithm or a fully homomorphic encryption algorithm, this specification does not limit this.
  • the homomorphic commitment algorithm when using the Pedersen commitment mechanism in the related art, a random number can be determined for the unencrypted data, and the corresponding commitment value can be calculated based on the random number and the unencrypted data.
  • the participant when the value of the state parameter and the amount of state change are the ciphertext value or the promised value, the participant needs to provide relevant proof information so that the blockchain node can determine the transaction Legal validity.
  • an event is used to make the value of a state parameter corresponding to a participant decrease according to the state change, that is, the purpose of the transaction is to make the value of the state parameter of the participant decrease the amount of state change, such as
  • the above unified certification information is used to prove that the value of the participant's state parameter is sufficient to implement multiple adjacent "reduced" types of alternative sub-transactions in the above set transaction (that is, the value of the state parameter is not less than the phase
  • the sum of the corresponding state changes of the neighboring multiple "reduced" types of candidate sub-exchanges when the value of the state parameter and the amount of state change are the ciphertext value or the promised value, the participant needs to provide relevant proof information so that the blockchain node can determine the transaction Legal validity.
  • an event is used to make the value of a
  • the set transaction may include a pre-change state value and a post-change state value respectively corresponding to each candidate sub-transaction to match the state change amount set in each candidate sub-transaction, so that each backup
  • 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 pre-change state value and the post-change state value
  • the state value is a ciphertext value calculated based on the homomorphic encryption algorithm or a promise value calculated based on the homomorphic commitment algorithm, respectively.
  • the unified proof information can be used to prove that in the above-mentioned adjacent multiple “decrease” type alternative sub-transactions, the state value of the last alternative sub-transaction after the change is not less than 0.
  • the independent proof information is used to prove that the state change amount set in the corresponding candidate sub-transaction is within the correct value interval.
  • the independent proof information can be used to indicate that the corresponding state change is in the correct numerical range, such as [0,264).
  • the blockchain node may obtain independent proof information corresponding to each candidate sub-transaction in the set transaction to verify whether the state change amount set in the corresponding candidate sub-transaction is in the correct state Numerical interval; wherein, when the verification result of the unified proof information by the blockchain node is verified, and the independent proof information corresponding to any of the multiple alternative sub-transactions passes the verification, the blockchain The node may trigger execution of any of the alternative sub-transactions.
  • the blockchain node may acquire the event corresponding to any of the alternative sub-transactions in the collective transaction when the value of the state parameter is used to increase the value of the state parameter.
  • Independent certification information of any alternative sub-transaction wherein, when the independent certification information corresponding to the alternative sub-transaction passes verification, the blockchain node may trigger execution of the alternative sub-transaction.
  • the Range Proof technology in related technologies can be used to generate the above-mentioned certification information, which is not limited in this specification.
  • Step 206 Determine a processing method for the multiple candidate sub-transactions according to the verification result.
  • 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.
  • 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.
  • 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.
  • 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.
  • each participant of the event 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 or the promise value is used, the confirmation information also contains the certification information, which is described above It has been described in detail.
  • 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.
  • FIG. 3 is a schematic diagram of a scenario of cross-border remittance provided by an exemplary embodiment.
  • 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.
  • user 1 opens a customer funds account at institution 1 in country A 1
  • 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.
  • the cross-border remittance operation is implemented on the blockchain.
  • 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.
  • the blockchain account Y1 corresponding to institution 1 holds 1000 HKD
  • the blockchain account Y2 corresponding to institution 2 holds HKD 2,500 and 4,200 Euros
  • the Blockchain account Y3 corresponding to Institution 3 holds 3,000 Euros and $2,000
  • the Blockchain account Y4 corresponding to Institution 4 holds $1,500.
  • 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.
  • the blockchain account Y1 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)) ,
  • 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
  • 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.
  • FIG. 4 is a schematic diagram of interaction in a cross-border remittance process according to an exemplary embodiment.
  • the interactive process of cross-border remittance can include the following steps:
  • step 401 the device 1 drafts a remittance transaction tx_i.
  • 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.
  • 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.
  • 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 the transfer of funds on the chain is realized between institutions 1 to 4 through the blockchain.
  • substitution 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
  • the number of relay parties may be one, three, or more than three, and this specification does not limit this.
  • 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_D(r_D(r_t2),Enc_D(r_t2),Enc_D
  • 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.
  • 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
  • Enc_D(t1) means the identity public key of the institution 4
  • 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 is not listed here one by one.
  • 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, such as 0 ⁇ t1 ⁇ 264, 0 ⁇ t2 ⁇ 264, 0 ⁇ t3 ⁇ 264.
  • 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.
  • step 402a to 402c device 1 synchronizes the details of the remittance transaction to device 2, device 3, and device 4, respectively.
  • 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.
  • an off-chain or referred to as off-chain
  • 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.
  • 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.
  • 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.
  • 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.
  • step 403a the device 1 adds the remittance transaction tx_i corresponding to the remittance transaction details to its own local queue 1.
  • the device 1 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.
  • the device 1 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, and the remittance transaction tx_i is determined by the device 1
  • the verification process of the details of the remittance transaction is omitted, and it is directly added to the local queue 1.
  • step 403b after verifying the details of the received remittance transaction, the device 2 adds it to its own local queue 2.
  • the device 2 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.
  • 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.
  • 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.
  • the operations performed by the device 3 and the device 4 are similar to those of the device 2, and are not repeated here.
  • the remittance transaction tx_i has been added to the local queues 1 to 4 maintained by devices 1 to 4 respectively.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • FIG. 5 is a schematic diagram of content of a blockchain transaction provided by an exemplary embodiment.
  • device 1 selects 6 remittance transactions and aggregates them into a blockchain transaction, such as remittance transactions tx_i-3, tx_i-2, tx_i-1, tx_i, tx_i+1, tx_i+2 are aggregated
  • the device 1 needs to generate corresponding proof information for each remittance transaction.
  • the blockchain transaction TX_a needs to contain proof information for the transaction amount of each remittance transaction, for example, the proof information corresponding to the remittance transaction tx_i-3 is RP_i-3
  • the proof information corresponding to the remittance transaction tx_i-2 is RP_i-2
  • the proof information corresponding to the remittance transaction tx_i-1 is RP_i-1
  • the proof information corresponding to the remittance transaction tx_i is RP_i
  • the proof information corresponding to the remittance transaction tx_i+1 is RP_i +1
  • the proof information corresponding to the remittance transaction tx_i+2 is RP_i+2.
  • the proof information RP_i corresponding to the remittance transaction tx_i is equivalent to the above-mentioned interval proofs RP_t1, RP_t2, and RP_t3, which are respectively used to prove that the transaction amount t1, t2, and t3 of the remittance transaction tx_i are in the correct value interval.
  • the drafting party of the remittance transaction can generate the certification information of the transaction amount without the need for device 1; of course, even if the remittance transaction is not drafted by device 1, it can still be The device 1 generates certification information for the corresponding transaction amount, which is not limited in this specification.
  • the device 1 also needs to generate a sufficient balance of the blockchain account Y1, not less than the transaction The amount of proof information.
  • the device 1 needs to select all the remittance transactions that will reduce the balance of the blockchain account Y1 from the above six remittance transactions, and make the selected remittance transactions be arranged next to each other in the blockchain transaction TX_a ; For example, when the remittance transaction tx_i-3, tx_i-2 and tx_i-1 will cause the balance of the blockchain account Y1 to increase, while the remittance transaction tx_i, tx_i+1, tx_i+2 will cause the balance of the blockchain account Y1 to decrease.
  • device 1 can arrange remittance transactions tx_i-3, tx_i-2 and tx_i-1 adjacently, and generate unified proof information RP_(i ⁇ i+2) for these three remittance transactions to prove the blockchain account Y1
  • the balance (referring to the balance after the value change caused by the remittance transaction tx_i, tx_i+1
  • the remittance transactions submitted by the device 1 may not all be successfully executed, and the remittance transaction submitted earlier may affect the balance of the blockchain account Y1, thereby affecting the subsequent remittance transaction, therefore, in the generation When unifying the proof information RP_(i ⁇ i+2), the influence of the previously submitted blockchain transaction should be considered.
  • institution 1 when institution 1 acts as a remittance or relay party in several remittance transactions included in the blockchain transaction, institution 1 will subtract the corresponding transfer amount (remittance) from the account balance of its corresponding blockchain account Y1
  • the party only transfers out the funds; the relaying party can receive the transferred funds and need to transfer out the funds, which is described for the operation of the transferred funds), and continue to participate in the subsequent remittance transactions based on the updated remittance amount.
  • institution 1 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.
  • 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
  • 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.
  • the blockchain node 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.
  • the remittance transactions that may cause changes in the amount of blockchain transactions include: the increase in the amount of money (receipt) generated when the remittance transaction of institution 1 as a relay or payee is marked as successful, and the institution 1 as a sender or The amount of money generated when the remittance transaction of the relay party is marked as a failed state or a time-out state is increased (the deducted transfer amount is rolled back), etc.
  • the device 1 further takes 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 value change value of the above remittance transaction that may cause the amount change to the block
  • the balance value of the chain account Y1 is updated, and then unified certification information RP_(i ⁇ i+2) is generated according to the updated balance value.
  • the device 1 when generating each blockchain transaction, the device 1 also adds a corresponding sequence number seq for each blockchain transaction according to the generation sequence of the blockchain transaction. For example, when device 1 generates blockchain transactions TX_1, TX_2, and TX_3, the seq value of blockchain transaction TX_1 is 99, the seq value of blockchain transaction TX_2 is 100, and the seq value of blockchain transaction TX_3 is A value of 101 indicates that the blockchain transaction TX_1 was generated earlier than the blockchain transaction TX_2, and the blockchain transaction TX_2 was generated earlier than the blockchain transaction TX_3.
  • the blockchain node 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.
  • steps 404b-d devices 2 to 4 aggregate the transactions TX_b, TX_c, and TX_d according to the remittance transactions in the local queues 2 to 4, and submit them to the blockchain after signing.
  • the device 2 can select one or more remittance transactions from the local queue 2 to aggregate and generate corresponding blockchain transactions. Assume that device 2 includes the above-mentioned remittance transaction tx_i in a selected remittance transaction, and accordingly generates a corresponding blockchain transaction TX_b; where the remittance transaction that causes the balance of the institution 2’s blockchain account Y2 to decrease is in TX_b Arranged adjacent to each other to generate corresponding unified certification information.
  • the device 3 may select one or more remittance transactions from the local queue 3 to aggregate and generate corresponding blockchain transactions. Assume that device 3 includes the above-mentioned remittance transaction tx_i in a selected remittance transaction, and accordingly generates the corresponding blockchain transaction TX_c; where the remittance transaction that causes the balance of the institution’s 3 blockchain account Y3 to decrease is in TX_c Arranged adjacent to each other to generate corresponding unified certification information.
  • the device 4 may select one or more remittance transactions from the local queue 4 to aggregate and generate corresponding blockchain transactions. Assume that device 4 includes the above-mentioned remittance transaction tx_i in a certain selected remittance transaction, and accordingly generates the corresponding blockchain transaction TX_d; where the remittance transaction that causes the balance of the blockchain account Y4 of institution 4 to decrease is in TX_d Arranged adjacent to each other to generate corresponding unified certification information.
  • 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
  • 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.
  • Step 405 The blockchain node processes the received blockchain transaction to verify each remittance transaction included in the blockchain transaction.
  • Step 406 mark the remittance transaction tx_i.
  • each institution 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.
  • a blockchain node 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.
  • the blockchain nodes can separately extract and verify the remittance transactions included in each blockchain transaction.
  • blockchain nodes can verify the certification information RP_i-3, RP_i-2, RP_i-1, RP_i, RP_i+1, RP_i+2, as shown in FIG. 5, In order to determine whether the remittance amount of each remittance transaction is in the correct value range; and, the blockchain node verifies the unified certification information RP_(i ⁇ i+2) to determine whether the account balance of the blockchain account Y1 is sufficient, to Determine whether each remittance transaction in the blockchain transaction TX_a can be successfully executed.
  • the blockchain node may also implement other verification operations.
  • FIG. 6 is a schematic diagram of a statistical trigger situation provided by an exemplary embodiment.
  • blockchain nodes can record the blockchain transactions submitted by institutions 1 to 4 respectively, 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 verification, the participant may be marked as "OK".
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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+
  • the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710. Of course, it may include hardware required for other services.
  • the processor 702 reads the corresponding computer program from the non-volatile memory 710 into the memory 708 and then runs it to form a blockchain-based event processing terminal interaction device at a logical level.
  • 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.
  • the blockchain-based event processing device is applied to participants, and may include:
  • the first generating unit 801 generates corresponding alternative sub-transactions according to the events in which the participant participates, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transactions are set with corresponding State change amount for the state parameter of the participant to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are calculated based on a homomorphic encryption algorithm, respectively The ciphertext value obtained or the promise value calculated based on the homomorphic promise algorithm;
  • the second generating unit 802 generates unified proof information for multiple candidate sub-transactions that are used to reduce the value of the state parameter in the adjacent and corresponding events in the aggregate transaction to prove that the state parameter is in The value after the multiple alternative sub-transactions is in the correct value interval;
  • the submitting unit 803 submits the set transaction to the blockchain, so that the candidate sub-transactions included in the set transaction are processed in sequence.
  • Optional also includes:
  • the identifying unit 804 when several candidate sub-transactions are selected for aggregation into the set transaction, identify the manner in which the event corresponding to each selected candidate sub-transaction adjusts the value of the state parameter;
  • the arranging unit 805 arranges the at least two candidate sub-transactions adjacent to the set transaction when the events corresponding to the at least two candidate sub-transactions are used to reduce the value of the state parameter.
  • the set transaction includes a pre-change state value and a post-change state value respectively corresponding to each candidate sub-transaction to match the state change amount set in each candidate sub-transaction, so that each After the candidate 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 pre-change state value and the change
  • the post-state value is a ciphertext value calculated based on the homomorphic encryption algorithm or a promise value calculated based on the homomorphic commitment algorithm, respectively.
  • Optional also includes:
  • the third generating unit 806 separately generates corresponding independent certification information for each candidate sub-transaction in the set transaction, and the independent certification information is used to prove that the state change amount set in the corresponding candidate sub-transaction is in State the correct numerical interval.
  • 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.
  • Optional also includes:
  • the adding unit 807 adds corresponding numbers to each set transaction in the order of generation, so that each set transaction is sequentially processed in the blockchain according to the corresponding number size.
  • the device includes a processor 902, an internal bus 904, a network interface 906, a memory 908, and a non-volatile memory 910. Of course, it may include hardware required for other services.
  • the processor 902 reads the corresponding computer program from the non-volatile memory 910 into the memory 908 and then runs it to form a blockchain-based event processing terminal interaction device at a logical level.
  • 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.
  • the blockchain-based event processing device is applied to a blockchain node, and may include:
  • the receiving unit 1001 receives a collective transaction submitted by a participant to the blockchain, and the collective transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the backup The sub-transaction is set with a corresponding state change amount for the participant's state parameter to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount Respectively, the ciphertext value calculated based on the homomorphic encryption algorithm or the commitment value calculated based on the homomorphic commitment algorithm;
  • the first obtaining unit 1002 obtains unified certification information in the collective transaction, and the unified certification information corresponds to multiple adjacent and corresponding events in the collective transaction that are used to reduce the value of the state parameter.
  • Alternative sub-transactions to verify whether the value of the state parameter after passing through the multiple alternative sub-transactions is in the correct value interval;
  • the determining unit 1003 determines the processing method of the multiple candidate sub-transactions according to the verification result.
  • a second obtaining unit 1004 which obtains independent certification information corresponding to each candidate sub-transaction in the collective transaction to verify whether the state change amount set in the corresponding candidate sub-transaction is within the correct numerical range ;
  • the determining unit 1003 is specifically configured to: when the verification result is verified, and the independent certification information corresponding to any one of the plurality of candidate sub-transactions passes verification, trigger execution of any Alternative sub-transactions.
  • Optional also includes:
  • the third acquiring unit 1005 when the event corresponding to any candidate sub-transaction in the collective transaction is used to increase the value of the state parameter, acquires the candidate sub-transaction corresponding to the optional sub-transaction in the collective transaction Independent certification information of the transaction;
  • the first triggering unit 1006 triggers execution of any alternative sub-transaction when the independent certification information corresponding to the alternative sub-transaction passes verification.
  • the candidate sub-transaction corresponding to the event includes unilateral trigger information of the participant on the event; the device further includes:
  • the second triggering unit 1007 triggers the execution of the alternative sub-transaction corresponding to the event when all the parties involved in the event submit the single-party trigger information for the event to the blockchain and the verification is passed.
  • Optional also includes:
  • the identifying unit 1008 identifies the serial number corresponding to the collective transaction, and the serial number is added in the order in which each collective transaction is generated to sequentially process each collective transaction submitted by the participant according to the corresponding serial number size.
  • 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.
  • the computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • 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.
  • RAM random access memory
  • ROM read only memory
  • flash RAM flash random access memory
  • 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.
  • computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • first, second, third, etc. 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.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word "if” as used herein may be interpreted as "when” or “when” or “in response to a determination”.

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: generating corresponding alternative sub-transactions according to an event in which the participant participates so that several alternative sub-transactions cluster into a collected transaction, wherein the alternative sub-transactions are configured with corresponding state variations for enabling a corresponding numerical value change to occur to a state parameter of the participant on the basis of the state variations, and the value of the state parameter and the state variations are respectively calculated based on a homomorphic encryption algorithm or a homomorphic commitment algorithm (102); with regard to a plurality of adjacent alternative sub-transactions, events corresponding thereto all being used to decrease the value of the state parameter, in the collected transaction, generating uniform certification information to certify that the value of the state parameter after being subjected to the plurality of alternative sub-transactions is located in a correct value interval (104); and submitting the collected transaction to a blockchain so that the alternative sub-transactions included in the collected transaction are sequentially 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 terminal 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:
根据所述参与方所参与的事件,生成对应的备选子交易,以使得若干备选子交易被聚合为集合交易;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于所述同态承诺算法计算得到的承诺数值;According to the events in which the participant participates, a corresponding alternative sub-transaction is generated, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transaction is set with a corresponding state change amount to use In order to make the state parameters of the participants change correspondingly based on the state change, and the value of the state parameter and the state change are the ciphertext value calculated based on the homomorphic encryption algorithm or A commitment value calculated based on the homomorphic commitment algorithm;
针对所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,生成统一证明信息,以证明所述状态参数在经过所述多个备选子交易后的取值处于正确取值区间;For multiple candidate sub-transactions in which the adjacent and corresponding events in the set transaction are used to reduce the value of the state parameter, unified certification information is generated to prove that the state parameter passes through the multiple backup The value after selecting the child transaction is in the correct value range;
将所述集合交易提交至区块链,以使所述集合交易中包含的备选子交易被依次处理。Submit the aggregate transaction to the blockchain so that the alternative sub-transactions included in the aggregate transaction are processed in sequence.
根据本说明书一个或多个实施例的第二方面,提出了一种基于区块链的事件处理方法,应用于区块链节点,所述方法包括: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:
接收参与方提交至区块链的集合交易,所述集合交易中包含若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值;Receiving a set transaction submitted by a participant to the blockchain, the set transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the alternative sub-transaction is set A corresponding state change amount is set for the state parameter of the participant to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are based on the same The ciphertext value calculated by the homomorphic encryption algorithm or the promise value calculated based on the homomorphic commitment algorithm;
获取所述集合交易中的统一证明信息,所述统一证明信息对应于所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,以验证所述状态参数在经过所述多个备选子交易后的取值是否处于正确取值区间;Acquiring unified certification information in the collective transaction, the unified certification information corresponding to multiple candidate sub-transactions that are adjacent and corresponding events in the collective transaction are used to reduce the value of the state parameter, Verify whether the value of the state parameter after passing through the plurality of candidate sub-transactions is in the correct value interval;
根据验证结果确定对所述多个备选子交易的处理方式。According to the verification result, a processing method for the multiple candidate sub-transactions is determined.
根据本说明书一个或多个实施例的第三方面,提出了一种基于区块链的事件处理装置,应用于参与方,所述装置包括: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:
第一生成单元,根据所述参与方所参与的事件,生成对应的备选子交易,以使得若干备选子交易被聚合为集合交易;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值;The first generating unit generates corresponding alternative sub-transactions according to the events in which the participant participates, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transactions are set with corresponding states The amount of change is used to make the state parameter of the participant change correspondingly based on the amount of state change, and the value of the state parameter and the amount of state change are calculated based on a homomorphic encryption algorithm, respectively The cipher text value or the promise value calculated based on the homomorphic promise algorithm;
第二生成单元,针对所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,生成统一证明信息,以证明所述状态参数在经过所述多个备选子交易后的取值处于正确取值区间;The second generating unit generates unified proof information for multiple candidate sub-transactions that are adjacent and corresponding events in the set transaction to reduce the value of the state parameter, to prove that the state parameter is passing The value after the multiple candidate sub-transactions is in the correct value interval;
提交单元,将所述集合交易提交至区块链,以使所述集合交易中包含的备选子交易被依次处理。The submission unit submits the aggregate transaction to the blockchain, so that the candidate sub-transactions included in the aggregate transaction are processed in sequence.
根据本说明书一个或多个实施例的第四方面,提出了一种基于区块链的事件处理装置,应用于区块链节点,所述装置包括: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 collective transaction submitted by a participant to the blockchain, and the collective transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the alternative The sub-transaction is set with a corresponding state change amount for the participant's state parameter to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are It is the ciphertext value calculated based on the homomorphic encryption algorithm or the promised value calculated based on the homomorphic commitment algorithm;
第一获取单元,获取所述集合交易中的统一证明信息,所述统一证明信息对应于所 述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,以验证所述状态参数在经过所述多个备选子交易后的取值是否处于正确取值区间;The first obtaining unit obtains unified certification information in the collective transaction, the unified certification information corresponding to multiple adjacent and corresponding events in the collective transaction are used to reduce the multiple values of the state parameter Select a sub-transaction to verify whether the value of the status parameter after the multiple candidate sub-transactions is in the correct value interval;
确定单元,根据验证结果确定对所述多个备选子交易的处理方式。The determining unit determines the processing method for the multiple candidate sub-transactions according to the verification result.
根据本说明书一个或多个实施例的第五方面,提出了一种电子设备,包括: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 executes the executable instruction to implement the method described in the first aspect above.
根据本说明书一个或多个实施例的第六方面,提出了一种电子设备,包括: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 content of a blockchain transaction provided by an exemplary embodiment.
图6是一示例性实施例提供的一种统计触发情况的示意图。FIG. 6 is a schematic diagram of a statistical trigger situation provided by an exemplary embodiment.
图7是一示例性实施例提供的一种设备的结构示意图。7 is a schematic structural diagram of an apparatus provided by an exemplary embodiment.
图8是一示例性实施例提供的一种基于区块链的事件处理装置的框图。FIG. 8 is a block diagram of a blockchain-based event processing device provided by an exemplary embodiment.
图9是一示例性实施例提供的另一种设备的结构示意图。FIG. 9 is a schematic structural diagram of another device provided by an exemplary embodiment.
图10是一示例性实施例提供的另一种基于区块链的事件处理装置的框图。FIG. 10 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 the following description refers to the accompanying drawings, 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: Generate a corresponding alternative sub-transaction according to the event that the participant participates, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transaction is set with a corresponding state change amount , So that the state parameter of the participant changes correspondingly based on the state change, and the value of the state parameter and the state change are the secrets calculated based on the homomorphic encryption algorithm, respectively. The text value or the promise value calculated based on the homomorphic promise algorithm.
在一实施例中,本说明书的事件可以包括任意类型、覆盖任意场景,比如投票、签订协议、流量分配、转账、跨境汇款等,本说明书并不对此进行限制。以投票为例,描述信息可以包括投票事由和投票选项等信息,而各个参与方向区块链中提交的触发信息可以包括对投票选项的选择结果,从而触发完成投票操作。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, there may be 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 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 state changes, etc. This is restricted. 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.
在一实施例中,任一参与方在生成描述信息时,该描述信息中的状态变化量可以为密文数值或承诺数值。比如当状态变化量的明文数值为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 state change in the description information may be a ciphertext value or a commitment value. For example, when the plaintext value of the state 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 other participants of the event can verify the correspondence between the ciphertext commitment T1 and the plaintext value t1 and the 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, the participant may maintain a waiting queue, which contains candidate sub-transactions corresponding to each event in which the participant participates; and by selecting several candidate sub-transactions from the waiting queue, Generate the corresponding aggregate transaction. The aggregate transaction may contain multiple alternative sub-transactions, each of which corresponds to an event in which the above-mentioned parties participate, so that after the aggregate transaction is submitted to the blockchain, the multiple alternative sub-transactions included All 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.
在一实施例中,事件的描述信息可以包括状态变化量,而所述事件可以用于使各个参与方在区块链上对应记录的状态参数按照所述状态变化量发生取值变化,比如增大取值、减小取值等。其中,根据事件的类型或场景差异,相应的状态参数也可能不同,比如转账或跨境汇款场景下的状态参数可以为参与方的账户余额,再比如流量分配场景下的状态参数可以为参与方持有的剩余流量的数额,本说明书并不对此进行限制。In an embodiment, the description information of the event may include a state change amount, and the event may be used to cause the state parameters correspondingly recorded on the blockchain by various parties to change in value according to the state change amount, such as increasing Large values, reduced values, 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.
步骤104,针对所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,生成统一证明信息,以证明所述状态参数在经过所述多个备选子交易后的取值处于正确取值区间。Step 104: For multiple candidate sub-transactions that are adjacent and corresponding events in the set transaction are used to reduce the value of the state parameter, generate unified proof information to prove that the state parameter passes through the The value after multiple alternative sub-transactions is in the correct value range.
在一实施例中,通过生成上述的统一证明信息,使得上述的多个备选子交易可以仅生成一个统一证明信息,而无需分别、单独生成对应的证明信息,有助于简化证明信息、提升处理效率。In an embodiment, by generating the above-mentioned unified certification information, the multiple candidate sub-transactions described above can generate only one unified certification information without having to separately and individually generate corresponding certification information, which helps simplify the certification information and improve Processing efficiency.
在一实施例中,“针对所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,生成统一证明信息”并不一定是指仅由该多个备选子交易来生成统一证明信息,如果集合交易中还存在排列于该多个备选子交易之前的其他备选子交易,那么该其他备选子交易同样会对状态参数的取值造成影响,因而统一证明信息还跟该其他备选子交易相关。换言之,如果集合交易中存在排列于该多个备选子交易之前的其他备选子交易,那么状态参数在经历该多个备选子交易之前,还需经历该其他备选子交易所带来的取值变化,而统一证明信息用于证明状态参数在该其他备选子交易和该多个备选子交易的共同作用后的取值处于正确取值区间。In an embodiment, "for multiple candidate sub-transactions that are used to reduce the value of the state parameter for adjacent and corresponding events in the set transaction" does not necessarily mean that only The multiple alternative sub-transactions generate unified certification information. If there are other alternative sub-transactions arranged before the multiple alternative sub-transactions in the collective transaction, the other alternative sub-transactions will also affect the status parameters. The value has an impact, so the unified certification information is also related to the other alternative sub-transactions. In other words, if there are other alternative sub-transactions arranged before the multiple alternative sub-transactions in the collective transaction, then the state parameter needs to experience the other alternative sub-exchanges before undergoing the multiple alternative sub-transactions The value of is changed, and the unified proof information is used to prove that the value of the state parameter after the joint action of the other candidate sub-transaction and the multiple candidate sub-transactions is in the correct value interval.
例如,当集合交易包含的备选子交易依次为“减减减加加”(“减”代表用于减小状态参数的取值的备选子交易,“加”代表用于增大状态参数的取值的备选子交易)时,可以针对前三个连续的备选子交易生成统一证明信息,此时由于这三个备选子交易之前并不存在其他备选子交易,因而状态参数仅受这三个备选子交易的作用而产生取值变化,统一证明信息用于证明该变化后的取值处于正确数值区间。For example, when the alternative sub-transactions included in the set transaction are sequentially "decrease, decrement, and add" ("minus" represents the alternative sub-transaction used to decrease the value of the state parameter, "plus" represents the increase in the state parameter Value of alternative sub-transactions), you can generate unified proof information for the first three consecutive alternative sub-transactions. At this time, because there are no other alternative sub-transactions before these three alternative sub-transactions, the status parameter Only by the effect of these three alternative sub-transactions, the value change occurs, and the unified proof information is used to prove that the value after the change is in the correct numerical range.
再例如,当集合交易包含的备选子交易依次为“加加减加减减减加”时,可以针对第五、第六、第七共三个连续的备选子交易生成统一证明信息,此时由于这三个备选子交易之前存在第一、第二、第三、第四共四个其他备选子交易,因而状态参数不仅受到三个连续的“减”的备选子交易的作用,还受到四个其他备选子交易的作用,统一证明信息用于证明状态参数在这七个备选子交易的作用下而产生取值变化后,该变化后的取值处于正确数值区间。For another example, when the alternative sub-transactions included in the collective transaction are "addition, subtraction, addition, subtraction, subtraction, and addition", unified proof information can be generated for the three consecutive alternative sub-transactions of the fifth, sixth, and seventh, At this time, since there are four other alternative sub-transactions of the first, second, third, and fourth before these three alternative sub-transactions, the state parameter is not only affected by three consecutive "subtracted" alternative sub-transactions. The effect is also affected by four other alternative sub-transactions. The unified proof information is used to prove that the state parameter has a value change under the action of the seven alternative sub-transactions, and the changed value is in the correct numerical range. .
在一实施例中,上述“对应的事件均用于减小所述状态参数的取值的多个备选子交易”可以是恰好处于相邻位置,而并未实施特别的排序处理,这使得一些情况下,多个符合条件的备选子交易可能并未相邻设置、导致无法采用本说明书来生成统一证明信息,还可能使得多个符合条件的备选子交易无法完全连续排列、被进一步分割为多组,那么每组仍然可以分别生成统一证明信息,只是无法为多个符合条件的备选子交易生成一份 统一证明信息。In an embodiment, the above “corresponding events are all used to reduce the value of the state parameter of multiple alternative sub-transactions” may be just adjacent to each other, and no special sorting process is implemented, which makes In some cases, multiple eligible alternative sub-transactions may not be set adjacent to each other, resulting in the inability to use this manual to generate unified certification information. It may also prevent multiple eligible alternative sub-transactions from being arranged completely continuously. Split into multiple groups, then each group can still generate unified certification information separately, but it is impossible to generate a unified certification information for multiple eligible sub-transactions.
在一实施例中,当若干备选子交易被选取以用于聚合为所述集合交易时,可以识别每一被选取的备选子交易对应的事件对所述状态参数的取值的调整方式;当至少两个备选子交易对应的事件均用于减小所述状态参数的取值时,可以将所述至少两个备选子交易相邻地排列于所述集合交易中。换言之,在聚合形成集合交易时,可以主动对各个备选子交易进行排序,并尽量将用于减小状态参数取值的备选子交易都进行相邻排列,从而使得这些备选子交易可以仅生成一份统一证明信息,可以尽量减少证明信息的数量。In an embodiment, when several candidate sub-transactions are selected for aggregation into the set transaction, the manner in which the value of the state parameter is adjusted by the event corresponding to each selected candidate sub-transaction can be identified ; When the events corresponding to at least two alternative sub-transactions are used to reduce the value of the state parameter, the at least two alternative sub-transactions may be arranged adjacently in the set transaction. In other words, when aggregated to form a set of transactions, you can actively sort each alternative sub-transaction, and try to arrange the alternative sub-transactions used to reduce the value of the state parameter adjacently, so that these alternative sub-transactions can be Only generating one piece of unified certification information can minimize the quantity of certification information.
在一实施例中,当采用密文数值或承诺数值时,对于集合交易中单独存在的、对应的事件均用于减小所述状态参数的取值的多个备选子交易,参与方可以单独为其生成证明信息,以证明状态参数在经过该多个备选子交易后的取值处于正确取值区间。In an embodiment, when a ciphertext value or a commitment value is used, for multiple alternative sub-transactions that individually exist in the set transaction and the corresponding events are used to reduce the value of the state parameter, the participant may Proof information is separately generated for it to prove that the value of the state parameter after the multiple alternative sub-transactions is in the correct value interval.
在一实施例中,各个参与方对应的状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值。对于同态加密算法而言,可以采用任意类型的同态加密算法,只要确保该同态加密算法能够满足加法同态,使得即便处于密文状态下,仍然能够使得状态参数的取值增加或减少该状态变化量;对于该同态加密算法为加法同态加密算法或全同态加密算法,本说明书并不对此进行限制。对于同态承诺算法而言,当采用相关技术中的Pedersen承诺机制时,可以为未加密数据确定一随机数,并基于该随机数与未加密数据进行计算得到相应的承诺数值。In an embodiment, the value of the state parameter corresponding to each participant and the state change amount are respectively a ciphertext value calculated based on a homomorphic encryption algorithm or a promise value calculated based on a homomorphic commitment algorithm. 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 in the state; 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 art, a random number can be determined for the unencrypted data, and the corresponding commitment value can be calculated based on the random number and the unencrypted data.
在一实施例中,当状态参数的取值、状态变化量为密文数值或承诺数值时,参与方需要提供相关的证明信息,以使得区块链节点在执行相关交易时,能够确定交易的合法有效性。例如,当事件用于使得某一参与方对应的状态参数按照该状态变化量发生取值减小时,即交易目的是使得该某一参与方的状态参数的取值减小该状态变化量,譬如上述的统一证明信息用于证明:该参与方的状态参数的取值足以实施上述集合交易中相邻的多个“减小”类型的备选子交易(即状态参数的取值不小于该相邻的多个“减小”类型的备选子交易所对应的状态变化量之和)。In an embodiment, when the value of the state parameter and the amount of state change are the ciphertext value or the promised value, the participant needs to provide relevant proof information so that the blockchain node can determine the transaction Legal validity. For example, when an event is used to make the value of a state parameter corresponding to a participant decrease according to the state change, that is, the purpose of the transaction is to make the value of the state parameter of the participant decrease the amount of state change, such as The above unified certification information is used to prove that the value of the participant's state parameter is sufficient to implement multiple adjacent "reduced" types of alternative sub-transactions in the above set transaction (that is, the value of the state parameter is not less than the phase The sum of the corresponding state changes of the neighboring multiple "reduced" types of candidate sub-exchanges).
例如,所述集合交易中可以包含分别对应于每一备选子交易的变化前状态值、变化后状态值,以配合于每一备选子交易中设定的状态变化量,使得每一备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;其中,所述变化前状态值和所述变化后状态值分别为基于所述同态加密算法计算得到的密文数值或基于所述同态承诺算法计算得到的承诺数值。那么,统一证明信息可以用于证明:在上述相邻的多个“减小”类型的备选子交易中,最后一个备选子交 易的变化后状态值不小于0。For example, the set transaction may include a pre-change state value and a post-change state value respectively corresponding to each candidate sub-transaction to match the state change amount set in each candidate sub-transaction, so that each backup After the 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 pre-change state value and the post-change state value The state value is a ciphertext value calculated based on the homomorphic encryption algorithm or a promise value calculated based on the homomorphic commitment algorithm, respectively. Then, the unified proof information can be used to prove that in the above-mentioned adjacent multiple “decrease” type alternative sub-transactions, the state value of the last alternative sub-transaction after the change is not less than 0.
在一实施例中,当采用密文数值或承诺数值时,对于集合交易中的每一备选子交易,不论其用于增大或减小状态参数的取值,均生成相应的独立证明信息,所述独立证明信息用于证明相应的备选子交易中设定的状态变化量处于所述正确数值区间。例如,独立证明信息可以用于表明相应的状态变化量处于正确数值区间,譬如[0,264)。In an embodiment, when a ciphertext value or a commitment value is used, for each candidate sub-transaction in the set transaction, regardless of whether it is used to increase or decrease the value of the state parameter, corresponding independent proof information is generated The independent proof information is used to prove that the state change amount set in the corresponding candidate sub-transaction is within the correct value interval. For example, the independent proof information can be used to indicate that the corresponding state change is in the correct numerical range, such as [0,264).
在一实施例中,可以采用相关技术中的区间证明(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.
步骤106,将所述集合交易提交至区块链,以使所述集合交易中包含的备选子交易被依次处理。Step 106: Submit the aggregate transaction to the blockchain, so that the candidate sub-transactions included in the aggregate transaction are processed in sequence.
在一实施例中,参与方可以按照生成顺序为各个合并交易添加编号,使各个合并交易在区块链中被按照对应编号的大小进行依次处理。换言之,区块链交易在收到参与方提交的合并交易后,需要读取合并交易所包含的编号;如果编号与先前处理的合并交易的编号连续,比如最新处理的合并交易的编号为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.
在一实施例中,在事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。单方触发信息表明相应的参与方对事件的描述信息予以确认,希望触发事件的执行;而事件的每一参与方都需要分别向区块链提交单方触发信息,使得区块链节点基于所有参与方分别提交的单方触发信息,确定是否应当执行相应的备选子交易所指示的事件。例如,事件的任一参与方生成描述信息并提供至其他参与方后,不仅该任一参与方需要向自身维护的等待队列中添加相应的备选子交易,每一其他参与方在对描述信息予以确认后,也分别向自身维护的等待队列中添加相应的备选子交易;以及,每一参与方分别基于自身维护的等待队列生成集合交易,从而通过将集合交易提交至区块链,使得上述的单方触发信息 被提交至区块链,以供区块链节点进行验证。单方触发信息中可以包含描述信息和相应参与方对描述信息生成的签名;签名属于相应参与方提供的确认信息,而如果采用密文数值或承诺数值,确认信息还包含证明信息,这在上文中已经详细描述。通过由各个参与方分别向区块链提交单方触发信息,而非某一参与方提交多方触发信息,不仅可以对处理压力进行分担、防止单个参与方的处理压力过大,还可使各个参与方根据自身的实际情况(如处理压力、优先级管理等)对所参与的各个事件进行选择性地处理甚至批量处理。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 or the promise value is used, the confirmation information also contains the certification information, which is described above It has been described in detail. 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.
与图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 collective transaction submitted by a participant to the blockchain, and the collective transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the alternative The sub-transaction is set with a corresponding state change amount for the participant's state parameter to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are It is the ciphertext value calculated based on the homomorphic encryption algorithm or the commitment value calculated based on the homomorphic commitment algorithm.
在一实施例中,本说明书的事件可以包括任意类型、覆盖任意场景,比如投票、签订协议、流量分配、转账、跨境汇款等,本说明书并不对此进行限制。以投票为例,描述信息可以包括投票事由和投票选项等信息,而各个参与方向区块链中提交的触发信息可以包括对投票选项的选择结果,从而触发完成投票操作。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, there may be 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 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 state changes, etc. This is restricted. 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.
在一实施例中,任一参与方在生成描述信息时,该描述信息中的状态变化量可以为密文数值或承诺数值。比如当状态变化量的明文数值为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 state change in the description information may be a ciphertext value or a commitment value. For example, when the plaintext value of the state 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 other participants of the event can verify the correspondence between the ciphertext commitment T1 and the plaintext value t1 and the 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, the participant may maintain a waiting queue, which contains candidate sub-transactions corresponding to each event in which the participant participates; and by selecting several candidate sub-transactions from the waiting queue, Generate the corresponding aggregate transaction. The aggregate transaction may contain multiple alternative sub-transactions, each of which corresponds to an event in which the above-mentioned parties participate, so that after the aggregate transaction is submitted to the blockchain, the multiple alternative sub-transactions included All 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 and the priority of the event; or, the waiting queue itself can be Sort by degree, priority, etc., so that it can still be regarded as one by one.
在一实施例中,事件的描述信息可以包括状态变化量,而所述事件可以用于使各个参与方在区块链上对应记录的状态参数按照所述状态变化量发生取值变化,比如增大取值、减小取值等。其中,根据事件的类型或场景差异,相应的状态参数也可能不同,比如转账或跨境汇款场景下的状态参数可以为参与方的账户余额,再比如流量分配场景下的状态参数可以为参与方持有的剩余流量的数额,本说明书并不对此进行限制。In an embodiment, the description information of the event may include a state change amount, and the event may be used to cause the state parameters correspondingly recorded on the blockchain by various parties to change in value according to the state change amount, such as increasing Large values, reduced values, 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.
步骤204,获取所述集合交易中的统一证明信息,所述统一证明信息对应于所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,以验证所述状态参数在经过所述多个备选子交易后的取值是否处于正确取值区间。Step 204: Obtain unified certification information in the collective transaction, and the unified certification information corresponds to multiple alternatives that are adjacent and corresponding events in the collective transaction are used to reduce the value of the state parameter Transaction to verify whether the value of the status parameter after the multiple candidate sub-transactions is in the correct value interval.
在一实施例中,通过生成上述的统一证明信息,使得上述的多个备选子交易可以仅生成一个统一证明信息,而无需分别、单独生成对应的证明信息,有助于简化证明信息、提升处理效率。In an embodiment, by generating the above-mentioned unified certification information, the multiple candidate sub-transactions described above can generate only one unified certification information without having to separately and individually generate corresponding certification information, which helps simplify the certification information and improve Processing efficiency.
在一实施例中,“针对所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,生成统一证明信息”并不一定是指仅由该多个备选子交易来生成统一证明信息,如果集合交易中还存在排列于该多个备选子交易之前的其他备选子交易,那么该其他备选子交易同样会对状态参数的取值造成影响,因而统一证明信息还跟该其他备选子交易相关。换言之,如果集合交易中存在排列于该多个备选子交易之前的其他备选子交易,那么状态参数在经历该多个备选子交易之前,还需经历该其他备选子交易所带来的取值变化,而统一证明信息用于证明状态参数在该其他备选子交易和该多个备选子交易的共同作用后的取值处于正确取值区间。In an embodiment, "for multiple candidate sub-transactions that are used to reduce the value of the state parameter for adjacent and corresponding events in the set transaction" does not necessarily mean that only The multiple alternative sub-transactions generate unified certification information. If there are other alternative sub-transactions arranged before the multiple alternative sub-transactions in the collective transaction, the other alternative sub-transactions will also affect the status parameters. The value has an impact, so the unified certification information is also related to the other alternative sub-transactions. In other words, if there are other alternative sub-transactions arranged before the multiple alternative sub-transactions in the collective transaction, then the state parameter needs to experience the other alternative sub-exchanges before undergoing the multiple alternative sub-transactions The value of is changed, and the unified proof information is used to prove that the value of the state parameter after the joint action of the other candidate sub-transaction and the multiple candidate sub-transactions is in the correct value interval.
例如,当集合交易包含的备选子交易依次为“减减减加加”(“减”代表用于减小状态参数的取值的备选子交易,“加”代表用于增大状态参数的取值的备选子交易)时,可以针对前三个连续的备选子交易生成统一证明信息,此时由于这三个备选子交易之前并不存在其他备选子交易,因而状态参数仅受这三个备选子交易的作用而产生取值变化,统一证明信息用于证明该变化后的取值处于正确数值区间。For example, when the alternative sub-transactions included in the set transaction are sequentially "decrease, decrement, and add" ("minus" represents the alternative sub-transaction used to decrease the value of the state parameter, "plus" represents the increase in the state parameter Value of alternative sub-transactions), you can generate unified proof information for the first three consecutive alternative sub-transactions. At this time, because there are no other alternative sub-transactions before these three alternative sub-transactions, the status parameter Only by the effect of these three alternative sub-transactions, the value change occurs, and the unified proof information is used to prove that the value after the change is in the correct numerical range.
再例如,当集合交易包含的备选子交易依次为“加加减加减减减加”时,可以针对第五、第六、第七共三个连续的备选子交易生成统一证明信息,此时由于这三个备选子交易之前存在第一、第二、第三、第四共四个其他备选子交易,因而状态参数不仅受到三个连续的“减”的备选子交易的作用,还受到四个其他备选子交易的作用,统一证明信息用于证明状态参数在这七个备选子交易的作用下而产生取值变化后,该变化后的取值处于正确数值区间。For another example, when the alternative sub-transactions included in the collective transaction are "addition, subtraction, addition, subtraction, subtraction, and addition", unified proof information can be generated for the three consecutive alternative sub-transactions of the fifth, sixth, and seventh, At this time, since there are four other alternative sub-transactions of the first, second, third, and fourth before these three alternative sub-transactions, the state parameter is not only affected by three consecutive "subtracted" alternative sub-transactions. The effect is also affected by four other alternative sub-transactions. The unified proof information is used to prove that the state parameter has a value change under the action of the seven alternative sub-transactions, and the changed value is in the correct numerical range. .
在一实施例中,上述“对应的事件均用于减小所述状态参数的取值的多个备选子交易”可以是恰好处于相邻位置,而并未实施特别的排序处理,这使得一些情况下,多个符合条件的备选子交易可能并未相邻设置、导致无法采用本说明书来生成统一证明信息,还可能使得多个符合条件的备选子交易无法完全连续排列、被进一步分割为多组,那么每组仍然可以分别生成统一证明信息,只是无法为多个符合条件的备选子交易生成一份统一证明信息。In an embodiment, the above “corresponding events are all used to reduce the value of the state parameter of multiple alternative sub-transactions” may be just adjacent to each other, and no special sorting process is implemented, which makes In some cases, multiple eligible alternative sub-transactions may not be set adjacent to each other, resulting in the inability to use this manual to generate unified certification information. It may also prevent multiple eligible alternative sub-transactions from being arranged completely continuously. Split into multiple groups, then each group can still generate unified certification information separately, but it is impossible to generate a unified certification information for multiple eligible sub-transactions.
在一实施例中,当若干备选子交易被选取以用于聚合为所述集合交易时,可以识别每一被选取的备选子交易对应的事件对所述状态参数的取值的调整方式;当至少两个备 选子交易对应的事件均用于减小所述状态参数的取值时,可以将所述至少两个备选子交易相邻地排列于所述集合交易中。换言之,在聚合形成集合交易时,可以主动对各个备选子交易进行排序,并尽量将用于减小状态参数取值的备选子交易都进行相邻排列,从而使得这些备选子交易可以仅生成一份统一证明信息,可以尽量减少证明信息的数量。In an embodiment, when several candidate sub-transactions are selected for aggregation into the set transaction, the manner in which the value of the state parameter is adjusted by the event corresponding to each selected candidate sub-transaction can be identified ; When the events corresponding to at least two alternative sub-transactions are used to reduce the value of the state parameter, the at least two alternative sub-transactions may be arranged adjacently in the set transaction. In other words, when aggregated to form a set of transactions, you can actively sort each alternative sub-transaction, and try to arrange the alternative sub-transactions used to reduce the value of the state parameter adjacently, so that these alternative sub-transactions can be Only generating one piece of unified certification information can minimize the quantity of certification information.
在一实施例中,当采用密文数值或承诺数值时,对于集合交易中单独存在的、对应的事件均用于减小所述状态参数的取值的多个备选子交易,参与方可以单独为其生成证明信息,以证明状态参数在经过该多个备选子交易后的取值处于正确取值区间。In an embodiment, when a ciphertext value or a commitment value is used, for multiple alternative sub-transactions that individually exist in the set transaction and the corresponding events are used to reduce the value of the state parameter, the participant may Proof information is separately generated for it to prove that the value of the state parameter after the multiple alternative sub-transactions is in the correct value interval.
在一实施例中,各个参与方对应的状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值。对于同态加密算法而言,可以采用任意类型的同态加密算法,只要确保该同态加密算法能够满足加法同态,使得即便处于密文状态下,仍然能够使得状态参数的取值增加或减少该状态变化量;对于该同态加密算法为加法同态加密算法或全同态加密算法,本说明书并不对此进行限制。对于同态承诺算法而言,当采用相关技术中的Pedersen承诺机制时,可以为未加密数据确定一随机数,并基于该随机数与未加密数据进行计算得到相应的承诺数值。In an embodiment, the value of the state parameter corresponding to each participant and the state change amount are respectively a ciphertext value calculated based on a homomorphic encryption algorithm or a promise value calculated based on a homomorphic commitment algorithm. 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 in the state; 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 art, a random number can be determined for the unencrypted data, and the corresponding commitment value can be calculated based on the random number and the unencrypted data.
在一实施例中,当状态参数的取值、状态变化量为密文数值或承诺数值时,参与方需要提供相关的证明信息,以使得区块链节点在执行相关交易时,能够确定交易的合法有效性。例如,当事件用于使得某一参与方对应的状态参数按照该状态变化量发生取值减小时,即交易目的是使得该某一参与方的状态参数的取值减小该状态变化量,譬如上述的统一证明信息用于证明:该参与方的状态参数的取值足以实施上述集合交易中相邻的多个“减小”类型的备选子交易(即状态参数的取值不小于该相邻的多个“减小”类型的备选子交易所对应的状态变化量之和)。In an embodiment, when the value of the state parameter and the amount of state change are the ciphertext value or the promised value, the participant needs to provide relevant proof information so that the blockchain node can determine the transaction Legal validity. For example, when an event is used to make the value of a state parameter corresponding to a participant decrease according to the state change, that is, the purpose of the transaction is to make the value of the state parameter of the participant decrease the amount of state change, such as The above unified certification information is used to prove that the value of the participant's state parameter is sufficient to implement multiple adjacent "reduced" types of alternative sub-transactions in the above set transaction (that is, the value of the state parameter is not less than the phase The sum of the corresponding state changes of the neighboring multiple "reduced" types of candidate sub-exchanges).
例如,所述集合交易中可以包含分别对应于每一备选子交易的变化前状态值、变化后状态值,以配合于每一备选子交易中设定的状态变化量,使得每一备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;其中,所述变化前状态值和所述变化后状态值分别为基于所述同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值。那么,统一证明信息可以用于证明:在上述相邻的多个“减小”类型的备选子交易中,最后一个备选子交易的变化后状态值不小于0。For example, the set transaction may include a pre-change state value and a post-change state value respectively corresponding to each candidate sub-transaction to match the state change amount set in each candidate sub-transaction, so that each backup After the 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 pre-change state value and the post-change state value The state value is a ciphertext value calculated based on the homomorphic encryption algorithm or a promise value calculated based on the homomorphic commitment algorithm, respectively. Then, the unified proof information can be used to prove that in the above-mentioned adjacent multiple “decrease” type alternative sub-transactions, the state value of the last alternative sub-transaction after the change is not less than 0.
在一实施例中,当采用密文数值或承诺数值时,对于集合交易中的每一备选子交易,不论其用于增大或减小状态参数的取值,均生成相应的独立证明信息,所述独立证明信 息用于证明相应的备选子交易中设定的状态变化量处于所述正确数值区间。例如,独立证明信息可以用于表明相应的状态变化量处于正确数值区间,譬如[0,264)。In an embodiment, when a ciphertext value or a commitment value is used, for each candidate sub-transaction in the set transaction, regardless of whether it is used to increase or decrease the value of the state parameter, corresponding independent proof information is generated The independent proof information is used to prove that the state change amount set in the corresponding candidate sub-transaction is within the correct value interval. For example, the independent proof information can be used to indicate that the corresponding state change is in the correct numerical range, such as [0,264).
在一实施例中,区块链节点可以获取所述集合交易中对应于每一备选子交易的独立证明信息,以验证相应的备选子交易中设定的状态变化量是否处于所述正确数值区间;其中,当区块链节点针对统一证明信息的验证结果为通过验证,且所述多个备选子交易中的任一备选子交易对应的独立证明信息通过验证时,区块链节点可以触发执行所述任一备选子交易。In an embodiment, the blockchain node may obtain independent proof information corresponding to each candidate sub-transaction in the set transaction to verify whether the state change amount set in the corresponding candidate sub-transaction is in the correct state Numerical interval; wherein, when the verification result of the unified proof information by the blockchain node is verified, and the independent proof information corresponding to any of the multiple alternative sub-transactions passes the verification, the blockchain The node may trigger execution of any of the alternative sub-transactions.
在一实施例中,区块链节点可以在所述集合交易中的任一备选子交易对应的事件用于增大所述状态参数的取值时,获取所述集合交易中对应于所述任一备选子交易的独立证明信息;其中,当对应于所述任一备选子交易的独立证明信息通过验证时,区块链节点可以触发执行所述任一备选子交易。In an embodiment, the blockchain node may acquire the event corresponding to any of the alternative sub-transactions in the collective transaction when the value of the state parameter is used to increase the value of the state parameter. Independent certification information of any alternative sub-transaction; wherein, when the independent certification information corresponding to the alternative sub-transaction passes verification, the blockchain node may trigger execution of the alternative sub-transaction.
在一实施例中,可以采用相关技术中的区间证明(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.
步骤206,根据验证结果确定对所述多个备选子交易的处理方式。Step 206: Determine a processing method for the multiple candidate sub-transactions according to the verification result.
在一实施例中,参与方可以按照生成顺序为各个合并交易添加编号,使各个合并交易在区块链中被按照对应编号的大小进行依次处理。换言之,区块链交易在收到参与方提交的合并交易后,需要读取合并交易所包含的编号;如果编号与先前处理的合并交易的编号连续,比如最新处理的合并交易的编号为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.
在一实施例中,在事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。单方触发信息表明相应的参与方对事件的描述信息予以确认,希望触发事件的执行;而事件的每 一参与方都需要分别向区块链提交单方触发信息,使得区块链节点基于所有参与方分别提交的单方触发信息,确定是否应当执行相应的备选子交易所指示的事件。例如,事件的任一参与方生成描述信息并提供至其他参与方后,不仅该任一参与方需要向自身维护的等待队列中添加相应的备选子交易,每一其他参与方在对描述信息予以确认后,也分别向自身维护的等待队列中添加相应的备选子交易;以及,每一参与方分别基于自身维护的等待队列生成集合交易,从而通过将集合交易提交至区块链,使得上述的单方触发信息被提交至区块链,以供区块链节点进行验证。单方触发信息中可以包含描述信息和相应参与方对描述信息生成的签名;签名属于相应参与方提供的确认信息,而如果采用密文数值或承诺数值,确认信息还包含证明信息,这在上文中已经详细描述。通过由各个参与方分别向区块链提交单方触发信息,而非某一参与方提交多方触发信息,不仅可以对处理压力进行分担、防止单个参与方的处理压力过大,还可使各个参与方根据自身的实际情况(如处理压力、优先级管理等)对所参与的各个事件进行选择性地处理甚至批量处理。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 or the promise value is used, the confirmation information also contains the certification information, which is described above It has been described in detail. 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.
为了便于理解,下面以跨境汇款场景为例,对本说明书一个或多个实施例的技术方案进行说明。基于本说明书的技术方案,每一机构可以分别对自身所参与的若干汇款交易(相当于上述的备选子交易)合并为一笔区块链交易(相当于上述的集合交易),并通过向区块链提交该区块链交易,实现对若干汇款交易的批量提交和处理。下面将首先对单笔汇款交易的生成与处理过程进行描述,然后扩展至多笔汇款交易的批量处理。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 HKD 2,500 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 the transfer of funds on the chain is realized between institutions 1 to 4 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), 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 is not listed here one by one.
RP_t1、RP_t2、RP_t3分别为对应于交易金额t1、t2、t3的区间证明,以分别用于证明交易金额t1、t2、t3处于正确数值区间,比如0≤t1<264、0≤t2<264、0≤t3<264。其中,设备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, such as 0≤t1<264, 0≤t2<264, 0≤t3<264. 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.
步骤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, and 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) = whether r_t3G + t3H is established (where G and H are preset system parameters); device 2 verifies currency_1 and currency_2 Whether the exchange rate between rates is 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.
步骤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选取6个汇款交易并聚合为一笔区块链交易,比如汇款交易tx_i-3、tx_i-2、tx_i-1、tx_i、tx_i+1、tx_i+2被聚合为区块链交易TX_a,该设备1需要为各个汇款交易生成相应的证明信息。For example, FIG. 5 is a schematic diagram of content of a blockchain transaction provided by an exemplary embodiment. As shown in Figure 5, assume that device 1 selects 6 remittance transactions and aggregates them into a blockchain transaction, such as remittance transactions tx_i-3, tx_i-2, tx_i-1, tx_i, tx_i+1, tx_i+2 are aggregated For the blockchain transaction TX_a, the device 1 needs to generate corresponding proof information for each remittance transaction.
首先,对于区块链交易TX_a中的每一汇款交易,该区块链交易TX_a中需要包含针对每一汇款交易的交易额的证明信息,比如汇款交易tx_i-3对应的证明信息为RP_i-3、汇款交易tx_i-2对应的证明信息为RP_i-2、汇款交易tx_i-1对应的证明信息为RP_i-1、汇款交易tx_i对应的证明信息为RP_i、汇款交易tx_i+1对应的证明信息为RP_i+1、汇款交易tx_i+2对应的证明信息为RP_i+2。First, for each remittance transaction in the blockchain transaction TX_a, the blockchain transaction TX_a needs to contain proof information for the transaction amount of each remittance transaction, for example, the proof information corresponding to the remittance transaction tx_i-3 is RP_i-3 The proof information corresponding to the remittance transaction tx_i-2 is RP_i-2, the proof information corresponding to the remittance transaction tx_i-1 is RP_i-1, the proof information corresponding to the remittance transaction tx_i is RP_i, and the proof information corresponding to the remittance transaction tx_i+1 is RP_i +1, the proof information corresponding to the remittance transaction tx_i+2 is RP_i+2.
以汇款交易tx_i对应的证明信息RP_i为例,相当于上文所述的区间证明RP_t1、RP_t2、RP_t3,分别用于证明汇款交易tx_i的交易额t1、t2、t3处于正确数值区间。类似地,对于其他非设备1所起草的汇款交易而言,可以由汇款交易的起草方生成对交易额的证明信息、无需设备1生成;当然,即便并非设备1所起草的汇款交易,仍然可由该设备1为相应的交易额生成证明信息,本说明书并不对此进行限制。Taking the proof information RP_i corresponding to the remittance transaction tx_i as an example, it is equivalent to the above-mentioned interval proofs RP_t1, RP_t2, and RP_t3, which are respectively used to prove that the transaction amount t1, t2, and t3 of the remittance transaction tx_i are in the correct value interval. Similarly, for other remittance transactions drafted by other than device 1, the drafting party of the remittance transaction can generate the certification information of the transaction amount without the need for device 1; of course, even if the remittance transaction is not drafted by device 1, it can still be The device 1 generates certification information for the corresponding transaction amount, which is not limited in this specification.
然后,对于机构1作为汇款方或中继方的汇款交易,即导致机构1的区块链账户Y1的余额减少的汇款交易,设备1还需要生成区块链账户Y1的余额充足、不小于交易额的证明信息。此时,设备1需要从上述的6个汇款交易中,挑选出所有会导致区块链账户Y1的余额减少的汇款交易,并使得挑选出的这些汇款交易在区块链交易TX_a中相邻排列;例如,当汇款交易tx_i-3、tx_i-2和tx_i-1会导致区块链账户Y1的余额增加,而汇款交易tx_i、tx_i+1、tx_i+2会导致区块链账户Y1的余额减少时,设备1可以将汇款交易tx_i-3、tx_i-2和tx_i-1相邻排列,并针对这3个汇款交易生成统一证明信息RP_(i~i+2),以证明区块链账户Y1的余额(指经过汇款交易tx_i、tx_i+1、tx_i+2带来的取值变化后的余额)足以完成汇款交易tx_i、tx_i+1和tx_i+2,而无需为汇款交易tx_i、tx_i+1和tx_i+2分别生成单独的区间证明。Then, for the remittance transaction of institution 1 as a remittance or relay party, that is, the remittance transaction that causes the balance of the blockchain account Y1 of the institution 1 to decrease, the device 1 also needs to generate a sufficient balance of the blockchain account Y1, not less than the transaction The amount of proof information. At this time, the device 1 needs to select all the remittance transactions that will reduce the balance of the blockchain account Y1 from the above six remittance transactions, and make the selected remittance transactions be arranged next to each other in the blockchain transaction TX_a ; For example, when the remittance transaction tx_i-3, tx_i-2 and tx_i-1 will cause the balance of the blockchain account Y1 to increase, while the remittance transaction tx_i, tx_i+1, tx_i+2 will cause the balance of the blockchain account Y1 to decrease At this time, device 1 can arrange remittance transactions tx_i-3, tx_i-2 and tx_i-1 adjacently, and generate unified proof information RP_(i~i+2) for these three remittance transactions to prove the blockchain account Y1 The balance (referring to the balance after the value change caused by the remittance transaction tx_i, tx_i+1, tx_i+2) is sufficient to complete the remittance transaction tx_i, tx_i+1 and tx_i+2, without the need for the remittance transaction tx_i, tx_i+1 And tx_i+2 generate separate interval proofs.
在一实施例中,考虑到设备1提交的汇款交易并不一定全部顺利执行,而在先提交的汇款交易可能影响区块链账户Y1的余额,从而影响在后的汇款交易,因此,在生成统一证明信息RP_(i~i+2)时,应当考虑在先提交的区块链交易的影响。例如,当机构1在该区块链交易中包含的若干汇款交易中作为汇款方或中继方时,机构1会将自身对应的区块链账户Y1的账户余额减去对应的转账金额(汇款方仅转出资金;中继方既 可接收转入资金又需要转出资金,这里是针对转出资金的操作而描述),并基于更新后的汇款金额继续参与后续的汇款交易。当该区块链交易被提交至区块链后,如果机构1作为汇款方或中继方的某一汇款交易成功执行,机构1无需调整区块链账户Y1;如果机构1作为汇款方或中继方的某一汇款交易未成功执行,机构1需要对区块链账户Y1的账户余额进行回滚调节。而当上述的区块链交易中包含机构1作为收款方或中继方(收款方仅转入资金;中继方既可接收转入资金又需要转出资金,这里是针对转入资金的操作而描述)的汇款交易时,如果该汇款交易成功执行,机构1需要向区块链账户Y1中增加相应资金、实现收款,如果汇款交易未成功执行,机构1无需调整区块链账户Y1。相应地,区块链节点在收到并处理设备1提交的区块链交易时,可以针对区块链交易所包含的汇款交易是否能够成功执行,对各个汇款交易进行状态标记,比如交易为成功状态、失败状态、超时状态等。In an embodiment, considering that the remittance transactions submitted by the device 1 may not all be successfully executed, and the remittance transaction submitted earlier may affect the balance of the blockchain account Y1, thereby affecting the subsequent remittance transaction, therefore, in the generation When unifying the proof information RP_(i~i+2), the influence of the previously submitted blockchain transaction should be considered. For example, when institution 1 acts as a remittance or relay party in several remittance transactions included in the blockchain transaction, institution 1 will subtract the corresponding transfer amount (remittance) from the account balance of its corresponding blockchain account Y1 The party only transfers out the funds; the relaying party can receive the transferred funds and need to transfer out the funds, which is described 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.
因此,设备1在聚合生成区块链交易TX_a时,并不直接通过区块链账户Y1的余额取值生成统一证明信息RP_(i~i+2),而是需要先确定出设备1先前提交的区块链交易中可能造成金额变化的汇款交易,包括:机构1作为中继方或收款方的汇款交易被标记为成功状态时产生的金额增加(收款)、机构1作为汇款方或中继方的汇款交易被标记为失败状态或超时状态时产生的金额增加(对已扣除的转账金额进行回滚)等。以及,设备1进一步根据区块链账户Y1的余额取值(已扣除先前提交的汇款交易的转账金额、尚未收款)与上述可能造成金额变化的汇款交易实际产生的金额变化值,对区块链账户Y1的余额取值进行更新,然后根据更新后的余额取值生成统一证明信息RP_(i~i+2)。Therefore, when the device 1 aggregates and generates the blockchain transaction TX_a, it does not directly generate the unified certification information RP_(i~i+2) through the value of the balance of the blockchain account Y1, but needs to determine the previous submission of the device 1 The remittance transactions that may cause changes in the amount of blockchain transactions include: the increase in the amount of money (receipt) generated when the remittance transaction of institution 1 as a relay or payee is marked as successful, and the institution 1 as a sender or The amount of money generated when the remittance transaction of the relay party is marked as a failed state or a time-out state is increased (the deducted transfer amount is rolled back), etc. And, the device 1 further takes 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 value change value of the above remittance transaction that may cause the amount change to the block The balance value of the chain account Y1 is updated, and then unified certification information RP_(i~i+2) is generated according to the updated balance value.
此外,设备1在生成各个区块链交易时,还按照区块链交易的生成顺序,为每一区块链交易添加相应的顺序编号seq。比如当设备1分别生成了区块链交易TX_1、TX_2和TX_3时,区块链交易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。In addition, when generating each blockchain transaction, the device 1 also adds a corresponding sequence number seq for each blockchain transaction according to the generation sequence of the blockchain transaction. For example, when device 1 generates blockchain transactions TX_1, TX_2, and TX_3, the seq value of blockchain transaction TX_1 is 99, the seq value of blockchain transaction TX_2 is 100, and the seq value of blockchain transaction TX_3 is A value of 101 indicates that the blockchain transaction TX_1 was generated earlier than the blockchain transaction TX_2, and the blockchain transaction TX_2 was generated earlier than the 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.
步骤404b-d,设备2~4根据本地队列2~4中的汇款交易,分别聚合生成交易TX_b、TX_c、TX_d,并在签名后分别提交至区块链。In steps 404b-d, devices 2 to 4 aggregate the transactions TX_b, TX_c, and TX_d according to the remittance transactions in the local queues 2 to 4, and submit them to the blockchain after signing.
在一实施例中,与设备1相类似的,设备2可以从本地队列2中选取一个或多 个汇款交易,以聚合生成相应的区块链交易。假定设备2在某一次选取的汇款交易中包含上述的汇款交易tx_i,并据此生成了相应的区块链交易TX_b;其中,导致机构2的区块链账户Y2的余额减少的汇款交易在TX_b中相邻排列,以生成相应的统一证明信息。In an embodiment, similar to the device 1, the device 2 can select one or more remittance transactions from the local queue 2 to aggregate and generate corresponding blockchain transactions. Assume that device 2 includes the above-mentioned remittance transaction tx_i in a selected remittance transaction, and accordingly generates a corresponding blockchain transaction TX_b; where the remittance transaction that causes the balance of the institution 2’s blockchain account Y2 to decrease is in TX_b Arranged adjacent to each other to generate corresponding unified certification information.
在一实施例中,与设备1相类似的,设备3可以从本地队列3中选取一个或多个汇款交易,以聚合生成相应的区块链交易。假定设备3在某一次选取的汇款交易中包含上述的汇款交易tx_i,并据此生成了相应的区块链交易TX_c;其中,导致机构3的区块链账户Y3的余额减少的汇款交易在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. Assume that device 3 includes the above-mentioned remittance transaction tx_i in a selected remittance transaction, and accordingly generates the corresponding blockchain transaction TX_c; where the remittance transaction that causes the balance of the institution’s 3 blockchain account Y3 to decrease is in TX_c Arranged adjacent to each other to generate corresponding unified certification information.
在一实施例中,与设备1相类似的,设备4可以从本地队列4中选取一个或多个汇款交易,以聚合生成相应的区块链交易。假定设备4在某一次选取的汇款交易中包含上述的汇款交易tx_i,并据此生成了相应的区块链交易TX_d;其中,导致机构4的区块链账户Y4的余额减少的汇款交易在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. Assume that device 4 includes the above-mentioned remittance transaction tx_i in a certain selected remittance transaction, and accordingly generates the corresponding blockchain transaction TX_d; where the remittance transaction that causes the balance of the blockchain account Y4 of institution 4 to decrease is in TX_d Arranged adjacent to each other to generate corresponding unified certification information.
需要指出的是:设备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分别提交的区块链交易后,可以分别提取每一区块链交易中包含的汇款交易并实施验证。以设备1提交的区块链交易TX_a为例,区块链节点可以分别验证如图5所示的证明信息RP_i-3、RP_i-2、RP_i-1、RP_i、RP_i+1、RP_i+2,以分别确定各个汇款交易的汇款额是否处于正确数值区间;以及,区块链节点通过验证统一证明信息RP_(i~i+2),以确定区块链账户Y1的账户余额是否足额,以确定是否能够顺利执行区块链交易TX_a中的各个汇款交易。当然,区块链节点还可能实施其他的验证操作,可以参考相关技术中对于汇款交易的验证过程,比如验证汇出额与汇入额是否一致、与业务数额是否一致等,此处不再一一赘述,且本说明书并不对此进行限制。In an embodiment, after receiving the blockchain transactions submitted by the devices 1 to 4, the blockchain nodes can separately extract and verify the remittance transactions included in each blockchain transaction. Taking the blockchain transaction TX_a submitted by device 1 as an example, blockchain nodes can verify the certification information RP_i-3, RP_i-2, RP_i-1, RP_i, RP_i+1, RP_i+2, as shown in FIG. 5, In order to determine whether the remittance amount of each remittance transaction is in the correct value range; and, the blockchain node verifies the unified certification information RP_(i~i+2) to determine whether the account balance of the blockchain account Y1 is sufficient, to Determine whether each remittance transaction in the blockchain transaction TX_a can be successfully executed. Of course, the blockchain node may also implement other verification operations. You can refer to the verification process for remittance transactions in related technologies, such as verifying whether the remittance amount is consistent with the remittance amount, and whether it is consistent with the business amount. I will repeat it, and this specification does not limit it.
在一实施例中,如果汇款交易的执行由汇款方、中继方、收款方等参与方同时参与触发,因而区块链节点还需要验证汇款交易的各个参与方是否都实施了触发(即提交了包含该汇款交易的区块链交易)。例如,图6是一示例性实施例提供的一种统计触发情况的示意图。如图6所示,基于区块链的原生功能或智能合约所提供的扩展功能,区块链节点可以分别记录机构1~机构4所提交的区块链交易,比如机构1提交的区块链交易TX_a、TX_*,机构2提交的区块链交易TX_*、TX_b、TX_#,机构3提交的区块链交易TX_*、TX_c,机构4提交的区块链交易TX_d等;以及,区块链节点可以提取出各个区块链交易中包含的汇款交易,并分别针对各个汇款交易的参与方(汇款交易详情中包含汇款方、中继方、收款方的信息)进行统计:当收到相应参与方提交的区块链交易中包含该汇款交易,且该汇款交易通过了上述验证时,可以将该参与方标记为“OK”。In one embodiment, if the execution of the remittance transaction is triggered by participants such as the remittance party, relay party, and recipient, the blockchain node also needs to verify whether each participant of the remittance transaction has implemented the trigger (ie Submit the blockchain transaction containing the remittance transaction). For example, FIG. 6 is a schematic diagram of a statistical trigger situation provided by an exemplary embodiment. As shown in Figure 6, based on the native functions of the blockchain or the extended functions provided by smart contracts, blockchain nodes can record the blockchain transactions submitted by institutions 1 to 4 respectively, 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 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.
图7是一示例性实施例提供的一种设备的示意结构图。请参考图7,在硬件层面,该设备包括处理器702、内部总线704、网络接口706、内存708以及非易失性存储器710,当然还可能包括其他业务所需要的硬件。处理器702从非易失性存储器710中读取对应的计算机程序到内存708中然后运行,在逻辑层面上形成基于区块链的事件处理终端交互装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。7 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 7. At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710. Of course, it may include hardware required for other services. The processor 702 reads the corresponding computer program from the non-volatile memory 710 into the memory 708 and then runs it to form a blockchain-based event processing terminal interaction 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.
请参考图8,在软件实施方式中,该基于区块链的事件处理装置应用于参与方,可以包括:Please refer to FIG. 8. In the software implementation, the blockchain-based event processing device is applied to participants, and may include:
第一生成单元801,根据所述参与方所参与的事件,生成对应的备选子交易,以使得若干备选子交易被聚合为集合交易;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值;The first generating unit 801 generates corresponding alternative sub-transactions according to the events in which the participant participates, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transactions are set with corresponding State change amount for the state parameter of the participant to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are calculated based on a homomorphic encryption algorithm, respectively The ciphertext value obtained or the promise value calculated based on the homomorphic promise algorithm;
第二生成单元802,针对所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,生成统一证明信息,以证明所述状态参数在经过所述多个备选子交易后的取值处于正确取值区间;The second generating unit 802 generates unified proof information for multiple candidate sub-transactions that are used to reduce the value of the state parameter in the adjacent and corresponding events in the aggregate transaction to prove that the state parameter is in The value after the multiple alternative sub-transactions is in the correct value interval;
提交单元803,将所述集合交易提交至区块链,以使所述集合交易中包含的备选子交易被依次处理。The submitting unit 803 submits the set transaction to the blockchain, so that the candidate sub-transactions included in the set transaction are processed in sequence.
可选的,还包括:Optional, also includes:
识别单元804,当若干备选子交易被选取以用于聚合为所述集合交易时,识别每一被选取的备选子交易对应的事件对所述状态参数的取值的调整方式;The identifying unit 804, when several candidate sub-transactions are selected for aggregation into the set transaction, identify the manner in which the event corresponding to each selected candidate sub-transaction adjusts the value of the state parameter;
排列单元805,当至少两个备选子交易对应的事件均用于减小所述状态参数的取值时,将所述至少两个备选子交易相邻地排列于所述集合交易中。The arranging unit 805 arranges the at least two candidate sub-transactions adjacent to the set transaction when the events corresponding to the at least two candidate sub-transactions are used to reduce the value of the state parameter.
可选的,所述集合交易中包含分别对应于每一备选子交易的变化前状态值、变化后状态值,以配合于每一备选子交易中设定的状态变化量,使得每一备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变 化后状态值;其中,所述变化前状态值和所述变化后状态值分别为基于所述同态加密算法计算得到的密文数值或基于所述同态承诺算法计算得到的承诺数值。Optionally, the set transaction includes a pre-change state value and a post-change state value respectively corresponding to each candidate sub-transaction to match the state change amount set in each candidate sub-transaction, so that each After the candidate 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 pre-change state value and the change The post-state value is a ciphertext value calculated based on the homomorphic encryption algorithm or a promise value calculated based on the homomorphic commitment algorithm, respectively.
可选的,还包括:Optional, also includes:
第三生成单元806,分别为所述集合交易中的每一备选子交易生成相应的独立证明信息,所述独立证明信息用于证明相应的备选子交易中设定的状态变化量处于所述正确数值区间。The third generating unit 806 separately generates corresponding independent certification information for each candidate sub-transaction in the set transaction, and the independent certification information is used to prove that the state change amount set in the corresponding candidate sub-transaction is in State the correct numerical interval.
可选的,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。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.
可选的,还包括:Optional, also includes:
添加单元807,按照生成顺序为各个集合交易添加相应的编号,以使各个集合交易在区块链中被按照对应的编号大小进行依次处理。The adding unit 807 adds corresponding numbers to each set transaction in the order of generation, so that each set transaction is sequentially processed in the blockchain according to the corresponding number size.
图9是一示例性实施例提供的一种设备的示意结构图。请参考图9,在硬件层面,该设备包括处理器902、内部总线904、网络接口906、内存908以及非易失性存储器910,当然还可能包括其他业务所需要的硬件。处理器902从非易失性存储器910中读取对应的计算机程序到内存908中然后运行,在逻辑层面上形成基于区块链的事件处理终端交互装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。9 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 9. At the hardware level, the device includes a processor 902, an internal bus 904, a network interface 906, a memory 908, and a non-volatile memory 910. Of course, it may include hardware required for other services. The processor 902 reads the corresponding computer program from the non-volatile memory 910 into the memory 908 and then runs it to form a blockchain-based event processing terminal interaction 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.
请参考图10,在软件实施方式中,该基于区块链的事件处理装置应用于区块链节点,可以包括:Please refer to FIG. 10. In the software implementation, the blockchain-based event processing device is applied to a blockchain node, and may include:
接收单元1001,接收参与方提交至区块链的集合交易,所述集合交易中包含若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值;The receiving unit 1001 receives a collective transaction submitted by a participant to the blockchain, and the collective transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the backup The sub-transaction is set with a corresponding state change amount for the participant's state parameter to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount Respectively, the ciphertext value calculated based on the homomorphic encryption algorithm or the commitment value calculated based on the homomorphic commitment algorithm;
第一获取单元1002,获取所述集合交易中的统一证明信息,所述统一证明信息对应于所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,以验证所述状态参数在经过所述多个备选子交易后的取值是否处于正确取值区 间;The first obtaining unit 1002 obtains unified certification information in the collective transaction, and the unified certification information corresponds to multiple adjacent and corresponding events in the collective transaction that are used to reduce the value of the state parameter. Alternative sub-transactions to verify whether the value of the state parameter after passing through the multiple alternative sub-transactions is in the correct value interval;
确定单元1003,根据验证结果确定对所述多个备选子交易的处理方式。The determining unit 1003 determines the processing method of the multiple candidate sub-transactions according to the verification result.
可选的,Optional,
还包括:第二获取单元1004,获取所述集合交易中对应于每一备选子交易的独立证明信息,以验证相应的备选子交易中设定的状态变化量是否处于所述正确数值区间;It also includes: a second obtaining unit 1004, which obtains independent certification information corresponding to each candidate sub-transaction in the collective transaction to verify whether the state change amount set in the corresponding candidate sub-transaction is within the correct numerical range ;
所述确定单元1003具体用于:当所述验证结果为通过验证,且所述多个备选子交易中的任一备选子交易对应的独立证明信息通过验证时,触发执行所述任一备选子交易。The determining unit 1003 is specifically configured to: when the verification result is verified, and the independent certification information corresponding to any one of the plurality of candidate sub-transactions passes verification, trigger execution of any Alternative sub-transactions.
可选的,还包括:Optional, also includes:
第三获取单元1005,当所述集合交易中的任一备选子交易对应的事件用于增大所述状态参数的取值时,获取所述集合交易中对应于所述任一备选子交易的独立证明信息;The third acquiring unit 1005, when the event corresponding to any candidate sub-transaction in the collective transaction is used to increase the value of the state parameter, acquires the candidate sub-transaction corresponding to the optional sub-transaction in the collective transaction Independent certification information of the transaction;
第一触发单元1006,当对应于所述任一备选子交易的独立证明信息通过验证时,触发执行所述任一备选子交易。The first triggering unit 1006 triggers execution of any alternative sub-transaction when the independent certification information corresponding to the alternative sub-transaction passes verification.
可选的,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;所述装置还包括:Optionally, the candidate sub-transaction corresponding to the event includes unilateral trigger information of the participant on the event; the device further includes:
第二触发单元1007,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,触发执行所述事件对应的备选子交易。The second triggering unit 1007 triggers the execution of the alternative sub-transaction corresponding to the event when all the parties involved in the event submit the single-party trigger information for the event to the blockchain and the verification is passed.
可选的,还包括:Optional, also includes:
识别单元1008,识别所述集合交易对应的编号,所述编号被按照各个集合交易的生成顺序而添加,以按照对应的编号大小对所述参与方提交的各个集合交易进行依次处理。The identifying unit 1008 identifies the serial number corresponding to the collective transaction, and the serial number is added in the order in which each collective transaction is generated to sequentially process each collective transaction submitted by the participant according to the corresponding serial number size.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。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.
在一个典型的配置中,计算机包括一个或多个处理器(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 (24)

  1. 一种基于区块链的事件处理方法,应用于参与方,所述方法包括:A blockchain-based event processing method applied to participants. The method includes:
    根据所述参与方所参与的事件,生成对应的备选子交易,以使得若干备选子交易被聚合为集合交易;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值;According to the events in which the participant participates, a corresponding alternative sub-transaction is generated, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transaction is set with a corresponding state change amount to use In order to make the state parameters of the participants change correspondingly based on the state change, and the value of the state parameter and the state change are the ciphertext value calculated based on the homomorphic encryption algorithm or Commitment value calculated based on homomorphic commitment algorithm;
    针对所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,生成统一证明信息,以证明所述状态参数在经过所述多个备选子交易后的取值处于正确取值区间;For multiple candidate sub-transactions in which the adjacent and corresponding events in the set transaction are used to reduce the value of the state parameter, unified certification information is generated to prove that the state parameter passes through the multiple backup The value after selecting the child transaction is in the correct value range;
    将所述集合交易提交至区块链,以使所述集合交易中包含的备选子交易被依次处理。Submit the aggregate transaction to the blockchain so that the alternative sub-transactions included in the aggregate transaction are processed in sequence.
  2. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    当若干备选子交易被选取以用于聚合为所述集合交易时,识别每一被选取的备选子交易对应的事件对所述状态参数的取值的调整方式;When several candidate sub-transactions are selected for aggregation into the set transaction, identify the manner in which the event corresponding to each selected candidate sub-transaction adjusts the value of the state parameter;
    当至少两个备选子交易对应的事件均用于减小所述状态参数的取值时,将所述至少两个备选子交易相邻地排列于所述集合交易中。When the events corresponding to at least two candidate sub-transactions are used to reduce the value of the state parameter, the at least two candidate sub-transactions are arranged adjacently in the set transaction.
  3. 根据权利要求1所述的方法,所述集合交易中包含分别对应于每一备选子交易的变化前状态值、变化后状态值,以配合于每一备选子交易中设定的状态变化量,使得每一备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;其中,所述变化前状态值和所述变化后状态值分别为基于所述同态加密算法计算得到的密文数值或基于所述同态承诺算法计算得到的承诺数值。The method of claim 1, the set transaction includes a pre-change state value and a post-change state value corresponding to each candidate sub-transaction, respectively, to match the state change set in each candidate sub-transaction After each candidate 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 pre-change state The value and the changed state value are respectively a ciphertext value calculated based on the homomorphic encryption algorithm or a promise value calculated based on the homomorphic commitment algorithm.
  4. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    分别为所述集合交易中的每一备选子交易生成相应的独立证明信息,所述独立证明信息用于证明相应的备选子交易中设定的状态变化量处于所述正确数值区间。The corresponding independent proof information is separately generated for each candidate sub-transaction in the set transaction, and the independent certification information is used to prove that the state change amount set in the corresponding candidate sub-transaction is within the correct numerical interval.
  5. 根据权利要求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.
  6. 根据权利要求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.
  7. 一种基于区块链的事件处理方法,应用于区块链节点,所述方法包括:A blockchain-based event processing method applied to blockchain nodes. The method includes:
    接收参与方提交至区块链的集合交易,所述集合交易中包含若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值;Receiving a set transaction submitted by a participant to the blockchain, the set transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the alternative sub-transaction is set A corresponding state change amount is set for the state parameter of the participant to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are based on the same The ciphertext value calculated by the homomorphic encryption algorithm or the promise value calculated based on the homomorphic commitment algorithm;
    获取所述集合交易中的统一证明信息,所述统一证明信息对应于所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,以验证所述状态参数在经过所述多个备选子交易后的取值是否处于正确取值区间;Acquiring unified certification information in the collective transaction, the unified certification information corresponding to multiple candidate sub-transactions that are adjacent and corresponding events in the collective transaction are used to reduce the value of the state parameter, Verify whether the value of the state parameter after passing through the plurality of candidate sub-transactions is in the correct value interval;
    根据验证结果确定对所述多个备选子交易的处理方式。According to the verification result, a processing method for the multiple candidate sub-transactions is determined.
  8. 根据权利要求7所述的方法,The method according to claim 7,
    还包括:获取所述集合交易中对应于每一备选子交易的独立证明信息,以验证相应的备选子交易中设定的状态变化量是否处于所述正确数值区间;It also includes: obtaining independent certification information corresponding to each candidate sub-transaction in the set transaction to verify whether the state change amount set in the corresponding candidate sub-transaction is within the correct numerical range;
    所述根据验证结果确定对所述多个备选子交易的处理方式,包括:当所述验证结果为通过验证,且所述多个备选子交易中的任一备选子交易对应的独立证明信息通过验证时,触发执行所述任一备选子交易。The determining the processing method for the multiple candidate sub-transactions according to the verification result includes: when the verification result is verified, and any of the multiple candidate sub-transactions corresponds to an independent When the certification information passes the verification, the execution of any of the candidate sub-transactions is triggered.
  9. 根据权利要求7所述的方法,还包括:The method of claim 7, further comprising:
    当所述集合交易中的任一备选子交易对应的事件用于增大所述状态参数的取值时,获取所述集合交易中对应于所述任一备选子交易的独立证明信息;When the event corresponding to any candidate sub-transaction in the set transaction is used to increase the value of the state parameter, obtain independent certification information corresponding to the any candidate sub-transaction in the set transaction;
    当对应于所述任一备选子交易的独立证明信息通过验证时,触发执行所述任一备选子交易。When the independent certification information corresponding to the any alternative sub-transaction passes the verification, the execution of the any alternative sub-transaction is triggered.
  10. 根据权利要求7所述的方法,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;所述方法还包括:The method according to claim 7, wherein the candidate sub-transaction corresponding to the event contains unilateral trigger information of the participant on the event; the method further comprises:
    当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,触发执行所述事件对应的备选子交易。When all the parties involved in the event submit the single-party trigger information for the event that is submitted to the blockchain, and the verification is passed, the execution of the alternative sub-transaction corresponding to the event is triggered.
  11. 根据权利要求7所述的方法,还包括:The method of claim 7, further comprising:
    识别所述集合交易对应的编号,所述编号被按照各个集合交易的生成顺序而添加,以按照对应的编号大小对所述参与方提交的各个集合交易进行依次处理。Identify the serial number corresponding to the collective transaction, and the serial number is added in the order in which each collective transaction is generated to sequentially process each collective transaction submitted by the participant according to the corresponding serial number size.
  12. 一种基于区块链的事件处理装置,应用于参与方,所述装置包括:An event processing device based on blockchain, applied to participants, the device includes:
    第一生成单元,根据所述参与方所参与的事件,生成对应的备选子交易,以使得若 干备选子交易被聚合为集合交易;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值;The first generating unit generates corresponding alternative sub-transactions according to the events in which the participant participates, so that several alternative sub-transactions are aggregated into a collective transaction; wherein, the alternative sub-transactions are set with corresponding states The amount of change is used to make the state parameter of the participant change correspondingly based on the amount of state change, and the value of the state parameter and the amount of state change are calculated based on a homomorphic encryption algorithm, respectively The cipher text value or the promise value calculated based on the homomorphic promise algorithm;
    第二生成单元,针对所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,生成统一证明信息,以证明所述状态参数在经过所述多个备选子交易后的取值处于正确取值区间;The second generating unit generates unified proof information for multiple candidate sub-transactions that are adjacent and corresponding events in the set transaction to reduce the value of the state parameter, to prove that the state parameter is passing The value after the multiple candidate sub-transactions is in the correct value interval;
    提交单元,将所述集合交易提交至区块链,以使所述集合交易中包含的备选子交易被依次处理。The submission unit submits the aggregate transaction to the blockchain, so that the candidate sub-transactions included in the aggregate transaction are processed in sequence.
  13. 根据权利要求12所述的装置,还包括:The apparatus according to claim 12, further comprising:
    识别单元,当若干备选子交易被选取以用于聚合为所述集合交易时,识别每一被选取的备选子交易对应的事件对所述状态参数的取值的调整方式;An identification unit, when several candidate sub-transactions are selected for aggregation into the set transaction, identifying the manner in which the event corresponding to each selected candidate sub-transaction adjusts the value of the state parameter;
    排列单元,当至少两个备选子交易对应的事件均用于减小所述状态参数的取值时,将所述至少两个备选子交易相邻地排列于所述集合交易中。The arranging unit, when the events corresponding to at least two candidate sub-transactions are used to reduce the value of the state parameter, arrange the at least two candidate sub-transactions adjacently in the set transaction.
  14. 根据权利要求12所述的装置,所述集合交易中包含分别对应于每一备选子交易的变化前状态值、变化后状态值,以配合于每一备选子交易中设定的状态变化量,使得每一备选子交易被处理后,所述参与方的状态参数由所述变化前状态值经由所述状态变化量而变化至所述变化后状态值;其中,所述变化前状态值和所述变化后状态值分别为基于所述同态加密算法计算得到的密文数值或基于所述同态承诺算法计算得到的承诺数值。The device according to claim 12, wherein the set transaction includes a pre-change state value and a post-change state value corresponding to each alternative sub-transaction, respectively, to match the state change set in each alternative sub-transaction After each candidate 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 pre-change state The value and the changed state value are respectively a ciphertext value calculated based on the homomorphic encryption algorithm or a promise value calculated based on the homomorphic commitment algorithm.
  15. 根据权利要求12所述的装置,还包括:The apparatus according to claim 12, further comprising:
    第三生成单元,分别为所述集合交易中的每一备选子交易生成相应的独立证明信息,所述独立证明信息用于证明相应的备选子交易中设定的状态变化量处于所述正确数值区间。The third generating unit respectively generates corresponding independent certification information for each candidate sub-transaction in the set transaction, and the independent certification information is used to prove that the state change amount set in the corresponding candidate sub-transaction is in the Correct value interval.
  16. 根据权利要求12所述的装置,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;其中,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,所述事件对应的备选子交易在区块链中被触发执行。The apparatus according to claim 12, 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 respectively 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.
  17. 根据权利要求12所述的装置,还包括:The apparatus according to claim 12, further comprising:
    添加单元,按照生成顺序为各个集合交易添加相应的编号,以使各个集合交易在区块链中被按照对应的编号大小进行依次处理。The adding unit adds corresponding numbers to each set transaction in the order of generation, so that each set transaction is processed sequentially according to the corresponding number size in the blockchain.
  18. 一种基于区块链的事件处理装置,应用于区块链节点,所述装置包括:A blockchain-based event processing device applied to blockchain nodes, the device includes:
    接收单元,接收参与方提交至区块链的集合交易,所述集合交易中包含若干备选子交易,所述备选子交易对应于所述参与方所参与的事件;其中,所述备选子交易设定有对应的状态变化量,以用于使所述参与方的状态参数基于所述状态变化量而发生相应的数值变化,且所述状态参数的取值、所述状态变化量分别为基于同态加密算法计算得到的密文数值或基于同态承诺算法计算得到的承诺数值;The receiving unit receives a collective transaction submitted by a participant to the blockchain, and the collective transaction includes several alternative sub-transactions, the alternative sub-transactions correspond to events in which the participant participates; wherein, the alternative The sub-transaction is set with a corresponding state change amount for the participant's state parameter to change correspondingly based on the state change amount, and the value of the state parameter and the state change amount are It is the ciphertext value calculated based on the homomorphic encryption algorithm or the promised value calculated based on the homomorphic commitment algorithm;
    第一获取单元,获取所述集合交易中的统一证明信息,所述统一证明信息对应于所述集合交易中相邻且对应的事件均用于减小所述状态参数的取值的多个备选子交易,以验证所述状态参数在经过所述多个备选子交易后的取值是否处于正确取值区间;The first obtaining unit obtains unified certification information in the collective transaction, the unified certification information corresponding to multiple adjacent and corresponding events in the collective transaction are used to reduce the multiple values of the state parameter Select a sub-transaction to verify whether the value of the status parameter after the multiple candidate sub-transactions is in the correct value interval;
    确定单元,根据验证结果确定对所述多个备选子交易的处理方式。The determining unit determines the processing method for the multiple candidate sub-transactions according to the verification result.
  19. 根据权利要求18所述的装置,The device according to claim 18,
    还包括:第二获取单元,获取所述集合交易中对应于每一备选子交易的独立证明信息,以验证相应的备选子交易中设定的状态变化量是否处于所述正确数值区间;It also includes: a second obtaining unit, which obtains independent certification information corresponding to each candidate sub-transaction in the set transaction to verify whether the state change amount set in the corresponding candidate sub-transaction is within the correct numerical range;
    所述确定单元具体用于:当所述验证结果为通过验证,且所述多个备选子交易中的任一备选子交易对应的独立证明信息通过验证时,触发执行所述任一备选子交易。The determining unit is specifically configured to: when the verification result is verified, and the independent certification information corresponding to any one of the plurality of candidate sub-transactions passes the verification, trigger the execution of any backup Select sub-transactions.
  20. 根据权利要求18所述的装置,还包括:The apparatus of claim 18, further comprising:
    第三获取单元,当所述集合交易中的任一备选子交易对应的事件用于增大所述状态参数的取值时,获取所述集合交易中对应于所述任一备选子交易的独立证明信息;A third acquiring unit, when the event corresponding to any candidate sub-transaction in the collective transaction is used to increase the value of the state parameter, acquiring the corresponding sub-transaction in the collective transaction Independent certification information;
    第一触发单元,当对应于所述任一备选子交易的独立证明信息通过验证时,触发执行所述任一备选子交易。The first triggering unit triggers execution of any alternative sub-transaction when the independent certification information corresponding to the alternative sub-transaction passes verification.
  21. 根据权利要求18所述的装置,在所述事件对应的备选子交易中,包含所述参与方对所述事件的单方触发信息;所述装置还包括:The apparatus according to claim 18, wherein the candidate sub-transaction corresponding to the event includes unilateral trigger information of the participant on the event; the apparatus further includes:
    第二触发单元,当所述事件的所有参与方分别向区块链提交的针对所述事件的单方触发信息均通过验证时,触发执行所述事件对应的备选子交易。The second triggering unit triggers the execution of the alternative sub-transaction corresponding to the event when all the parties involved in the event submit the single-party trigger information for the event to the blockchain and the verification is passed.
  22. 根据权利要求18所述的装置,还包括:The apparatus of claim 18, further comprising:
    识别单元,识别所述集合交易对应的编号,所述编号被按照各个集合交易的生成顺序而添加,以按照对应的编号大小对所述参与方提交的各个集合交易进行依次处理。The identification unit identifies the serial number corresponding to the collective transaction, and the serial number is added in the order in which each collective transaction is generated to sequentially process each collective transaction submitted by the participant according to the corresponding serial number size.
  23. 一种电子设备,包括:An electronic device, including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-6中任一项所述的 方法。Wherein, the processor executes the executable instruction to implement the method according to any one of claims 1-6.
  24. 一种电子设备,包括:An electronic device, including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求7-11中任一项所述的方法。Wherein, the processor executes the executable instruction to implement the method according to any one of claims 7-11.
PCT/CN2019/113960 2018-12-14 2019-10-29 Event processing method and apparatus based on blockchain, and electronic device WO2020119298A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811530105.2 2018-12-14
CN201811530105.2A CN110033363B (en) 2018-12-14 2018-12-14 Event processing method and device based on block chain and electronic equipment

Publications (1)

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

Family

ID=67235343

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/113960 WO2020119298A1 (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) CN110033363B (en)
TW (1) TWI729518B (en)
WO (1) WO2020119298A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210383371A1 (en) * 2020-06-05 2021-12-09 Hon Hai Precision Industry Co., Ltd. Method of recording transactions based on blockchain and electronic device using the same

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110033363B (en) * 2018-12-14 2024-01-23 创新先进技术有限公司 Event processing method and device based on block chain and electronic equipment
CN110458561B (en) * 2019-07-31 2020-08-04 阿里巴巴集团控股有限公司 Method and device for realizing confidential transaction in block chain network
CN111046069B (en) * 2019-11-11 2021-05-07 蚂蚁区块链科技(上海)有限公司 Aggregation calculation method, device and equipment in block chain type account book
CN110912705B (en) * 2019-11-14 2022-07-05 山东师范大学 Distributed electronic voting method and system based on block chain
CN112637278B (en) * 2020-12-09 2021-10-08 云南财经大学 Data sharing method and system based on block chain and attribute-based encryption and computer readable storage medium
CN112837156A (en) * 2021-02-10 2021-05-25 中国人民银行数字货币研究所 Transaction method and device with fixed execution sequence
CN113706146A (en) * 2021-08-04 2021-11-26 杭州溪塔科技有限公司 Processing method, device and system for executing batch transaction based on block chain

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160261404A1 (en) * 2015-03-02 2016-09-08 Dell Products L.P. Methods and systems for obfuscating data and computations defined in a secure distributed transaction ledger
CN106549749A (en) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 A kind of block chain method for secret protection encrypted based on additive homomorphism
CN107392584A (en) * 2017-07-24 2017-11-24 中国银行股份有限公司 Cross-border payment system and the cross-border method of payment based on block chain payment system
CN110033363A (en) * 2018-12-14 2019-07-19 阿里巴巴集团控股有限公司 Event-handling method and device, electronic equipment based on block chain

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10152756B2 (en) * 2014-03-31 2018-12-11 Monticello Enterprises LLC System and method for providing multiple payment method options to browser
US10812274B2 (en) * 2015-05-07 2020-10-20 Blockstream Corporation Transferring ledger assets between blockchains via pegged sidechains
CN106453407B (en) * 2016-11-23 2019-10-15 江苏通付盾科技有限公司 Identity identifying method, certificate server and user terminal based on block chain
CN108269072A (en) * 2016-12-30 2018-07-10 深圳瀚德创客金融投资有限公司 For the transaction processing method and network node of block chain
US10740733B2 (en) * 2017-05-25 2020-08-11 Oracle International Corporaton Sharded permissioned distributed ledgers
CN107239953B (en) * 2017-06-20 2021-10-29 无锡井通网络科技有限公司 Block chain-based rapid data storage method and system
CN108021821A (en) * 2017-11-28 2018-05-11 北京航空航天大学 Multicenter block chain transaction intimacy protection system and method
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160261404A1 (en) * 2015-03-02 2016-09-08 Dell Products L.P. Methods and systems for obfuscating data and computations defined in a secure distributed transaction ledger
CN106549749A (en) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 A kind of block chain method for secret protection encrypted based on additive homomorphism
CN107392584A (en) * 2017-07-24 2017-11-24 中国银行股份有限公司 Cross-border payment system and the cross-border method of payment based on block chain payment system
CN110033363A (en) * 2018-12-14 2019-07-19 阿里巴巴集团控股有限公司 Event-handling method and device, electronic equipment based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHANG, FAN ET AL.: "Privacy Data Authentication Schemes Based on Borromean Ring Signature", JOURNAL OF CRYPTOLOGIC RESEARCH, vol. 5, no. 5, 15 October 2018 (2018-10-15), XP055712198, ISSN: 2095-7025 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210383371A1 (en) * 2020-06-05 2021-12-09 Hon Hai Precision Industry Co., Ltd. Method of recording transactions based on blockchain and electronic device using the same

Also Published As

Publication number Publication date
CN110033363A (en) 2019-07-19
TWI729518B (en) 2021-06-01
CN110033363B (en) 2024-01-23
TW202025035A (en) 2020-07-01

Similar Documents

Publication Publication Date Title
US11257093B2 (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
US10861016B2 (en) Event processing method, apparatus and electronic device based on blockchain technology
CN109242485B (en) Block chain transaction method and device and electronic equipment
CN109756582B (en) Information recording method, device, node and storage medium in block chain network
WO2020119297A1 (en) Event processing method and apparatus based on blockchain, and electronic device
JP2022166214A (en) System and method for controlling asset-related actions via blockchain
TW202008272A (en) Block-chain transaction method and device, and electronic device
US20210398116A1 (en) Managing transactions in multiple blockchain networks
CN110008716A (en) Block chain method of commerce and device, electronic equipment, storage medium
CN113595734A (en) Method, system and apparatus for managing transactions in multiple blockchain networks
CN110033370A (en) Account creation method and device, electronic equipment, storage medium
CN113595733A (en) Method, system and apparatus for managing transactions in multiple blockchain networks
AU2016272701A1 (en) Systems and methods for publicly verifiable authorization
Zhang et al. Boros: Secure and efficient off-blockchain transactions via payment channel hub
CN110009323A (en) Block chain method of commerce and device, electronic equipment, storage medium
CN110009492A (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
Li et al. Implementation and preliminary evaluation of an auditable confidentiality mechanism for DeFi

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

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

Country of ref document: EP

Kind code of ref document: A1