WO2021197092A1 - Deposit certificate and recovery of balance of blockchain account - Google Patents

Deposit certificate and recovery of balance of blockchain account Download PDF

Info

Publication number
WO2021197092A1
WO2021197092A1 PCT/CN2021/081720 CN2021081720W WO2021197092A1 WO 2021197092 A1 WO2021197092 A1 WO 2021197092A1 CN 2021081720 W CN2021081720 W CN 2021081720W WO 2021197092 A1 WO2021197092 A1 WO 2021197092A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
encrypted
time
transaction
user
Prior art date
Application number
PCT/CN2021/081720
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 WO2021197092A1 publication Critical patent/WO2021197092A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • G06Q20/102Bill distribution or payments

Definitions

  • One or more implementations of this specification relate to the field of blockchain technology, and in particular to the deposit and recovery of a blockchain account balance.
  • account balance information on the blockchain can be stored in an encrypted privacy state.
  • Specific encryption methods can include homomorphic encryption, so that blockchain accounts can be chained in an encrypted privacy state. Up-transfer transactions; each blockchain user can keep the encryption or decryption parameters related to his own account balance in the local database (or private database) under the corresponding node device or the client's chain, so as to facilitate the knowledge of their own chain at any time The plain text corresponding to the account balance.
  • the localized stored plaintext of the account balance and the encryption or decryption parameters related to the account balance are easy to be deleted, modified, or lost when the node device or client system fails or the storage medium is damaged.
  • Blockchain users will find it difficult to know the plaintext corresponding to the account balance on their own chain.
  • one or more embodiments of this specification provide a deposit certificate, recovery method, device, and computer equipment of a blockchain account balance.
  • one or more implementations of this specification provide a method for depositing a blockchain account balance.
  • the account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm.
  • the method includes: a node device of the blockchain receives a deposit certificate transaction sent by a blockchain user client based on a preset sending cycle; the deposit certificate transaction includes the current block height and the current recovery parameter; wherein, all The block height at the time is the block height at the time when the attestation transaction is constructed, and the at the time recovery parameter is a value stored locally by the client and available to the blockchain user at the time at which the attestation transaction is constructed.
  • the plaintext of the encrypted account balance is restored with multiple parameters, and at least some of the parameters of the restored parameters at the time are encrypted; the deposit certificate transaction is published to the blockchain, so that the blockchain can pair Consensus processing is performed on the deposit transaction; when the deposit transaction consensus is passed, the deposit transaction is stored in the distributed ledger of the blockchain, and the current block height and the current recovery parameters are correspondingly updated In the state database of the blockchain users.
  • the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
  • the first encryption algorithm is a homomorphic encryption algorithm
  • the current random number is an encrypted random number corresponding to the encrypted account balance at the construction time
  • the blockchain user The transfer amount of the related transfer transaction is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the blockchain user’s
  • the key encryption related to the public key is a homomorphic encryption algorithm
  • this specification also provides a method for restoring the balance of a blockchain account.
  • the account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm, and the method includes:
  • the block chain user client sends a deposit transaction to the node device of the blockchain based on the preset sending cycle, so that after the deposit transaction is passed by consensus, the current block height and the current block height included in the deposit transaction are restored.
  • the parameters are correspondingly updated in the state database of the blockchain account; wherein, the current block height is the block height of the blockchain synchronized by the client at the time the deposit transaction is constructed, and the current recovery
  • the parameters are multiple parameters that are stored locally by the client and can restore the plaintext of the encrypted account balance of the blockchain user at the time of the construction of the deposit transaction, and at least the restored parameters at that time Part of the parameters are encrypted; obtain the latest current recovery parameters and the latest current block height corresponding to the latest construction time of the deposit transaction in the state database of the blockchain account; decrypt at least part of the latest current recovery parameters Parameters, and obtain the plaintext of the encrypted account balance at the latest construction time based on the latest recovery parameters obtained by decryption; After the beginning of the block, based on the transfer transaction related to the blockchain user stored on the blockchain, the plaintext of the current account balance of the blockchain user is restored.
  • the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plain text of the encrypted account balance at the time of construction of the deposit certificate transaction; wherein the plain text of the random number at the time and the account balance at the time of construction are encrypted.
  • the first encryption algorithm is a homomorphic encryption algorithm
  • the current random number is a random number used when homomorphically encrypting the encrypted account balance at the construction time
  • the transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as an encryption factor, and the transfer amount and the transfer amount random number are combined with the The key encryption related to the public key of the blockchain user;
  • the plaintext based on the encrypted account balance at the latest construction time starts from the height of the latest current block and is based on the stored on the blockchain
  • recovering the plaintext of the current account balance of the blockchain user includes: the plaintext of the encrypted account balance based on the latest construction time, from the latest At the beginning of the block after the block height at that time, the key related to the private key of the blockchain user is used to decrypt the transfer transactions related to the blockchain user one by one to obtain the transfer amount and the transfer amount of the transfer transaction one by one.
  • Transfer amount random number based on the transfer amount
  • this specification also provides a device for depositing blockchain account balances.
  • the account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm.
  • the device is applied to
  • the node equipment of the block chain includes: a receiving unit that receives a deposit certificate transaction sent by a blockchain user client based on a preset sending cycle; the deposit certificate transaction includes the current block height and the current recovery parameter; wherein, the The block height at that time is the block height at the time when the attestation transaction is constructed, and the at that time recovery parameters are stored locally by the client and can be used by the blockchain user at the time when the attestation transaction is constructed.
  • the clear text of the encrypted account balance is used to restore multiple parameters, and at least part of the parameters of the restored parameters at that time are encrypted; the issuing unit publishes the deposit certificate transaction to the blockchain, so that the block The chain performs consensus processing on the deposit transaction; the storage unit, when the deposit transaction consensus is passed, stores the deposit transaction in the distributed ledger of the blockchain, and combines the current block height and At that time, the recovery parameters are correspondingly updated in the state database of the blockchain user.
  • the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
  • the first encryption algorithm is a homomorphic encryption algorithm
  • the current random number is an encrypted random number corresponding to the encrypted account balance at the construction time
  • the blockchain user The transfer amount of the related transfer transaction is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the blockchain user’s
  • the key encryption related to the public key is a homomorphic encryption algorithm
  • this specification also provides a device for restoring the balance of a blockchain account.
  • the account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm.
  • the device is used in the district.
  • the blockchain user client includes: a sending unit, which sends a deposit transaction to the node device of the blockchain based on a preset sending cycle, so that after the deposit transaction is passed by consensus, the deposit transaction includes the current
  • the block height and the recovery parameters at the time are correspondingly updated in the state database of the blockchain account; wherein the current block height is the block at the time of the construction of the deposit transaction on the blockchain synchronized by the client Height, the recovery parameters at that time are multiple parameters stored locally by the client that can recover the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit transaction, and all At least part of the parameters of the restoration parameters at the time are encrypted;
  • an obtaining unit obtains the latest restoration parameters and the latest current block height corresponding to the latest construction time of the deposit transaction in the state database of the blockchain
  • the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
  • the first encryption algorithm is a homomorphic encryption algorithm
  • the current random number is a random number used when homomorphically encrypting the encrypted account balance at the construction time
  • the transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as an encryption factor, and the transfer amount and the transfer amount random number are combined with the The key encryption related to the public key of the blockchain user;
  • the decryption and recovery unit is further based on the plaintext of the encrypted account balance at the latest construction time, starting from the block after the latest current block height , Using the key related to the private key of the blockchain user to decrypt the transfer transactions related to the blockchain user one by one to obtain the transfer amount and the transfer amount random number of the transfer transaction one by one; based on the transfer The transfer amount and the transfer amount random number of the transaction are restored one by one in the plaintext of the account balance of the blockchain user corresponding to the transfer transaction, until the plaintext of the current account balance of the blockchain user is recovered.
  • this specification also provides a computer device, including: a memory and a processor; the memory stores a computer program that can be run by the processor; when the processor runs the computer program, it executes as described above
  • the blockchain account balance deposit method implemented by the node device described in each embodiment is not limited to: a processor and a processor; the memory stores a computer program that can be run by the processor; when the processor runs the computer program, it executes as described above
  • the blockchain account balance deposit method implemented by the node device described in each embodiment.
  • This specification also provides a computer device, including: a memory and a processor; the memory stores a computer program that can be run by the processor; when the processor runs the computer program, it executes the above-mentioned embodiments The described method for restoring the balance of the blockchain account executed by the client.
  • the blockchain account balance deposit certificate, recovery method, device, and computer equipment provided by the various embodiments of this specification.
  • the client can send deposit certificates to the node devices of the blockchain based on a preset sending cycle.
  • Transaction so that the current block height and recovery parameters included in the deposit transaction are updated in the state database of the blockchain account correspondingly, and the anti-tampering mechanism based on the blockchain is the above-mentioned current block height and the current recovery Parameter deposit;
  • the client starts from the latest current block height of the above-mentioned deposit transaction certificate, for transfer transactions on blocks after the above-mentioned latest current block height, the clear text of the client user’s blockchain account balance is Perform recovery outside the chain until it catches up with the current block height of the blockchain, and obtain the clear text of the current account balance of the client user; compared to the initial value of the account balance and the genesis block, all blocks are combined with
  • the method for restoring the account balance greatly reduces the processing time and
  • FIG. 1 is a schematic flowchart of a method for depositing and recovering a blockchain account balance according to an exemplary embodiment
  • FIG. 2 is a schematic diagram of the process of depositing and restoring a homomorphic encrypted blockchain account balance provided by an exemplary embodiment
  • FIG. 3 is a schematic diagram of an account balance deposit certification device applied to a blockchain on a node device side according to an exemplary embodiment
  • FIG. 4 is a schematic diagram of an account balance recovery device applied to a client's blockchain according to an exemplary embodiment
  • Fig. 5 is a hardware structure diagram of the implementation of the device for depositing or restoring the account balance provided in this specification.
  • the steps of the corresponding method are not necessarily executed in the order shown and described in this specification.
  • the method may include more or fewer steps than described in this specification.
  • a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. describe.
  • the blockchain or blockchain network described in one or more embodiments of this specification can specifically refer to a P2P network system with a distributed data storage structure reached by each node device through a consensus mechanism.
  • Ledger data is distributed in time-connected "blocks".
  • the next block can contain the data summary of the previous block and is based on the specific consensus mechanism (such as POW, POS, DPOS or PBFT, etc.) )
  • the ledger data in the above-mentioned block chain can be stored in the block in a transaction format.
  • the node device or client of the blockchain can construct the real data generated by the physical world into a standard transaction format supported by the blockchain, and then publish it to the blockchain.
  • the nodes in the blockchain The device performs consensus processing on the received transaction, and after reaching a consensus, the node device as the accounting node in the blockchain will package the transaction into a block and store it persistently in the block of the blockchain. certificate.
  • the blockchain In order to easily obtain the current value of the ledger data, the blockchain also sets up a state database (or world state) to store the current value of the ledger data, eliminating the need for node devices to traverse the entire blockchain to calculate the current value of the ledger data
  • the value of the state can be read directly from the state database.
  • each node device can update its current value in the state database according to the data in the above transaction.
  • the data included in the distributed database of the blockchain will not be attacked or tampered with, and even if some node devices have a system failure or the storage medium is damaged, because other node devices have stored the global blockchain Data, some of the above-mentioned node devices can still recover global blockchain data from other node devices, thereby ensuring the authenticity of the data information stored in the distributed database of the blockchain.
  • Example types of blockchain networks may include public blockchain networks, private blockchain networks, and consortium blockchain networks. Although the term blockchain is usually associated with cryptocurrency networks, the blockchain used in this article can refer to DLS (Distributed Ledger System) that does not refer to any specific use case.
  • DLS Distributed Ledger System
  • the consensus process is controlled by the nodes of the consensus network.
  • the public blockchain network can be considered as a public network relative to the participating entities.
  • public blockchain networks support public transactions. Public transactions are shared with all nodes in the public blockchain network and stored in the global blockchain.
  • the global blockchain is a blockchain that replicates across all nodes. In other words, for the global blockchain, all nodes are in a completely consistent state.
  • consensus protocols include, but are not limited to, proof-of-work (POW).
  • private blockchain networks are provided to specific entities, and specific entities centrally control read and write permissions. This entity controls which nodes can participate in the blockchain network. Therefore, a private blockchain network is often referred to as a permissioned network, which imposes restrictions on who is allowed to participate in the network and its level of participation (for example, only in certain transactions).
  • Various types of access control mechanisms can be used (for example, existing participants vote to add new entities, and regulators can control access).
  • the alliance blockchain network is private among participating entities.
  • the consensus process is controlled by an authorized group of nodes (consortium member nodes), and one or more nodes are operated by corresponding entities (for example, enterprises).
  • entities for example, enterprises
  • a consortium consisting of ten (10) entities e.g., enterprises
  • each entity operates at least one node in the consortium blockchain network. Therefore, in terms of participating entities, the consortium blockchain network can be considered a private network.
  • each entity (node) must sign each block in order to make the block valid and add the valid block to the blockchain.
  • at least a subset of entities (nodes) e.g., at least 7 entities
  • the state database (or "world state”) of the blockchain can set up corresponding user accounts for different blockchain users to store state information such as the account balance of the blockchain users.
  • account balance information on the blockchain can be stored in an encrypted privacy state.
  • Specific encryption methods can include homomorphic encryption, so that blockchain accounts can be chained in an encrypted privacy state. Up-transfer transactions; each blockchain user can keep the encryption or decryption parameters related to his own account balance in the local database (or private database) under the corresponding node device or the client's chain, so as to facilitate the knowledge of their own chain at any time The plain text corresponding to the account balance.
  • the localized stored plaintext of the account balance and the encryption or decryption parameters related to the account balance are easy to be deleted, modified, or lost when the node device or client system fails or the storage medium is damaged.
  • Blockchain users will find it difficult to know the plaintext corresponding to the account balance on their own chain.
  • one or more implementations of this specification provide a method for depositing and restoring the balance of a blockchain account for blockchain users to restore the plaintext corresponding to their account balance based on the client where they are located.
  • blockchain client described in one or more implementations provided in this specification can be an independent device connected to the node device of the blockchain, or it can be integrated inside the node device. Functional plug-in, this is not limited.
  • an important concept is Account; taking Ethereum as an example, Ethereum usually divides accounts into external accounts and contract accounts; external accounts are accounts directly controlled by users; and contracts An account is created by a user through an external account, and an account containing contract code (ie, a smart contract).
  • the user account described in this specification may include the above-mentioned external account or contract account.
  • the account types supported by the blockchain can also be further extended, which is not particularly limited in this specification.
  • a structure is usually used to maintain the account status of the account.
  • the state of the account related to the transaction in the blockchain will usually change.
  • the structure of an account usually includes fields such as Balance, Nonce, Code, and Storage.
  • the Balance field is used to maintain the current account balance of the account. Since the account balance is information related to user privacy, some blockchains will use encryption to process the account balance on the blockchain.
  • Figure 1 illustrates the process steps of a method for depositing and restoring a blockchain account balance provided by an exemplary embodiment of this specification.
  • the account balances of user accounts stored on the above-mentioned blockchain are all encrypted using the first encryption algorithm. deal with.
  • Step 102 The blockchain client sends a certificate deposit transaction to the node device of the blockchain based on a preset sending cycle, and the certificate deposit transaction includes the current block height and the current recovery parameter; wherein, the current block The height is the block height of the block chain synchronized by the client at the moment the deposit transaction is constructed, and the recovery parameters at that time are stored locally by the client and available to the blockchain users in the deposit.
  • the encrypted account balance at the time of construction of the certificate transaction is restored with multiple parameters, and at least part of the restored parameters are encrypted.
  • the “local storage” mentioned in this specification refers to the private storage off-chain relative to the on-chain storage of the blockchain (which may include block ledgers and state databases).
  • the encrypted account balance of the blockchain users is correspondingly continuously updated in the state database stored on the client.
  • the blockchain client can save the recovery parameters at the time in the local storage (private storage under the chain), which is used to restore the plaintext of the encrypted account balance of the above-mentioned blockchain user on the blockchain at the time the deposit transaction is constructed. Or decrypt the encrypted account balance on the blockchain of the blockchain user who logs in to the client to obtain the corresponding plaintext.
  • the blockchain client at least stores the on-chain account information of the blockchain users who log in to the above client (the account information includes the encrypted account balance), and updates the blockchain as the blockchain status database is updated User's on-chain account information. Based on the preset sending cycle, the client periodically sends the deposit transaction to the node device connected to it to deposit the current block height at the time of deposit transaction construction and the current recovery parameters of the plaintext of the encrypted account balance to the block. On the chain.
  • the block height on the client terminal may be different from the block height synchronized by the node device at the time of the construction of the above-mentioned deposit transaction, the above-mentioned block height at that time and the recovery parameters at the time are all based on the blockchain information synchronized on the client. Generated.
  • the above-mentioned blockchain client can periodically go to multiple preset locations in the memory to read the content of each parameter included in the recovery parameter at the time, based on the read recovery parameters at the time. Parameter construction of deposit transaction.
  • the content of the recovery parameters at the time and the height of the current block are stored by the blockchain client, and the client can periodically obtain the information including the recovery parameters at the time and the height of the current block based on a preset sending cycle. Based on the storage snapshot of the storage snapshot, the above-mentioned attestation transaction is constructed.
  • At least part of the parameters of the recovery parameter are encrypted.
  • the account balance of the user account stored on the above-mentioned blockchain is encrypted using the first encryption algorithm, and the random number is used as the encryption factor;
  • the above-mentioned recovery parameters at the time may include the current random number corresponding to the encrypted account balance at the time the deposit transaction is constructed, and the blockchain
  • the above-mentioned client should at least encrypt the above-mentioned random number at that time.
  • the client can encrypt the latest current random number based on its own public key, or the client can encrypt the latest current random number based on a password key.
  • the specific encryption method is not limited in this embodiment. .
  • the account balance of the user account stored on the above-mentioned blockchain is encrypted using the first encryption algorithm, and the random number is used as the encryption factor;
  • the above-mentioned recovery parameters at the time may include the current random number corresponding to the encrypted account balance at the time the deposit transaction is constructed, and the blockchain
  • the plaintext should be encrypted.
  • This embodiment does not limit the specific encryption method of the client to the plaintext of the random number and account balance included in the recovery parameter at that time, and the client can encrypt the plaintext of the random number and account balance included in the recovery parameter at the time.
  • the same encryption method is used for encryption, and different encryption methods can also be used for encryption, which is not limited here.
  • Step 104 The node device of the blockchain receives the certificate deposit transaction and publishes the certificate deposit transaction to the blockchain, so that the blockchain performs consensus processing on the certificate deposit transaction.
  • the consensus algorithms supported in the blockchain can include: the first type of consensus algorithm, that is, the consensus algorithm that node devices need to compete for the accounting right of each round of accounting cycle; for example, Proof of Work (POW) ), Proof of Stake (POS), Delegated Proof of Stake (DPOS) and other consensus algorithms; the second type of consensus algorithm, that is, pre-election of accounting nodes for each round of accounting cycle (no need to compete Accounting rights) consensus algorithms; for example, practical Byzantine Fault Tolerance (PBFT) and other consensus algorithms.
  • the first type of consensus algorithm that is, the consensus algorithm that node devices need to compete for the accounting right of each round of accounting cycle
  • POW Proof of Work
  • POS Proof of Stake
  • DPOS Delegated Proof of Stake
  • PBFT Practical Byzantine Fault Tolerance
  • all node devices that compete for the right to keep accounts can execute the transaction after receiving the transaction.
  • the node devices that compete for the right to bookkeeping one node device may win this round of contention for the right to bookkeeping and become the bookkeeping node.
  • the accounting node can package the received transaction with other transactions to generate the latest block, and send the generated latest block or the block header of the latest block to other node devices for consensus.
  • the node device with the right to book accounts has been agreed before this round of bookkeeping. Therefore, after the node device receives the transaction, if it is not the accounting node of this round, it can send the transaction to the accounting node.
  • the transaction can be executed during or before the process of packaging the transaction with other transactions to generate the latest block.
  • the accounting node After the accounting node generates the latest block, it can send the latest block or the block header of the latest block to other node devices for consensus.
  • the accounting node in this round can package the received transaction to generate the latest block, and the generated latest block or the latest block
  • the header of the block is sent to other node devices for consensus verification. If other node equipment receives the latest block or the block header of the latest block, it is verified that there is no problem, and the latest block can be appended to the end of the original blockchain to complete the accounting process of the blockchain. In the process of other nodes verifying the new block or block header sent by the accounting node, the transactions contained in the block can also be executed.
  • Step 106 When the deposit transaction consensus is passed, the node device stores the deposit transaction in the distributed ledger of the blockchain, and updates the current block height and the current recovery parameters in the corresponding State database of blockchain users.
  • This embodiment does not limit the storage location of the block height at the time and the recovery parameters at the time in the state database of the blockchain.
  • the content of blockchain user accounts can be expanded to The current block height and recovery parameters at the time when the above-mentioned deposit transaction was constructed are included.
  • a notification message can be returned to the above-mentioned client; and the client can determine whether the deposit transaction returned by the node device is received after the above-mentioned deposit transaction is published to the blockchain.
  • the notification message is passed, and after the notification message is received, the current block height and the recovery parameter at the time of the construction are correspondingly updated to the user's state database stored in the client.
  • the client When the above-mentioned client loses the locally stored plaintext of the current blockchain account balance due to possible reasons, or the recovery parameters of the plaintext of the current account balance, the user will not be able to know the current blockchain account.
  • the client can be based on the latest recovery parameters and the latest current block height corresponding to the latest construction time of the deposit transaction in the above-mentioned blockchain state database, and related to the user in the blockchain block
  • the transfer transaction is to restore the clear text of the current account balance (Balance) in the user account stored on the blockchain.
  • the specific process of recovery can include:
  • Step 108 The above-mentioned blockchain client obtains the latest recovery parameters and the latest current block height corresponding to the latest construction time of the deposit certificate transaction in the state database of the blockchain account.
  • the above-mentioned blockchain client can update the blockchain database synchronously, and obtain the latest recovery parameters and the latest current block height corresponding to the latest construction time of the deposit transaction from the updated state database of its own account.
  • step 110 the blockchain client decrypts at least part of the latest recovery parameters at the time, and obtains the plaintext of the encrypted account balance at the latest construction time based on the latest recovery parameters obtained from the decryption.
  • the account balance of the user account stored on the blockchain is encrypted using the first encryption algorithm, using a random number as an encryption factor, and the ciphertext of the account balance is known
  • the plaintext of the account balance can be calculated inversely based on the first encryption algorithm and the random number.
  • the above-mentioned latest current recovery parameters may include the latest current random number corresponding to the encrypted account balance at the latest construction time of the deposit transaction, and the The encrypted account balance of the blockchain user at the latest construction time of the deposit certificate transaction, and the above-mentioned latest random number at that time is encrypted using an algorithm known to the client.
  • the client can encrypt the above-mentioned latest current random number based on its own public key, and accordingly, it should decrypt the latest current random number obtained from the blockchain based on its own private key.
  • the client can encrypt the latest current random number based on the password key, and accordingly, the latest current random number obtained from the blockchain should be decrypted based on the password key.
  • the client After decrypting and obtaining the above-mentioned latest current random number, the client can reversely calculate the encrypted account balance corresponding to the encrypted account balance based on the above-mentioned latest current random number and the encrypted account balance at the latest construction time of the deposit certificate transaction.
  • the account balance of the user account stored on the above-mentioned blockchain is encrypted using the first encryption algorithm, and the random number is used as the encryption factor;
  • the above-mentioned latest current recovery parameters may include the latest current random number corresponding to the encrypted account balance at the latest construction time of the deposit transaction, and the The plaintext corresponding to the encrypted account balance of the blockchain user at the latest construction time of the deposit transaction; in order to protect the privacy of the user account balance on the blockchain, the latest current random number and the latest construction time
  • the plaintext of the encrypted account balance should be encrypted.
  • the client can obtain the latest current random number included in the latest current recovery parameter and the plaintext of the account balance corresponding to the encrypted account balance at the latest construction time through decryption.
  • Step 112 Based on the plaintext of the account balance corresponding to the encrypted account balance at the latest construction time, starting from the height of the latest current block, based on the information stored on the blockchain related to the blockchain user In the transfer transaction, the plaintext of the current account balance of the blockchain user is restored.
  • the client terminal can start from the latest current block height of the above-mentioned deposit certificate transaction certificate.
  • the client user For transfer transactions on the above-mentioned latest current block height and subsequent blocks, the client user’s blockchain
  • the clear text of the account balance is restored off-chain until it catches up with the current block height of the blockchain, and the clear text of the current account balance of the client user is obtained; compared to starting from the initial value of the account balance and the genesis block,
  • the method for restoring the account balance provided by this embodiment greatly reduces the processing time and the amount of calculation.
  • this specification takes the account balance of the blockchain encrypted using a homomorphic encryption algorithm as an example to describe in detail the method of restoring the account balance of the blockchain user based on the method described in one or more of the above embodiments step.
  • the on-chain account balance of blockchain user A is encrypted using a homomorphic encryption algorithm:
  • X is the plaintext amount of the balance
  • R is a random number
  • G and H are the global public parameters of the homomorphic encryption algorithm
  • PC is the ciphertext of the balance after homomorphic encryption.
  • User A's client terminal locally stores the balance plaintext X and random number R corresponding to the PC value of his account balance.
  • the method for depositing and restoring the blockchain balance described in this embodiment includes:
  • Step 201 The user A client sends a deposit certificate transaction to the node device of the blockchain based on a preset sending cycle.
  • the deposit transaction includes the current block of the blockchain synchronized by the user A client at the time the deposit transaction is constructed. Height h, and multiple parameters stored locally by the client that can restore the encrypted plaintext of the account balance of the blockchain user at the time of the construction of the deposit certificate transaction: the plaintext X of the account balance and At that time, the random number R, and the above X and R are all encrypted.
  • the recovery parameters for recovering the plaintext of the encrypted account balance may include the above X And R value; calculate the PC value through the forward encryption of X and R, and verify whether the obtained PC value is the same as the encrypted account balance in the user account on the chain, and it can be verified whether the above plaintext X is the same as that on the chain Corresponding to the encrypted account balance in the user account, thereby recovering the correct plaintext X.
  • step 202 the above-mentioned node device publishes the certificate deposit transaction to the blockchain, so that the blockchain performs consensus processing on the deposit transaction; when the deposit transaction consensus is passed, the deposit transaction
  • the certificate transaction is stored in the distributed ledger of the blockchain, and the current block height h and the current recovery parameters (X, R) are correspondingly updated in the state database of the blockchain user.
  • the client can synchronize the contents of the client user's state database to the client memory, and store the encrypted data of the user account on the blockchain in the client's local database (private database under the chain) The plain text X'and the encrypted random number R'corresponding to the account balance PC'.
  • the above client may experience system failure or hardware damage, and its locally stored plaintext X'and encrypted random number R'corresponding to the encrypted account balance PC' of the user account on the blockchain are lost, and the above client It is impossible to know the account balance X'of the user's blockchain account at this time.
  • the client can perform the following steps:
  • Step 203 Obtain the latest current recovery parameters (X 0 , R 0 ) and the latest current block height h 0 corresponding to the latest construction time t 0 of the deposit certificate transaction in the state database of the blockchain account;
  • Step 204 Decrypt X 0 and R 0 in the latest recovery parameters at the time to obtain the plaintext X 0 of the encrypted account balance at the latest construction time;
  • Step 205 based on the plaintext X 0 of the encrypted account balance at the latest construction time, starting from the block after the latest current block height, based on the data stored on the blockchain and the blockchain For user-related transfer transactions, recover the plaintext of the current account balance of the blockchain user:
  • the plaintext of the account balance of the blockchain user A is X 0
  • the corresponding encrypted random number is R 0
  • the account balance PC 0 (X 0 , R 0 ) G ⁇ X 0 *H ⁇ R 0 ;
  • transaction 1 is a transfer transaction in which user A transfers x 1 to user B.
  • the client uses the keys related to user A's private key to decrypt encypt(x 1 ) and encrypt(r 1 ) respectively to obtain the transfer amount x 1 and the transfer random number r 1 , and based on the homomorphic characteristics of the homomorphic encryption algorithm,
  • the plaintext X 01 and the random number R 01 of the account balance of user A after transaction 1 In order to obtain the ciphertext PC 01 , the plaintext X 01 and the random number R 01 of the account balance of user A after transaction 1:
  • PC 01 PC 0 -PC 1 ;
  • R 01 R 0 -r 1 .
  • Transaction 2 is a transfer transaction in which user C transfers x 2 to user A.
  • the client uses the keys related to user A's private key to decrypt encypt(x 2 ) and encrypt(r 2 ) respectively to obtain the transfer amount x 2 and the transfer random number r 2 , and based on the homomorphic characteristics of the homomorphic encryption algorithm, In order to obtain the ciphertext PC 12 , the plaintext X 12 and the random number R 12 of the account balance of user A after transaction 2:
  • PC 12 PC 01 +PC 2 ;
  • R 12 R 01+ r 2 .
  • the transfer transaction related to user A is obtained, and the encrypted transfer amount and the encrypted transfer amount in the transfer transaction related to the user A are decrypted using the key related to the private key of the blockchain user Transfer random numbers; thus, based on the homomorphic characteristics of the homomorphic encryption algorithm, the ciphertext, plaintext and corresponding random numbers of the current account balance of the blockchain user are restored: PC', X', and R'.
  • the client can recover the plaintext X'and random number R'of the account balance that matches the current highest block of the blockchain, and then based on The above-mentioned plain text X', random number R', and the transfer transactions that are continuously and newly included on the chain are updated with the recovery parameters stored locally.
  • the embodiment of this specification also provides a deposit certificate device 30 for a blockchain account balance and a recovery device 40 for a blockchain account balance.
  • the devices 30 and 40 can be implemented by software, or can be implemented by hardware or a combination of software and hardware. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions into the memory by the CPU (Central Process Unit, central processing unit) of the device where it is located. From the perspective of hardware, in addition to the CPU, memory, and storage shown in Figure 5, the device where the above-mentioned device is located usually also includes other hardware such as chips for wireless signal transmission and reception, and/or for implementing network communication functions. Other hardware such as boards.
  • this specification also provides a device 30 for depositing a blockchain account balance.
  • the account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm.
  • the device 30 is applied to the node equipment of the blockchain and includes: a receiving unit 302, which receives a deposit transaction sent by a blockchain user client based on a preset sending cycle; the deposit transaction includes the current block height and the current recovery Parameters; wherein, the block height at the time is the block height at the time of construction of the deposit certificate transaction, and the recovery parameters at that time are stored locally by the client and can be used by the blockchain user in the deposit certificate
  • the multiple parameters of the encrypted account balance at the time of construction of the transaction are restored in plaintext, and at least some of the parameters of the restored parameters at that time are encrypted;
  • the issuing unit 304 publishes the deposit certificate transaction to the blockchain , So that the blockchain performs consensus processing on the deposit transaction; the storage unit 306, when the deposit transaction consensus is passed, store the deposit transaction in the distributed ledger of the blockchain, and The
  • the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
  • the first encryption algorithm is a homomorphic encryption algorithm
  • the current random number is an encrypted random number corresponding to the encrypted account balance at the construction time
  • the blockchain user The transfer amount of the related transfer transaction is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the blockchain user’s
  • the key encryption related to the public key is a homomorphic encryption algorithm
  • this specification also provides a device 40 for restoring the balance of a blockchain account.
  • the account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm.
  • the device 40 is applied to a blockchain user client and includes a sending unit 402, which sends a deposit transaction to a node device of the blockchain based on a preset sending period, so that after the deposit transaction is passed by consensus, the The current block height and the current recovery parameters included in the deposit certificate transaction are correspondingly updated in the state database of the blockchain account; wherein, the current block height is that the block chain synchronized by the client is in the deposit certificate
  • the block height at the time of transaction construction, and the restoration parameters at that time are stored locally by the client and can restore the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit transaction Multiple parameters, and at least part of the recovery parameters at the time are encrypted; the acquiring unit 404 acquires the latest recovery parameters and the latest recovery parameters corresponding to the latest construction time of the deposit transaction in the state database of the blockchain account
  • the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
  • the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
  • the first encryption algorithm is a homomorphic encryption algorithm
  • the current random number is a random number used when homomorphically encrypting the encrypted account balance at the construction time
  • the transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as an encryption factor, and the transfer amount and the transfer amount random number are combined with the The key encryption related to the public key of the blockchain user;
  • the decryption and recovery unit is further based on the plaintext of the encrypted account balance at the latest construction time, starting from the block after the latest current block height , Using the key related to the private key of the blockchain user to decrypt the transfer transactions related to the blockchain user one by one to obtain the transfer amount and the transfer amount random number of the transfer transaction one by one; based on the transfer The transfer amount and the transfer amount random number of the transaction are restored one by one in the plaintext of the account balance of the blockchain user corresponding to the transfer transaction, until the plaintext of the current account balance of the blockchain user is recovered.
  • the device implementations described above are merely illustrative, where the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical modules, that is, they may be located in One place, or it can be distributed to multiple network modules. Some or all of the units or modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement it without creative work.
  • a typical implementation device is a computer.
  • the specific form of the computer can 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 receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
  • the embodiments of this specification also provide a computer device.
  • the computer device includes a memory and a processor.
  • the memory stores a computer program that can be run by the processor; when the processor runs the stored computer program, it executes each step of the blockchain account balance deposit method executed by the node device in the embodiment of this specification. Please refer to the previous content for a detailed description of each step of the blockchain account balance deposit method executed by the above node device, and will not be repeated.
  • the embodiments of this specification also provide a computer device.
  • the computer device includes a memory and a processor.
  • the memory stores a computer program that can be run by the processor; when the processor runs the stored computer program, it executes each of the blockchain account balance recovery methods executed by the blockchain client in the embodiment of this specification. step. Please refer to the previous content for a detailed description of each step of the method for restoring the balance of the blockchain account executed by the blockchain client, and will not be repeated.
  • the computing device 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 in computer readable media, random access memory (RAM) and/or non-volatile memory, 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 memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • Information can be computer-readable instructions, data structures, program modules, 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 technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • CD-ROM compact disc
  • DVD digital versatile disc
  • Magnetic cassettes magnetic tape magnetic disk storage or other magnetic storage devices or any other non
  • the implementation of this specification can be provided as a method, a system or a computer program product. Therefore, the implementation manners in this specification may adopt the form of a complete hardware implementation, a complete software implementation, or a combination of software and hardware implementations. Moreover, the implementation of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. .

