A method and system for correcting data in blockchain

By receiving and processing data correction transactions in the blockchain, using smart contracts and endorsement information from regulatory agencies to correct transaction data, the problem of data correction in the blockchain is solved, and the premise of not destroying tamperability and credibility is achieved. The following revisions to transaction data ensure asset security and transaction consistency.

CN113672635BActive Publication Date: 2024-09-10ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111022815.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-01
Publication Date
2024-09-10
Estimated Expiration
2041-09-01

AI Technical Summary

Technical Problem

In the blockchain, how to correct the data recorded in the blockchain without destroying the non-tamperability and credibility, especially when there are flaws in the transaction data, such as the transfer is confirmed to be illegal or the amount is wrong In this case, the modification cost of existing technology is high and affects the original design intention of the blockchain.

Method used

By receiving data correction transactions, writing the correction information in the blockchain, and processing based on this information when related transactions are associated, using smart contracts and endorsement information from regulatory agencies to ensure the legality and effectiveness of the correction, and avoiding direct modification of the zone Blockchain data uses UTXO or Account model to revise transaction data.

Benefits of technology

It realizes the correction of data without affecting the credibility of the blockchain, reduces the cost of modification, protects the integrity of historical transaction data, and ensures asset security and transaction consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672635B
    Figure CN113672635B
Patent Text Reader

Abstract

The present specification relates to the field of blockchain technology, and in particular to a method and system for correcting data in a blockchain, the method comprising: receiving a data correction transaction, the data correction transaction being used to request correction of a transaction that has been executed by the blockchain; writing correction information of the transaction to be corrected into the blockchain; receiving other transactions; and when the other transactions are associated with the transaction to be corrected, processing the other transactions based on the correction information of the transaction to be corrected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a method and system for correcting data in a blockchain. Background Art

[0002] Blockchain is a decentralized distributed ledger system and technology, which is essentially a decentralized database with the characteristics of data traceability and non-tamperability.

[0003] However, in some scenarios, the data on the blockchain needs to be corrected. How to correct the data already recorded in the blockchain becomes a problem to be solved. Summary of the invention

[0004] One of the embodiments of the present specification provides a method for correcting data in a blockchain, comprising: receiving a data correction transaction, wherein the data correction transaction is used to request correction of a transaction that has been executed by the blockchain; writing correction information of the transaction to be corrected into the blockchain; receiving other transactions; and when the other transactions are associated with the transaction to be corrected, processing the other transactions based on the correction information of the transaction to be corrected.

[0005] One of the embodiments of the present specification provides a system for correcting data in a blockchain, comprising: a transaction receiving module, used to receive a data correction transaction, wherein the data correction transaction is used to request correction of a transaction that has been executed on the blockchain; a transaction execution module, used to write correction information of the transaction to be corrected into the blockchain; an other transaction receiving module, used to receive other transactions; and a correction processing module, used to process the other transactions based on the correction information of the transaction to be corrected when the other transactions are associated with the transaction to be corrected.

[0006] One of the embodiments of the present specification provides a device for correcting data in a blockchain, including a processor, wherein the processor is used to execute the above-mentioned method for correcting data in a blockchain.

[0007] One of the embodiments of this specification provides a computer-readable storage medium, which stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the above-mentioned method for correcting data in the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:

[0009] Figure 1 It is a schematic diagram of an application scenario of a correction system for data in a blockchain according to some embodiments of this specification;

[0010] Figure 2 is an exemplary flow chart of a method for correcting data in a blockchain according to some embodiments of this specification;

[0011] Figure 3 It is exemplary transaction information based on the UTXO model shown in some embodiments of this specification;

[0012] Figure 4 is an exemplary flow chart of a method for correcting data in a blockchain according to some embodiments of this specification;

[0013] Figure 5 This is a modular schematic diagram of a system for correcting data in a blockchain according to some embodiments of this specification. DETAILED DESCRIPTION

[0014] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.

[0015] It should be understood that the "system", "device", "unit" and / or "module" used herein are a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.

[0016] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.

[0017] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.

[0018] Figure 1It is a schematic diagram of an application scenario of a correction system for data in a blockchain according to some embodiments of this specification.

[0019] like Figure 1 As shown, the blockchain system 100 may include a user terminal 110, a blockchain network 120, and a network 130.

[0020] The user terminal 110 may be a terminal using a blockchain service, which may be connected to a node in the blockchain network 120 through the network 130. The user terminal 110 may initiate a transaction, that is, generate a transaction and send the generated transaction to the blockchain network 120, so that the transaction is broadcasted in the blockchain network 120.

[0021] It should be noted that the transactions mentioned in this specification specifically refer to blockchain transactions, which are used to trigger various events in the blockchain system 100. For example, an event may include one or more of the addition of a new node, the exit of a node, a transfer, data storage, etc.

