A blockchain-based information sharing method and device, and a storage medium
By leveraging blockchain technology and homomorphic encryption functions, the problem of property losses caused by the lack of information sharing among banks has been solved, enabling information sharing and reasonable lending decisions while protecting privacy.
Patent Information
- Application Number
- CN202010327203.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-23
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2040-04-23
AI Technical Summary
When banks share corporate tax data, they are reluctant to share lending information in order to protect customer information. This may result in multiple banks simultaneously lending to companies beyond their risk tolerance, increasing the risk of financial loss for the banks.
By using blockchain technology and homomorphic encryption functions to encrypt asset information and perform homomorphic operations within the blockchain network, information sharing between banks can be achieved, ensuring asset transfer decisions are made while protecting privacy.
This reduces the risk of information leakage and minimizes financial losses for banks, enabling multi-party information sharing among banks and rationalizing lending decisions.
Smart Images

Figure CN111507818B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a blockchain-based information sharing method, apparatus, and storage medium. Background Technology
[0002] A company's tax data can reflect its operating performance to some extent, and banks can access this data with the company's authorization. Currently, there are various types of banks, and a company can authorize multiple banks to share the same tax data. Each bank, upon receiving the company's tax data, can assess the company's risk tolerance and determine the appropriate loan amount. However, to protect customer information, banks do not share loan information, which can lead to multiple banks lending to the same company simultaneously. If the total loan amount from these multiple banks exceeds the company's risk tolerance, these banks may be liable for the risk of the company's inability to repay. Summary of the Invention
[0003] This application provides a blockchain-based information sharing method and apparatus, which enables multi-party information sharing based on blockchain while protecting privacy. This not only reduces the risk of information leakage but also reduces financial losses for banks.
[0004] Firstly, this application provides a blockchain-based information sharing method, which includes:
[0005] The blockchain node receives an asset transfer request from the first account. The asset transfer request includes first asset information, which includes the object identifier of the asset transfer object, first ciphertext, and second ciphertext. The first ciphertext is the ciphertext of the first asset after homomorphic encryption using a target encryption function, and the second ciphertext is the ciphertext of the second asset after homomorphic encryption using the same target encryption function. The amount of the second asset is greater than or equal to the amount of the first asset.
[0006] If an asset transfer record corresponding to the object identifier is detected in the blockchain network, the blockchain node calls the smart contract to calculate the sum of the third ciphertexts included in each asset transfer record corresponding to the object identifier, and obtains the fourth ciphertext. The third ciphertext, the first ciphertext, and the second ciphertext are all obtained by homomorphic encryption using the same encryption function.
[0007] If the fourth ciphertext is smaller than the second ciphertext, and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext, then the blockchain node calls the smart contract to perform a homomorphic operation on the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext.
[0008] The blockchain node returns a first asset transfer response to the first account, enabling the first account to homomorphically decrypt the fifth ciphertext included in the first asset transfer response, obtain the fifth asset, and transfer the fifth asset to the asset transfer recipient.
[0009] In conjunction with the first aspect, in one possible implementation, after the blockchain node invokes the smart contract to perform a homomorphic operation on the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext, the method further includes:
[0010] The blockchain node sends the second ciphertext, the fourth ciphertext, and the fifth ciphertext to each consensus node in the blockchain network, so that each consensus node returns a consensus confirmation message when it verifies that the difference between the second ciphertext and the fourth ciphertext is equal to the fifth ciphertext.
[0011] If the consensus confirmation messages returned by each consensus node meet the preset consensus strategy, then the blockchain node is triggered to return the first asset transfer response to the first account.
[0012] In conjunction with the first aspect, in one possible implementation, the first account is a bank account, the asset transfer target is a corporate account, the first asset information is the pre-loan information of the bank account, the first asset is the pre-loan limit of the bank account, the second asset is the maximum loan limit of the bank account, and the asset transfer record is a loan record.
[0013] Secondly, this application provides an information sharing device, which includes:
[0014] The transceiver module is used to receive an asset transfer request from a first account. The asset transfer request includes first asset information, which includes an object identifier of the asset transfer object, a first ciphertext, and a second ciphertext. The first ciphertext is the ciphertext of the first asset after homomorphic encryption using a target encryption function, and the second ciphertext is the ciphertext of the second asset after homomorphic encryption using the target encryption function. The amount of the second asset is greater than or equal to the amount of the first asset.
[0015] The statistics module is used to call the smart contract to calculate the sum of the third ciphertexts included in each asset transfer record corresponding to the object identifier when the existence of the asset transfer record corresponding to the object identifier is detected in the blockchain network, so as to obtain the fourth ciphertext. The third ciphertext, the first ciphertext, and the second ciphertext are all obtained by homomorphic encryption using the same encryption function.
[0016] The calculation module is used to call the smart contract to perform a homomorphic operation on the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext when the fourth ciphertext is less than the second ciphertext and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext.
[0017] The transceiver module is also used to return a first asset transfer response to the first account, so that the first account can homomorphically decrypt the fifth ciphertext included in the first asset transfer response to obtain the fifth asset, and transfer the fifth asset to the asset transfer object.
[0018] In conjunction with the second aspect, in one possible implementation, the aforementioned asset transfer request further includes a first signature and an account identifier of the first account. The device also includes a detection module. The aforementioned transceiver module is further configured to send the asset transfer request to each consensus node in the blockchain network, so that each consensus node can search for the public key of the first account in the blockchain network based on the account identifier of the first account, and perform consensus confirmation on the first signature based on the public key of the first account and the first asset information; the detection module is configured to detect whether an asset transfer record corresponding to the object identifier exists in the blockchain network when the consensus confirmation messages returned by each consensus node satisfy a preset consensus strategy.
[0019] In conjunction with the second aspect, in one possible implementation, the aforementioned transceiver module is further configured to, upon detecting that no asset transfer record corresponding to the object identifier exists in the blockchain network, return a second asset transfer response to the first account, so that the first account transfers the first asset to the asset transfer object; or, when the sum of the fourth ciphertext and the first ciphertext is less than or equal to the second ciphertext, return the second asset transfer response to the first account, so that the first account transfers the first asset to the asset transfer object.
[0020] In conjunction with the second aspect, in one possible implementation, the aforementioned first asset information further includes a first time period. Specifically, the aforementioned statistics module is used to: when an asset transfer record corresponding to the object identifier is detected in the blockchain network, determine a second time period based on the first time period and the time interval corresponding to the credit rating of the asset transfer object; the aforementioned calculation module calls a smart contract to obtain each third ciphertext in the asset transfer record corresponding to the object identifier within the second time period, and uses the sum of each third ciphertext in the asset transfer record corresponding to the object identifier within the second time period as the fourth ciphertext.
[0021] In conjunction with the second aspect, in one possible implementation, the aforementioned transceiver module is further configured to, upon receiving the first asset transfer record of the asset transfer object and the second signature of the first asset transfer record encrypted with the private key of the first account, wherein the first asset transfer record includes the fifth ciphertext, the object identifier, and the account identifier of the first account; send the first asset transfer record and the second signature to each consensus node in the blockchain network, so that each consensus node can search for the public key of the first account in the blockchain network based on the account identifier of the first account, and perform consensus confirmation on the second signature based on the public key of the first account and the first asset transfer record; the aforementioned transceiver module is further configured to, when the consensus confirmation messages returned by each consensus node satisfy the preset consensus strategy, upload the first asset transfer record to the blockchain network.
[0022] In conjunction with the second aspect, in one possible implementation, the device further includes a lookup module. The aforementioned transceiver module is further configured to receive asset clearing information from the asset transfer object, the asset clearing information including the account identifier of the first account and a sixth ciphertext, the sixth ciphertext being the ciphertext of the sixth asset after homomorphic encryption using the target encryption function; the lookup module is configured to search for the first asset transfer record in the blockchain network; the aforementioned calculation module is further configured to call the smart contract to perform a homomorphic operation between the fifth ciphertext and the sixth ciphertext in the first asset transfer record to obtain a seventh ciphertext; the aforementioned transceiver module is further configured to return the seventh ciphertext to the asset transfer object and update the first asset transfer record in the blockchain network based on the seventh ciphertext.
[0023] In conjunction with the second aspect, in one possible implementation, the aforementioned transceiver module is further configured to send the second ciphertext, the fourth ciphertext, and the fifth ciphertext to each consensus node in the blockchain network, so that each consensus node returns a consensus confirmation message when verifying that the difference between the second ciphertext and the fourth ciphertext is equal to the fifth ciphertext; and when the consensus confirmation messages returned by each consensus node satisfy a preset consensus strategy, a first asset transfer response is returned to the first account.
[0024] In conjunction with the second aspect, in one possible implementation, the first account is a bank account, the asset transfer target is a corporate account, the first asset information is the pre-loan information of the bank account, the first asset is the pre-loan limit of the bank account, the second asset is the maximum loan limit of the bank account, and the asset transfer record is a loan record.
[0025] Thirdly, this application provides a blockchain node, including: a processor, a memory, and a transceiver;
[0026] The processor is connected to a memory and a transceiver. The memory stores program code, and the transceiver communicates with various consensus nodes in the blockchain network or sends and receives information / data. Specifically, the transceiver is used to receive an asset transfer request from a first account. The asset transfer request includes first asset information, which includes an object identifier of the asset transfer object, a first ciphertext, and a second ciphertext. The first ciphertext is the ciphertext of the first asset after homomorphic encryption using a target encryption function, and the second ciphertext is the ciphertext of the second asset after homomorphic encryption using the same target encryption function. The amount of the second asset is greater than or equal to the amount of the first asset.
[0027] The processor is used to call this program code to perform the following operations:
[0028] If an asset transfer record corresponding to the object identifier is detected on the blockchain, the smart contract is invoked to calculate the sum of the third ciphertexts included in each asset transfer record corresponding to the object identifier, and the fourth ciphertext is obtained. The third ciphertext, the first ciphertext, and the second ciphertext are all obtained by homomorphic encryption of the same encryption function.
[0029] If the fourth ciphertext is smaller than the second ciphertext, and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext, then the smart contract is invoked to perform a homomorphic operation on the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext.
[0030] The transceiver is also used to: return a first asset transfer response to the first account, so that the first account can homomorphically decrypt the fifth ciphertext included in the first asset transfer response to obtain the fifth asset, and transfer the fifth asset to the asset transfer object.
[0031] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the blockchain-based information sharing method as described in the first aspect of embodiments of this application.
[0032] This embodiment of the application receives an asset transfer request from a first account. When an asset transfer record corresponding to the object identifier included in the asset transfer request is detected on the blockchain, a smart contract is invoked to calculate the sum of the third ciphertext included in each asset transfer record corresponding to the object identifier, resulting in a fourth ciphertext. If the fourth ciphertext is less than the second ciphertext included in the asset transfer request, and the sum of the fourth ciphertext and the first ciphertext included in the asset transfer request is greater than the second ciphertext, then the smart contract is invoked to perform a homomorphic operation on the second and fourth ciphertexts to obtain a fifth ciphertext. A first asset transfer response is then returned to the first account, enabling the first account to homomorphically decrypt the fifth ciphertext included in the first asset transfer response to obtain a fifth asset, which is then transferred to the asset transfer object. By implementing this embodiment of the application, when information is shared among multiple parties in a blockchain network, using a target encryption function to homomorphically encrypt assets can protect the privacy of asset information, while performing homomorphic operations between ciphertexts reduces the financial loss of the first account. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1A This is a schematic diagram of the structure of the distributed system provided in the embodiments of this application;
[0035] Figure 1B This is a schematic diagram of the block structure provided in the embodiments of this application;
[0036] Figure 2 This is a flowchart illustrating a blockchain-based information sharing method provided in an embodiment of this application;
[0037] Figure 3 This is a flowchart illustrating another blockchain-based information sharing method provided in an embodiment of this application;
[0038] Figure 4 This is a schematic diagram of the structure of the information sharing device provided in the embodiments of this application;
[0039] Figure 5 This is a schematic diagram of the structure of a blockchain node provided in an embodiment of this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0041] The system involved in the embodiments of this application can be a distributed system formed by connecting a client and multiple nodes (any form of computing device in the network, such as a server or user terminal) through network communication.
[0042] Taking a distributed system as an example, see blockchain system. Figure 1A , Figure 1A This is a schematic diagram of the structure of a distributed system provided in an embodiment of this application. The distributed system 100 consists of multiple nodes (any form of computing device accessing the network, such as servers or user terminals) and clients, forming a peer-to-peer (P2P) network between the nodes. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In the distributed system, any machine, such as a server or terminal, can join and become a node. A node includes a hardware layer, a middleware layer, an operating system layer, and an application layer.
[0043] See Figure 1A The functions of each node in the blockchain system shown include:
[0044] 1) Routing: A basic function of nodes used to support communication between nodes.
[0045] In addition to routing capabilities, nodes can also have the following functions:
[0046] 2) Applications are deployed in the blockchain to implement specific business needs. They record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system. When other nodes successfully verify the source and integrity of the record data, they add the record data to a temporary block.
[0047] For example, the business logic implemented by the application includes:
[0048] 2.1) A wallet is used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system; after other nodes successfully verify the transaction, they store the transaction record data in the temporary block of the blockchain as a response to acknowledge the validity of the transaction; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;
[0049] 2.2) Shared ledger, used to provide functions such as storage, query and modification of ledger data. It sends the record data of the operation on the ledger data to other nodes in the blockchain system. After the other nodes verify the validity, as a response to acknowledge the validity of the ledger data, they store the record data in a temporary block. They can also send confirmation to the node that initiated the operation.
[0050] 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented through code deployed on a shared ledger that executes when certain conditions are met. Based on actual business needs, the code is used to complete automated transactions, such as querying the logistics status of goods purchased by a buyer and transferring the buyer's electronic money to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions; they can also execute contracts for processing received information.
[0051] 3) A blockchain consists of a series of blocks that are sequentially generated. Once a new block is added to the blockchain, it will not be removed. The blocks contain the data submitted by the nodes in the blockchain system.
[0052] See Figure 1B , Figure 1B This is a schematic diagram of the block structure provided in an embodiment of this application. For example... Figure 1B As shown, each block includes the hash value of the transactions stored in that block (the hash value of this block) and the hash value of the previous block. Blocks are linked together through these hash values to form the blockchain. Additionally, blocks may include information such as a timestamp when the block was generated. A blockchain is essentially a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains relevant information used to verify the validity of the information (anti-counterfeiting) and to generate the next block.
[0053] The following will be combined with the appendix Figure 2 To be continued Figure 3 This application describes the blockchain-based information sharing method provided.
[0054] In some feasible implementations, the blockchain node mentioned in the embodiments of this application can be Figure 1AAny node in the distributed system 100 shown, including a blockchain node deployed at the tax bureau, can communicate with clients. The first account and asset transfer object mentioned in this embodiment can communicate with nodes in the distributed system 100 through a client.
[0055] Please see Figure 2 , Figure 2 This is a flowchart illustrating a blockchain-based information sharing method provided in an embodiment of this application. Figure 2 As shown, this blockchain-based information sharing method may include, but is not limited to, the following steps:
[0056] S201, the blockchain node receives the asset transfer request from the first account.
[0057] In some feasible implementations, the aforementioned first account can be a bank account. The aforementioned asset transfer request can include first asset information, which can include the object identifier of the asset transfer target, a first ciphertext, and a second ciphertext. The asset transfer target can be a corporate account. The first ciphertext can be the ciphertext of the first asset after homomorphic encryption using a target encryption function, and the second ciphertext can be the ciphertext of the second asset after homomorphic encryption using the same target encryption function. The amount of the second asset is greater than or equal to the amount of the first asset. Optionally, the asset transfer request can be understood as the first account requesting the blockchain node to perform an asset transfer verification, verifying whether the first account can transfer the first asset to the asset transfer target. The first account sends the first asset information to the blockchain node. The first asset information can be pre-loan information, which includes the first asset (i.e., the pre-loan amount) and the second asset (i.e., the loan amount of the first account to the asset transfer target). In one possible implementation, the second asset is a preset value, which is determined by the first account based on the credit rating and / or tax information of the asset transfer target and has a corresponding relationship with the object identifier of the asset transfer target. The first asset may be proposed by the object to which the asset is transferred.
[0058] In some feasible implementations, when a bank user wants to lend money to a business, they can log in to the bank's client using a first account and input the object identifier of the loan recipient (i.e., the object identifier of the asset transfer recipient), the pre-loan amount (i.e., the first asset), and the maximum loan amount (i.e., the second asset). The object identifier of the asset transfer recipient can be the business's tax identification number or the name of the business's legal representative, etc. The bank client receives the object identifier of the asset transfer recipient and the first asset input by the bank user. Optionally, the second asset can be associated with the object identifier of the asset transfer recipient. When the bank user inputs the object identifier of the asset transfer recipient, the bank client can find the second asset based on the object identifier. The first asset is then homomorphically encrypted using a target encryption function to obtain the first ciphertext, and the second asset is homomorphically encrypted using the same target encryption function to obtain the second ciphertext. The bank client packages the object identifier of the asset transfer recipient, the first ciphertext, and the second ciphertext into first asset information and sends this first asset information to the blockchain node via the first account in an asset transfer request. Accordingly, the blockchain node receives the asset transfer request from the first account. The amount of the second asset is greater than or equal to the amount of the first asset.
[0059] It should be noted that homomorphic encryption refers to an encryption function that performs addition and multiplication operations on the plaintext on a ring before encryption, which is equivalent to performing the corresponding operations on the ciphertext after encryption. An encryption function with homomorphic properties is an encryption function that satisfies Dec(En(a)⊙En(b))=a⊕b for two plaintexts a and b, where En is the encryption operation, Dec is the decryption operation, and ⊙ and ⊕ correspond to operations on the plaintext and ciphertext fields, respectively. When ⊕ represents addition, the encryption is called additive homomorphic encryption; when ⊕ represents multiplication, the encryption is called multiplicative homomorphic encryption. The target encryption function in the embodiments of this application can be any function that satisfies a homomorphic encryption algorithm (or Dec(En(a)⊙En(b))=a⊕b).
[0060] In some feasible implementations, the asset transfer request further includes a first signature and an account identifier of the first account. After receiving the asset transfer request from the first account, the blockchain node can obtain the public key of the first account based on the account identifier. Each consensus node can then perform consensus confirmation on the first signature based on the public key of the first account and the first asset information. For example, each consensus node uses the public key of the first account to decrypt the first signature in the asset transfer request to obtain a first verification code. The consensus node performs a hash operation on the first asset information to obtain a second verification code. If the first verification code and the second verification code are the same, the consensus node confirms that the first signature belongs to the first account and returns a consensus confirmation message. If the consensus confirmation messages returned by each consensus node satisfy a preset consensus strategy, the blockchain node checks in the blockchain network whether there is an asset transfer record corresponding to the object identifier. In this embodiment, the blockchain node and each consensus node belong to the same blockchain network.
[0061] In some feasible implementations, the consensus nodes in the aforementioned blockchain network have different weights. A blockchain node receives the verification results of the first signature returned by each consensus node and can identify the consensus node that returned the consensus confirmation message as the target consensus node. The blockchain node can calculate the sum of the weights of each target consensus node and the sum of the weights of all consensus nodes in the blockchain network. The blockchain node compares whether the sum of the weights of the target consensus nodes exceeds half the sum of the weights of all consensus nodes in the blockchain network. If the sum of the weights of the target consensus nodes exceeds half the sum of the weights of all consensus nodes in the blockchain network, the blockchain node determines that the verification results of the first signature returned by each consensus node satisfy the preset consensus strategy.
[0062] S202, if an asset transfer record corresponding to an object identifier is detected in the blockchain network, the blockchain node calls the smart contract to calculate the sum of the third ciphertext included in each asset transfer record corresponding to the object identifier, and obtains the fourth ciphertext.
[0063] In some feasible implementations, after receiving the aforementioned asset transfer request, a blockchain node can check whether an asset transfer record corresponding to the aforementioned object identifier exists in the blockchain network. If an asset transfer record corresponding to the object identifier exists on the blockchain, it indicates that the asset transfer object has a loan record and is not taking out a loan for the first time. The blockchain node can then invoke a smart contract to retrieve each asset transfer record corresponding to the object identifier from the blockchain. The blockchain node can also invoke a smart contract to calculate the sum of the third ciphertext in each asset transfer record corresponding to the object identifier, obtaining a fourth ciphertext. Each asset transfer record includes at least one third ciphertext. This third ciphertext is the ciphertext of the asset to be repaid by the asset transfer object after homomorphic encryption using the aforementioned target encryption function. Optionally, the asset transfer record can be a transfer from the first account to the asset transfer object, or a transfer from another account to the asset transfer object. The third ciphertext, the first ciphertext, and the second ciphertext are all obtained by homomorphic encryption using the same encryption function.
[0064] In some feasible implementations, if no asset transfer record corresponding to the object identifier exists in the blockchain network, indicating that the asset transfer object has no loan record and this is its first loan, the blockchain node returns a second asset transfer response to the first account. If the sum of the fourth ciphertext and the first ciphertext is less than or equal to the second ciphertext, the blockchain node returns the second asset transfer response to the first account, enabling the first account to transfer the first asset to the asset transfer object. After receiving the second asset transfer response, the first account can transfer the first asset to the asset transfer object through a bank client to complete the bank's loan to the enterprise. Optionally, the first account can return the current asset transfer record to the blockchain node through a bank client. This asset transfer record includes the object identifier of the asset transfer object and the first ciphertext. The blockchain node can upload the asset transfer record returned by the first account to the blockchain, facilitating other bank accounts to query the enterprise's asset transfer records on the blockchain, thereby achieving information sharing between banks.
[0065] In some feasible implementations, the aforementioned first asset information also includes a first time period. The asset transfer record also includes time period information, which is the loan period, meaning the loan period from its start date to its full repayment date. If an asset transfer record corresponding to the object identifier exists on the blockchain, the blockchain node obtains the time interval corresponding to the credit rating of the transferred asset. Optionally, the credit rating of the transferred asset is a preset value, determined by the blockchain node based on the asset's repayment history. For example, if there is no repayment history, the credit rating of the transferred asset is assumed to be good. In one possible implementation, the credit rating and time interval have a corresponding relationship, which is a pre-set rule by the blockchain node. For example, a good credit rating corresponds to a 2-year time interval; an excellent credit rating corresponds to a 1-year time interval, and so on. The blockchain node can determine a second time period based on the first time period and the time interval corresponding to the asset's credit rating. A blockchain node can invoke a smart contract to retrieve the asset transfer records corresponding to the aforementioned asset transfer object in the blockchain network. It can then extract the third ciphertext from each of these records within a second time period. The sum of these third ciphertexts within the second time period is used as the fourth ciphertext. If the credit rating of the asset transfer object is higher than a preset rating, the start time of the second time period is the difference between the start time of the first time period and this time interval. For example, if the credit rating of the asset transfer recipient is good and the corresponding time interval is 2 years, then the blockchain node will use the start time of the first time period mentioned above as the end time to obtain the asset transfer records of the asset transfer recipient 2 years ago. For example, if the first time period is from April 21, 2020 to April 21, 2015, then the second time period is from April 21, 2018 to April 21, 2020. That is, the blockchain node obtains the sum of the encrypted asset transfer records of the asset transfer recipient from April 21, 2018 to April 21, 2020 as the fourth encrypted text mentioned above.
[0066] If the credit rating of the asset transfer target is lower than or equal to the preset rating, the blockchain node will obtain all asset transfer records of the aforementioned asset transfer target before the start time of the first time period in the blockchain network, and use the sum of the ciphertext of all asset transfer records of the aforementioned asset transfer target before the start time of the first time period as the aforementioned fourth ciphertext.
[0067] In this embodiment, when the credit rating of the asset transfer recipient is higher than a preset rating, the loan records (i.e., asset transfer records) of the asset transfer recipient within a short period before the current loan cycle (i.e., the first time cycle) are viewed; when the credit rating of the asset transfer recipient is lower than or equal to the preset rating, all loan records (i.e., asset transfer records) of the asset transfer recipient before the start time of the current loan cycle (i.e., before the start time of the first time cycle) are viewed. If the asset transfer recipient has outstanding assets in these loan records, the amount that the bank (i.e., the first account) can lend to the asset transfer recipient is calculated based on the outstanding assets, thereby making the bank's lending more reasonable.
[0068] S203, if the fourth ciphertext is less than the second ciphertext, and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext, then the blockchain node calls the smart contract to perform a homomorphic operation on the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext.
[0069] In some feasible implementations, after obtaining the fourth ciphertext, the blockchain node can compare its size with the second ciphertext. If the fourth ciphertext is smaller than the second ciphertext, it indicates that the amount of loan already taken out by the enterprise has not exceeded the loan amount that the enterprise can afford, as assessed by the first account. In this case, the blockchain node calls the smart contract to calculate the sum of the fourth ciphertext and the first ciphertext, and compares this sum with the second ciphertext. If the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext, the blockchain node calls the smart contract to calculate the difference between the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext. The asset corresponding to this fifth ciphertext represents the loan amount that the enterprise can currently afford. Specifically, the smart contract includes a homomorphic operation function. The input to this function is any two homomorphically encrypted ciphertexts and a function parameter, such as the second ciphertext and the fourth ciphertext. The function parameter is determined by the target encryption function. Different encryption functions result in different ciphertext elements, thus requiring different function parameters. This function parameter can be understood as the number of ciphertext elements. The output of the homomorphic operation function is the difference between any two ciphertexts, such as the difference between the second and fourth ciphertexts. For example, this homomorphic operation function is a `subtract` function (a type of homomorphic subtraction operation), represented as `subtract(C, D, n)`, where C is the second ciphertext, D is the fourth ciphertext, and n is the function parameter.
[0070] In some feasible implementations, if the fourth ciphertext is greater than the second ciphertext, it indicates that the enterprise's loan amount has exceeded the loan amount that the first account assesses the enterprise can afford. In this case, the blockchain node returns a failure response to the first account. After receiving the failure response through its bank client, the first account can refuse to transfer assets to the asset transfer recipient. Optionally, if the sum of the fourth ciphertext and the first ciphertext is less than or equal to the second ciphertext, the blockchain node returns a second asset transfer response to the first account. After receiving the second asset transfer response through its bank client, the first account can transfer the first asset to the asset transfer recipient.
[0071] S204, the blockchain node returns the first asset transfer response to the first account.
[0072] In some feasible implementations, after obtaining the aforementioned fifth ciphertext, the blockchain node can return a first asset transfer response to the aforementioned first account. This first asset transfer response may include the fifth asset. After receiving the first asset transfer response through a bank client, the first account can homomorphically decrypt the fifth ciphertext included in the first asset transfer response to obtain the fifth asset, and can then transfer the fifth asset to the aforementioned asset transfer recipient. The fifth asset is less than the first asset. For example, the first asset is 100,000, the second asset is 150,000, and the fifth asset is 50,000. This application embodiment utilizes homomorphic encryption algorithms to protect privacy information and queries a company's historical loan records based on the blockchain, thereby determining the company's current loanable amount based on these records. This achieves multi-party information sharing among banks based on blockchain, reducing not only the risk of information leakage but also the financial losses of banks.
[0073] Optionally, after obtaining the aforementioned fifth ciphertext, the blockchain node can use the public key of the first account to encrypt the first asset transfer response and send the encrypted first asset transfer response to the first account.
[0074] In this embodiment, a blockchain node receives an asset transfer request from a first account. When it detects an asset transfer record on the blockchain corresponding to the object identifier included in the asset transfer request, it calls a smart contract to calculate the sum of the third ciphertext included in each asset transfer record corresponding to the object identifier, obtaining a fourth ciphertext. If the fourth ciphertext is less than the second ciphertext included in the asset transfer request, and the sum of the fourth ciphertext and the first ciphertext included in the asset transfer request is greater than the second ciphertext, then the smart contract is called to calculate the difference between the second ciphertext and the fourth ciphertext to obtain a fifth ciphertext. A first asset transfer response is then returned to the first account, allowing the first account to decrypt the fifth ciphertext included in the first asset transfer response, obtain the fifth asset, and transfer the fifth asset to the asset transfer object. By implementing this embodiment, when sharing information among multiple parties in a blockchain network, using a target encryption function to perform homomorphic encryption on assets can protect the privacy of asset information. Furthermore, homomorphic operations are performed between ciphertexts to reduce the financial losses of the first account.
[0075] Please see Figure 3 , Figure 3 This is a flowchart illustrating another blockchain-based information sharing method provided in an embodiment of this application. Figure 3 As shown, this blockchain-based information sharing method may include, but is not limited to, the following steps:
[0076] S301, the blockchain node receives the asset transfer request from the first account.
[0077] S302, if an asset transfer record corresponding to an object identifier is detected on the blockchain, the blockchain node calls the smart contract to calculate the sum of the third ciphertext included in each asset transfer record corresponding to the object identifier, and obtains the fourth ciphertext.
[0078] S303, if the fourth ciphertext is less than the second ciphertext, and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext, then the blockchain node calls the smart contract to calculate the difference between the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext.
[0079] In some feasible implementations, the implementation methods of steps S301-S303 of the embodiments of this application can be referred to Figure 2 The implementation of steps S201-S203 in the illustrated embodiment will not be described again here.
[0080] S304, the blockchain node sends the second, fourth, and fifth ciphertexts to the consensus nodes in the blockchain network so that the consensus nodes can confirm the consensus.
[0081] S305, if the consensus confirmation messages returned by each consensus node meet the preset consensus strategy, the blockchain node returns the first asset transfer response to the first account.
[0082] In some feasible implementations, after obtaining the fifth ciphertext, the blockchain node can send the second, fourth, and fifth ciphertexts to each consensus node in the blockchain network. Upon receiving the second, fourth, and fifth ciphertexts, each consensus node can verify whether the difference between the second and fourth ciphertexts equals the fifth ciphertext. If the difference equals the fifth ciphertext, it returns a confirmation message. Each consensus node returns its verification result to the blockchain node. If the consensus confirmation messages returned by each consensus node satisfy a preset consensus strategy, the blockchain node returns a first asset transfer response to the first account. This first asset transfer response may include the fifth asset. After receiving the first asset transfer response through a bank client, the first account can decrypt the fifth ciphertext included in the first asset transfer response to obtain the fifth asset, and can then transfer the fifth asset to the asset transfer recipient. The fifth asset is less than or equal to the first asset. In this embodiment, the blockchain node and each consensus node belong to the same blockchain network.
[0083] If the consensus confirmation messages returned by each consensus node do not meet the preset consensus strategy, the blockchain node calls the smart contract to recalculate the difference between the second ciphertext and the fourth ciphertext, and resends the second ciphertext, the fourth ciphertext, and the difference to each consensus node in the blockchain network to achieve consensus, until the consensus confirmation messages returned by each consensus node meet the preset consensus strategy.
[0084] Optionally, each consensus node in the aforementioned blockchain network has a different weight. A blockchain node receives the verification results returned by each consensus node and can identify the consensus node that returned the consensus confirmation message as the target consensus node. The blockchain node can calculate the sum of the weights of each target consensus node and the sum of the weights of all consensus nodes in the blockchain network. The blockchain node compares whether the sum of the weights of the target consensus nodes exceeds half the sum of the weights of all consensus nodes in the blockchain network. If the sum of the weights of the target consensus nodes exceeds half the sum of the weights of all consensus nodes in the blockchain network, the blockchain node determines that the verification results returned by each consensus node satisfy the preset consensus strategy.
[0085] It should be noted that the aforementioned first account is a bank account, and the aforementioned asset transfer recipient is a corporate account. The aforementioned first asset information refers to the pre-disbursement information of this bank account, the aforementioned first asset being the pre-disbursement limit of this bank account, and the aforementioned second asset being the maximum disbursement limit of this bank account. The aforementioned asset transfer record is a disbursement record.
[0086] S306, the blockchain node receives the first asset transfer record of the aforementioned asset transfer object and the second signature of the first asset transfer record after being encrypted with the private key of the first account.
[0087] In some feasible implementations, after the first account transfers the fifth asset to the aforementioned asset transfer recipient, the first account can generate a first asset transfer record through a bank client, and can use its private key to perform encryption operations on the first asset transfer record to obtain a second signature. The first account can then send the first asset transfer record and the second signature to a blockchain node through the bank client, and the blockchain node receives the first asset transfer record and the second signature accordingly. The first asset transfer record includes the fifth encrypted text, the object identifier of the asset transfer recipient, and the account identifier of the aforementioned first account.
[0088] S307, the blockchain node sends the first asset transfer record and the second signature to each consensus node in the blockchain network, so that each consensus node can find the public key of the first account in the blockchain network according to the account identifier of the first account, and confirm the second signature based on the public key of the first account and the first asset transfer record.
[0089] S308, if the consensus confirmation messages returned by each consensus node meet the preset consensus strategy, then the blockchain node will upload the aforementioned first asset transfer record to the blockchain network.
[0090] In some feasible implementations, after receiving the first asset transfer record and the second signature, the blockchain node can send them to various consensus nodes in the blockchain network. Upon receiving the first asset transfer record and the first signature, each consensus node can obtain the public key of the first account based on its account identifier, and use that public key to decrypt the second signature to obtain a third verification code. The consensus node then performs a hash operation on the first asset transfer record to obtain a fourth verification code. If the third and fourth verification codes are the same, the consensus node returns a consensus confirmation message. Each consensus node returns its verification result for the second signature to the blockchain node. If the verification results of the second signature returned by each consensus node satisfy a preset consensus strategy, the blockchain node uploads the first asset transfer record of the first account to the blockchain network. In this case, the fifth ciphertext in the first asset transfer record is obtained by homomorphically encrypting the outstanding assets of the transferred asset object using the aforementioned target encryption function.
[0091] In some feasible implementations, after the blockchain node uploads the first asset transfer record of the aforementioned first account to the blockchain network, the blockchain node receives the asset repayment information of the asset transfer object. For example, the asset transfer object can transfer a sixth asset to the first account through an enterprise client, and the first account sends the asset repayment information to the blockchain node. This asset repayment information may include the account identifier of the first account and a sixth ciphertext. The sixth ciphertext is the ciphertext of the sixth asset after homomorphic encryption using the aforementioned target encryption function. It can be understood that the sixth asset is the amount of funds repaid by the aforementioned asset information for the fifth asset. After receiving the asset repayment information, the blockchain node can search for the first asset transfer record on the blockchain. When the ciphertext included in the first asset transfer record is not equal to zero, the blockchain node can call a smart contract to calculate the difference between the ciphertext in the first asset transfer record (i.e., the fifth ciphertext) and the sixth ciphertext to obtain the seventh ciphertext. The blockchain node can use the public key of the asset transfer object to encrypt the seventh ciphertext and send the seventh ciphertext encrypted with the public key of the asset transfer object to the asset transfer object. After decrypting the seventh ciphertext, the recipient of the asset transfer can obtain the outstanding repayment amount, which can be zero. Optionally, the blockchain node can update the first asset transfer record on the blockchain based on the seventh ciphertext, for example, changing the remaining amount in the first asset transfer record from the fifth ciphertext to the seventh ciphertext; if the seventh ciphertext equals zero, the first asset transfer record is marked as completed; furthermore, the first asset transfer record can be deleted.
[0092] Using the tax bureau as the blockchain node and a bank account as the first account as an example, in this embodiment, the tax bureau (blockchain node) receives a pre-loan request (i.e., an asset transfer request) from the bank (i.e., the first account). The pre-loan request includes pre-loan information (i.e., first asset information), which includes a tax identifier (i.e., the object identifier of the asset transfer target), a first ciphertext of the pre-loan amount (i.e., the first asset) after homomorphic encryption using a target encryption function, and a second ciphertext of the loan limit (i.e., the second asset) after homomorphic encryption using a target encryption function. The tax bureau searches the blockchain for a loan record (i.e., an asset transfer record) corresponding to this enterprise. If it exists, the blockchain node calls a smart contract to calculate the sum of the ciphertexts (i.e., the third ciphertext) corresponding to the enterprise's outstanding assets in these loan records, obtaining a fourth ciphertext. When the fourth ciphertext is less than the second ciphertext, and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext, the blockchain node calls a smart contract to calculate the difference between the second ciphertext and the fourth ciphertext to obtain a fifth ciphertext, and returns an asset transfer response to the bank. The bank transfers the assets to the enterprise according to the asset transfer response. The bank returns the loan disbursement record (i.e., the first asset transfer record) to the blockchain node, and the blockchain node records the loan disbursement record returned by the bank on the blockchain. While utilizing homomorphic encryption to protect privacy, this enables multi-party information sharing based on the blockchain, not only reducing the risk of information leakage but also minimizing financial losses for the bank.
[0093] The foregoing details the blockchain-based information sharing method of this application embodiment. In order to facilitate better implementation of the above-mentioned scheme of this application embodiment, this application embodiment also provides corresponding devices and equipment.
[0094] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of the information sharing device provided in the embodiments of this application. This information sharing device 1 can be applied to, for example... Figure 2 or Figure 3 In the blockchain node shown, the information sharing device 1 may include:
[0095] The transceiver module 10 is used to receive asset transfer requests from a first account. The asset transfer request includes first asset information, which includes an object identifier of the asset transfer target, a first ciphertext, and a second ciphertext. The first ciphertext is the ciphertext of the first asset after homomorphic encryption using a target encryption function, and the second ciphertext is the ciphertext of the second asset after homomorphic encryption using the same target encryption function. The amount of the second asset is greater than or equal to the amount of the first asset. The statistics module 11 is used to, upon detecting the existence of an asset transfer record corresponding to the object identifier in the blockchain network, invoke a smart contract to count each asset transfer corresponding to the object identifier. The sum of the third ciphertext included in the record is used to obtain the fourth ciphertext. The third ciphertext, the first ciphertext, and the second ciphertext are all obtained by homomorphic encryption using the same encryption function. The calculation module 12 is used to call the smart contract to perform homomorphic operation on the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext when the fourth ciphertext is less than the second ciphertext and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext. The sending and receiving module 10 is also used to return a first asset transfer response to the first account so that the first account can homomorphically decrypt the fifth ciphertext included in the first asset transfer response to obtain the fifth asset and transfer the fifth asset to the asset transfer object.
[0096] In some feasible implementations, the asset transfer request further includes a first signature and an account identifier of the first account. The information sharing device 1 also includes a detection module 13. The transceiver module 10 is further configured to send the asset transfer request to each consensus node in the blockchain network, so that each consensus node can search for the public key of the first account in the blockchain network based on the account identifier of the first account, and perform consensus confirmation on the first signature based on the public key of the first account and the first asset information; the detection module 13 is configured to detect in the blockchain network whether there is an asset transfer record corresponding to the object identifier when the consensus confirmation messages returned by each consensus node meet the preset consensus strategy.
[0097] In some feasible implementations, the transceiver module 10 is further configured to, upon detecting that no asset transfer record corresponding to the object identifier exists in the blockchain network, return a second asset transfer response to the first account so that the first account can transfer the first asset to the asset transfer object; or, when the sum of the fourth ciphertext and the first ciphertext is less than or equal to the second ciphertext, return the second asset transfer response to the first account so that the first account can transfer the first asset to the asset transfer object.
[0098] In some feasible implementations, the aforementioned first asset information also includes a first time period. Specifically, the statistics module 11 is used to: when an asset transfer record corresponding to the object identifier is detected in the blockchain network, determine a second time period based on the first time period and the time interval corresponding to the credit rating of the asset transfer object; the calculation module calls a smart contract to obtain each third ciphertext in the asset transfer record corresponding to the object identifier within the second time period, and uses the sum of each third ciphertext in the asset transfer record corresponding to the object identifier within the second time period as the fourth ciphertext.
[0099] In some feasible implementations, the transceiver module 10 is further configured to, upon receiving the first asset transfer record of the asset transfer object and the second signature of the first asset transfer record encrypted with the private key of the first account, wherein the first asset transfer record includes the fifth ciphertext, the object identifier, and the account identifier of the first account; send the first asset transfer record and the second signature to each consensus node in the blockchain network, so that each consensus node can find the public key of the first account in the blockchain network based on the account identifier of the first account, and perform consensus confirmation on the second signature based on the public key of the first account and the first asset transfer record. The transceiver module 10 is further configured to, when the consensus confirmation messages returned by each consensus node satisfy the preset consensus strategy, upload the first asset transfer record to the blockchain network.
[0100] In some feasible implementations, the information sharing device 1 further includes a search module 15. The aforementioned transceiver module 10 is also used to receive asset clearing information of the asset transfer object, the asset clearing information including the account identifier of the first account and the sixth ciphertext, the sixth ciphertext being the ciphertext of the sixth asset after homomorphic encryption by the target encryption function; the search module 15 is used to search for the first asset transfer record in the blockchain network; the aforementioned calculation module 12 is also used to call the smart contract to perform homomorphic operation on the fifth ciphertext and the sixth ciphertext in the first asset transfer record to obtain the seventh ciphertext; the aforementioned transceiver module 10 is also used to return the seventh ciphertext to the asset transfer object and update the first asset transfer record in the blockchain network based on the seventh ciphertext.
[0101] In some feasible implementations, the aforementioned transceiver module 10 is further configured to send the second ciphertext, the fourth ciphertext, and the fifth ciphertext to each consensus node in the blockchain network, so that each consensus node returns a consensus confirmation message when verifying that the difference between the second ciphertext and the fourth ciphertext is equal to the fifth ciphertext; and when the consensus confirmation messages returned by each consensus node satisfy the preset consensus strategy, a first asset transfer response is returned to the first account.
[0102] In some feasible implementations, the first account is a bank account, the asset transfer target is a corporate account, the first asset information is the pre-loan information of the bank account, the first asset is the pre-loan limit of the bank account, the second asset is the maximum loan limit of the bank account, and the asset transfer record is a loan record.
[0103] Among them, the above-mentioned statistics module 11, calculation module 12, detection module 13, on-chain module 14 and search module 15 can be a single module, such as a processing module.
[0104] In the specific implementation, the implementation of each module can also be referenced accordingly. Figure 2 or Figure 3 The corresponding description of the blockchain node in the method embodiment shown executes the methods and functions performed by the blockchain node in the above embodiment.
[0105] In this embodiment, the information sharing device 1 receives an asset transfer request from a first account. When it detects an asset transfer record on the blockchain corresponding to the object identifier included in the asset transfer request, it calls a smart contract to calculate the sum of the third ciphertext included in each asset transfer record corresponding to the object identifier, obtaining a fourth ciphertext. If the fourth ciphertext is less than the second ciphertext included in the asset transfer request, and the sum of the fourth ciphertext and the first ciphertext included in the asset transfer request is greater than the second ciphertext, then the smart contract is called to calculate the difference between the second ciphertext and the fourth ciphertext to obtain a fifth ciphertext. A first asset transfer response is then returned to the first account, enabling the first account to decrypt the fifth ciphertext included in the first asset transfer response, obtain the fifth asset, and transfer the fifth asset to the asset transfer object. By utilizing homomorphic encryption, multi-party information sharing based on blockchain is achieved while protecting privacy, reducing not only the risk of information leakage but also the financial losses of banks.
[0106] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a blockchain node provided in an embodiment of this application. For example... Figure 5 As shown, the blockchain node 1000 may include a processor 1001, a memory 1002, and a transceiver 1003. Furthermore, the electronic device 1000 may also include at least one communication bus 1004. The communication bus 1004 is used to enable communication between these components. The memory 1002 may be high-speed RAM or non-volatile memory, such as at least one disk drive. Optionally, the memory 1002 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 5As shown, the memory 1002, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.
[0107] exist Figure 5 In the blockchain node 1000 shown, the transceiver 1003 is used to communicate with various nodes in the blockchain system. Specifically, the transceiver 1003 is used to... The processor 1001 can be used to call the device control application stored in the memory 1002 to implement the blockchain-based information sharing method provided in this application.
[0108] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned information sharing device 1, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the aforementioned... Figure 2 or Figure 3 The description of the blockchain-based information sharing method in the corresponding embodiments is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.
[0109] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0110] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A blockchain-based information sharing method, characterized in that, include: A blockchain node receives an asset transfer request from a first account. The asset transfer request includes first asset information, which includes an object identifier of the asset transfer object, a first ciphertext, a second ciphertext, and a first time period. The first ciphertext is the ciphertext of the first asset after homomorphic encryption using a target encryption function. The second ciphertext is the ciphertext of the second asset after homomorphic encryption using the target encryption function. The amount of the second asset is greater than or equal to the amount of the first asset. The first account is the asset lender, and the asset transfer recipient is the asset borrower; If an asset transfer record corresponding to the object identifier is detected in the blockchain network, the blockchain node determines a second time period based on the first time period and the time interval corresponding to the credit rating of the asset transfer object. It then calls a smart contract to retrieve each third ciphertext from the asset transfer record corresponding to the object identifier within the second time period. The sum of each third ciphertext from the asset transfer record corresponding to the object identifier within the second time period is used as the fourth ciphertext. The third ciphertext, the first ciphertext, and the second ciphertext are all obtained by homomorphic encryption using the same encryption function. The third ciphertext is used to indicate the assets to be returned by the asset transfer object. If the credit rating of the asset transfer target is higher than the preset rating, the start time of the second time period is the difference between the start time of the first time period and the time interval, and the end time of the second time period is the start time of the first time period; the asset transfer record includes the asset transfer record of the first account for the asset transfer target and the asset transfer record of the second account for the asset transfer target, wherein the second account is an account other than the first account; If the fourth ciphertext is less than the second ciphertext, and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext, then the blockchain node calls the smart contract to perform a homomorphic operation on the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext. The fifth ciphertext is used to indicate the remaining amount of assets that the asset transfer object can apply for. The blockchain node returns a first asset transfer response to the first account; wherein the first asset transfer response is used to instruct the first account to homomorphically decrypt the fifth ciphertext included in the first asset transfer response to obtain the fifth asset, and transfer the fifth asset to the asset transfer object; The blockchain node receives the first asset transfer record of the asset transfer object sent by the first account and the second signature of the first asset transfer record after being encrypted by the private key of the first account. The first asset transfer record includes the fifth ciphertext, the object identifier, and the account identifier of the first account. The blockchain node sends the first asset transfer record and the second signature to each consensus node in the blockchain network, so that each consensus node can find the public key of the first account in the blockchain network based on the account identifier of the first account, and perform consensus confirmation on the second signature based on the public key of the first account and the first asset transfer record; each consensus node in the blockchain network has different weights. The blockchain node receives the consensus confirmation results returned by each consensus node, determines the consensus node that returned the consensus confirmation message as the target consensus node, calculates the sum of the weights of each target consensus node, and calculates the sum of the weights of each consensus node in the blockchain network. If the sum of the weights of all the target consensus nodes exceeds a set proportion of the sum of the weights of all consensus nodes in the blockchain network, then the blockchain node determines that the consensus confirmation messages returned by each consensus node meet the preset consensus strategy, and uploads the first asset transfer record to the blockchain network.
2. The method according to claim 1, characterized in that, The asset transfer request also includes a first signature and an account identifier for the first account; After the blockchain node receives the asset transfer request from the first account, the method further includes: The blockchain node sends the asset transfer request to each consensus node in the blockchain network, so that each consensus node can find the public key of the first account in the blockchain network according to the account identifier of the first account, and perform consensus confirmation on the first signature based on the public key of the first account and the first asset information. If the consensus confirmation messages returned by each consensus node satisfy the preset consensus strategy, then the blockchain node checks in the blockchain network whether there is an asset transfer record corresponding to the object identifier.
3. The method according to claim 1, characterized in that, The method further includes: If no asset transfer record corresponding to the object identifier is detected in the blockchain network, the blockchain node returns a second asset transfer response to the first account, so that the first account transfers the first asset to the asset transfer object; or, If the sum of the fourth ciphertext and the first ciphertext is less than or equal to the second ciphertext, the blockchain node returns the second asset transfer response to the first account, so that the first account transfers the first asset to the asset transfer object.
4. The method according to claim 1, characterized in that, The method further includes: The blockchain node receives the asset clearing information of the asset transfer object. The asset clearing information includes the account identifier of the first account and the sixth ciphertext. The sixth ciphertext is the ciphertext of the sixth asset after homomorphic encryption by the target encryption function. The blockchain node searches for the first asset transfer record in the blockchain network; The blockchain node invokes the smart contract to perform a homomorphic operation on the fifth ciphertext and the sixth ciphertext in the first asset transfer record to obtain the seventh ciphertext. The blockchain node returns a seventh ciphertext to the asset transfer object and updates the first asset transfer record in the blockchain network based on the seventh ciphertext.
5. The method according to any one of claims 1-4, characterized in that, The smart contract includes homomorphic operation functions; The input to the homomorphic operation function is any two homomorphically encrypted ciphertexts and function parameters, wherein the function parameters are determined by the target encryption function, and the output of the homomorphic operation function is the difference between any two ciphertexts.
6. An information sharing device, characterized in that, include: The transceiver module is used to receive an asset transfer request from a first account. The asset transfer request includes first asset information, which includes an object identifier of the asset transfer object, a first ciphertext, a second ciphertext, and a first time period. The first ciphertext is the ciphertext of the first asset after homomorphic encryption using a target encryption function. The second ciphertext is the ciphertext of the second asset after homomorphic encryption using the target encryption function. The amount of the second asset is greater than or equal to the amount of the first asset. The first account is the asset lender, and the asset transfer recipient is the asset borrower; The statistics module is used to determine a second time period based on the first time period and the time interval corresponding to the credit rating of the asset transfer object when an asset transfer record corresponding to the object identifier is detected in the blockchain network. It then calls a smart contract to retrieve each third ciphertext in the asset transfer record corresponding to the object identifier within the second time period, and uses the sum of each third ciphertext in the asset transfer record corresponding to the object identifier within the second time period as a fourth ciphertext. The third ciphertext, the first ciphertext, and the second ciphertext are all obtained by homomorphic encryption using the same encryption function. The third ciphertext is used to indicate the assets to be repaid by the asset transfer object. If the credit rating of the asset transfer target is higher than the preset rating, the start time of the second time period is the difference between the start time of the first time period and the time interval, and the end time of the second time period is the start time of the first time period; the asset transfer record includes the asset transfer record of the first account for the asset transfer target and the asset transfer record of the second account for the asset transfer target, wherein the second account is an account other than the first account; The calculation module is used to call the smart contract to perform a homomorphic operation on the second ciphertext and the fourth ciphertext to obtain a fifth ciphertext when the fourth ciphertext is less than the second ciphertext and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext. The fifth ciphertext is used to indicate the remaining amount of assets that the asset transfer object can apply for. The transceiver module is further configured to return a first asset transfer response to the first account; wherein the first asset transfer response is configured to instruct the first account to perform homomorphic decryption on the fifth ciphertext included in the first asset transfer response to obtain the fifth asset, and to transfer the fifth asset to the asset transfer object; The transceiver module is further configured to receive a first asset transfer record of the asset transfer object sent by the first account and a second signature of the first asset transfer record after encryption operation by the private key of the first account. The first asset transfer record includes the fifth ciphertext, the object identifier, and the account identifier of the first account. The transceiver module is further configured to send the first asset transfer record and the second signature to each consensus node in the blockchain network, so that each consensus node can find the public key of the first account in the blockchain network based on the account identifier of the first account, and perform consensus confirmation on the second signature based on the public key of the first account and the first asset transfer record; each consensus node in the blockchain network has different weights. The transceiver module is also used to receive consensus confirmation results returned by each consensus node; The processing module is used to determine the consensus node that returns the consensus confirmation message as the target consensus node, calculate the sum of the weights of each target consensus node, and calculate the sum of the weights of each consensus node in the blockchain network. If the sum of the weights of each target consensus node exceeds a set proportion of the sum of the weights of each consensus node in the blockchain network, then it is determined that the consensus confirmation message returned by each consensus node satisfies the preset consensus strategy. The transceiver module is also used to upload the first asset transfer record to the blockchain network.
7. A blockchain node, characterized in that, include: Processor, memory, and transceiver; The processor is connected to a memory and a transceiver, respectively. The memory stores program code, and the transceiver communicates with various consensus nodes in the blockchain network or sends and receives information / data. Specifically, the transceiver is used to: receive an asset transfer request from a first account. The asset transfer request includes first asset information, which includes an object identifier of the asset transfer target, a first ciphertext, a second ciphertext, and a first time period. The first ciphertext is the ciphertext of the first asset after homomorphic encryption using a target encryption function, and the second ciphertext is the ciphertext of the second asset after homomorphic encryption using the target encryption function. The amount of the second asset is greater than or equal to the amount of the first asset. The first account is the asset lender, and the asset transfer target is the asset borrower. The processor is used to call the program code to perform the following operations: If an asset transfer record corresponding to the object identifier is detected on the blockchain, a second time period is determined based on the first time period and the time interval corresponding to the credit rating of the asset transfer object. A smart contract is invoked to retrieve each third ciphertext in the asset transfer record corresponding to the object identifier within the second time period. The sum of each third ciphertext in the asset transfer record corresponding to the object identifier within the second time period is used as the fourth ciphertext. The third ciphertext, the first ciphertext, and the second ciphertext are all obtained by homomorphic encryption using the same encryption function. The third ciphertext is used to indicate the assets to be repaid by the asset transfer object. If the credit rating of the asset transfer object is higher than a preset rating, the start time of the second time period is the difference between the start time of the first time period and the time interval, and the end time of the second time period is the start time of the first time period. The asset transfer record includes asset transfer records from the first account to the asset transfer object and asset transfer records from the second account to the asset transfer object. The second account is an account other than the first account. If the fourth ciphertext is less than the second ciphertext, and the sum of the fourth ciphertext and the first ciphertext is greater than the second ciphertext, then the smart contract is invoked to perform a homomorphic operation on the second ciphertext and the fourth ciphertext to obtain the fifth ciphertext. The fifth ciphertext is used to indicate the remaining amount of assets that the asset transfer object can apply for. The transceiver is further configured to: return a first asset transfer response to the first account; wherein the first asset transfer response is configured to instruct the first account to homomorphically decrypt the fifth ciphertext included in the first asset transfer response to obtain the fifth asset, and transfer the fifth asset to the asset transfer object; The transceiver is further configured to: receive a first asset transfer record of the asset transfer object sent by the first account and a second signature of the first asset transfer record encrypted with the private key of the first account, wherein the first asset transfer record includes the fifth ciphertext, the object identifier, and the account identifier of the first account; send the first asset transfer record and the second signature to each consensus node in the blockchain network, so that each consensus node can find the public key of the first account in the blockchain network according to the account identifier of the first account, and perform consensus confirmation on the second signature based on the public key of the first account and the first asset transfer record; each consensus node in the blockchain network has different weights; and receive the consensus confirmation results returned by each consensus node. The processor is also used to call the program code to perform the following operations: determining the consensus node that returns the consensus confirmation message as the target consensus node, calculating the sum of the weights of each target consensus node, and calculating the sum of the weights of each consensus node in the blockchain network. If the sum of the weights of each target consensus node exceeds a set proportion of the sum of the weights of each consensus node in the blockchain network, then it is determined that the consensus confirmation message returned by each consensus node satisfies the preset consensus strategy. The transceiver is also used to upload the first asset transfer record to the blockchain network.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and device for resource transfer and fund transfer
CN108009441A
Data query method and device
CN110858251A