Abstract

Provided are a method and apparatus for deposit certificate and recovery of the balance of a blockchain account. The method comprises: a blockchain user client sending a deposit certificate transaction to a node device of a blockchain on the basis of a preset sending period so as to correspondingly update, in a state database of a blockchain account, the current block height and the current recovery parameters comprised in the deposit certificate transaction; acquiring the latest current recovery parameters and the latest current block height corresponding to the latest construction moment of the deposit certificate transaction; decrypting at least some of the latest current recovery parameters, and obtaining, on the basis of the latest current recovery parameters obtained by decryption, plaintext of an account balance encrypted at the latest construction moment; and on the basis of the plaintext of the account balance encrypted at the latest construction moment, starting from a block after the latest current block height, and recovering the plaintext of the current account balance of a blockchain user on the basis of a transfer transaction that is stored in the blockchain and related to the blockchain user.

Description

区块链账户余额的存证、恢复Deposit and recovery of blockchain account balance 技术领域Technical field
本说明书一个或多个实施方式涉及区块链技术领域,尤其涉及一种区块链账户余额的存证、恢复。One or more implementations of this specification relate to the field of blockchain technology, and in particular to the deposit and recovery of a blockchain account balance.
背景技术Background technique
为保护用户的数据隐私,区块链上的账户余额信息可以被加密的隐私状态存储,具体的加密方式可以包括同态加密等,以使区块链账户可以在被加密的隐私状态下进行链上转账交易;各区块链用户可在相应的节点设备或客户端的链下的本地数据库(或称为私有数据库)中保管与自身账户余额相关的加密或解密参数,以方便随时获知自身链上的账户余额对应的明文。In order to protect users’ data privacy, account balance information on the blockchain can be stored in an encrypted privacy state. Specific encryption methods can include homomorphic encryption, so that blockchain accounts can be chained in an encrypted privacy state. Up-transfer transactions; each blockchain user can keep the encryption or decryption parameters related to his own account balance in the local database (or private database) under the corresponding node device or the client's chain, so as to facilitate the knowledge of their own chain at any time The plain text corresponding to the account balance.
然而,本地化存储的上述账户余额的明文、与账户余额相关的加密或解密参数,易被删除、修改,或在遇到节点设备或客户端系统失效、存储介质损坏时发生丢失,此时,区块链用户将很难获知自身链上的账户余额所对应的明文。However, the localized stored plaintext of the account balance and the encryption or decryption parameters related to the account balance are easy to be deleted, modified, or lost when the node device or client system fails or the storage medium is damaged. At this time, Blockchain users will find it difficult to know the plaintext corresponding to the account balance on their own chain.
发明内容Summary of the invention
有鉴于此,本说明书一个或多个实施方式提供一种区块链账户余额的存证、恢复方法、装置和计算机设备。In view of this, one or more embodiments of this specification provide a deposit certificate, recovery method, device, and computer equipment of a blockchain account balance.
为实现上述目的,本说明书一个或多个实施方式提供了一种区块链账户余额的存证方法,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述方法包括:区块链的节点设备接收区块链用户客户端基于预设的发送周期发送的存证交易;所述存证交易包括当时区块高度和当时恢复参数;其中,所述当时区块高度为所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;将所述存证交易发布至所述区块链,以使所述区块链对所述存证交易进行共识处理;当所述存证交易共识通过,将所述存证交易存储至所述区块链的分布式账本,并将所述当时区块高度和当时恢复参数对应更新在所述区块链用户的状态数据库。In order to achieve the above objectives, one or more implementations of this specification provide a method for depositing a blockchain account balance. The account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm. Processing, the method includes: a node device of the blockchain receives a deposit certificate transaction sent by a blockchain user client based on a preset sending cycle; the deposit certificate transaction includes the current block height and the current recovery parameter; wherein, all The block height at the time is the block height at the time when the attestation transaction is constructed, and the at the time recovery parameter is a value stored locally by the client and available to the blockchain user at the time at which the attestation transaction is constructed. The plaintext of the encrypted account balance is restored with multiple parameters, and at least some of the parameters of the restored parameters at the time are encrypted; the deposit certificate transaction is published to the blockchain, so that the blockchain can pair Consensus processing is performed on the deposit transaction; when the deposit transaction consensus is passed, the deposit transaction is stored in the distributed ledger of the blockchain, and the current block height and the current recovery parameters are correspondingly updated In the state database of the blockchain users.
在又一示出的实施方式中,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。In another illustrated embodiment, the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的被加密的账户余额的明文被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
在又一示出的实施方式中,所述第一加密算法为同态加密算法,所述当时随机数为所述构建时刻的被加密的账户余额对应的加密随机数;所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密。In another embodiment shown, the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is an encrypted random number corresponding to the encrypted account balance at the construction time; the blockchain user The transfer amount of the related transfer transaction is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the blockchain user’s The key encryption related to the public key.
相应地,本说明书还提供了一种区块链账户余额的恢复方法,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述方法包括:区块链用户客户端基于预设的发送周期向区块链的节点设备发送存证交易,以使所述存证交易被共识通过后,将所述存证交易包括的当时区块高度和当时恢复参数对应更新在所述区块链账户的状态数据库中;其中,所述当时区块高度为所述客户端同步的区块链在所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;获取所述区块链账户的状态数据库中的与所述存证交易最新构建时刻对应的最新当时恢复参数和最新当时区块高度;解密所述最新当时恢复参数的至少部分参数,并基于解密所得的最新当时恢复参数获得所述最新构建时刻的被加密的账户余额的明文;基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文。Correspondingly, this specification also provides a method for restoring the balance of a blockchain account. The account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm, and the method includes: The block chain user client sends a deposit transaction to the node device of the blockchain based on the preset sending cycle, so that after the deposit transaction is passed by consensus, the current block height and the current block height included in the deposit transaction are restored. The parameters are correspondingly updated in the state database of the blockchain account; wherein, the current block height is the block height of the blockchain synchronized by the client at the time the deposit transaction is constructed, and the current recovery The parameters are multiple parameters that are stored locally by the client and can restore the plaintext of the encrypted account balance of the blockchain user at the time of the construction of the deposit transaction, and at least the restored parameters at that time Part of the parameters are encrypted; obtain the latest current recovery parameters and the latest current block height corresponding to the latest construction time of the deposit transaction in the state database of the blockchain account; decrypt at least part of the latest current recovery parameters Parameters, and obtain the plaintext of the encrypted account balance at the latest construction time based on the latest recovery parameters obtained by decryption; After the beginning of the block, based on the transfer transaction related to the blockchain user stored on the blockchain, the plaintext of the current account balance of the blockchain user is restored.
在又一示出的实施方式中,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。In another illustrated embodiment, the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的账户余额的明文被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plain text of the encrypted account balance at the time of construction of the deposit certificate transaction; wherein the plain text of the random number at the time and the account balance at the time of construction are encrypted.
在又一示出的实施方式中,所述第一加密算法为同态加密算法,所述当时随机数为对所述构建时刻的被加密的账户余额同态加密时所使用的随机数;所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密;所述基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文,包括:基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,使用与所述区块链用户的私钥相关的密钥逐个解密与所述区块链用户相关的转账交易,以逐个获得所述转账交易的转账金额和转账金额随机数;基于所述转账交易的转账金额和转账金额随机数,逐个恢复与所述转账交易对应的所述区块链用户的账户余额的明文,直至恢复得到所述区块链用户的当前的账户余额的明文。In another embodiment shown, the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is a random number used when homomorphically encrypting the encrypted account balance at the construction time; The transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as an encryption factor, and the transfer amount and the transfer amount random number are combined with the The key encryption related to the public key of the blockchain user; the plaintext based on the encrypted account balance at the latest construction time starts from the height of the latest current block and is based on the stored on the blockchain For transfer transactions related to the blockchain user, recovering the plaintext of the current account balance of the blockchain user includes: the plaintext of the encrypted account balance based on the latest construction time, from the latest At the beginning of the block after the block height at that time, the key related to the private key of the blockchain user is used to decrypt the transfer transactions related to the blockchain user one by one to obtain the transfer amount and the transfer amount of the transfer transaction one by one. Transfer amount random number; based on the transfer amount of the transfer transaction and the transfer amount random number, restore the plaintext of the blockchain user’s account balance corresponding to the transfer transaction one by one until the blockchain user’s account balance is recovered The clear text of the current account balance.
相应地,本说明书还提供了一种区块链账户余额的存证装置,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述装置应用于区块链的节点设备,包括:接收单元,接收区块链用户客户端基于预设的发送周期发送的存证交易;所述存证交易包括当时区块高度和当时恢复参数;其中,所述当时区块高度为所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述 区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;发布单元,将所述存证交易发布至所述区块链,以使所述区块链对所述存证交易进行共识处理;存储单元,当所述存证交易共识通过,将所述存证交易存储至所述区块链的分布式账本,并将所述当时区块高度和当时恢复参数对应更新在所述区块链用户的状态数据库。Correspondingly, this specification also provides a device for depositing blockchain account balances. The account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm. The device is applied to The node equipment of the block chain includes: a receiving unit that receives a deposit certificate transaction sent by a blockchain user client based on a preset sending cycle; the deposit certificate transaction includes the current block height and the current recovery parameter; wherein, the The block height at that time is the block height at the time when the attestation transaction is constructed, and the at that time recovery parameters are stored locally by the client and can be used by the blockchain user at the time when the attestation transaction is constructed. The clear text of the encrypted account balance is used to restore multiple parameters, and at least part of the parameters of the restored parameters at that time are encrypted; the issuing unit publishes the deposit certificate transaction to the blockchain, so that the block The chain performs consensus processing on the deposit transaction; the storage unit, when the deposit transaction consensus is passed, stores the deposit transaction in the distributed ledger of the blockchain, and combines the current block height and At that time, the recovery parameters are correspondingly updated in the state database of the blockchain user.
在又一示出的实施方式中,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。In another illustrated embodiment, the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的被加密的账户余额的明文被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
在又一示出的实施方式中,所述第一加密算法为同态加密算法,所述当时随机数为所述构建时刻的被加密的账户余额对应的加密随机数;所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密。In another embodiment shown, the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is an encrypted random number corresponding to the encrypted account balance at the construction time; the blockchain user The transfer amount of the related transfer transaction is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the blockchain user’s The key encryption related to the public key.
相应地,本说明书还提供了一种区块链账户余额的恢复装置,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述装置应用于区块链用户客户端,包括:发送单元,基于预设的发送周期向区块链的节点设备发送存证交易,以使所述存证交易被共识通过后,将所述存证交易包括的当时区块高度和当时恢复参数对应更新在所述区块链账户的状态数据库中;其中,所述当时区块高度为所述客户端同步的区块链在所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;获取单元,获取 所述区块链账户的状态数据库中的与所述存证交易最新构建时刻对应的最新当时恢复参数和最新当时区块高度;解密及恢复单元,解密所述最新当时恢复参数的至少部分参数,并基于解密所得的最新当时恢复参数获得所述最新构建时刻的被加密的账户余额的明文;基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文。Correspondingly, this specification also provides a device for restoring the balance of a blockchain account. The account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm. The device is used in the district. The blockchain user client includes: a sending unit, which sends a deposit transaction to the node device of the blockchain based on a preset sending cycle, so that after the deposit transaction is passed by consensus, the deposit transaction includes the current The block height and the recovery parameters at the time are correspondingly updated in the state database of the blockchain account; wherein the current block height is the block at the time of the construction of the deposit transaction on the blockchain synchronized by the client Height, the recovery parameters at that time are multiple parameters stored locally by the client that can recover the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit transaction, and all At least part of the parameters of the restoration parameters at the time are encrypted; an obtaining unit obtains the latest restoration parameters and the latest current block height corresponding to the latest construction time of the deposit transaction in the state database of the blockchain account; decryption And a recovery unit to decrypt at least part of the parameters of the latest recovery parameters at the time, and obtain the plaintext of the encrypted account balance at the latest construction time based on the latest recovery parameters obtained from the decryption; The clear text of the account balance, starting from the block after the latest current block height, based on the transfer transaction related to the blockchain user stored on the blockchain, recovering the blockchain user’s The clear text of the current account balance.
在又一示出的实施方式中,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。In another illustrated embodiment, the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的被加密的账户余额的明文被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
在又一示出的实施方式中,所述第一加密算法为同态加密算法,所述当时随机数为对所述构建时刻的被加密的账户余额同态加密时所使用的随机数;所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密;所述解密和恢复单元,进一步基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,使用与所述区块链用户的私钥相关的密钥逐个解密与所述区块链用户相关的转账交易,以逐个获得所述转账交易的转账金额和转账金额随机数;基于所述转账交易的转账金额和转账金额随机数,逐个恢复与所述转账交易对应的所述区块链用户的账户余额的明文,直至恢复得到所述区块链用户的当前的账户余额的明文。In another embodiment shown, the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is a random number used when homomorphically encrypting the encrypted account balance at the construction time; The transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as an encryption factor, and the transfer amount and the transfer amount random number are combined with the The key encryption related to the public key of the blockchain user; the decryption and recovery unit is further based on the plaintext of the encrypted account balance at the latest construction time, starting from the block after the latest current block height , Using the key related to the private key of the blockchain user to decrypt the transfer transactions related to the blockchain user one by one to obtain the transfer amount and the transfer amount random number of the transfer transaction one by one; based on the transfer The transfer amount and the transfer amount random number of the transaction are restored one by one in the plaintext of the account balance of the blockchain user corresponding to the transfer transaction, until the plaintext of the current account balance of the blockchain user is recovered.
相应地,本说明书还提供了一种计算机设备,包括:存储器和处理器;所述存储器 上存储有可由所述处理器运行的计算机程序;所述处理器运行所述计算机程序时,执行如上述各实施方式所述的、节点设备所执行的区块链账户余额存证方法。Correspondingly, this specification also provides a computer device, including: a memory and a processor; the memory stores a computer program that can be run by the processor; when the processor runs the computer program, it executes as described above The blockchain account balance deposit method implemented by the node device described in each embodiment.
本说明书还提供了一种计算机设备,包括:存储器和处理器;所述存储器上存储有可由所述处理器运行的计算机程序;所述处理器运行所述计算机程序时,执行如上述各实施方式所述的、客户端所执行的区块链账户余额的恢复方法。This specification also provides a computer device, including: a memory and a processor; the memory stores a computer program that can be run by the processor; when the processor runs the computer program, it executes the above-mentioned embodiments The described method for restoring the balance of the blockchain account executed by the client.
本说明书各个实施方式提供的区块链的账户余额存证、恢复方法、装置和计算机设备在本实施方式中,客户端可基于预设的发送周期向所述区块链的节点设备发送存证交易,以使所述存证交易包括的当时区块高度和当时恢复参数对应更新在所述区块链账户的状态数据库中,基于区块链的防篡改机制为上述当时区块高度和当时恢复参数存证;客户端从上述存证交易存证的最新当时区块高度开始,针对上述最新当时区块高度以后的区块上的转账交易,对客户端用户的区块链账户余额的明文在链外进行恢复,直至追上区块链的当前区块高度,获得客户端用户的当前的账户余额的明文;相较于从账户余额初始值和创世区块开始,进行所有区块上与用户相关的转账交易的回访和计算,本实施方式提供的账户余额的恢复方法极大降低了处理时间和计算量。The blockchain account balance deposit certificate, recovery method, device, and computer equipment provided by the various embodiments of this specification. In this embodiment, the client can send deposit certificates to the node devices of the blockchain based on a preset sending cycle. Transaction, so that the current block height and recovery parameters included in the deposit transaction are updated in the state database of the blockchain account correspondingly, and the anti-tampering mechanism based on the blockchain is the above-mentioned current block height and the current recovery Parameter deposit; the client starts from the latest current block height of the above-mentioned deposit transaction certificate, for transfer transactions on blocks after the above-mentioned latest current block height, the clear text of the client user’s blockchain account balance is Perform recovery outside the chain until it catches up with the current block height of the blockchain, and obtain the clear text of the current account balance of the client user; compared to the initial value of the account balance and the genesis block, all blocks are combined with For the return visit and calculation of user-related transfer transactions, the method for restoring the account balance provided by this embodiment greatly reduces the processing time and the amount of calculation.
附图说明Description of the drawings
图1是一示例性实施方式提供的区块链的账户余额存证和恢复方法的流程示意图;FIG. 1 is a schematic flowchart of a method for depositing and recovering a blockchain account balance according to an exemplary embodiment;
图2是一示例性实施方式提供的对被同态加密的区块链账户余额进行存证和恢复方法的流程的示意图;2 is a schematic diagram of the process of depositing and restoring a homomorphic encrypted blockchain account balance provided by an exemplary embodiment;
图3是一示例性实施方式提供的应用于节点设备端的区块链的账户余额存证装置的示意图;FIG. 3 is a schematic diagram of an account balance deposit certification device applied to a blockchain on a node device side according to an exemplary embodiment;
图4是一示例性实施方式提供的应用于客户端的区块链的账户余额恢复装置的示意图;FIG. 4 is a schematic diagram of an account balance recovery device applied to a client's blockchain according to an exemplary embodiment;
图5是运行本说明书所提供的账户余额存证或恢复装置实施方式的一种硬件结构图。Fig. 5 is a hardware structure diagram of the implementation of the device for depositing or restoring the account balance provided in this specification.
具体实施方式Detailed ways
这里将详细地对示例性实施方式进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施方式中所描述的实施方式并不代表与本说明书一个或多个实施方式相一致的所有实 施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施方式的一些方面相一致的装置和方法的例子。Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary implementation manners do not represent all implementation manners consistent with one or more implementation manners of this specification. On the contrary, 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 executed 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, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. describe.
本说明书一个或多个实施方式所述的区块链或区块链网络,具体可指一个各节点设备通过共识机制达成的、具有分布式数据存储结构的P2P网络系统,该区块链内的账本数据分布在时间上相连的一个个“区块(block)”之内,后一区块可包含前一区块的数据摘要,且根据具体的共识机制(如POW、POS、DPOS或PBFT等)的不同,达成全部或部分节点的数据全备份。上述区块链内的账本数据可以以交易的格式存储在区块之内。区块链的节点设备或客户端对于物理世界产生的真实数据,可以将其构建成区块链所支持的标准的交易(transaction)格式,然后发布至区块链,由区块链中的节点设备对收到的交易进行共识处理,并在达成共识后,由区块链中作为记账节点的节点设备,将这笔交易打包进区块,在区块链的区块中进行持久化存证。The blockchain or blockchain network described in one or more embodiments of this specification can specifically refer to a P2P network system with a distributed data storage structure reached by each node device through a consensus mechanism. Ledger data is distributed in time-connected "blocks". The next block can contain the data summary of the previous block and is based on the specific consensus mechanism (such as POW, POS, DPOS or PBFT, etc.) ) To achieve full backup of all or part of the node data. The ledger data in the above-mentioned block chain can be stored in the block in a transaction format. The node device or client of the blockchain can construct the real data generated by the physical world into a standard transaction format supported by the blockchain, and then publish it to the blockchain. The nodes in the blockchain The device performs consensus processing on the received transaction, and after reaching a consensus, the node device as the accounting node in the blockchain will package the transaction into a block and store it persistently in the block of the blockchain. certificate.
为了容易地获取到账本数据的当前值,区块链还设置有状态数据库(或称为world state)来存储账本数据的当前值,省去了节点设备遍历整个区块链去计算账本数据当前的状态的值,而可以直接从状态数据库中读取。在上述交易被存储至区块链的区块中时,各个节点设备可依据上述交易中的数据,在状态数据库中相应地更新其当前值。In order to easily obtain the current value of the ledger data, the blockchain also sets up a state database (or world state) to store the current value of the ledger data, eliminating the need for node devices to traverse the entire blockchain to calculate the current value of the ledger data The value of the state can be read directly from the state database. When the above transaction is stored in a block of the blockchain, each node device can update its current value in the state database according to the data in the above transaction.
本领域的技术人员熟知,由于区块链网络系统在相应共识机制下运行,已收录至区块链数据库内的数据很难被任意的节点篡改,例如采用Pow共识的区块链,至少需要全网51%算力的攻击才有可能篡改已有数据,因此区块链系统有着其他中心化数据库系统所无法比拟的保证数据安全、防攻击篡改的特性。由此可知,被收录至区块链的分布式数据库中的数据不会被攻击或篡改,而且,即使部分节点设备发生系统故障或存储介质损坏,由于其他节点设备已存储了全局的区块链数据,上述部分节点设备仍可以从其他节点设备处恢复全局的区块链数据,从而保证了存证入区块链的分布式数据库的数据信息的真实可靠性。Those skilled in the art are well aware that because the blockchain network system operates under the corresponding consensus mechanism, the data that has been included in the blockchain database is difficult to be tampered with by any node. For example, a blockchain using Pow consensus requires at least full Only 51% of the network's computing power can tamper with existing data. Therefore, the blockchain system has the characteristics of ensuring data security and preventing attack and tampering that other centralized database systems cannot match. It can be seen that the data included in the distributed database of the blockchain will not be attacked or tampered with, and even if some node devices have a system failure or the storage medium is damaged, because other node devices have stored the global blockchain Data, some of the above-mentioned node devices can still recover global blockchain data from other node devices, thereby ensuring the authenticity of the data information stored in the distributed database of the blockchain.
区块链网络的示例类型可以包括公有区块链网络、私有区块链网络和联盟区块链网络。尽管术语区块链通常与加密货币网络相关联,但是本文使用的区块链可指代不参考 任何特定用例的DLS(分布式账本系统)。Example types of blockchain networks may include public blockchain networks, private blockchain networks, and consortium blockchain networks. Although the term blockchain is usually associated with cryptocurrency networks, the blockchain used in this article can refer to DLS (Distributed Ledger System) that does not refer to any specific use case.
在公有区块链网络中,共识过程由共识网络的节点控制。例如,数百、数千、甚至数百万个实体可以在公有区块链网络中协作,每个实体在公有区块链网络中操作至少一个节点。因此,公有区块链网络可以被认为是相对于参与实体的公有网络。通常,公有区块链网络支持公有交易。公有交易与公有区块链网络内的所有节点共享,并存储在全局区块链中。全局区块链是跨所有节点复制的区块链。也就是说,对于全局区块链,所有节点处于完全一致的状态。为了达成共识(例如,同意向区块链添加块),在公有区块链网络内实施共识协议。示例共识协议包括但不限于,工作量证明(proof-of-work,POW)。In the public blockchain network, the consensus process is controlled by the nodes of the consensus network. For example, hundreds, thousands, or even millions of entities can collaborate in a public blockchain network, and each entity operates at least one node in the public blockchain network. Therefore, the public blockchain network can be considered as a public network relative to the participating entities. Generally, public blockchain networks support public transactions. Public transactions are shared with all nodes in the public blockchain network and stored in the global blockchain. The global blockchain is a blockchain that replicates across all nodes. In other words, for the global blockchain, all nodes are in a completely consistent state. In order to reach consensus (for example, agree to add blocks to the blockchain), a consensus agreement is implemented within the public blockchain network. Example consensus protocols include, but are not limited to, proof-of-work (POW).
通常,私有区块链网络提供给特定实体,特定实体集中控制读取和写入权限。该实体控制哪些节点能够参与区块链网络。因此,私有区块链网络通常被称为许可网络,其对允许谁参与网络及其参与水平(例如,仅在某些交易中)施加限制。可以使用各种类型的访问控制机制(例如,现有参与者投票添加新实体,监管机构可以控制准入)。Generally, private blockchain networks are provided to specific entities, and specific entities centrally control read and write permissions. This entity controls which nodes can participate in the blockchain network. Therefore, a private blockchain network is often referred to as a permissioned network, which imposes restrictions on who is allowed to participate in the network and its level of participation (for example, only in certain transactions). Various types of access control mechanisms can be used (for example, existing participants vote to add new entities, and regulators can control access).
通常,联盟区块链网络在参与实体中是私有的。在联盟区块链网络中,共识过程由授权的一组节点(联盟成员节点)控制,一个或多个节点由相应的实体(例如,企业)操作。例如,由十(10)个实体(例如,企业)组成的联盟可以操作联盟区块链网络,每个实体在该联盟区块链网络中操作至少一个节点。因此,就参与实体而言,联盟区块链网络可以被认为是私有网络。在一些示例中,每个实体(节点)必须对每个块进行签名,以使该块有效并将有效的块添加到区块链。在一些示例中,至少实体(节点)的子集(例如,至少7个实体)必须对每个块进行签名以使该块有效,并且将有效的块添加到区块链。Generally, the alliance blockchain network is private among participating entities. In a consortium blockchain network, the consensus process is controlled by an authorized group of nodes (consortium member nodes), and one or more nodes are operated by corresponding entities (for example, enterprises). For example, a consortium consisting of ten (10) entities (e.g., enterprises) can operate a consortium blockchain network, and each entity operates at least one node in the consortium blockchain network. Therefore, in terms of participating entities, the consortium blockchain network can be considered a private network. In some examples, each entity (node) must sign each block in order to make the block valid and add the valid block to the blockchain. In some examples, at least a subset of entities (nodes) (e.g., at least 7 entities) must sign each block to make the block valid, and add the valid block to the blockchain.
可以预期,本说明书所提供的实施方式能够在任何合适类型的区块链网络中实现。It can be expected that the implementation provided in this specification can be implemented in any suitable type of blockchain network.
区块链的状态数据库(或“world state”)内可为不同的区块链用户设置相应的用户账户,以存储区块链用户的账户余额等状态信息。为保护用户的数据隐私,区块链上的账户余额信息可以被加密的隐私状态存储,具体的加密方式可以包括同态加密等,以使区块链账户可以在被加密的隐私状态下进行链上转账交易;各区块链用户可在相应的节点设备或客户端的链下的本地数据库(或称为私有数据库)中保管与自身账户余额相关的加密或解密参数,以方便随时获知自身链上的账户余额对应的明文。The state database (or "world state") of the blockchain can set up corresponding user accounts for different blockchain users to store state information such as the account balance of the blockchain users. In order to protect users’ data privacy, account balance information on the blockchain can be stored in an encrypted privacy state. Specific encryption methods can include homomorphic encryption, so that blockchain accounts can be chained in an encrypted privacy state. Up-transfer transactions; each blockchain user can keep the encryption or decryption parameters related to his own account balance in the local database (or private database) under the corresponding node device or the client's chain, so as to facilitate the knowledge of their own chain at any time The plain text corresponding to the account balance.
然而,本地化存储的上述账户余额的明文、与账户余额相关的加密或解密参数,易 被删除、修改,或在遇到节点设备或客户端系统失效、存储介质损坏时发生丢失,此时,区块链用户将很难获知自身链上的账户余额所对应的明文。However, the localized stored plaintext of the account balance and the encryption or decryption parameters related to the account balance are easy to be deleted, modified, or lost when the node device or client system fails or the storage medium is damaged. At this time, Blockchain users will find it difficult to know the plaintext corresponding to the account balance on their own chain.
鉴于以上的问题,本说明书的一个或多个实施方式提供了区块链账户余额的存证和恢复方法,用于区块链用户基于其所在的客户端恢复其账户余额所对应的明文。In view of the above problems, one or more implementations of this specification provide a method for depositing and restoring the balance of a blockchain account for blockchain users to restore the plaintext corresponding to their account balance based on the client where they are located.
值得注意的是,在本说明书提供的一个或多个实施方式中所述的区块链客户端,可以是与区块链的节点设备连接的独立设备端,也可以是集成于节点设备内部的功能化插件,对此不作限定。It is worth noting that the blockchain client described in one or more implementations provided in this specification can be an independent device connected to the node device of the blockchain, or it can be integrated inside the node device. Functional plug-in, this is not limited.
在区块链领域,有一个重要的概念就是账户(Account);以以太坊为例,以太坊通常将账户划分为外部账户和合约账户两类;外部账户就是由用户直接控制的账户;而合约账户则是由用户通过外部账户创建的,包含合约代码的账户(即智能合约),本说明书所述的用户账户可以包括上述外部账户或合约账户。In the field of blockchain, an important concept is Account; taking Ethereum as an example, Ethereum usually divides accounts into external accounts and contract accounts; external accounts are accounts directly controlled by users; and contracts An account is created by a user through an external account, and an account containing contract code (ie, a smart contract). The user account described in this specification may include the above-mentioned external account or contract account.
当然,对于一些基于以太坊的架构而衍生出的区块链模型(比如蚂蚁区块链),还可以对区块链支持的账户类型,进行进一步的扩展,在本说明书中不进行特别限定。Of course, for some blockchain models derived from the Ethereum architecture (such as the Ant blockchain), the account types supported by the blockchain can also be further extended, which is not particularly limited in this specification.
对于区块链中的账户而言,通常会通过一个结构体,来维护账户的账户状态。当区块中的交易被执行后,区块链中与该交易相关的账户的状态通常也会发生变化。以以太坊为例,账户的结构体通常包括Balance,Nonce,Code和Storage等字段。其中的Balance字段,用于维护账户目前的账户余额。由于账户余额为涉及用户隐私的信息,一些区块链会采用加密的方式处理区块链上的账户余额。For accounts in the blockchain, a structure is usually used to maintain the account status of the account. When the transaction in the block is executed, the state of the account related to the transaction in the blockchain will usually change. Taking Ethereum as an example, the structure of an account usually includes fields such as Balance, Nonce, Code, and Storage. The Balance field is used to maintain the current account balance of the account. Since the account balance is information related to user privacy, some blockchains will use encryption to process the account balance on the blockchain.
图1示意了本说明书一示例性实施方式提供的区块链账户余额的存证和恢复方法的流程步骤,上述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理。Figure 1 illustrates the process steps of a method for depositing and restoring a blockchain account balance provided by an exemplary embodiment of this specification. The account balances of user accounts stored on the above-mentioned blockchain are all encrypted using the first encryption algorithm. deal with.
步骤102,区块链客户端基于预设的发送周期向所述区块链的节点设备发送存证交易,所述存证交易包括当时区块高度和当时恢复参数;其中,所述当时区块高度为所述客户端同步的区块链在所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述恢复参数的至少部分参数被加密处理。Step 102: The blockchain client sends a certificate deposit transaction to the node device of the blockchain based on a preset sending cycle, and the certificate deposit transaction includes the current block height and the current recovery parameter; wherein, the current block The height is the block height of the block chain synchronized by the client at the moment the deposit transaction is constructed, and the recovery parameters at that time are stored locally by the client and available to the blockchain users in the deposit. The encrypted account balance at the time of construction of the certificate transaction is restored with multiple parameters, and at least part of the restored parameters are encrypted.
本说明书所述的“本地存储”是相对于区块链的链上存储(可包括区块账本和状态数据库)而言的链下的私有存储。随着与区块链用户相关的转账交易被不断收录至区块链,区块链用户的被加密账户余额被相应地不断更新在客户端存储的状态数据库中。区 块链客户端可在本地存储(链下的私有存储)中保存当时恢复参数,用于恢复上述区块链用户在存证交易构建时刻的区块链上的被加密的账户余额的明文,或解密登陆该客户端的区块链用户在区块链上的被加密的账户余额,以获得对应的明文。The "local storage" mentioned in this specification refers to the private storage off-chain relative to the on-chain storage of the blockchain (which may include block ledgers and state databases). As the transfer transactions related to blockchain users are continuously included in the blockchain, the encrypted account balance of the blockchain users is correspondingly continuously updated in the state database stored on the client. The blockchain client can save the recovery parameters at the time in the local storage (private storage under the chain), which is used to restore the plaintext of the encrypted account balance of the above-mentioned blockchain user on the blockchain at the time the deposit transaction is constructed. Or decrypt the encrypted account balance on the blockchain of the blockchain user who logs in to the client to obtain the corresponding plaintext.
随着区块链上区块高度的增加,区块链状态数据库会发生相应的更新;而且该区块链用户的账户余额可能会随着与其相关的转账交易被收录入区块中而发生更新。区块链客户端至少存储有登陆上述客户端的区块链用户的链上账户信息(该账户信息中包括被加密的账户余额),并随着区块链状态数据库的更新,更新该区块链用户的链上账户信息。客户端基于预设的发送周期向与其连接的节点设备定时发送存证交易,以将存证交易构建时刻的当时区块高度和对被加密的账户余额的明文的当时恢复参数存证到区块链上。As the block height on the blockchain increases, the blockchain state database will be updated accordingly; and the account balance of the blockchain user may be updated as the related transfer transactions are included in the block. . The blockchain client at least stores the on-chain account information of the blockchain users who log in to the above client (the account information includes the encrypted account balance), and updates the blockchain as the blockchain status database is updated User's on-chain account information. Based on the preset sending cycle, the client periodically sends the deposit transaction to the node device connected to it to deposit the current block height at the time of deposit transaction construction and the current recovery parameters of the plaintext of the encrypted account balance to the block. On the chain.
由于在上述存证交易构建时刻,客户端上的区块高度可能与节点设备同步的区块高度有时差,上述当时区块高度和当时恢复参数均是基于客户端上同步的区块链信息而生成的。Since the block height on the client terminal may be different from the block height synchronized by the node device at the time of the construction of the above-mentioned deposit transaction, the above-mentioned block height at that time and the recovery parameters at the time are all based on the blockchain information synchronized on the client. Generated.
在一示出的实施方式中,上述区块链客户端可在存储器中定时到多个预设位置分别读取当时恢复参数所包含的各个参数的内容,基于读取到的当时恢复参数的各个参数构建存证交易。在又一示出的实施方式中,上述当时恢复参数的内容和当时区块高度被区块链客户端存储,客户端可基于预设的发送周期定时获取包括上述当时恢复参数和当时区块高度的存储快照,基于该存储快照构建上述存证交易。In an illustrated embodiment, the above-mentioned blockchain client can periodically go to multiple preset locations in the memory to read the content of each parameter included in the recovery parameter at the time, based on the read recovery parameters at the time. Parameter construction of deposit transaction. In another embodiment shown, the content of the recovery parameters at the time and the height of the current block are stored by the blockchain client, and the client can periodically obtain the information including the recovery parameters at the time and the height of the current block based on a preset sending cycle. Based on the storage snapshot of the storage snapshot, the above-mentioned attestation transaction is constructed.
为了防止区块链上其他节点设备获知上述当时恢复参数的明文而恢复或解密该区块链用户的账户余额明文,上述恢复参数的至少部分参数被加密处理。In order to prevent other node devices on the blockchain from learning the plaintext of the recovery parameter at that time and recovering or decrypting the plaintext of the account balance of the blockchain user, at least part of the parameters of the recovery parameter are encrypted.
在又一示出的实施方式中,上述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;当在已知账户余额的密文的前提下,可以基于第一加密算法和随机数逆向计算出账户余额的明文时,上述当时恢复参数可包括存证交易构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;由于基于上述当时随机数和被加密的账户余额可以逆向计算出与被加密的账户余额的明文,为了在区块链上保护用户账户余额的隐私,上述客户端至少应将上述当时随机数进行加密处理。In another embodiment shown, the account balance of the user account stored on the above-mentioned blockchain is encrypted using the first encryption algorithm, and the random number is used as the encryption factor; when the ciphertext of the known account balance is Under the premise, when the plaintext of the account balance can be calculated inversely based on the first encryption algorithm and the random number, the above-mentioned recovery parameters at the time may include the current random number corresponding to the encrypted account balance at the time the deposit transaction is constructed, and the blockchain The user’s encrypted account balance at the time of the construction of the deposit transaction; because based on the above-mentioned random number and the encrypted account balance, the plaintext of the encrypted account balance can be calculated in reverse, in order to protect the user on the blockchain For the privacy of the account balance, the above-mentioned client should at least encrypt the above-mentioned random number at that time.
例如,客户端可基于自身持有的公钥对上述最新当时随机数进行加密,或者,客户端可基于口令密钥对上述最新当时随机数进行加密,具体的加密方式在本实施方式中不 作限定。For example, the client can encrypt the latest current random number based on its own public key, or the client can encrypt the latest current random number based on a password key. The specific encryption method is not limited in this embodiment. .
在又一示出的实施方式中,上述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;当在已知账户余额的密文的前提下,基于第一加密算法和随机数无法逆向计算出账户余额的明文时,上述当时恢复参数可包括存证交易构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额对应的明文;为了在区块链上保护用户账户余额的隐私,所述当时随机数和所述构建时刻的被加密的账户余额的明文均应被加密处理。In another embodiment shown, the account balance of the user account stored on the above-mentioned blockchain is encrypted using the first encryption algorithm, and the random number is used as the encryption factor; when the ciphertext of the known account balance is Under the premise, when the plaintext of the account balance cannot be calculated in reverse based on the first encryption algorithm and the random number, the above-mentioned recovery parameters at the time may include the current random number corresponding to the encrypted account balance at the time the deposit transaction is constructed, and the blockchain The plaintext corresponding to the user’s encrypted account balance at the time of construction of the deposit transaction; in order to protect the privacy of the user’s account balance on the blockchain, the value of the random number at that time and the encrypted account balance at the time of construction The plaintext should be encrypted.
本实施方式中并不限定客户端对上述当时恢复参数所包含的当时随机数和账户余额的明文的具体加密方式,而且上述客户端对上述当时恢复参数所包含的随机数和账户余额的明文可采用相同的加密方式加密,也可采用不同的加密方式加密,在此也不作限定。This embodiment does not limit the specific encryption method of the client to the plaintext of the random number and account balance included in the recovery parameter at that time, and the client can encrypt the plaintext of the random number and account balance included in the recovery parameter at the time. The same encryption method is used for encryption, and different encryption methods can also be used for encryption, which is not limited here.
步骤104,所述区块链的节点设备接收上述存证交易,并将上述存证交易发布至区块链,以使所述区块链对所述存证交易进行共识处理。Step 104: The node device of the blockchain receives the certificate deposit transaction and publishes the certificate deposit transaction to the blockchain, so that the blockchain performs consensus processing on the certificate deposit transaction.
其中,区块链中支持的共识算法可以包括:第一类共识算法,即节点设备需要争夺每一轮的记账周期的记账权的共识算法;例如,工作量证明(Proof of Work,POW)、股权证明(Proof of Stake,POS)、委任权益证明(Delegated Proof of Stake,DPOS)等共识算法;第二类共识算法,即预先为每一轮记账周期选举记账节点(不需要争夺记账权)的共识算法;例如,实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)等共识算法。Among them, the consensus algorithms supported in the blockchain can include: the first type of consensus algorithm, that is, the consensus algorithm that node devices need to compete for the accounting right of each round of accounting cycle; for example, Proof of Work (POW) ), Proof of Stake (POS), Delegated Proof of Stake (DPOS) and other consensus algorithms; the second type of consensus algorithm, that is, pre-election of accounting nodes for each round of accounting cycle (no need to compete Accounting rights) consensus algorithms; for example, practical Byzantine Fault Tolerance (PBFT) and other consensus algorithms.
在采用第一类共识算法的区块链网络中,争夺记账权的节点设备,都可以在接收到交易后执行该笔交易。争夺记账权的节点设备中可能有一个节点设备在本轮争夺记账权的过程中胜出,成为记账节点。记账节点可以将收到的交易与其它交易一起打包以生成最新区块,并将生成的最新区块或者该最新区块的区块头发送至其它节点设备进行共识。In the blockchain network using the first type of consensus algorithm, all node devices that compete for the right to keep accounts can execute the transaction after receiving the transaction. Among the node devices that compete for the right to bookkeeping, one node device may win this round of contention for the right to bookkeeping and become the bookkeeping node. The accounting node can package the received transaction with other transactions to generate the latest block, and send the generated latest block or the block header of the latest block to other node devices for consensus.
在采用第二类共识算法的区块链网络中,具有记账权的节点设备在本轮记账前已经商定好。因此,节点设备在接收到交易后,如果自身不是本轮的记账节点,则可以将该交易发送至记账节点。对于本轮的记账节点,在将该交易与其它交易一起打包以生成最新区块的过程中或者之前,可以执行该交易。记账节点在生成最新区块后,可以将该最新区块或者该最新区块的区块头发送至其它节点设备进行共识。In the blockchain network using the second type of consensus algorithm, the node device with the right to book accounts has been agreed before this round of bookkeeping. Therefore, after the node device receives the transaction, if it is not the accounting node of this round, it can send the transaction to the accounting node. For this round of accounting nodes, the transaction can be executed during or before the process of packaging the transaction with other transactions to generate the latest block. After the accounting node generates the latest block, it can send the latest block or the block header of the latest block to other node devices for consensus.
如上所述,无论区块链采用以上示出的哪种共识算法,本轮的记账节点都可以将接收到的交易打包以生成最新区块,并将生成的最新区块或者该最新区块的区块头发送至 其它节点设备进行共识验证。如果其它节点设备接收到最新区块或者该最新区块的区块头后,经验证没有问题,可以将该最新区块追加到原有的区块链末尾,从而完成区块链的记账过程。其它节点验证记账节点发来的新的区块或区块头的过程中,也可以执行该区块中的包含的交易。As mentioned above, no matter which consensus algorithm shown above is adopted by the blockchain, the accounting node in this round can package the received transaction to generate the latest block, and the generated latest block or the latest block The header of the block is sent to other node devices for consensus verification. If other node equipment receives the latest block or the block header of the latest block, it is verified that there is no problem, and the latest block can be appended to the end of the original blockchain to complete the accounting process of the blockchain. In the process of other nodes verifying the new block or block header sent by the accounting node, the transactions contained in the block can also be executed.
步骤106,当所述存证交易共识通过,所述节点设备将所述存证交易存储至所述区块链的分布式账本,并将所述当时区块高度和当时恢复参数对应更新在所述区块链用户的状态数据库。Step 106: When the deposit transaction consensus is passed, the node device stores the deposit transaction in the distributed ledger of the blockchain, and updates the current block height and the current recovery parameters in the corresponding State database of blockchain users.
本实施方式并不限定上述当时区块高度和当时恢复参数在区块链的状态数据库的存储位置,例如,可以将区块链用户账户(包括外部账户或合约账户等)的内容进行扩展,以收录上述存证交易构建时刻的当时区块高度和当时恢复参数。This embodiment does not limit the storage location of the block height at the time and the recovery parameters at the time in the state database of the blockchain. For example, the content of blockchain user accounts (including external accounts or contract accounts, etc.) can be expanded to The current block height and recovery parameters at the time when the above-mentioned deposit transaction was constructed are included.
当上述存证交易被共识通过后,可以向上述客户端返回通知消息;而客户端在将上述存证交易发布至区块链后,可以确定是否接收到节点设备返回的该存证交易被共识通过的通知消息,并在收到上述通知消息后,将上述构建时刻的当时区块高度和当时恢复参数对应更新到客户端存储的用户的状态数据库中。When the above-mentioned deposit transaction is approved by consensus, a notification message can be returned to the above-mentioned client; and the client can determine whether the deposit transaction returned by the node device is received after the above-mentioned deposit transaction is published to the blockchain. After the notification message is passed, and after the notification message is received, the current block height and the recovery parameter at the time of the construction are correspondingly updated to the user's state database stored in the client.
在上述客户端由于可能的原因丢失了本地存储的现在时刻的区块链账户余额的明文,或对现在时刻的账户余额的明文的恢复参数时,用户将无法获知自身区块链账户中的当前的账户余额(Balance)的明文。此时,客户端可基于上述区块链状态数据库中存证的与所述存证交易最新构建时刻对应的最新当时恢复参数和最新当时区块高度,和区块链区块中与该用户相关的转账交易,对区块链上存储的用户账户内的当前的账户余额(Balance)的明文进行恢复。When the above-mentioned client loses the locally stored plaintext of the current blockchain account balance due to possible reasons, or the recovery parameters of the plaintext of the current account balance, the user will not be able to know the current blockchain account. The clear text of the account balance (Balance). At this point, the client can be based on the latest recovery parameters and the latest current block height corresponding to the latest construction time of the deposit transaction in the above-mentioned blockchain state database, and related to the user in the blockchain block The transfer transaction is to restore the clear text of the current account balance (Balance) in the user account stored on the blockchain.
恢复的具体过程可包括:The specific process of recovery can include:
步骤108,上述区块链客户端获取所述区块链账户的状态数据库中与所述存证交易最新构建时刻对应的最新当时恢复参数和最新当时区块高度。Step 108: The above-mentioned blockchain client obtains the latest recovery parameters and the latest current block height corresponding to the latest construction time of the deposit certificate transaction in the state database of the blockchain account.
上述区块链客户端可同步更新区块链数据库,从更新所得的自身账户的状态数据库中获取上述与所述存证交易最新构建时刻对应的最新当时恢复参数和最新当时区块高度。The above-mentioned blockchain client can update the blockchain database synchronously, and obtain the latest recovery parameters and the latest current block height corresponding to the latest construction time of the deposit transaction from the updated state database of its own account.
步骤110,所述区块链客户端解密所述最新当时恢复参数的至少部分参数,并基于解密所得的最新当时恢复参数获得与所述最新构建时刻的被加密的账户余额的明文。In step 110, the blockchain client decrypts at least part of the latest recovery parameters at the time, and obtains the plaintext of the encrypted account balance at the latest construction time based on the latest recovery parameters obtained from the decryption.
在一示出的实施方式中,上述区块链上存储的用户账户的账户余额被采用第一加密 算法、将随机数作为加密因子进行了加密处理,且在已知账户余额的密文的前提下,可以基于第一加密算法和随机数逆向计算出账户余额的明文,此时上述最新当时恢复参数可包括存证交易最新构建时刻的被加密的账户余额对应的最新当时随机数,和所述区块链用户在所述存证交易的最新构建时刻的被加密的账户余额,上述最新当时随机数被使用客户端已知的算法加密。In an illustrated embodiment, the account balance of the user account stored on the blockchain is encrypted using the first encryption algorithm, using a random number as an encryption factor, and the ciphertext of the account balance is known Next, the plaintext of the account balance can be calculated inversely based on the first encryption algorithm and the random number. At this time, the above-mentioned latest current recovery parameters may include the latest current random number corresponding to the encrypted account balance at the latest construction time of the deposit transaction, and the The encrypted account balance of the blockchain user at the latest construction time of the deposit certificate transaction, and the above-mentioned latest random number at that time is encrypted using an algorithm known to the client.
例如,客户端可基于自身持有的公钥对上述最新当时随机数进行加密,相应地,应基于自身持有的私钥对从区块链中获取的最新当时随机数进行解密。或者,客户端可基于口令密钥对上述最新当时随机数进行加密,相应地,应基于上述口令密钥对从区块链中获取的最新当时随机数进行解密。For example, the client can encrypt the above-mentioned latest current random number based on its own public key, and accordingly, it should decrypt the latest current random number obtained from the blockchain based on its own private key. Alternatively, the client can encrypt the latest current random number based on the password key, and accordingly, the latest current random number obtained from the blockchain should be decrypted based on the password key.
在解密获得上述最新当时随机数后,客户端可基于上述最新当时随机数和所述存证交易的最新构建时刻的被加密的账户余额,逆向计算出与被加密的账户余额对应的、所述存证交易的最新构建时刻的账户余额的明文。After decrypting and obtaining the above-mentioned latest current random number, the client can reversely calculate the encrypted account balance corresponding to the encrypted account balance based on the above-mentioned latest current random number and the encrypted account balance at the latest construction time of the deposit certificate transaction. The clear text of the account balance at the latest construction time of the deposit certificate transaction.
在又一示出的实施方式中,上述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;当在已知账户余额的密文的前提下,基于第一加密算法和随机数无法逆向计算出账户余额的明文时,上述最新当时恢复参数可包括存证交易最新构建时刻的被加密的账户余额对应的最新当时随机数,和所述区块链用户在所述存证交易最新构建时刻的被加密的账户余额对应的明文;为了在区块链上保护用户账户余额的隐私,所述最新当时随机数、和所述最新构建时刻的被加密的账户余额的明文均应被加密处理。客户端可通过解密而获得上述最新当时恢复参数包含的最新当时随机数和与所述最新构建时刻的被加密的账户余额对应的账户余额的明文。In another embodiment shown, the account balance of the user account stored on the above-mentioned blockchain is encrypted using the first encryption algorithm, and the random number is used as the encryption factor; when the ciphertext of the known account balance is Under the premise, when the plaintext of the account balance cannot be calculated inversely based on the first encryption algorithm and the random number, the above-mentioned latest current recovery parameters may include the latest current random number corresponding to the encrypted account balance at the latest construction time of the deposit transaction, and the The plaintext corresponding to the encrypted account balance of the blockchain user at the latest construction time of the deposit transaction; in order to protect the privacy of the user account balance on the blockchain, the latest current random number and the latest construction time The plaintext of the encrypted account balance should be encrypted. The client can obtain the latest current random number included in the latest current recovery parameter and the plaintext of the account balance corresponding to the encrypted account balance at the latest construction time through decryption.
步骤112,基于所述最新构建时刻的被加密的账户余额对应的账户余额的明文,从与所述最新当时区块高度开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文。Step 112: Based on the plaintext of the account balance corresponding to the encrypted account balance at the latest construction time, starting from the height of the latest current block, based on the information stored on the blockchain related to the blockchain user In the transfer transaction, the plaintext of the current account balance of the blockchain user is restored.
在本实施方式中,客户端可从上述存证交易存证的最新当时区块高度开始,针对上述最新当时区块高度及其以后的区块上的转账交易,对客户端用户的区块链账户余额的明文在链外进行恢复,直至追上区块链的当前区块高度,获得客户端用户的当前的账户余额的明文;相较于从账户余额初始值和创世区块开始,进行所有区块上与用户相关的转账交易的回访和计算,本实施方式提供的账户余额的恢复方法极大降低了处理时间和计算量。In this embodiment, the client terminal can start from the latest current block height of the above-mentioned deposit certificate transaction certificate. For transfer transactions on the above-mentioned latest current block height and subsequent blocks, the client user’s blockchain The clear text of the account balance is restored off-chain until it catches up with the current block height of the blockchain, and the clear text of the current account balance of the client user is obtained; compared to starting from the initial value of the account balance and the genesis block, For the return visits and calculations of user-related transfer transactions on all blocks, the method for restoring the account balance provided by this embodiment greatly reduces the processing time and the amount of calculation.
以下,如图2所示,本说明书以区块链的账户余额被使用同态加密算法加密为例,详细叙述基于上述一个或多个实施方式所述的方法恢复区块链用户的账户余额的步骤。Hereinafter, as shown in Figure 2, this specification takes the account balance of the blockchain encrypted using a homomorphic encryption algorithm as an example to describe in detail the method of restoring the account balance of the blockchain user based on the method described in one or more of the above embodiments step.
在本实施方式中,区块链用户A的链上账户余额被使用同态加密算法加密:In this embodiment, the on-chain account balance of blockchain user A is encrypted using a homomorphic encryption algorithm:
PC(X,R)=G^X*H^RPC(X,R)=G^X*H^R
其中,X为余额的明文金额,R为随机数,G和H为同态加密算法的全局公开参数,PC即为同态加密后的余额密文。用户A的客户端本地存储有与其账户余额PC值对应的余额明文X和随机数R。Among them, X is the plaintext amount of the balance, R is a random number, G and H are the global public parameters of the homomorphic encryption algorithm, and PC is the ciphertext of the balance after homomorphic encryption. User A's client terminal locally stores the balance plaintext X and random number R corresponding to the PC value of his account balance.
如图2所示,本实施方式所述的区块链余额的存证和恢复方法包括:As shown in Figure 2, the method for depositing and restoring the blockchain balance described in this embodiment includes:
步骤201,用户A客户端基于预设的发送周期向区块链的节点设备发送存证交易,该存证交易包括用户A客户端同步的区块链在上述存证交易构建时刻的当时区块高度h,和所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数:账户余额的明文X和当时随机数R,且上述X和R均被加密处理。Step 201: The user A client sends a deposit certificate transaction to the node device of the blockchain based on a preset sending cycle. The deposit transaction includes the current block of the blockchain synchronized by the user A client at the time the deposit transaction is constructed. Height h, and multiple parameters stored locally by the client that can restore the encrypted plaintext of the account balance of the blockchain user at the time of the construction of the deposit certificate transaction: the plaintext X of the account balance and At that time, the random number R, and the above X and R are all encrypted.
由于在本实施方式所使用的同态加密算法中,在已知PC和R的前提下,较难逆向计算出X,因此对被加密的账户余额的明文进行恢复的恢复参数,可包含上述X和R值;通过X和R正向加密计算得出PC值,并验证得出的PC值是否与链上的用户账户内的被加密的账户余额相同,可以验证上述明文X是否与链上的用户账户内的被加密的账户余额对应,从而恢复出正确的明文X。Since in the homomorphic encryption algorithm used in this embodiment, it is difficult to reversely calculate X under the premise that PC and R are known, the recovery parameters for recovering the plaintext of the encrypted account balance may include the above X And R value; calculate the PC value through the forward encryption of X and R, and verify whether the obtained PC value is the same as the encrypted account balance in the user account on the chain, and it can be verified whether the above plaintext X is the same as that on the chain Corresponding to the encrypted account balance in the user account, thereby recovering the correct plaintext X.
步骤202,上述节点设备将所述存证交易发布至所述区块链,以使所述区块链对所述存证交易进行共识处理;当所述存证交易共识通过,将所述存证交易存储至所述区块链的分布式账本,并将所述当时区块高度h和当时恢复参数(X,R)对应更新在所述区块链用户的状态数据库。In step 202, the above-mentioned node device publishes the certificate deposit transaction to the blockchain, so that the blockchain performs consensus processing on the deposit transaction; when the deposit transaction consensus is passed, the deposit transaction The certificate transaction is stored in the distributed ledger of the blockchain, and the current block height h and the current recovery parameters (X, R) are correspondingly updated in the state database of the blockchain user.
随着上述客户端不断地发送存证交易,该存证交易中的当时区块高度h和当时恢复参数(X,R)不断地被对应更新在所述区块链用户的状态数据库。客户端通过与区块链同步,可将客户端用户的状态数据库内容同步至客户端存储器,并在客户端本地数据库(链下的私有数据库)中存储与区块链上用户账户的被加密的账户余额PC’对应的明文X’和加密随机数R’。某时刻,上述客户端可能发生系统失效或硬件损坏,其本地存储的与区块链上用户账户的被加密的账户余额PC’对应的明文X’和加密随机数R’发生遗失,上述客户端无法得知该用户此时的区块链账户的账户余额X’。As the aforementioned client continues to send the deposit transaction, the current block height h and the current recovery parameter (X, R) in the deposit transaction are continuously updated in the state database of the blockchain user. By synchronizing with the blockchain, the client can synchronize the contents of the client user's state database to the client memory, and store the encrypted data of the user account on the blockchain in the client's local database (private database under the chain) The plain text X'and the encrypted random number R'corresponding to the account balance PC'. At a certain moment, the above client may experience system failure or hardware damage, and its locally stored plaintext X'and encrypted random number R'corresponding to the encrypted account balance PC' of the user account on the blockchain are lost, and the above client It is impossible to know the account balance X'of the user's blockchain account at this time.
为了恢复得知上述账户余额X’,客户端可执行以下操作步骤:In order to recover the above account balance X’, the client can perform the following steps:
步骤203,获取所述区块链账户的状态数据库中的与所述存证交易最新构建时刻t 0对应的最新当时恢复参数(X 0,R 0)和最新当时区块高度h 0Step 203: Obtain the latest current recovery parameters (X 0 , R 0 ) and the latest current block height h 0 corresponding to the latest construction time t 0 of the deposit certificate transaction in the state database of the blockchain account;
步骤204,解密所述最新当时恢复参数中的X 0和R 0,以获得所述最新构建时刻的被加密的账户余额的明文X 0 Step 204: Decrypt X 0 and R 0 in the latest recovery parameters at the time to obtain the plaintext X 0 of the encrypted account balance at the latest construction time;
步骤205,基于所述最新构建时刻的被加密的账户余额的明文X 0,从与所述最新当时区块高度之后的区块开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文: Step 205, based on the plaintext X 0 of the encrypted account balance at the latest construction time, starting from the block after the latest current block height, based on the data stored on the blockchain and the blockchain For user-related transfer transactions, recover the plaintext of the current account balance of the blockchain user:
在区块高度为h 0的区块被收录后,该区块链用户A的账户余额的明文为X 0,且对应的加密随机数为R 0,此时:账户余额PC 0(X 0,R 0)=G^X 0*H^R 0After the block with the block height h 0 is included, the plaintext of the account balance of the blockchain user A is X 0 , and the corresponding encrypted random number is R 0 , at this time: the account balance PC 0 (X 0 , R 0 )=G^X 0 *H^R 0 ;
逐一遍历区块高度为h 0之后的区块内收录的交易,逐一获取与该区块链用户A相关的转账交易:交易1,交易2……交易N。 Traverse the transactions included in the block after the block height is h 0 one by one, and obtain the transfer transactions related to the blockchain user A one by one: transaction 1, transaction 2...transaction N.
例如,交易1为用户A向用户B转账x 1的转账交易,在该交易中,转账金额x 1也被使用相同的同态加密算法、并基于随机数r 1作为加密因子进行了加密:PC 1(x 1,r 1)=G^x 1*H^r 1;此时,区块内收录的交易1的内容可包括[用户A地址,用户B地址,encypt(x 1),encrypt(r 1)],其中,x 1和r 1被使用了与用户A的公钥相关的密钥进行加密。 For example, transaction 1 is a transfer transaction in which user A transfers x 1 to user B. In this transaction, the transfer amount x 1 is also encrypted using the same homomorphic encryption algorithm and based on the random number r 1 as the encryption factor: PC 1 (x 1 , r 1 )=G^x 1 *H^r 1 ; at this time, the content of transaction 1 included in the block can include [user A address, user B address, encypt(x 1 ), encrypt( r 1 )], where x 1 and r 1 are encrypted using a key related to user A's public key.
客户端使用与用户A的私钥相关的密钥分别解密encypt(x 1)、encrypt(r 1)以获得转账金额x 1和转账随机数r 1,并基于同态加密算法的同态特性,从而获得交易1后用户A的账户余额的密文PC 01,明文X 01和随机数R 01The client uses the keys related to user A's private key to decrypt encypt(x 1 ) and encrypt(r 1 ) respectively to obtain the transfer amount x 1 and the transfer random number r 1 , and based on the homomorphic characteristics of the homomorphic encryption algorithm, In order to obtain the ciphertext PC 01 , the plaintext X 01 and the random number R 01 of the account balance of user A after transaction 1:
PC 01=PC 0-PC 1PC 01 =PC 0 -PC 1 ;
X 01=X 0-x 1X 01 =X 0 -x 1 ;
R 01=R 0-r 1R 01 =R 0 -r 1 .
交易2为用户C向用户A转账x 2的转账交易,在该交易中,转账金额x 2也被使用相同的同态加密算法、并基于随机数r 2作为加密因子进行了加密:PC 2(x 2,r 2)=G^x 2*H^r 2;此时,区块内收录的交易2的内容可包括[用户C地址,用户A地址,encypt(x 2),encrypt(r 2)],其中,x 2和r 2被使用了与用户A的公钥相关的密钥进行加密。 Transaction 2 is a transfer transaction in which user C transfers x 2 to user A. In this transaction, the transfer amount x 2 is also encrypted using the same homomorphic encryption algorithm and based on the random number r 2 as the encryption factor: PC 2 ( x 2 , r 2 )=G^x 2 *H^r 2 ; at this time, the content of transaction 2 included in the block can include [user C address, user A address, encypt(x 2 ), encrypt(r 2 )], where x 2 and r 2 are encrypted using a key related to user A's public key.
客户端使用与用户A的私钥相关的密钥分别解密encypt(x 2)、encrypt(r 2)以获得转账金额x 2和转账随机数r 2,并基于同态加密算法的同态特性,从而获得交易2后用户A 的账户余额的密文PC 12,明文X 12和随机数R 12The client uses the keys related to user A's private key to decrypt encypt(x 2 ) and encrypt(r 2 ) respectively to obtain the transfer amount x 2 and the transfer random number r 2 , and based on the homomorphic characteristics of the homomorphic encryption algorithm, In order to obtain the ciphertext PC 12 , the plaintext X 12 and the random number R 12 of the account balance of user A after transaction 2:
PC 12=PC 01+PC 2PC 12 =PC 01 +PC 2 ;
X 12=X 01+x 2X 12 =X 01 +x 2 ;
R 12=R 01+r 2R 12 =R 01+ r 2 .
……...
直至在现在的区块内,获得与用户A相关的转账交易,使用与所述区块链用户的私钥相关的密钥解密与所述用户相关A的转账交易内的被加密的转账金额和转账随机数;从而基于同态加密算法的同态特性,恢复所述区块链用户的当前的账户余额的密文、明文和相应的随机数:PC’、X’和R’。Until the current block, the transfer transaction related to user A is obtained, and the encrypted transfer amount and the encrypted transfer amount in the transfer transaction related to the user A are decrypted using the key related to the private key of the blockchain user Transfer random numbers; thus, based on the homomorphic characteristics of the homomorphic encryption algorithm, the ciphertext, plaintext and corresponding random numbers of the current account balance of the blockchain user are restored: PC', X', and R'.
值得注意的是,当客户端的计算速度不能匹配上述区块链的成块速度时,客户端最终恢复所得的区块链用户的当前的账户余额的X’和R’可能并非是客户端当初遗失的X’和R’,但是基于上述实施方式所提供的账户余额恢复方法,客户端可以恢复出与区块链现在的最高区块匹配的账户余额的明文X’和随机数R’,再基于上述明文X’、随机数R’,和链上不断新收录的转账交易,更新其本地存储的恢复参数。It is worth noting that when the calculation speed of the client cannot match the block speed of the above-mentioned blockchain, the X'and R'of the current account balance of the blockchain user obtained by the client finally recovered may not be the original loss of the client. X'and R', but based on the account balance recovery method provided by the above implementation, the client can recover the plaintext X'and random number R'of the account balance that matches the current highest block of the blockchain, and then based on The above-mentioned plain text X', random number R', and the transfer transactions that are continuously and newly included on the chain are updated with the recovery parameters stored locally.
与上述流程实现对应,本说明书的实施方式还提供了区块链账户余额的存证装置30和区块链账户余额的恢复装置40。装置30和40可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为逻辑意义上的装置,是通过所在设备的CPU(Central Process Unit,中央处理器)将对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,除了图5所示的CPU、内存以及存储器之外,上述装置所在的设备通常还包括用于进行无线信号收发的芯片等其他硬件,和/或用于实现网络通信功能的板卡等其他硬件。Corresponding to the above-mentioned process implementation, the embodiment of this specification also provides a deposit certificate device 30 for a blockchain account balance and a recovery device 40 for a blockchain account balance. The devices 30 and 40 can be implemented by software, or can be implemented by hardware or a combination of software and hardware. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions into the memory by the CPU (Central Process Unit, central processing unit) of the device where it is located. From the perspective of hardware, in addition to the CPU, memory, and storage shown in Figure 5, the device where the above-mentioned device is located usually also includes other hardware such as chips for wireless signal transmission and reception, and/or for implementing network communication functions. Other hardware such as boards.
如图3所示,本说明书还提供了一种区块链账户余额的存证装置30,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述装置30应用于区块链的节点设备,包括:接收单元302,接收区块链用户客户端基于预设的发送周期发送的存证交易;所述存证交易包括当时区块高度和当时恢复参数;其中,所述当时区块高度为所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;发布单元304,将所述存证交易发布至所述区块链,以使所述区块链对所述存证交易进行共识处理;存 储单元306,当所述存证交易共识通过,将所述存证交易存储至所述区块链的分布式账本,并将所述当时区块高度和当时恢复参数对应更新在所述区块链用户的状态数据库。As shown in Figure 3, this specification also provides a device 30 for depositing a blockchain account balance. The account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm. The device 30 is applied to the node equipment of the blockchain and includes: a receiving unit 302, which receives a deposit transaction sent by a blockchain user client based on a preset sending cycle; the deposit transaction includes the current block height and the current recovery Parameters; wherein, the block height at the time is the block height at the time of construction of the deposit certificate transaction, and the recovery parameters at that time are stored locally by the client and can be used by the blockchain user in the deposit certificate The multiple parameters of the encrypted account balance at the time of construction of the transaction are restored in plaintext, and at least some of the parameters of the restored parameters at that time are encrypted; the issuing unit 304 publishes the deposit certificate transaction to the blockchain , So that the blockchain performs consensus processing on the deposit transaction; the storage unit 306, when the deposit transaction consensus is passed, store the deposit transaction in the distributed ledger of the blockchain, and The current block height and the current recovery parameters are correspondingly updated in the state database of the blockchain user.
在又一示出的实施方式中,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。In another illustrated embodiment, the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的被加密的账户余额的明文被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
在又一示出的实施方式中,所述第一加密算法为同态加密算法,所述当时随机数为所述构建时刻的被加密的账户余额对应的加密随机数;所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密。In another embodiment shown, the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is an encrypted random number corresponding to the encrypted account balance at the construction time; the blockchain user The transfer amount of the related transfer transaction is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the blockchain user’s The key encryption related to the public key.
上述装置30中各个单元的功能和作用的实现过程具体详见上述区块链节点设备所执行的区块链账户余额的存证方法中对应步骤的实现过程,相关之处参见方法实施方式的部分说明即可,在此不再赘述。For the implementation process of the functions and roles of each unit in the above device 30, please refer to the implementation process of the corresponding steps in the method for depositing the balance of a blockchain account executed by the above-mentioned blockchain node device. For details, please refer to the part of the method implementation. Just explain it, so I won't repeat it here.
如图4所示,本说明书还提供了一种区块链账户余额的恢复装置40,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述装置40应用于区块链用户客户端,包括:发送单元402,基于预设的发送周期向区块链的节点设备发送存证交易,以使所述存证交易被共识通过后,将所述存证交易包括的当时区块高度和当时恢复参数对应更新在所述区块链账户的状态数据库中;其中,所述当时区块高度为所述客户端同步的区块链在所述存证交易构建时刻的区块高度,所述当时恢复参 数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;获取单元404,获取所述区块链账户的状态数据库中的与所述存证交易最新构建时刻对应的最新当时恢复参数和最新当时区块高度;解密及恢复单元406,解密所述最新当时恢复参数的至少部分参数,并基于解密所得的最新当时恢复参数获得所述最新构建时刻的被加密的账户余额的明文;基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文。As shown in Figure 4, this specification also provides a device 40 for restoring the balance of a blockchain account. The account balances of user accounts stored on the blockchain are all encrypted using the first encryption algorithm. The device 40 is applied to a blockchain user client and includes a sending unit 402, which sends a deposit transaction to a node device of the blockchain based on a preset sending period, so that after the deposit transaction is passed by consensus, the The current block height and the current recovery parameters included in the deposit certificate transaction are correspondingly updated in the state database of the blockchain account; wherein, the current block height is that the block chain synchronized by the client is in the deposit certificate The block height at the time of transaction construction, and the restoration parameters at that time are stored locally by the client and can restore the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit transaction Multiple parameters, and at least part of the recovery parameters at the time are encrypted; the acquiring unit 404 acquires the latest recovery parameters and the latest recovery parameters corresponding to the latest construction time of the deposit transaction in the state database of the blockchain account The latest block height at the time; the decryption and recovery unit 406 decrypts at least part of the latest recovery parameters at the time, and obtains the clear text of the encrypted account balance at the latest construction time based on the latest recovery parameters obtained at the time. The plaintext of the encrypted account balance at the latest construction time starts from the block after the latest current block height, based on the transfer transactions stored on the blockchain and related to the blockchain user, and restores Obtain the plaintext of the current account balance of the blockchain user.
在又一示出的实施方式中,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。In another illustrated embodiment, the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The encrypted account balance at the time of construction of the deposit certificate transaction; wherein the random number at that time is encrypted.
在又一示出的实施方式中,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的被加密的账户余额的明文被加密处理。In another embodiment shown, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account balances of the user accounts stored on the blockchain The first encryption algorithm is adopted, and the random number is used as the encryption factor for encryption processing; the recovery parameters at the time include the random number corresponding to the encrypted account balance at the construction time, and the blockchain user in the The plaintext of the encrypted account balance at the construction time of the deposit certificate transaction; wherein the plaintext of the random number at the time and the encrypted account balance at the construction time are encrypted.
在又一示出的实施方式中,所述第一加密算法为同态加密算法,所述当时随机数为对所述构建时刻的被加密的账户余额同态加密时所使用的随机数;所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密;所述解密和恢复单元,进一步基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,使用与所述区块链用户的私钥相关的密钥逐个解密与所述区块链用户相关的转账交易,以逐个获得所述转账交易的转账金额和转账金额随机数;基于所述转账交易的转账金额和转账金额随机数,逐个恢复与所述转账交易对应的所述区块链用户的账户余额的明文,直至恢复得到所述区块链用 户的当前的账户余额的明文。In another embodiment shown, the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is a random number used when homomorphically encrypting the encrypted account balance at the construction time; The transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as an encryption factor, and the transfer amount and the transfer amount random number are combined with the The key encryption related to the public key of the blockchain user; the decryption and recovery unit is further based on the plaintext of the encrypted account balance at the latest construction time, starting from the block after the latest current block height , Using the key related to the private key of the blockchain user to decrypt the transfer transactions related to the blockchain user one by one to obtain the transfer amount and the transfer amount random number of the transfer transaction one by one; based on the transfer The transfer amount and the transfer amount random number of the transaction are restored one by one in the plaintext of the account balance of the blockchain user corresponding to the transfer transaction, until the plaintext of the current account balance of the blockchain user is recovered.
上述装置40中各个单元的功能和作用的实现过程具体详见上述区块链客户端所执行的区块链账户余额的恢复方法中对应步骤的实现过程,相关之处参见方法实施方式的部分说明即可,在此不再赘述。For the implementation process of the functions and roles of each unit in the above device 40, please refer to the implementation process of the corresponding steps in the method for restoring the balance of the blockchain account executed by the blockchain client. For related details, please refer to the description of the method implementation. That's it, I won't repeat it here.
以上所描述的装置实施方式仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部单元或模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。The device implementations described above are merely illustrative, where the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical modules, that is, they may be located in One place, or it can be distributed to multiple network modules. Some or all of the units or modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement it without creative work.
上述实施方式阐明的装置、单元、模块,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The devices, units, and modules described in the foregoing implementation manners may be specifically implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. The specific form of the computer can 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 receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
与上述方法实施方式相对应,本说明书的实施方式还提供了一种计算机设备,如图5所示,该计算机设备包括存储器和处理器。其中,存储器上存储有能够由处理器运行的计算机程序;处理器在运行存储的计算机程序时,执行本说明书实施方式中节点设备所执行的区块链账户余额的存证方法的各个步骤。对上述节点设备所执行的区块链账户余额的存证方法的各个步骤的详细描述请参见之前的内容,不再重复。Corresponding to the foregoing method embodiments, the embodiments of this specification also provide a computer device. As shown in FIG. 5, the computer device includes a memory and a processor. Wherein, the memory stores a computer program that can be run by the processor; when the processor runs the stored computer program, it executes each step of the blockchain account balance deposit method executed by the node device in the embodiment of this specification. Please refer to the previous content for a detailed description of each step of the blockchain account balance deposit method executed by the above node device, and will not be repeated.
与上述方法实施方式相对应,本说明书的实施方式还提供了一种计算机设备,如图5所示,该计算机设备包括存储器和处理器。其中,存储器上存储有能够由处理器运行的计算机程序;处理器在运行存储的计算机程序时,执行本说明书实施方式中上述区块链客户端所执行的区块链账户余额的恢复方法的各个步骤。对上述区块链客户端所执行的区块链账户余额的恢复方法的各个步骤的详细描述请参见之前的内容,不再重复。Corresponding to the foregoing method embodiments, the embodiments of this specification also provide a computer device. As shown in FIG. 5, the computer device includes a memory and a processor. Among them, the memory stores a computer program that can be run by the processor; when the processor runs the stored computer program, it executes each of the blockchain account balance recovery methods executed by the blockchain client in the embodiment of this specification. step. Please refer to the previous content for a detailed description of each step of the method for restoring the balance of the blockchain account executed by the blockchain client, and will not be repeated.
以上所述仅为本说明书的较佳实施方式而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。The above descriptions are only the preferred embodiments of this specification, and are not intended to limit this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in this specification. Within the scope of protection.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可由任何方法或技术来实现信息存储。信息可是计算机可读指令、数据结构、程序的模块或其他数据。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data.
计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。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 technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements includes not only those elements, but also Other elements that are not explicitly listed, or also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element.
本领域技术人员应明白,本说明书的实施方式可提供为方法、系统或计算机程序产品。因此,本说明书的实施方式可采用完全硬件实施方式、完全软件实施方式或结合软件和硬件方面的实施方式的形式。而且,本说明书的实施方式可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the implementation of this specification can be provided as a method, a system or a computer program product. Therefore, the implementation manners in this specification may adopt the form of a complete hardware implementation, a complete software implementation, or a combination of software and hardware implementations. Moreover, the implementation of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. .