[0022] The blockchain network 120 may include multiple blockchain nodes, for example, Figure 1 1, 120-2, 120-3, ..., 120-n. After receiving the transaction initiated by the user terminal 110, any blockchain node can forward the transaction to other nodes so that the transaction is broadcast in the blockchain network 120. The blockchain node can collect the transactions broadcasted in the blockchain network 120 and generate a block based on one or more transactions, and then broadcast the block on the chain. In the same period, multiple blocks generated by different blockchain nodes can appear, and among these blocks, only one block will become a valid block. Among them, the prerequisite for becoming a valid block may include: the blockchain nodes participating in the consensus (also known as consensus nodes) verify one or more blocks generated on the blockchain. Based on the agreement of the consensus mechanism, when a preset number (such as half or two-thirds) of consensus nodes verify one of the blocks, the block becomes a valid block. Afterwards, the blockchain node can perform relevant operations according to the transaction content recorded in the valid block, and this process can be called the execution of the transaction. For example, the execution of a transfer transaction includes transferring tokens between accounts. Based on the consensus mechanism, the behavior of each blockchain node in the blockchain network 120 and the stored blockchain data can remain consistent.

[0023] In some embodiments, the blockchain node may also initiate a transaction and broadcast the initiated transaction on the chain, and then the blockchain executes the transaction according to the above process. In some embodiments, the user terminal 110 may also be one of the nodes on the blockchain.

[0024] In some embodiments, the user terminal 110 or the node in the blockchain network 120 may include various computing devices, such as smart phones, laptop computers, desktop computers, servers, etc.

[0025] In some embodiments, the server may be an independent server or a server group, which may be centralized or distributed. In some embodiments, the server may be regional or remote. In some embodiments, the server may be executed on a cloud platform. For example, the cloud platform may include one or any combination of a private cloud, a public cloud, a hybrid cloud, a community cloud, a decentralized cloud, an internal cloud, etc. In some embodiments, the client 110 and the blockchain node may be integrated into the same computing device.

[0026] The network 130 connects the components of the system so that the components can communicate with each other. The network between the components in the system may include a wired network and / or a wireless network. For example, the network 130 may include a cable network, a wired network, a fiber optic network, a telecommunications network, an internal network, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network (ZigBee), a near field communication (NFC), an in-device bus, an in-device line, a cable connection, or any combination thereof. The network connection between each two parts may be in one of the above-mentioned ways or in multiple ways. It is understandable that the network 130 and the blockchain network 120 do not have to have a clear boundary. In a more general application scenario, the blockchain nodes and the ordinary network nodes can be connected to the same physical network together, and the blockchain nodes therein logically constitute a blockchain network.

[0027] For blockchain, transactions indicate the state transfer in the blockchain. The execution of each transaction will change the state of the blockchain (or global ledger or world state). It can be a transfer of funds, a message call, or the deployment of a contract. As mentioned above, when a block is passed by consensus, it becomes a valid block. The blockchain node will link it to the existing block data as a new block, and the node that generates the valid block will receive a corresponding accounting reward (such as a token). It can be seen that the data recording transactions can include block data and world state, both of which can also be collectively referred to as blockchain data. When the specification mentions writing certain information to the blockchain, it can be understood that the information is recorded in the block data and / or world state.

[0028] Block data includes a data chain (i.e., blockchain) formed by linking multiple blocks in the order of their generation time. Block data has the characteristic of being unmodifiable. A block can include two parts: a block header and a block body. The key information (or summary information) of the block can be written into the block header, and detailed information of the block can be written into the block body. For example, the block timestamp, the block hash value (of this block), the block hash value of the parent block (previous block), the block height, the root hash of the Merkle tree, etc. can be written into the block header. The block timestamp can reflect the generation time of the block, the block hash value can be calculated based on the content in the block header, and the block height can reflect the number of blocks generated by this block. Transaction information such as transaction lists and transaction receipt lists can be written into the block body. The transaction list includes one or more transactions based on which the block is generated (collectively referred to as transactions in the block), and the transaction receipt list includes receipts of one or more transactions in the block. In the block body, all transaction information can be hashed in groups of two to obtain multiple hash values ​​of the previous level. These hash values ​​can be hashed in groups of two again to obtain multiple hash values ​​of the next level, and so on, to obtain a root hash value. This structure is called a Merkle Tree, and it is an upside-down tree. The root hash of the tree is the root hash of the Merkle tree in the block header. The block data records transaction information, and the specific status data related to the transaction is recorded in the world state. Each node of the blockchain stores the world state, and the execution of each transaction will change the world state. For example, the world state saves the status data of all accounts involved in the transaction. If you need to know the balance of an account or the current status of a smart contract, you need to query the world state to obtain these specific status information.

[0029] In blockchain applications, the UTXO (unspent transaction output) model and the Account (account / balance) model are two common models used to implement blockchain transactions.