Claims (22)

  1. 一种区块链账户余额的存证方法,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述方法包括:A method for depositing a blockchain account balance, wherein the account balances of user accounts stored on the blockchain are all encrypted using a first encryption algorithm, and the method includes:
    区块链的节点设备接收区块链用户客户端基于预设的发送周期发送的存证交易;所述存证交易包括当时区块高度和当时恢复参数;其中,所述当时区块高度为所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;The node device of the blockchain receives the deposit certificate transaction sent by the blockchain user client based on the preset sending cycle; the deposit certificate transaction includes the current block height and the current recovery parameters; wherein, the current block height is all The block height at the time of construction of the attestation transaction, and the recovery parameters at that time are the plaintext of the encrypted account balance of the blockchain user at the time of construction of the attestation transaction, which is stored locally by the client Multiple parameters to be restored, and at least part of the parameters restored at that time are encrypted;
    将所述存证交易发布至所述区块链,以使所述区块链对所述存证交易进行共识处理;Publishing the certificate deposit transaction to the blockchain, so that the blockchain performs consensus processing on the certificate deposit transaction;
    当所述存证交易共识通过,将所述存证交易存储至所述区块链的分布式账本,并将所述当时区块高度和当时恢复参数对应更新在所述区块链用户的状态数据库。When the attestation transaction consensus is passed, the attestation transaction is stored in the distributed ledger of the blockchain, and the current block height and recovery parameters at the time are updated correspondingly to the state of the blockchain user database.
  2. 根据权利要求1所述的方法,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。The method according to claim 1, wherein the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  3. 根据权利要求1或2所述的方法,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;The method according to claim 1 or 2, wherein the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account of the user account stored on the blockchain The balance is encrypted using the first encryption algorithm and the random number as the encryption factor;
    所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。The recovery parameters at that time include the current random number corresponding to the encrypted account balance at the time of construction, and the encrypted account balance of the blockchain user at the time of construction of the deposit transaction; The random number is encrypted.
  4. 根据权利要求1或2所述的方法,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;The method according to claim 1 or 2, wherein the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account of the user account stored on the blockchain The balance is encrypted using the first encryption algorithm and the random number as the encryption factor;
    所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的被加密的账户余额的明文被加密处理。The recovery parameters at that time include the current random number corresponding to the encrypted account balance at the time of construction, and the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit certificate transaction; The plaintext of the random number at the time and the encrypted account balance at the time of construction is encrypted.
  5. 根据权利要求4所述的方法,所述第一加密算法为同态加密算法,所述当时随机数为所述构建时刻的被加密的账户余额对应的加密随机数;The method according to claim 4, wherein the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is an encrypted random number corresponding to the encrypted account balance at the construction time;
    所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密。The transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the transfer amount. The key encryption related to the public key of the blockchain user.
  6. 一种区块链账户余额的恢复方法,所述区块链上存储的用户账户的账户余额均 被采用第一加密算法进行了加密处理,所述方法包括:A method for restoring the balance of a blockchain account. The account balances of user accounts stored on the blockchain are all encrypted using a first encryption algorithm. The method includes:
    区块链用户客户端基于预设的发送周期向区块链的节点设备发送存证交易,以使所述存证交易被共识通过后,将所述存证交易包括的当时区块高度和当时恢复参数对应更新在所述区块链账户的状态数据库中;其中,所述当时区块高度为所述客户端同步的区块链在所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;The blockchain user client sends a deposit transaction to the node device of the blockchain based on the preset sending cycle, so that after the deposit transaction is passed by consensus, the current block height and the current block height included in the deposit transaction are included in the transaction. The recovery parameters are correspondingly updated in the state database of the blockchain account; wherein, the current block height is the block height of the blockchain synchronized by the client at the time the deposit transaction is constructed, and the current block height The recovery parameters are multiple parameters that are stored locally by the client and can recover the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit transaction, and the parameters of the recovery parameters at that time At least part of the parameters are encrypted;
    获取所述区块链账户的状态数据库中的与所述存证交易最新构建时刻对应的最新当时恢复参数和最新当时区块高度;Acquiring the latest recovery parameters and the latest current block height corresponding to the latest construction time of the deposit transaction in the state database of the blockchain account;
    解密所述最新当时恢复参数的至少部分参数,并基于解密所得的最新当时恢复参数获得所述最新构建时刻的被加密的账户余额的明文;Decrypt at least part of the parameters of the latest recovery parameters at the time, and obtain the plaintext of the encrypted account balance at the latest construction time based on the latest recovery parameters obtained from the decryption;
    基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文。Based on the clear text of the encrypted account balance at the latest construction time, starting from the block after the latest current block height, based on the transfer transaction related to the blockchain user stored on the blockchain , Restore the plaintext of the current account balance of the blockchain user.
  7. 根据权利要求6所述的方法,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。The method according to claim 6, wherein the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  8. 根据权利要求6或7所述的方法,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;According to the method of claim 6 or 7, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the account of the user account stored on the blockchain The balance is encrypted using the first encryption algorithm and the random number as the encryption factor;
    所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。The recovery parameters at that time include the current random number corresponding to the encrypted account balance at the time of construction, and the encrypted account balance of the blockchain user at the time of construction of the deposit transaction; The random number is encrypted.
  9. 根据权利要求6或7所述的方法,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;According to the method of claim 6 or 7, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the accounts of the user accounts stored on the blockchain The balance is encrypted using the first encryption algorithm and the random number as the encryption factor;
    所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的账户余额的明文被加密处理。The recovery parameters at that time include the current random number corresponding to the encrypted account balance at the time of construction, and the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit certificate transaction; The plain text of the random number at the time and the account balance at the time of construction is encrypted.
  10. 根据权利要求9所述的方法,所述第一加密算法为同态加密算法,所述当时随机数为对所述构建时刻的被加密的账户余额同态加密时所使用的随机数;The method according to claim 9, wherein the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is a random number used for homomorphic encryption of the encrypted account balance at the construction time;
    所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账 金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密;The transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the transfer amount. The key encryption related to the public key of the blockchain user;
    所述基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文,包括:The plaintext of the encrypted account balance based on the latest construction time starts from the height of the latest current block, based on the transfer transactions stored on the blockchain related to the blockchain user, and restores Obtain the plaintext of the current account balance of the blockchain user, including:
    基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,使用与所述区块链用户的私钥相关的密钥逐个解密与所述区块链用户相关的转账交易,以逐个获得所述转账交易的转账金额和转账金额随机数;Based on the plaintext of the encrypted account balance at the latest construction time, starting from the block after the latest current block height, the key related to the private key of the blockchain user is used to decrypt one by one with the Blockchain user-related transfer transactions to obtain the transfer amount and the transfer amount random number of the transfer transaction one by one;
    基于所述转账交易的转账金额和转账金额随机数,逐个恢复与所述转账交易对应的所述区块链用户的账户余额的明文,直至恢复得到所述区块链用户的当前的账户余额的明文。Based on the transfer amount of the transfer transaction and the transfer amount random number, restore the plaintext of the account balance of the blockchain user corresponding to the transfer transaction one by one, until the current account balance of the blockchain user is recovered Plaintext.
  11. 一种区块链账户余额的存证装置,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述装置应用于区块链的节点设备,包括:A device for depositing a blockchain account balance. The account balances of user accounts stored on the blockchain are all encrypted using a first encryption algorithm. The device is applied to the node equipment of the blockchain and includes :
    接收单元,接收区块链用户客户端基于预设的发送周期发送的存证交易;所述存证交易包括当时区块高度和当时恢复参数;其中,所述当时区块高度为所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;The receiving unit receives the deposit certificate transaction sent by the blockchain user client based on the preset sending cycle; the deposit certificate transaction includes the current block height and the current recovery parameter; wherein, the current block height is the deposit certificate The block height at the time of transaction construction, and the restoration parameters at that time are stored locally by the client and can restore the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit certificate transaction Multiple parameters, and at least part of the parameters of the restored parameters at the time are encrypted;
    发布单元,将所述存证交易发布至所述区块链,以使所述区块链对所述存证交易进行共识处理;A publishing unit that publishes the certificate deposit transaction to the blockchain, so that the blockchain performs consensus processing on the certificate deposit transaction;
    存储单元,当所述存证交易共识通过,将所述存证交易存储至所述区块链的分布式账本,并将所述当时区块高度和当时恢复参数对应更新在所述区块链用户的状态数据库。The storage unit, when the attestation transaction consensus is passed, store the attestation transaction in the distributed ledger of the blockchain, and update the current block height and recovery parameters in the blockchain correspondingly The user's state database.
  12. 根据权利要求11所述的装置,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。The device according to claim 11, wherein the deposit certificate transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  13. 根据权利要求11或12所述的装置,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;The device according to claim 11 or 12, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the accounts of the user accounts stored on the blockchain The balance is encrypted using the first encryption algorithm and the random number as the encryption factor;
    所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。The recovery parameters at that time include the current random number corresponding to the encrypted account balance at the time of construction, and the encrypted account balance of the blockchain user at the time of construction of the deposit transaction; The random number is encrypted.
  14. 根据权利要求11或12所述的装置,所述区块链上存储的用户账户的账户余额 均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;The device according to claim 11 or 12, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the accounts of the user accounts stored on the blockchain The balance is encrypted using the first encryption algorithm and the random number as the encryption factor;
    所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的被加密的账户余额的明文被加密处理。The recovery parameters at that time include the current random number corresponding to the encrypted account balance at the time of construction, and the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit certificate transaction; The plaintext of the random number at the time and the encrypted account balance at the time of construction is encrypted.
  15. 根据权利要求14所述的装置,所述第一加密算法为同态加密算法,所述当时随机数为所述构建时刻的被加密的账户余额对应的加密随机数;The device according to claim 14, wherein the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is an encrypted random number corresponding to the encrypted account balance at the construction time;
    所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密。The transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the transfer amount. The key encryption related to the public key of the blockchain user.
  16. 一种区块链账户余额的恢复装置,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,所述装置应用于区块链用户客户端,包括:A device for restoring a blockchain account balance. The account balances of user accounts stored on the blockchain are all encrypted using a first encryption algorithm. The device is applied to a blockchain user client and includes:
    发送单元,基于预设的发送周期向区块链的节点设备发送存证交易,以使所述存证交易被共识通过后,将所述存证交易包括的当时区块高度和当时恢复参数对应更新在所述区块链账户的状态数据库中;其中,所述当时区块高度为所述客户端同步的区块链在所述存证交易构建时刻的区块高度,所述当时恢复参数为所述客户端本地存储的、可对所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文进行恢复的多个参数,且所述当时恢复参数的至少部分参数被加密处理;The sending unit sends a deposit transaction to the node device of the blockchain based on a preset sending cycle, so that after the deposit transaction is passed by consensus, the current block height included in the deposit transaction corresponds to the current recovery parameter Updated in the state database of the blockchain account; wherein, the current block height is the block height of the blockchain synchronized by the client at the time the deposit transaction is constructed, and the current recovery parameter is A plurality of parameters stored locally by the client that can restore the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit certificate transaction, and at least some of the parameters of the restored parameters at that time Be encrypted
    获取单元,获取所述区块链账户的状态数据库中的与所述存证交易最新构建时刻对应的最新当时恢复参数和最新当时区块高度;An acquiring unit to acquire the latest current recovery parameters and the latest current block height corresponding to the latest construction time of the deposit certificate transaction in the state database of the blockchain account;
    解密及恢复单元,解密所述最新当时恢复参数的至少部分参数,并基于解密所得的最新当时恢复参数获得所述最新构建时刻的被加密的账户余额的明文;基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,基于所述区块链上存储的与所述区块链用户相关的转账交易,恢复得到所述区块链用户的当前的账户余额的明文。The decryption and recovery unit decrypts at least part of the parameters of the latest recovery parameters at the time, and obtains the plaintext of the encrypted account balance at the latest construction time based on the latest recovery parameters obtained by the decryption; the encrypted account balance at the latest construction time is based on the encryption The clear text of the account balance of, starting from the block after the latest current block height, based on the transfer transaction related to the blockchain user stored on the blockchain, the blockchain user is restored The clear text of the current account balance.
  17. 根据权利要求16所述的装置,所述存证交易基于所述区块链客户端的存储快照构建,所述存储快照包括所述当时区块高度和当时恢复参数。The device according to claim 16, wherein the attestation transaction is constructed based on a storage snapshot of the blockchain client, and the storage snapshot includes the current block height and current recovery parameters.
  18. 根据权利要求16或17所述的装置,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;According to the device of claim 16 or 17, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the accounts of the user accounts stored on the blockchain The balance is encrypted using the first encryption algorithm and the random number as the encryption factor;
    所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所 述区块链用户在所述存证交易的构建时刻的被加密的账户余额;其中,所述当时随机数被加密处理。The recovery parameters at that time include the current random number corresponding to the encrypted account balance at the time of construction, and the encrypted account balance of the blockchain user at the time of construction of the deposit transaction; The random number is encrypted.
  19. 根据权利要求16或17所述的装置,所述区块链上存储的用户账户的账户余额均被采用第一加密算法进行了加密处理,包括:所述区块链上存储的用户账户的账户余额被采用第一加密算法、将随机数作为加密因子进行了加密处理;According to the device of claim 16 or 17, the account balances of the user accounts stored on the blockchain are all encrypted using the first encryption algorithm, including: the accounts of the user accounts stored on the blockchain The balance is encrypted using the first encryption algorithm and the random number as the encryption factor;
    所述当时恢复参数包括所述构建时刻的被加密的账户余额对应的当时随机数,和所述区块链用户在所述存证交易的构建时刻的被加密的账户余额的明文;其中,所述当时随机数、所述构建时刻的被加密的账户余额的明文被加密处理。The recovery parameters at that time include the current random number corresponding to the encrypted account balance at the time of construction, and the plaintext of the encrypted account balance of the blockchain user at the time of construction of the deposit certificate transaction; The plaintext of the random number at the time and the encrypted account balance at the time of construction is encrypted.
  20. 根据权利要求19所述的装置,所述第一加密算法为同态加密算法,所述当时随机数为对所述构建时刻的被加密的账户余额同态加密时所使用的随机数;The device according to claim 19, wherein the first encryption algorithm is a homomorphic encryption algorithm, and the current random number is a random number used when homomorphically encrypting the encrypted account balance at the construction time;
    所述区块链用户相关的转账交易的转账金额也被采用所述同态加密算法、基于转账金额随机数作为加密因子进行了加密,且所述转账金额和所述转账金额随机数被与所述区块链用户的公钥相关的密钥加密;The transfer amount of the transfer transaction related to the blockchain user is also encrypted using the homomorphic encryption algorithm, based on the transfer amount random number as the encryption factor, and the transfer amount and the transfer amount random number are combined with the transfer amount. The key encryption related to the public key of the blockchain user;
    所述解密和恢复单元,进一步基于所述最新构建时刻的被加密的账户余额的明文,从与所述最新当时区块高度之后的区块开始,使用与所述区块链用户的私钥相关的密钥逐个解密与所述区块链用户相关的转账交易,以逐个获得所述转账交易的转账金额和转账金额随机数;The decryption and recovery unit is further based on the plaintext of the encrypted account balance at the latest construction time, starting from the block after the latest current block height, and using the private key related to the blockchain user Decrypt the transfer transactions related to the blockchain user one by one to obtain the transfer amount and the transfer amount random number of the transfer transaction one by one;
    基于所述转账交易的转账金额和转账金额随机数,逐个恢复与所述转账交易对应的所述区块链用户的账户余额的明文,直至恢复得到所述区块链用户的当前的账户余额的明文。Based on the transfer amount of the transfer transaction and the transfer amount random number, restore the plaintext of the account balance of the blockchain user corresponding to the transfer transaction one by one, until the current account balance of the blockchain user is recovered Plaintext.
  21. 一种计算机设备,包括:存储器和处理器;所述存储器上存储有可由所述处理器运行的计算机程序;所述处理器运行所述计算机程序时,执行如权利要求1至5任意一项所述的方法。A computer device, comprising: a memory and a processor; the memory stores a computer program that can be run by the processor; when the processor runs the computer program, it executes as described in any one of claims 1 to 5 The method described.
  22. 一种计算机设备,包括:存储器和处理器;所述存储器上存储有可由所述处理器运行的计算机程序;所述处理器运行所述计算机程序时,执行如权利要求6至10任意一项所述的方法。A computer device, comprising: a memory and a processor; the memory stores a computer program that can be run by the processor; when the processor runs the computer program, the processor executes any one of claims 6 to 10 The method described.
PCT/CN2021/081720 2020-04-02 2021-03-19 Deposit certificate and recovery of balance of blockchain account WO2021197092A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010254885.3A CN111160913B (en) 2020-04-02 2020-04-02 Block chain account balance deposit certificate and recovery method and device
CN202010254885.3 2020-04-02

Publications (1)

Publication Number Publication Date
WO2021197092A1 true WO2021197092A1 (en) 2021-10-07

Family

ID=70567707

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/081720 WO2021197092A1 (en) 2020-04-02 2021-03-19 Deposit certificate and recovery of balance of blockchain account

Country Status (2)

Country Link
CN (2) CN112001731B (en)
WO (1) WO2021197092A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338676A (en) * 2021-12-31 2022-04-12 支付宝(杭州)信息技术有限公司 Block synchronization method and device, electronic equipment and storage medium
CN114978547A (en) * 2022-05-23 2022-08-30 杨永红 Under-link transaction method, device and equipment based on block chain network

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001731B (en) * 2020-04-02 2022-05-24 支付宝(杭州)信息技术有限公司 Block chain account balance deposit certificate and recovery method and device
CN111723149A (en) * 2020-05-18 2020-09-29 天津大学 Block chain storage optimization system and method based on remainder system
CN111651300B (en) * 2020-06-05 2023-03-21 成都质数斯达克科技有限公司 Block chain data recovery method, device, equipment and medium
CN111768180B (en) * 2020-06-24 2022-05-24 江苏荣泽信息科技股份有限公司 Block chain account balance deposit certificate and recovery method
CN112948350B (en) * 2021-02-02 2023-08-01 中央财经大学 Distributed ledger model cold data archiving and migration storage method based on MPT verification
CN116957579A (en) * 2021-04-27 2023-10-27 支付宝(杭州)信息技术有限公司 Data storage method and device based on blockchain
CN114362961B (en) * 2022-01-04 2024-03-19 北京众享比特科技有限公司 Block chain-based account recovery method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180075453A1 (en) * 2016-09-15 2018-03-15 American Express Travel Related Services Company, Inc. Systems and methods for blockchain based payment networks
CN108229943A (en) * 2018-01-19 2018-06-29 阿里巴巴集团控股有限公司 The method of adjustment of block chain remaining sum and device, electronic equipment
CN110073633A (en) * 2018-11-07 2019-07-30 阿里巴巴集团控股有限公司 Use the block chain data protection of homomorphic cryptography
CN110400142A (en) * 2018-06-01 2019-11-01 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN110471795A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Block chain state data reconstruction method and device, electronic equipment
CN111160913A (en) * 2020-04-02 2020-05-15 支付宝(杭州)信息技术有限公司 Block chain account balance deposit certificate and recovery method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106549749B (en) * 2016-12-06 2019-12-24 杭州趣链科技有限公司 Block chain privacy protection method based on addition homomorphic encryption
CN107395360A (en) * 2017-07-23 2017-11-24 刘志强 The method that a kind of historical relic and art work numeral based on block chain technology deposit card
EP3522064B1 (en) * 2018-02-02 2021-12-22 Università Degli Studi Di Trento A method and apparatus for distributed, privacy-preserving and integrity-preserving exchange, inventory and order book
CN108550037B (en) * 2018-04-11 2022-05-17 北京知金链网络技术有限公司 File processing method and device based on block chain
CN109120714B (en) * 2018-09-21 2021-07-09 深圳市九洲电器有限公司 Security data recovery method and system, and node server
CN110264193B (en) * 2019-05-20 2021-05-18 创新先进技术有限公司 Receipt storage method and node combining user type and transaction type
CN110266467B (en) * 2019-05-31 2021-04-27 创新先进技术有限公司 Method and device for realizing dynamic encryption based on block height
CN110866265A (en) * 2019-11-19 2020-03-06 腾讯科技(深圳)有限公司 Data storage method, device and storage medium based on block chain

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180075453A1 (en) * 2016-09-15 2018-03-15 American Express Travel Related Services Company, Inc. Systems and methods for blockchain based payment networks
CN108229943A (en) * 2018-01-19 2018-06-29 阿里巴巴集团控股有限公司 The method of adjustment of block chain remaining sum and device, electronic equipment
CN110400142A (en) * 2018-06-01 2019-11-01 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN110073633A (en) * 2018-11-07 2019-07-30 阿里巴巴集团控股有限公司 Use the block chain data protection of homomorphic cryptography
CN110471795A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Block chain state data reconstruction method and device, electronic equipment
CN111160913A (en) * 2020-04-02 2020-05-15 支付宝(杭州)信息技术有限公司 Block chain account balance deposit certificate and recovery method and device
CN112001731A (en) * 2020-04-02 2020-11-27 支付宝(杭州)信息技术有限公司 Block chain account balance deposit certificate and recovery method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338676A (en) * 2021-12-31 2022-04-12 支付宝(杭州)信息技术有限公司 Block synchronization method and device, electronic equipment and storage medium
CN114978547A (en) * 2022-05-23 2022-08-30 杨永红 Under-link transaction method, device and equipment based on block chain network
CN114978547B (en) * 2022-05-23 2023-11-24 丰猫网络技术(深圳)有限公司 Under-chain transaction method, device and equipment based on blockchain network