[0030] UTXO is a blockchain object model. In a blockchain based on the UTXO model, assets are not represented by account balances but by outputs of blockchain transactions that have not yet been spent. This output can be used as input in new transactions. In the case of valid blockchain transactions, unspent outputs can be used to implement further transactions. Figure 3 The figure shows exemplary transaction information based on the UTXO model, which includes the transaction identifier of the current transaction (such as transaction number: #2001), transaction input (i.e., the source transaction identifier of the current transaction funds or the previous transaction identifier #1001), and transaction output (transaction amount and recipient account or address). That is, multiple transactions constitute a chain structure, and all legal transactions can be traced back to the output of one or more previous transactions.

[0031] The Account model is similar to a traditional bank account, which represents assets through account balances. In a blockchain based on the Account model, when each node receives a new block, it rewrites its own world state according to the consensus mechanism to complete the account balance processing. The most common blockchain using the Account model is Ethereum.

[0032] In some specific scenarios, the transaction data recorded in the blockchain is not flawless. For example, a transfer is confirmed to be illegal and needs to be revoked. Another example is that the amount of a transaction is incorrect and needs to be modified. However, in the blockchain scenario, direct correction of blockchain data requires all (or most) consensus nodes to modify the database at the same time and to modify the Merkle tree of all blocks starting from the genesis block, resulting in extremely high modification costs and destroying the original design of the blockchain that it cannot be tampered with, thus affecting the credibility of the blockchain.

[0033] In view of this, in some embodiments of this specification, a data correction method is provided, which can correct blockchain data without directly modifying the blockchain data and without affecting the credibility.

[0034] Figure 2 This is an exemplary flow chart of a method for correcting data in a blockchain according to some embodiments of this specification.

[0035] In some embodiments, taking the UTXO model blockchain as an example, the description of the UTXO model can be found in Figure 1 One or more steps in the process 200 of the method for correcting data in the blockchain can be performed by Figure 1 The process 200 is executed by a blockchain node or a consensus node therein, and includes:

[0036] Step 210 , receiving a data correction transaction. In some embodiments, step 210 may be performed by the transaction receiving module 510 .

[0037] In some embodiments, a data correction transaction can be considered as a special transaction, which is used to request a correction of a transaction that has been executed by the blockchain. In some embodiments, a data correction transaction is similar to other transactions and can include a transaction identifier, a transaction input, and a transaction output. The transaction identifier can be a unique identifier of the transaction, such as a transaction ID, a transaction hash value, or a block number + transaction number where the transaction is located.

[0038] In some embodiments, the data correction transaction may also include a transaction identifier of the transaction to be corrected and a correction instruction. The transaction to be corrected may be uniquely identified by the transaction identifier of the transaction to be corrected. In some embodiments, the correction instruction is used to specify the specific correction operation of the transaction to be corrected, such as canceling the transaction to be corrected or changing the transaction data of the transaction to be corrected. In some embodiments, the correction instruction may further include the transaction data to be modified in the transaction to be corrected and the modified transaction data, which may include transaction input (source of funds, etc.) or transaction output (amount, recipient address, etc.).

[0039] In some embodiments, a data correction transaction can be implemented by calling a data correction smart contract to correct the data, and the transaction identifier and correction indication of the correction transaction can be used as input parameters of the data correction smart contract calling interface.

[0040] In some embodiments, the data correction transaction is initiated by an authorized user, who can be determined when the blockchain is built, or selected or added during the execution of the blockchain. By ensuring that the data correction transaction is initiated by a user with initiation qualifications, it is possible to avoid the loss of data, property or credibility by some nodes or users in the blockchain maliciously initiating data correction transactions. The user who initiates the transaction signs the transaction with his own private key, and the node receiving the transaction verifies the digital signature in the transaction with the public key of the authorized user. When the verification is passed, the data correction transaction is considered to be initiated by the authorized user, and the subsequent work is performed. Otherwise, the data correction transaction will not be processed.

[0041] In some embodiments, when the regulatory authority may intervene in the operation of the blockchain, the data correction transaction may also include the endorsement information of the regulatory authority to prevent any node from initiating the data correction transaction and provide credit support for the data correction transaction. In some embodiments, the endorsement information may include the authentication result of the regulatory authority and its digital signature. In some embodiments, the authentication result may include the authentication result of the transaction participants or the transaction amount, and provide a basis for the revocation or change of the current data correction transaction. In some embodiments, the digital signature may be generated by the regulatory authority using its private key to sign the summary information of the authentication result, and the summary information of the authentication result may be obtained by processing the authentication result based on the hash algorithm. The regulatory authority may distribute public keys to blockchain nodes. When receiving the data correction transaction, the blockchain node verifies the legitimacy of the endorsement information in the data correction transaction through the public key. If the verification fails, the transaction is not processed. If the verification passes, other subsequent processing is performed, such as verifying the legitimacy of the identity of the transaction initiator or broadcasting the transaction.

[0042] like Figure 1As described in the description, after verifying that the data correction transaction has passed, the blockchain node will broadcast the transaction to other nodes so that other nodes can receive the transaction.

[0043] Step 220 , execute a data correction transaction to write the correction information of the transaction to be corrected into the blockchain data. In some embodiments, step 220 may be executed by the transaction execution module 520 .

[0044] After the blockchain node receives the data correction transaction, it will go through block generation and consensus, and the transaction information of the data correction transaction will be written into the block data along with the new block. For more information about block generation and consensus, please refer to Figure 1 Related description.

[0045] The blockchain node then executes the data correction transaction. In some embodiments, the blockchain node can execute the data correction transaction by calling the smart contract in the blockchain. Smart contracts (referred to as contracts) are modular, reusable, and automatically executed scripts running on the blockchain. When deploying a contract, the contract code (such as bytecode) is stored in each blockchain node, and each contract corresponds to a contract address. The blockchain node can call the data correction transaction smart contract according to the contract address pointed to by the data correction transaction, and then write the correction information of the transaction to be corrected into the world state.

[0046] In some embodiments, when the correction instruction in the revised transaction is to cancel the pending revised transaction, the correction information of the pending revised transaction includes the transaction identifier of the pending revised transaction and the cancellation instruction. As an example, a transaction with the transaction identifier #1001 was once executed by the blockchain and now needs to be cancelled, then the correction information of the pending revised transaction includes: #1001, canceled.

[0047] In some embodiments, when the correction instruction in the correction transaction is to change the transaction data of the transaction to be corrected, the correction information of the transaction to be corrected includes the transaction identifier of the transaction to be corrected and the modified transaction data. Continuing with the previous example, after the execution of transaction #1001, a sum of 100 yuan of funds was transferred to Li Si's account, and now the amount of funds needs to be changed to 50 yuan, then the correction information to be corrected may include: #1001, the amount of 100 transferred to Li Si is changed from 50. The above is only an example. In actual application, the correction information may include a more detailed description of the modified content to meet the needs of specific scenarios.

[0048] Step 230 , receiving other transactions. In some embodiments, step 230 may be performed by other transaction receiving module 530 .

[0049] In some embodiments, transactions will continue to be generated in the blockchain, and the node will also receive other transactions in addition to the pending transaction. After receiving other transactions, the blockchain node can Figure 1 The described process sequentially performs transaction broadcasting, block generation, and consensus until the other transactions are waiting to be executed. In some embodiments, the other transactions may include transactions associated with the transaction to be revised.

[0050] In some embodiments, transactions associated with the transaction to be revised can be distinguished from other transactions, that is, when the other transaction contains the transaction identifier of the transaction to be revised, it is determined that the other transaction is associated with the transaction to be revised, otherwise it is not associated. Figure 3 For example, a transfer transaction with transaction number #2001 is used to transfer 2.5 yuan from Zhang San to Li Si. Specifically, the transaction input, i.e., the source of funds, is Zhang San's unspent transaction output of 12.5 yuan in the transaction with transaction number #1001. The transaction output includes two items. The first item is the payee Li Si, with an amount of 2.5, and the second item is the payee Zhang San, with an amount of 10, i.e., the unspent transaction output of Zhang San in the current transaction. Assuming that the transaction to be corrected is #1001, since transaction #2001 contains the transaction identifier of the transaction to be corrected, it can be determined that transaction #2001 is associated with transaction #1001.

[0051] When the other transaction is not associated with the transaction to be revised, step 260 is executed, that is, the other transaction is executed normally, otherwise step 250 is executed to process the other transaction based on the revised information of the transaction to be revised. In some embodiments, step 250 can be executed by the revision processing module 540.

[0052] In some embodiments, depending on the different revised information of the transaction to be revised, the other transactions are processed differently based on the revised information of the transaction to be revised.

[0053] In some embodiments, processing the other transactions based on the correction information of the transaction to be corrected includes, based on the transaction identifier and the cancellation indication of the transaction to be corrected in the correction information, not executing other transactions associated with the transaction to be corrected, or not executing transaction operations related to the transaction identifier of the transaction to be corrected in the other transactions. Figure 3In the example, when the transaction with transaction number #1001 is a pending transaction, it can be seen from the revoked indication in the correction information that transaction #1001 is revoked, and transaction #2001 is related to transaction #1001. At this time, the node may not execute the transaction with transaction number #2001. In some embodiments, the node may record in the world state that transaction #2001 is revoked or not executed. In some other embodiments, it is assumed that there is transaction #3001 in other transactions received by the node, and its transaction input involves two prior transactions, such as transferring 5 yuan from the unspent transaction output of transaction #1001 to Wang Wu and transferring 5 yuan from the unspent transaction output of transaction #1002 to Wang Wu, where transaction #1001 is revoked. At this time, the node may execute the transfer of 5 yuan from the unspent transaction output of transaction #1002 to Wang Wu in #3001, but not the transfer of 5 yuan from the unspent transaction output of transaction #1001 to Wang Wu. For example, the node only records in the world state that "5 yuan from the unspent transaction output of transaction #1002 is transferred to Wang Wu."

[0054] In some embodiments, processing the other transaction based on the revised information of the transaction to be revised includes, based on the transaction identifier of the transaction to be revised in the revised information and the modified transaction data, executing the transaction operation related to the transaction identifier of the transaction to be revised in the other transaction based on the modified transaction data when executing the other transaction. Figure 3 In the example, when the transaction number #1001 is a pending revision transaction, and the revision information indicates that its unspent transaction output is changed from 12.5 yuan to 10 yuan, when the node executes the associated transaction #2001, the second amount is actually recorded as 7.5 yuan.

[0055] Through step 250, after the correction information of the transaction to be corrected is uploaded to the chain, the transaction data of other transactions related to it that occur subsequently can be modified accordingly, thereby avoiding the modification of the existing blockchain data and effectively revising the subsequent transaction behavior. In scenarios involving financial security, the security of funds can be effectively guaranteed.

[0056] In some optional embodiments, process 200 further includes:

[0057] Step 240 , determining whether the trigger condition is satisfied. Step 240 may be performed before step 250 . In some embodiments, step 240 may also be performed by the correction processing module 540 .

[0058] In some embodiments, the data correction transaction also includes a trigger condition. Before processing other transactions based on the correction information of the transaction to be corrected, it is first determined whether the trigger condition is met. When the trigger condition is met, the other transaction is processed based on the correction information of the transaction to be corrected. Otherwise, the other transaction is temporarily stored until it is determined that the trigger condition is met and then the other transaction is processed based on the correction information of the transaction to be corrected. In some embodiments, temporarily storing other transactions can be saving the transaction containing the transaction identifier of the transaction to be corrected to the local cache of the node. By setting the trigger condition, the transaction correction operation can be made more controllable. When the trigger condition is not met, the relevant transaction is temporarily stored, realizing the function of freezing the relevant transaction, and avoiding the transaction data of the transaction to be corrected from affecting subsequent transactions.

[0059] When the data correction transaction also includes a trigger condition, the correction information of the transaction to be corrected may also include the trigger condition. The blockchain node will periodically detect whether the trigger condition of the transaction to be corrected written into the blockchain is met, so that subsequent transactions can be processed. In some embodiments, the blockchain node can determine whether each trigger condition written into the blockchain is met in turn when obtaining a block that has passed consensus. When a block that has passed consensus is obtained, the node can execute the transaction recorded in the block. At this time, when it is determined that the trigger condition is met, other transactions can be directly processed based on the correction information. In some embodiments, the blockchain node can also judge the trigger condition based on time. For example, the trigger condition can be judged at intervals of preset time (such as 1 hour, 4 hours, 12 hours or 20 hours, etc.) or at a set time in a time period such as every day or every week.

[0060] In some embodiments, the triggering conditions may include one or more of the following: the voting results of the blockchain node on the data correction proposal meet the preset requirements, the current time meets the preset time conditions, the current block height of the blockchain reaches a preset value, and the account status of the specified account reaches a preset state. The above triggering conditions are explained one by one:

[0061] The voting result of the blockchain node on the data correction proposal meets the preset requirements: In some embodiments, the data correction transaction may also include the number of votes or voting ratio for the proposal to be passed. After receiving or executing the data correction transaction, the blockchain node may initiate another voting transaction for the data correction proposal for the data correction transaction. All nodes or some nodes with voting rights in the blockchain vote. When the number of nodes participating in the vote exceeds all nodes with voting rights (such as one-half or two-thirds, etc.) and the number of votes passed exceeds the preset number of votes or ratio (such as one-half or two-thirds, etc.), it can be considered that the proposal is passed, that is, the voting result meets the preset requirements. In some embodiments, the trigger condition that all nodes can participate in the vote is suitable for scenarios with a high degree of decentralization or a large number of nodes such as public chains. In some embodiments, according to the actual needs of the blockchain, some nodes can be restricted from having voting rights, such as only accounting nodes, regulators, alliance chain node operators or other authorized nodes have voting rights. The solution in which some nodes have voting rights is suitable for strong-center scenarios such as alliance chains, private chains, and BaaS (Blockchain as a Service).

[0062] The current time meets the preset time condition: In some embodiments, the current time indicates the moment of executing the trigger condition judgment operation. In some embodiments, when a block that passes the consensus is obtained, it is determined whether the trigger condition is satisfied, that is, when a block that passes the consensus is obtained, it can be determined whether the current time meets the preset time condition. Assuming that the preset time condition is 0:00 to 6:00 Beijing time, and the node obtains the block that passes the consensus at 10:00, the preset time condition is not met at this time, and the other associated transactions are temporarily stored until the next execution of the condition judgment and it is determined that the trigger condition is satisfied, and then the other transactions are processed based on the correction information of the transaction to be corrected. This solution is suitable for scenarios with requirements for processing time, and different time conditions are configured to avoid problems of too frequent processing or too long waiting time.

[0063] The current block height of the blockchain reaches a preset value: The current definition can be similar to the aforementioned "current time". In some embodiments, the preset value can be a numerical value or a numerical condition, such as an even number, a ten, or a hundred. Exemplarily, the preset value of the block height is a hundred. When the block height of the block that the node obtains through consensus is the 199th block, the trigger condition is not met at this time, and other transactions are temporarily stored; when the node obtains the next block that passes the consensus (i.e., the 200th block), the trigger condition is met at this time, and the other transactions are processed.

[0064] The account status of the specified account reaches a preset state: In some embodiments, the preset state of the account status can be when the amount of funds in a specific account is higher / lower than a certain value / ratio. For example, when the funds in a specific account are lower than 10% of the initial amount, it can be determined that a large number or large amount of transfers may have occurred in the account, which may be an abnormal transaction state. This trigger condition is more suitable for financial scenarios, effectively freezing related transactions before large-scale abnormal funds occur, making it easier for regulatory agencies to intervene in investigations or control, and taking timely measures to deal with subsequent related transactions when large-scale abnormal funds occur to ensure the safety of funds.

[0065] It should be noted that in some embodiments, the trigger conditions may include multiple ones, such as being configured to be triggered when the current time meets the range of 9 pm to 9 am the next day Beijing time and the account status of the specified account reaches a preset status, so as to realize nighttime supervision of the status of a specific account.

[0066] In some embodiments, a smart contract in the blockchain can be called by a node to determine trigger conditions and process other transactions.

[0067] Figure 4 This is an exemplary flow chart of a method for correcting data in a blockchain according to some embodiments of this specification.

[0068] In some embodiments, the blockchain based on the Account model can perform data correction according to process 400. For example, one or more steps in process 400 can be performed by Figure 1 The blockchain node or the consensus node therein executes. The correction method process 400 of the data in the blockchain is similar to the process 200, but because the transaction input included in the transaction in the Account model is no longer the source transaction identifier of the current transaction funds, but the payment account, there are some differences. The following focuses on the differences from the process 200, and the similarities can be referred to. Figure 2 In some embodiments, process 400 includes:

[0069] Step 410 , receiving a data correction transaction. In some embodiments, step 410 may be performed by the transaction receiving module 510 .

[0070] In some embodiments, more details about receiving data correction transactions can be found in step 210 and related descriptions, which are not repeated here. Different from the UTXO model, the transaction input included in the transaction in the Account model is no longer the source transaction identifier of the current transaction funds, but the payment account.

[0071] Step 420 , execute a data correction transaction to write the correction information of the transaction to be corrected into the blockchain data. In some embodiments, step 420 may be executed by the transaction execution module 520 .

[0072] In some embodiments, step 420 is similar to step 220, except that in the Account model, the transaction no longer contains the source transaction identifier of the current transaction funds, so it is difficult to determine the transaction related to the transaction to be corrected through the transaction identifier. At this time, it can be determined whether the other transactions are related transactions by judging whether they contain accounts related to the transaction to be corrected. Correspondingly, when the correction instruction is to cancel the transaction to be corrected, the correction information of the transaction to be corrected written into the blockchain includes the account involved in the transaction to be corrected and the revoked instruction; when the correction instruction is to change the transaction data of the transaction to be corrected, the correction information of the transaction to be corrected includes the account involved in the transaction to be corrected and the modified transaction data. Exemplarily, transaction #4001 is a transaction to be corrected, which includes the transfer of 10 tokens from Zhang San's account to Li Si's account. When the correction instruction is to cancel the transaction to be corrected, the correction information includes the accounts of Zhang San and Li Si and the revoked instruction. When the correction instruction is to change the transaction data of the transaction to be corrected, the correction information includes the accounts of Zhang San and Li Si and the modified transfer amount, such as changing to transfer 20 tokens.

[0073] Step 430 , receiving other transactions. In some embodiments, step 430 may be performed by other transaction receiving module 530 .

[0074] In some embodiments, more details about other transactions can be found in step 230 and related descriptions, which will not be repeated here.

[0075] In some embodiments, the difference between step 430 and step 230 is that for transactions based on the Account model, when determining whether other transactions are associated with the transaction to be corrected, it is determined whether other transactions contain accounts related to the transaction to be corrected. If they are included, the other transactions are considered to be associated with the transaction to be corrected, otherwise they are not associated. Exemplarily, a transfer transaction with transaction number #5001, in order to realize the transfer of 3 tokens from Li Si to Wang Wu, specifically includes: the transaction input, i.e., the source of funds, is the account address and balance of Li Si, and the transaction output is the account address and balance of Wang Wu, and the amount is 3 tokens. Assuming that the transaction to be corrected is #4001, since transaction #5001 contains the account related to the transaction to be corrected, i.e., Li Si's account, it can be determined that transaction #5001 is associated with transaction #4001.

[0076] When the other transaction is not associated with the transaction to be revised, step 460 is executed, that is, the other transaction is executed normally, otherwise step 450 is executed to process the other transaction based on the revised information of the transaction to be revised. In some embodiments, step 450 can be executed by the revision processing module 540.

[0077] Step 450 : When the other transaction is associated with the transaction to be revised, the other transaction is processed based on the revision information of the transaction to be revised. In some embodiments, step 440 may be performed by the revision processing module 540 .

[0078] In some embodiments, depending on the different revised information of the transaction to be revised, the other transactions are processed differently based on the revised information of the transaction to be revised.

[0079] In some embodiments, processing the other transactions based on the correction information of the transaction to be corrected includes, based on the account involved in the transaction to be corrected and the revoked indication in the correction information, not executing other transactions associated with the transaction to be corrected, or not executing transaction operations related to the account involved in the transaction to be corrected in the other transactions. Continuing with the above example, transaction #4001 is a transaction to be corrected, the correction information records the accounts of Zhang San and Li Si and the revoked indication, and transaction #5001 is associated with transaction #4001. At this time, the node may not execute transaction #5001. In some embodiments, the node may record in the world state that transaction #5001 is revoked or not executed. In some other embodiments, suppose that there is a #6001 transaction among other transactions received by the node, and its transaction input involves the accounts of Zhao Liu and Li Si, such as transferring 5 tokens in Zhao Liu's account to Wang Wu and transferring 5 tokens in Li Si's account to Wang Wu, wherein the #4001 transaction is revoked, and the #4001 transaction involves the accounts of Zhang San and Li Si, at this time, the node can execute the transfer of 5 tokens in Zhao Liu's account to Wang Wu in #6001, but not the transfer of 5 tokens in Li Si's account to Wang Wu. For example, the node only reduces the balance of Zhao Liu's account by 5 tokens and increases the balance of Wang Wu's account by 5 tokens in the world state.

[0080] In some embodiments, processing the other transactions based on the correction information of the transaction to be corrected includes, based on the account involved in the transaction to be corrected in the correction information and the modified transaction data, executing the transaction operations related to the account involved in the transaction to be corrected in the other transactions based on the modified transaction data when executing the other transactions. Continuing with the above example, transaction #4001 is a transaction to be corrected, and the correction information includes the accounts of Zhang San and Li Si, and the transfer amount is changed from 10 tokens to 20 tokens. When the node executes the associated transaction #5001, the node increases the account balance of Li Si by 7 tokens (i.e. +10-3) in the world state, and increases the account balance of Wang Wu by 3 tokens.

[0081] In some optional embodiments, process 400 further includes:

[0082] Step 440 , determining whether the trigger condition is satisfied. Step 440 may be performed before step 450 . In some embodiments, step 440 may also be performed by the correction processing module 540 .

[0083] In some embodiments, more details on determining whether the trigger condition is met may be referred to step 240 and related descriptions, which will not be repeated here.

[0084] It should be noted that the above description of processes 200 and 400 is only for example and illustration, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to the processes under the guidance of this specification. However, these modifications and changes are still within the scope of this specification. For example, step 240 or step 440 may not be performed.

[0085] Figure 5 This is a modular schematic diagram of a system for correcting data in a blockchain according to some embodiments of this specification.

[0086] like Figure 5 As shown, the correction system 500 for data in the blockchain may include a transaction receiving module 510, a transaction execution module 520, other transaction receiving modules 530 and a correction processing module 540.

[0087] In some embodiments, the transaction receiving module 510 is used to receive a data correction transaction, where the data correction transaction is used to request correction of a transaction that has been executed by the blockchain.

[0088] For more information about the data correction transaction, please refer to the relevant description of step 210 and step 410, which will not be repeated here.

[0089] In some embodiments, the transaction execution module 520 is used to execute a data correction transaction to write the correction information of the transaction to be corrected into the blockchain.

[0090] For more information about executing the data correction transaction, please refer to the relevant description of step 220 and step 420, which will not be repeated here.

[0091] In some embodiments, the other transaction receiving module 530 is used to receive other transactions.

[0092] For more information about other transactions, please refer to the relevant descriptions of step 230 and step 430, which will not be repeated here.

[0093] In some embodiments, the correction processing module 540 is configured to process the other transaction based on the correction information of the transaction to be corrected when the other transaction is associated with the transaction to be corrected.

[0094] For more information on processing other transactions, please refer to the relevant descriptions of steps 240~260 and steps 440~460, which will not be repeated here.

[0095] It should be noted that the above description of the correction system and its modules in the blockchain is only for the convenience of description and cannot limit this specification to the scope of the embodiments. For example, in some embodiments, Figure 5 The transaction receiving module 510 and the other transaction receiving module 530 disclosed in the disclosure may be different modules in a system, or one module may realize the functions of two or more modules mentioned above. For example, the transaction receiving module 510 and the transaction executing module 520 may be two modules, or one module may have both receiving and executing functions. For example, each module may share a storage module, or each module may have its own storage module. Such variations are all within the protection scope of this specification.

[0096] The beneficial effects that may be brought about by the embodiments of this specification include but are not limited to: (1) there is no need to modify the existing blockchain data, which has high feasibility and ensures the credibility of the blockchain; (2) the original historical transaction data does not need to be destroyed and the Merkle tree of all blocks does not need to be modified, thereby protecting the integrity of historical transaction information; (3) related transactions or accounts can be frozen to protect asset security; (4) other subsequent related transactions are processed based on the correction information, ensuring the consistency of blockchain behavior and making each transaction traceable.

[0097] It should be noted that different embodiments may produce different beneficial effects. In different embodiments, the beneficial effects that may be produced may be any one or a combination of the above, or any other beneficial effects that may be obtained.

[0098] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.

[0099] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.

[0100] In addition, unless explicitly stated in the claims, the order of the processing elements and sequences described in this specification, the use of alphanumeric characters, or the use of other names are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some invention embodiments that are currently considered useful through various examples, it should be understood that such details are only for illustrative purposes, and the attached claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing server or mobile device.

[0101] Similarly, it should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject matter of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.

[0102] In some embodiments, numbers describing the number of components and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining the digits. Although the numerical domains and parameters used to confirm the breadth of the range in some embodiments of this specification are approximate values, in specific embodiments, the setting of such numerical values ​​is as accurate as possible within the feasible range.

[0103] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, etc., cited in this specification is hereby incorporated by reference in its entirety. Except for application history documents that are inconsistent with or conflicting with the contents of this specification, documents that limit the broadest scope of the claims of this specification (currently or later attached to this specification) are also excluded. It should be noted that if the descriptions, definitions, and / or use of terms in the materials attached to this specification are inconsistent or conflicting with the contents described in this specification, the descriptions, definitions, and / or use of terms in this specification shall prevail.

[0104] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.

Claims

1. A method for correcting data in a blockchain, comprising: Receiving a data correction transaction, wherein the data correction transaction is used to request correction of a transaction that has been executed by the blockchain; Write the revised information of the transaction to be revised into the blockchain; Receive other transactions; When the other transaction is associated with the transaction to be revised, the other transaction is processed based on the revision information of the transaction to be revised.

2. The method according to claim 1, wherein the data correction transaction comprises a transaction identifier of the transaction to be corrected and a correction instruction; wherein: The correction instruction is to cancel the transaction to be corrected or to change the transaction data of the transaction to be corrected. 3 . The method according to claim 2 , wherein when the other transaction includes the transaction identifier of the transaction to be revised, it is determined that the other transaction is associated with the transaction to be revised.

4. The method according to claim 3, when the correction instruction is to cancel the transaction to be corrected, the correction information of the transaction to be corrected includes the transaction identifier of the transaction to be corrected and the cancellation instruction; When the correction instruction is to change the transaction data of the transaction to be corrected, the correction information of the transaction to be corrected includes the transaction identifier of the transaction to be corrected and the modified transaction data.

5. The method according to claim 4, wherein the processing of the other transactions based on the revised information of the transaction to be revised comprises: Based on the transaction identifier of the transaction to be revised in the revision information and the cancellation indication, not executing the transaction operation related to the transaction identifier of the transaction to be revised in the other transactions; Alternatively, based on the transaction identifier of the transaction to be revised and the cancellation indication in the revision information, the other transaction is not executed; Alternatively, based on the transaction identifier of the transaction to be revised in the revision information and the modified transaction data, when executing the other transactions, the transaction operations related to the transaction identifier of the transaction to be revised in the other transactions are executed based on the modified transaction data. 6 . The method according to claim 2 , wherein when the other transaction includes an account involved in the transaction to be revised, it is determined that the other transaction is associated with the transaction to be revised.

7. The method according to claim 6, when the correction instruction is to cancel the transaction to be corrected, the correction information of the transaction to be corrected includes the account involved in the transaction to be corrected and the instruction to be cancelled; When the revision instruction is to change the transaction data of the transaction to be revised, the revision information of the transaction to be revised includes the account involved in the transaction to be revised and the modified transaction data.

8. The method according to claim 7, wherein the processing of the other transactions based on the revised information of the transaction to be revised comprises: Based on the account involved in the transaction to be revised and the revoked instruction in the revision information, not executing the transaction operation related to the account involved in the transaction to be revised in the other transactions; Alternatively, based on the account involved in the transaction to be revised and the cancelled instruction in the revision information, the other transaction is not executed; Alternatively, based on the account involved in the transaction to be revised in the revision information and the modified transaction data, when executing the other transactions, the transaction operations related to the account involved in the transaction to be revised in the other transactions are executed based on the modified transaction data.

9. The method of claim 1, wherein the data correction transaction further comprises a trigger condition; Before processing the other transactions based on the revised information of the transaction to be revised, the method further includes: Determine whether the trigger condition is met. If the trigger condition is met, process the other transactions based on the correction information of the transaction to be corrected. Otherwise, temporarily store the other transactions until it is determined that the trigger condition is met, and then process the other transactions based on the correction information of the transaction to be corrected.

10. The method as claimed in claim 9, when a block that passes consensus is obtained, it is determined whether the trigger condition is met.

11. In the method as claimed in claim 9, the triggering conditions include one or more of the following: the voting results of the blockchain node on the data correction proposal meet the preset requirements, the current time meets the preset time conditions, the current block height of the blockchain reaches a preset value, and the account status of the specified account reaches a preset status.

12. The method of claim 1, wherein the data correction transaction further includes endorsement information of a regulatory agency, so that the data correction transaction is executed after the endorsement information is verified.

13. The method of claim 1, wherein the data correction transaction is initiated by an authorized user.

14. A system for correcting data in a blockchain, comprising: A transaction receiving module, used to receive a data correction transaction, wherein the data correction transaction is used to request correction of a transaction that has been executed by the blockchain; A transaction execution module, used for writing the revised information of the transaction to be revised into the blockchain; Other transaction receiving module, used to receive other transactions; The correction processing module is used for processing the other transactions based on the correction information of the transaction to be corrected when the other transactions are associated with the transaction to be corrected.

15. A device for correcting data in a blockchain, comprising a processor, wherein the processor is used to execute the method for correcting data in a blockchain as described in any one of claims 1 to 13.

16. A computer-readable storage medium, wherein the storage medium stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the method for correcting data in a blockchain as described in any one of claims 1 to 13.