Also Published As

Publication number Publication date
CN111160913A (en) 2020-05-15
CN111160913B (en) 2020-07-17
CN112001731A (en) 2020-11-27
CN112001731B (en) 2022-05-24

Similar Documents

Publication Publication Date Title
WO2021197092A1 (en) Deposit certificate and recovery of balance of blockchain account
TWI746949B (en) Block chain-based privacy transaction and its application method and device
Wang et al. Blockchain-based fair payment smart contract for public cloud storage auditing
JP6892513B2 (en) Off-chain smart contract service based on a reliable execution environment
TWI734090B (en) Block chain transaction method and device, and electronic equipment
US11410145B2 (en) Blockchain-implemented method for control and distribution of digital content
CN110300973B (en) Establishment of a federated blockchain network
JP6389350B2 (en) Transaction processing apparatus, transaction processing method, and program therefor
EP3491598B1 (en) Blockchain-implemented method and system
US11895248B2 (en) Method and apparatus for generating blockchain transaction
TWI723665B (en) Authentication based on a recoverd public key
CN111656343B (en) Error correction coding based shared blockchain data storage in trusted execution environments
CN110800250B (en) Controlled release of encrypted private keys
EP3619668B1 (en) Performing parallel execution of transactions in a distributed ledger system
CN111837117B (en) Error correction coding based shared blockchain data storage in trusted execution environments
TWI727284B (en) Block chain-based privacy transaction method, device and computer equipment, application method based on block chain privacy transaction and computer equipment
WO2021174927A1 (en) Blockchain-based identity verification method and apparatus, device, and storage medium
AU2019204713A1 (en) Transferring digital tickets based on blockchain networks
CN110800252A (en) Preventing participant misrepresentation of input data in secure multi-party computing
US11386426B2 (en) Invoice invalidation method and apparatus based on blockchain, and electronic device
EP3808030B1 (en) Managing blockchain-based centralized ledger systems
CN111241557B (en) Service request method and device based on block chain
WO2021204044A1 (en) Correction of blockchain data
CN112612856B (en) Block chain-based data processing method and device
CN111127021B (en) Service request method and device based on block chain

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

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

Country of ref document: EP

Kind code of ref document: A1