WO2021017425A1 - 区块链网络中实现机密交易的方法及装置 - Google Patents

区块链网络中实现机密交易的方法及装置 Download PDF

Info

Publication number
WO2021017425A1
WO2021017425A1 PCT/CN2020/071474 CN2020071474W WO2021017425A1 WO 2021017425 A1 WO2021017425 A1 WO 2021017425A1 CN 2020071474 W CN2020071474 W CN 2020071474W WO 2021017425 A1 WO2021017425 A1 WO 2021017425A1
Authority
WO
WIPO (PCT)
Prior art keywords
amount
transaction
commitment
asset
remittance
Prior art date
Application number
PCT/CN2020/071474
Other languages
English (en)
French (fr)
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 创新先进技术有限公司
Priority to US16/779,499 priority Critical patent/US20200175502A1/en
Publication of WO2021017425A1 publication Critical patent/WO2021017425A1/zh

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
    • 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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/405Establishing or using transaction specific rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption

Definitions

  • One or more embodiments of this specification relate to the field of blockchain technology, and more particularly to a method and device for implementing confidential transactions in a blockchain network.
  • Blockchain technology (also known as distributed ledger technology) is a de-neutralized distributed database technology, which has the characteristics of decentralization, openness and transparency, non-tampering, trustworthiness, etc., and is suitable for many In application scenarios with high demand for data reliability.
  • one or more embodiments of this specification provide a method and device for implementing confidential transactions in a blockchain network.
  • a method for implementing confidential transactions in a blockchain network is proposed, which is applied to a remittance party's device; the method includes:
  • the remitter has a corresponding remitter account on the blockchain ledger, and the remitter’s account includes the income balance recorded as the income balance commitment and the corresponding asset amount Recorded as the amount of assets promised and the statistical quantity of each valued asset promise, where assets with the same asset amount have the same asset promise;
  • a remittance transaction is created based on the selected asset amount commitment in the remitter’s account and the specified amount corresponding to each selected asset amount commitment, the remittance transaction includes the remittance amount commitment corresponding to the remittance amount, and each selected The amount of assets commitment and the corresponding designated amount, the interval certificate used to prove that the remittance amount is non-negative and not greater than the total amount of assets, the total amount of assets is the amount of assets corresponding to each selected asset amount commitment and the corresponding designated amount Weighted sum
  • a method for implementing confidential transactions in a blockchain network is proposed, which is applied to blockchain nodes; the method includes:
  • the remittance transaction including a remittance amount commitment corresponding to the remittance amount between the remitter and the recipient, at least one asset amount commitment and a corresponding designated amount, used to prove that the remittance amount is non-negative and not greater than the asset
  • the interval proof of the total amount is that the total amount of assets is the weighted sum of the amount of assets corresponding to the at least one asset amount commitment and the corresponding designated amount; wherein, the remitter account corresponding to the remitter on the blockchain ledger includes the recorded
  • the income balance promised for the income balance, the corresponding asset amount is recorded as the asset amount promised and the statistical quantity of the asset amount promised for each value, where the same asset amount has the same asset amount promise;
  • the remittance transaction is executed so that the statistical quantity corresponding to each asset amount commitment of the remittance exchange will subtract the corresponding designated amount after the transaction is completed, and the income balance of the remitter’s account will increase the change commitment after the transaction is completed , The income balance of the payee account corresponding to the payee on the blockchain ledger is increased by the remittance amount commitment after the transaction is completed.
  • a device for realizing confidential transactions in a blockchain network which is applied to the remittance equipment; the device includes:
  • the determining unit determines the amount of remittance between the remittance party and the remittance party.
  • the remittance party has a corresponding remitter account on the blockchain ledger.
  • the remitter account includes the income balance recorded as the income balance commitment and the corresponding
  • the amount of assets is recorded as the statistical quantity of the assets promised by the asset amount and each valued asset amount promise, where the assets with the same asset amount have the same asset amount promise;
  • the creation unit creates a remittance transaction based on the selected asset amount commitment in the remittance party’s account and the designated amount corresponding to each selected asset amount commitment, the remittance transaction includes the remittance amount commitment corresponding to the remittance amount, each The selected asset amount commitment and the corresponding designated amount, the interval proof used to prove that the remittance amount is non-negative and not greater than the total amount of assets, the total amount of assets is the amount of assets corresponding to each selected asset amount commitment and the corresponding The weighted sum of the specified quantity;
  • the submission unit submits the remittance transaction to the blockchain, so that the statistical amount corresponding to each selected asset amount commitment is subtracted from the corresponding designated amount after the transaction is completed, and the income balance of the remitter’s account increases after the transaction is completed.
  • the change commitment and the income balance of the beneficiary account corresponding to the beneficiary on the blockchain ledger will increase the remittance commitment after the transaction is completed.
  • a device for implementing confidential transactions in a blockchain network which is applied to a blockchain node; the device includes:
  • the receiving unit receives a remittance transaction, the remittance transaction includes a remittance amount commitment corresponding to the remittance amount between the remitter and the recipient, at least one asset amount commitment and a corresponding designated amount, used to prove that the remittance amount is non-negative and Proof of the interval not greater than the total amount of assets, the total amount of assets is the weighted sum of the amount of assets corresponding to the at least one asset amount commitment and the corresponding designated amount; wherein, the remitter account on the blockchain ledger corresponding to the remitter Including the income balance recorded as the income balance promise, the corresponding asset amount recorded as the asset amount promise, and the statistical quantity of the asset amount promised for each value, where the same asset amount has the same asset amount promise;
  • the execution unit executes the remittance transaction, so that the statistical quantity corresponding to each asset amount commitment of the remittance exchange is subtracted from the corresponding designated quantity after the transaction is completed, and the income balance of the remittance party’s account is increased after the transaction is completed.
  • zero amount commitment the income balance of the recipient's account corresponding to the recipient on the blockchain ledger will increase the remittance amount commitment after the transaction is completed.
  • an electronic device including:
  • a memory for storing processor executable instructions
  • the processor implements the method according to the first aspect by running the executable instruction.
  • a computer-readable storage medium is provided, and computer instructions are stored thereon, which when executed by a processor implement the steps of the method described in the first aspect.
  • an electronic device including:
  • a memory for storing processor executable instructions
  • the processor implements the method according to the second aspect by running the executable instruction.
  • a computer-readable storage medium is provided, and computer instructions are stored thereon, which when executed by a processor implement the steps of the method described in the second aspect.
  • Fig. 1 is a schematic diagram of an example environment provided by an example embodiment.
  • Fig. 2 is a schematic diagram of a conceptual architecture provided by an exemplary embodiment.
  • Fig. 3 is a flowchart of a method for implementing confidential transactions in a blockchain network provided by an exemplary embodiment.
  • Fig. 4 is a schematic diagram of a blockchain account structure provided by an exemplary embodiment.
  • Fig. 5 is a flow chart of a privacy-protected remittance transaction provided by an exemplary embodiment.
  • Fig. 6 is a schematic diagram of account changes before and after remittance provided by an exemplary embodiment.
  • Fig. 7 is a schematic diagram of another blockchain account structure provided by an exemplary embodiment.
  • Fig. 8 is an interactive schematic diagram of asset recharge through the main balance provided by an exemplary embodiment.
  • Fig. 9 is a schematic diagram of account changes before and after recharging according to an exemplary embodiment.
  • Fig. 10 is an interactive schematic diagram of a merge operation provided by an exemplary embodiment.
  • Fig. 11 is a schematic diagram of account changes before and after merger according to an exemplary embodiment.
  • Fig. 12 is a flow chart of a main balance transfer transaction provided by an exemplary embodiment.
  • Fig. 13 is a schematic diagram of account changes before and after the main balance remittance provided by an exemplary embodiment.
  • Fig. 14 is a flowchart of another method for implementing confidential transactions in a blockchain network provided by an exemplary embodiment.
  • Fig. 15 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Fig. 16 is a block diagram of a device for implementing confidential transactions in a blockchain network according to an exemplary embodiment.
  • Fig. 17 is a schematic structural diagram of another device provided by an exemplary embodiment.
  • Fig. 18 is a block diagram of another device for implementing confidential transactions in a blockchain network according to an exemplary embodiment.
  • the steps of the corresponding method may not be executed in the order shown and described in this specification.
  • the method includes 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. description.
  • Fig. 1 is a schematic diagram of an example environment provided by an example embodiment.
  • the example environment 100 allows entities to participate in the blockchain network 102.
  • the blockchain network 102 may be a public, private, or consortium blockchain network.
  • the example environment 100 may include computing devices 104, 106, 108, 110, 112 and a network 114; in an embodiment, the network 114 may include a local area network (LAN), a wide area network (Wide Area Network, WAN), the Internet, or It is combined and connected to websites, user devices (such as computing devices) and back-end systems.
  • the network 114 may be accessed through wired and/or wireless communication.
  • the computing devices 106, 108 may be nodes of a cloud computing system (not shown), or each computing device 106, 108 may be a separate cloud computing system, including being interconnected by a network and acting as a distributed processing system Multiple computers at work.
  • the computing devices 104-108 may run any appropriate computing system to enable them to serve as nodes in the blockchain network 102; for example, the computing devices 104-108 may include, but are not limited to, servers, desktop computers, and notebooks. Computers, tablet computing devices and smartphones. In an embodiment, the computing devices 104 to 108 may be attributed to related entities and used to implement corresponding services. For example, the service may be used to manage transactions between a certain entity or multiple entities.
  • the computing devices 104-108 respectively store the blockchain ledger corresponding to the blockchain network 102.
  • the computing device 104 may be (or include) a web server for providing browser functions, and the web server may provide visual information related to the blockchain network 102 based on the network 114.
  • the computing device 104 may not participate in block verification, but monitor the blockchain network 102 to determine when other nodes (for example, computing devices 106-108 may include) reached a consensus, and generate corresponding blocks accordingly Chain visual user interface.
  • the computing device 104 may receive a request initiated by a client device (such as the computing device 110 or the computing device 112) for the blockchain visualization user interface.
  • a client device such as the computing device 110 or the computing device 112
  • the nodes of the blockchain network 102 can also serve as client devices.
  • a user of the computing device 108 can use a browser running on the computing device 108 to send the aforementioned request to the computing device 104.
  • the computing device 104 may generate a blockchain visual user interface (such as a web page) based on the stored blockchain ledger, and send the generated blockchain visual user interface to the requesting client device.
  • a blockchain visual user interface such as a web page
  • the request for the blockchain visualization user interface may include user authorization information, before the blockchain visualization user interface is generated and sent to the requesting client device ,
  • the computing device 104 may verify the user authorization information, and return to the corresponding blockchain visual user interface after the verification is passed.
  • the blockchain visual user interface may be displayed on the client device (for example, it may be displayed in the user interface 116 shown in FIG. 1).
  • the display content of the user interface 116 can also be updated accordingly.
  • the user's interaction with the user interface 116 may lead to requests for other user interfaces, such as displaying block lists, block details, transaction lists, transaction details, account lists, account details, contract lists, contract details, or user requests for blocks Search results pages generated by the implementation of the search on the chain network.
  • Fig. 2 is a schematic diagram of a conceptual architecture provided by an exemplary embodiment.
  • the conceptual architecture 200 includes a physical layer 202, a managed service layer 204 and a blockchain network layer 206.
  • the entity layer 202 may include three entities: entity 1, entity 2 and entity 3, and each entity has its own transaction management system 208.
  • the managed service layer 204 may include an interface 210 corresponding to each transaction management system 208.
  • each transaction management system 208 uses a protocol (such as Hypertext Transfer Protocol Security (HTTPS), etc.) to communicate with the respective interface 210 through a network (such as the network 114 in FIG. 1).
  • HTTPS Hypertext Transfer Protocol Security
  • each interface 210 may provide a communication connection between its corresponding transaction management system 208 and the blockchain network layer 206; more specifically, the interface 210 may be connected to the blockchain network of the blockchain network layer 206 212 communications.
  • the communication between the interface 210 and the blockchain network layer 206 can be implemented using remote procedure calls (RPCs).
  • the interface 210 may provide an API interface for accessing the blockchain network 212 to the transaction management system 208.
  • the blockchain network 212 is provided in the form of a peer-to-peer network.
  • the peer-to-peer network includes a plurality of nodes 214, each of which is used to persist the blockchain ledger 216 formed by the blockchain data; Wherein, only one block chain ledger 216 is shown in FIG. 2, but there may be multiple block chain ledger 216 or copies thereof in the block chain network 212.
  • each node 214 can maintain a block chain separately Ledger 216 or a copy thereof.
  • Blockchain is generally divided into three types: Public Blockchain, Private Blockchain and Consortium Blockchain.
  • the most decentralized one is the public chain.
  • the public chain is represented by Bitcoin and Ethereum. Participants who join the public chain can read the data records on the chain, participate in transactions, and compete for the accounting rights of new blocks. Moreover, each participant (ie, node) can freely join and exit the network, and perform related operations.
  • the private chain is the opposite.
  • the write permission of the network is controlled by an organization or institution, and the data read permission is regulated by the organization.
  • the private chain can be a weakly centralized system with strict restrictions and few participating nodes. This type of blockchain is more suitable for internal use by specific institutions.
  • the alliance chain is a block chain between the public chain and the private chain, which can achieve "partial decentralization".
  • Each node in the alliance chain usually has a corresponding entity or organization; participants are authorized to join the network and form a stakeholder alliance to jointly maintain the operation of the blockchain.
  • UTXO Unspent Transaction Output
  • account model Two transaction models are usually used in blockchain networks, namely UTXO (Unspent Transaction Output) model and account model.
  • the typical application scenario of the UTXO model is the Bitcoin blockchain.
  • the assets on the chain under this model exist in the form of transaction output.
  • the unspent transaction output belongs to the private key. Owned by the owner; when in use, you can take one or more unspent transaction outputs as input, and specify one or more outputs to form a new one or more unspent transaction outputs.
  • the UTXO model is adopted by a variety of blockchain networks, the support for smart contracts is weak, which imposes greater restrictions on application scenarios.
  • the typical application scenario of the account model is the Ethereum blockchain.
  • the account model can support a complete smart contract function and has better scenario scalability.
  • the value of r is only controlled by private individuals (such as account owners, asset holders, transaction participants, etc.), so that irrelevant persons cannot deduct the original amount t based on the value of PC(r,t).
  • the transaction amount can be protected by homomorphic encryption or homomorphic commitment technology, and the interval proof technology can be used to ensure that the output of the transaction is non-negative.
  • the transaction amount can be protected by homomorphic encryption or homomorphic commitment technology, and the interval proof technology can be used to ensure that the transaction amount is non-negative and the account balance is sufficient to pay.
  • the UTXO model Under the UTXO model, one or more transaction outputs are used as the input of a transfer transaction, and one or more new transaction outputs are formed after the transfer is completed. It can be seen that one transaction output will only be spent in one transfer transaction, and cannot be spent by multiple transfer transactions, so that the interval proof generated for one transfer transaction is only related to the input of the transfer transaction and has nothing to do with the input of other transfer transactions. Therefore, the UTXO model naturally has high transaction concurrency. However, the UTXO model will cause the number of assets in the blockchain network to be much larger than the number of users, which may pose a great challenge to blockchain storage. At the same time, as mentioned earlier, the UTXO model has weak support for smart contracts, which limits The scenarios where the UTXO model can be used.
  • the account model can solve the UTXO model’s challenges to blockchain storage and expand more application scenarios through the support of smart contracts
  • the input of each transaction is the balance of the account.
  • the interval proof of a transaction is related to the balance of the account, and the balance of the account is updated after each transaction, so that all transactions under the same account need to be executed in sequence, that is, a transaction ends and the account balance occurs After the update, the interval proof can be generated for the next transaction and the next transaction is triggered, otherwise the transaction will be rejected by the consensus node because the interval proof is illegal. Therefore, when the privacy protection technology with interval proof is used under the account model, it will seriously hinder the transaction throughput.
  • Fig. 3 is a flowchart of a method for implementing confidential transactions in a blockchain network provided by an exemplary embodiment. As shown in Figure 3, the method is applied to the remittance party's equipment and can include the following steps:
  • Step 302 Determine the amount of remittance between the remitter and the recipient.
  • the remitter has a corresponding remitter account on the blockchain ledger.
  • the remitter’s account includes the income balance recorded as the income balance commitment and the corresponding
  • the amount of assets is recorded as the statistical quantity of the assets promised by the asset amount and each valued asset amount promise, where assets with the same asset amount have the same asset amount promise.
  • the remittance amount can be determined through negotiation between the remittance party and the recipient, or it can be determined by the remittance party itself. Based on the determined remittance amount, the appropriate asset can be selected from the remittance party's account to be used to pay the remittance amount.
  • the remitter corresponds to the remitter's account
  • the recipient corresponds to the beneficiary's account
  • both the remitter's account and the beneficiary's account are recorded in the blockchain ledger.
  • Each block chain node in the block chain network maintains a block chain ledger, and the consensus mechanism can ensure that the content of the block chain ledger maintained by all block chain nodes is consistent, so all block chain nodes can be considered Together they maintain a blockchain ledger.
  • FIG. 4 is a schematic diagram of a blockchain account structure provided by an exemplary embodiment.
  • the remitter’s account is account A as shown in Fig. 4, which includes income balance and asset information.
  • the plaintext amount of the income balance is Au, and for the purpose of confidentiality, it is specifically recorded on the blockchain ledger as the corresponding income balance commitment PC(Au, r_Au), where r_Au is a random number.
  • Asset information is used to record the assets held by the remitter.
  • the asset is generated based on the balance held by the remitter, which is different from the transaction output in the UTXO model. For example, based on the balance held by the remitter with a plaintext amount of t_a_1, it can be combined with the random number r_a_1 to generate the corresponding commitment amount PC (t_a_1, r_a_1), which is equivalent to the remitter holding an asset amount of t_a_1 and an asset amount commitment of PC (t_a_1,r_a_1); similarly, the corresponding commitment amount PC(t_a_2,r_a_2) can be generated based on the balance of the remitter's plaintext amount t_a_2 and the random number r_a_2, which is equivalent to the amount of assets held by the remitter It is t_a_2 and the asset amount commitment is the asset of PC (t_a_2, r_a_2); and so
  • this specification can limit the amount of assets with the same value to necessarily select the same random number.
  • the above asset amount t_a_1 must correspond to the random number r_a_1, and the asset amount t_a_2 must correspond to the random number r_a_2.
  • the asset amount of the same value must correspond to the asset amount commitment of the same value.
  • the asset amount t_a_1 must correspond to the asset amount commitment PC(t_a_1,r_a_1)
  • the asset amount t_a_2 must correspond to the asset amount commitment PC(t_a_2,r_a_2 ).
  • the asset information contained in the remitter’s account can specifically include each valued asset amount commitment and the statistical quantity of each valued asset amount commitment.
  • the asset amount commitment PC(t_a_1, The statistical quantity corresponding to r_a_1) is n1
  • the corresponding statistical quantity of asset commitment PC (t_a_2, r_a_2) is n2
  • the remitter holds n1 asset commitments whose value is PC (t_a_1, r_a_1), and n2 values Commitment to the amount of assets of PC (t_a_2, r_a_2). In this way, it is equivalent to dividing the assets contained in the remitter’s account into groups.
  • All assets in each asset group correspond to the same preset value of the asset amount (or asset amount commitment), and the assets of different asset groups correspond to Asset amounts (or asset amount commitments) with different preset values; of course, all assets can correspond to the same preset value asset amount (or asset amount commitment), which is equivalent to only one asset group.
  • the asset amount commitment corresponding to an asset group in Figure 4 is PC(t_a_1 ,r_a_1), the statistical quantity is n1, the asset amount commitment corresponding to another asset group is PC(t_a_2,r_a_2), and the statistical quantity is n2.
  • the asset amount commitment corresponding to an asset group in Figure 4 is PC(t_a_1 ,r_a_1), the statistical quantity is n1
  • the asset amount commitment corresponding to another asset group is PC(t_a_2,r_a_2)
  • the statistical quantity is n2.
  • the recipient’s account Similar to the remitter’s account, the recipient’s account also contains income balance and asset information.
  • the income balance is recorded as an income balance commitment.
  • the asset information includes the value of the asset commitment and its statistical quantity, including assets with the same amount of assets. Have the same asset amount commitment, so I won’t repeat them here.
  • Step 304 Create a remittance transaction based on the selected asset amount commitment in the remittance party’s account and the specified amount corresponding to each selected asset amount commitment, the remittance transaction including the remittance amount commitment corresponding to the remittance amount, each The selected asset amount commitment and the corresponding designated amount, the interval proof used to prove that the remittance amount is non-negative and not greater than the total amount of assets, the total amount of assets is the amount of assets corresponding to each selected asset amount commitment and the corresponding The weighted sum of the specified quantity.
  • one or more asset commitments contained in the remitter’s account can be selected, as well as the designated amount corresponding to each selected asset commitment.
  • the remittance amount is t
  • the selected asset amount commitments are PC(t_a_1,r_a_1) and PC(t_a_2,r_a_2), and the corresponding designated quantities are x1 and x2
  • the total asset amount can be determined as (t_a_1 *x1+t_a_2*x2), and should ensure that 0 ⁇ t ⁇ (t_a_1*x1+t_a_2*x2); specifically, an interval certificate can be generated to prove that the remittance amount is non-negative and not greater than the total assets, so as not to expose
  • the interval proof can be used to verify whether 0 ⁇ t ⁇ (t_a_1*x1+t_a
  • Step 306 Submit the remittance transaction to the blockchain, so that the statistical amount corresponding to each selected asset amount commitment is subtracted from the corresponding designated amount after the transaction is completed, and the income balance of the remittance party's account increases after the transaction is completed.
  • the change commitment and the income balance of the beneficiary account corresponding to the beneficiary on the blockchain ledger will increase the remittance commitment after the transaction is completed.
  • the remittance transaction can be packaged into a block by a blockchain node, and the block is added to the blockchain after consensus, so that the block contains the above Remittance transactions are executed on all blockchain nodes.
  • the blockchain node can verify the remittance transaction, such as verifying the signature of the remittance party and the recipient, verifying the aforementioned interval proof, etc., so that the remittance transaction is allowed to be executed after the verification is passed, otherwise the execution can be resolved.
  • the input of the remittance transaction comes from the assets in the remitter’s account, and the output consists of two parts: one part of the output target is the recipient’s account, the output amount is the remittance amount (the actual record is the remittance amount commitment), and the other part of the output target is the receipt
  • the payer’s account and the output amount are the change amount (the actual record is the change amount commitment).
  • the income balance is dedicated to the realization of remittances (used to remit the change amount as the remittance party, and used to remit the remittance amount as the remittance party), and the assets are dedicated to the realization of remittance.
  • the decoupling between the receipt and remittance of the same account can be realized, so that a user can be the remittance party of the remittance transaction TX1 and the remittance party of the remittance transaction TX2 while participating in the remittance transaction TX1 and TX2 at the same time, realizing the account Concurrency of transactions under the model can improve transaction execution efficiency in the blockchain network.
  • the value of the total amount of assets is only related to the selected asset amount commitment and its designated amount, and does not involve the amount of each asset recorded on the blockchain ledger.
  • the statistical number of promises allows different remittance transactions to generate corresponding interval proofs without affecting each other.
  • the blockchain node can check the specified quantity included in the remittance transaction and the statistics recorded on the blockchain ledger. Direct comparison of quantities: If the specified quantity is not greater than the statistical quantity, the corresponding remittance transaction is allowed to be executed, otherwise the execution is not allowed.
  • the same user can be the remitter of multiple remittance transactions at the same time to achieve transaction concurrency under the account model, which can improve the transaction execution efficiency in the blockchain network; and when the remittance transactions generated later arrive on the blockchain first
  • the blockchain node can preferentially process the remittance transaction that is generated later, without waiting for the execution of the remittance transaction that is generated earlier, to avoid transaction congestion at the blockchain node.
  • Fig. 5 is a flow chart of a privacy-protected remittance transaction provided by an exemplary embodiment; as shown in Fig. 5, the interaction process between the remittance party, the beneficiary party and the blockchain node may include the following steps:
  • step 501 the remitter determines the remittance amount t.
  • the remittance amount t can be negotiated between the sender and the recipient.
  • the remittance party can also determine the remittance amount t by itself, and the remittance party will confirm it in the subsequent steps.
  • the remittance party refers to the role that remits resources such as funds and assets in a remittance transaction
  • the recipient refers to the role that receives resources such as money and assets in a remittance transaction.
  • user A sends money to user B user A is the sender and user B is the recipient; at the same time, when user B sends money to user A, user B is the sender and user A is the recipient. Therefore, there is no binding relationship between the roles of the remittance party and the recipient and the user, and it needs to be determined based on the actual remittance relationship.
  • FIG. 6 is a schematic diagram of account changes before and after remittance provided by an exemplary embodiment. As shown in Figure 6, it is assumed that user A has a corresponding account A on the blockchain ledger, and user B has a corresponding account B on the blockchain ledger.
  • account A can include income balance and asset information, where the income balance is recorded as PC(Au,r_Au), and the asset information is recorded as [n1,PC(t_a_1,r_a_1)] and [n2,PC(t_a_2) ,r_a_2)], etc., indicating that the statistical number of assets corresponding to the asset amount commitment PC (t_a_1, r_a_1) in account A is n1, the statistical number of assets corresponding to the asset amount commitment PC (t_a_2, r_a_2) is n2, etc.
  • account B can include income balance and asset information, where the income balance is recorded as PC(Bu,r_Bu), and the asset information is recorded as [m1,PC(t_b_1,r_b_1)] and [m2,PC(t_b_2, r_b_2) )] etc., indicating that the statistical quantity of assets corresponding to the asset amount commitment PC (t_b_1, r_b_1) in account B is m1, the statistical quantity of assets corresponding to the asset amount commitment PC (t_b_2, r_b_2) is m2, etc.
  • Step 502 The remitter determines the random number r corresponding to the remittance amount t.
  • step 503 the remitter sends (r, t, T) to the recipient through the off-chain channel.
  • step 504 the payee verifies the received (r, t, T).
  • Step 505 After the payee passes the verification, it generates a signature and returns to the sender.
  • the recipient can use the recipient's private key to sign (A,B:T), generate a signature SigB, and return it to the sender.
  • the signature SigB indicates that the recipient agrees that the remittance party's corresponding account A will implement the remittance transaction with the remittance amount commitment T to the recipient's corresponding account B.
  • step 506 after receiving the signature SigB, the remitter generates an interval proof PR based on the selected asset amount commitment and the specified amount.
  • account A shown in Figure 6 contains several asset commitments and their corresponding statistical quantities.
  • the statistical quantity corresponding to the asset commitment PC (t_a_1, r_a_1) is n1
  • the asset commitment PC (t_a_2, r_a_2) The corresponding statistical quantity is n2.
  • the asset amount commitment PC (t_a_1, r_a_1) is calculated based on the asset amount t_a_1 and the random number r_a_1
  • the asset amount commitment PC (t_a_2, r_a_2) is calculated based on the asset amount t_a_2 and the random number r_a_2. get.
  • the remitter can generate an interval proof PR based on the selected asset amount commitment PC (t_a_1, r_a_1) and asset amount commitment PC (t_a_2, r_a_2), the corresponding designated amounts x1 and x2, and the remittance amount t.
  • the interval proof PR is used to prove: 0 ⁇ t ⁇ (t_a_1*x1+t_a_2*x2).
  • the Bulletproofs scheme and Borromean ring signature scheme in related technologies can be used to generate the above-mentioned interval proof. This manual does not limit this; and the blockchain node can verify the above "0 ⁇ t ⁇ " in the ciphertext state.
  • interval proof PR it can be determined that the interval proof PR has nothing to do with the statistical amount of each asset commitment in account A, so in addition to the above remittance transactions, account A can also participate in other remittance transactions at the same time, and Both can successfully generate interval proofs without mutual influence, thereby realizing concurrent transactions.
  • Step 507 The remitter signs the transaction content ⁇ A,B:T,[PC(t_a_1,r_a_1),x1; PC(t_a_2,r_a_2),x2],PR; SigB ⁇ to generate a signature SigA.
  • the remitter can use the remitter’s private key to sign the transaction content ⁇ A,B:T,[PC(t_a_1,r_a_1),x1; PC(t_a_2,r_a_2),x2],PR; SigB ⁇ to generate the signature SigA.
  • Step 508 the remittance submits the transaction to the blockchain.
  • the remittance party can submit the remittance transaction to a certain blockchain node in the blockchain network, and the remittance transaction can also be transmitted to all blockchain nodes in the blockchain network, and each blockchain node is separately
  • the remittance transaction is verified to execute the remittance operation when the verification is passed, and refuse the remittance when the verification fails.
  • Step 509 the blockchain node checks whether the transaction has been executed.
  • the blockchain node here can refer to any blockchain node in the blockchain network, that is, each blockchain node in the blockchain network will receive the above remittance transaction and pass steps 509 to 512, etc. Implement verification and other operations.
  • the blockchain node After receiving the above remittance transaction, the blockchain node can use the anti-double-spending or anti-replay mechanism in the related technology to verify whether the remittance transaction has been executed; if it has been executed, it can refuse to execute the remittance transaction, otherwise it will transfer Go to step 510.
  • Step 510 the blockchain node checks the signature.
  • the blockchain node can check whether the signatures SigA and SigB included in the remittance transaction are correct; if they are not correct, they can refuse to execute the remittance transaction, otherwise go to step 511.
  • Step 511 the blockchain node checks the interval proof PR.
  • the blockchain node may check the interval proof PR included in the remittance transaction based on interval proof technology to determine whether 0 ⁇ t ⁇ (t_a_1*x1+t_a_2*x2). If it is not satisfied, the remittance transaction can be refused to be executed;
  • Step 512 The blockchain node checks whether the statistical number is not less than the specified number.
  • the blockchain node can directly compare the statistical quantity with the specified quantity Compare to determine whether account A is sufficient to pay.
  • step 513 the blockchain node updates the respective accounts of the user A and the user B in the maintained blockchain ledger.
  • the blockchain node After passing the verification in steps 509 to 512, the blockchain node can update the account A and account B recorded in the blockchain ledger, as shown in Figure 6:
  • the income balance before the transaction is Au, which is recorded as the corresponding income balance commitment PC (Au, r_Au) in the blockchain ledger, and the corresponding statistical quantity of the asset commitment PC (t_a_1, r_a_1) before the transaction is n1.
  • the statistical quantity corresponding to the asset commitment PC (t_a_2, r_a_2) is n2.
  • the statistical quantity corresponding to the asset commitment PC (t_a_1, r_a_1) is reduced by x1 and updated to n1-x1, while the statistical quantity corresponding to the asset commitment PC (t_a_2, r_a_2) is reduced by x2 and updated to n2- x2;
  • the income balance is increased by the change amount t', which corresponds to the change commitment PC(t',r'), so the income balance commitment recorded in the blockchain ledger is updated to PC(Au,r_Au)+ PC(t',r').
  • the change commitment PC(t',r') is also included in the above remittance transaction, so that the blockchain node can perform the remittance transaction according to
  • the change commitment PC(t',r') updates the income balance of account A.
  • the income balance before the transaction is Bu, which is recorded as the corresponding income balance commitment PC (Bu, r_Bu) in the blockchain ledger, and the corresponding statistical quantity of the asset commitment PC (t_b_1, r_b_1) before the transaction is m1.
  • the statistical quantity corresponding to the asset commitment PC (t_b_2, r_b_2) is m2.
  • the statistical quantities m1 and m2 remain unchanged, while the income balance Bu increases the remittance amount t, so it is recorded in the blockchain ledger as the corresponding income balance commitment PC(Bu,r_Bu)+PC(t, r).
  • the input and output of the account can be decoupled while ensuring transaction privacy, and high concurrent transfer under the account model can be realized.
  • the value of the statistical quantity ie the assets in the account
  • the decline may be less than the specified amount in the remittance transaction and affect the execution of the remittance transaction.
  • the amount of the statistical quantity can be adjusted by recharging regularly or at any time.
  • a recharge transaction can be created.
  • the recharge transaction includes at least one specified asset amount commitment and corresponding recharge quantity, and a proof of interval used to prove that the remittance account’s income balance is not less than the recharge amount, and the recharge amount is the specified value asset
  • the weighted sum of the asset amount corresponding to the amount commitment and the recharge quantity (if only a designated value of the asset amount commitment is involved, the recharge amount is the product of the asset amount corresponding to the asset amount promise and the recharge amount); submit to the blockchain
  • the recharge transaction makes the statistical quantity of the asset amount promised in the remitter’s account corresponding to the specified value increase by the corresponding recharge quantity after the transaction is completed, and the income balance of the remitter’s account decreases at least one value specified above after the transaction is completed
  • the weighted sum of the asset commitment and the corresponding recharge quantity The weighted sum of the asset commitment and the corresponding recharge quantity.
  • the income balance in the remitter’s account can be divided into at least a part, and this part of the balance can be converted into corresponding assets. These assets can increase the value of the statistical quantity of the corresponding asset amount commitment.
  • the payee's account can also be recharged in the above manner.
  • the asset recharge operation based on the income balance can be implemented in the above manner, when the account participates in more frequent remittance transactions and the remittance amount is large, it may cause frequent recharge, resulting in frequent remittance and remittance of income balance of funds (recharge) , And even make the corresponding influence between the remittance transaction (the transaction of remittance from other accounts to the account) and the recharge transaction, which causes a decrease in efficiency.
  • FIG. 7 is a schematic diagram of another blockchain account structure provided by an exemplary embodiment.
  • the account A shown in Figure 7 can further include the main balance, that is, the account A contains three parts in total: Balance, income balance, and asset information.
  • the income balance is exclusively used to collect the transaction amount of inward transactions
  • asset information is exclusively used to participate in outbound transactions
  • the main balance is used to recharge asset information, thereby avoiding the recharge task of the income balance and preventing the above-mentioned influences.
  • the remittance party can create a recharge transaction, which includes at least one designated asset amount commitment and corresponding recharge amount, and a proof of interval used to prove that the main balance is not less than the recharge amount.
  • the recharge amount is at least one of the above specified values.
  • the weighted sum of the amount of assets corresponding to the commitment of the asset amount and the corresponding recharge quantity submit a recharge transaction to the blockchain, so that the remitter’s account corresponds to at least one of the above specified asset amount commitment statistics after the transaction is completed Increase the corresponding recharge quantity, and reduce the main balance of the remittance party’s account after the transaction is completed by the weighted sum of at least one valued asset commitment and the corresponding recharge quantity.
  • FIG. 8 is an interactive schematic diagram of asset recharge through main balance provided by an exemplary embodiment. As shown in Figure 8, the interaction process may include the following steps:
  • step 801 the remitter determines the designated asset amount and the recharge amount.
  • the remittance party can determine the amount of assets corresponding to the existing asset amount commitments in the account, and use one or more of the asset amounts as the above-mentioned specified value of the asset amount, so that the statistics corresponding to these existing asset amount commitments are in It can be increased accordingly after the recharge is completed.
  • the remitter can set other asset amounts that are different from the asset amount corresponding to the existing asset amount commitment, for example, when there is already an asset amount commitment corresponding to an asset value of 100 in the account, and an asset value corresponding to an asset value of 20.
  • you can set the above specified value as 50 so that you can recharge to get the amount commitment corresponding to the asset with the value of 50, and the asset information contained in the account can add the asset with the value of 50.
  • the statistical number of asset commitments are examples of asset amounts.
  • the remittance party can manually initiate a recharge transaction
  • an automated recharge operation can be implemented.
  • the water level value can be set for the statistical quantity of each valued asset amount commitment in the account.
  • a recharge transaction can be automatically initiated. The value of the assets is promised to be recharged, so that the corresponding statistics will rise to no less than the water level.
  • step 802 the remitter generates an interval proof PR.
  • the value Az of the main balance is recorded in the blockchain ledger as the corresponding commitment amount PC(Az, r_Az), where r_Az is a random number, it is necessary to generate the interval proof PR for verification
  • step 803 after the remitter signs the transaction, it is submitted to the blockchain.
  • the transaction content of the recharge transaction generated by the remitter can be Topup ⁇ A:[PC(t_a_1,r_a_1),y1; PC(t_a_2,r_a_2),y2],PR ⁇ , where "A" represents the account A’s Account address, [PC(t_a_1,r_a_1),y1;PC(t_a_2,r_a_2),y2] indicates that the recharge target is the asset amount commitment PC (t_a_1,r_a_1) contained in account A.
  • the amount of recharge is y1, and the asset amount commitment PC
  • the recharge quantity of (t_a_2,r_a_2) is y2.
  • a type field can be added to the transaction, and when creating each transaction, the remitter can assign a value to the type field to mark the type of the submitted transaction, so as to provide information about the remittance transaction, recharge transaction, and recharge transaction involved in this manual.
  • Consolidation transactions and main balance remittance transactions described below are distinguished. For example, remittance transactions can be marked by the value "Transfer”, and recharge transactions can be marked by the value "Topup".
  • the remitter uses the private key of the remitter to sign the above transaction content Topup ⁇ A:[PC(t_a_1,r_a_1),y1; PC(t_a_2,r_a_2),y2],PR ⁇ , and creates the signature after signing
  • the recharge transaction is submitted to the blockchain network for verification and execution by all blockchain nodes.
  • Step 804 the blockchain node verifies the transaction.
  • the blockchain node can verify whether the signature of the above recharge transaction is correct; if it is not correct, it can refuse to execute the transaction.
  • the blockchain node can verify the interval proof PR contained in the above recharge transaction to determine whether 0 ⁇ (t_a_1*y1+t_a_2*y2) ⁇ Az; if it is not correct, it can refuse to execute the transaction.
  • step 805 can be transferred.
  • Step 805 the blockchain node updates the account.
  • FIG. 9 is a schematic diagram of account changes before and after recharging according to an exemplary embodiment. As shown in Figure 9:
  • the main balance before the transaction is Az, which is recorded as the corresponding commitment amount PC (Az, r_Az) in the blockchain ledger
  • the income balance before the transaction is Au, which is recorded as the corresponding commitment amount PC in the blockchain ledger.
  • the pre-transaction asset commitment PC (t_a_1, r_a_1) corresponds to the statistical quantity n1
  • the asset commitment PC (t_a_2, r_a_2) corresponds to the statistical quantity n2.
  • the main balance is deducted (t_a_1*y1+t_a_2*y2), which is the weighted sum of the aforementioned asset amount and the amount of recharge, so it is recorded in the blockchain ledger as PC (Az, r_Az )-PC(t_a_1,r_a_1)*y1-PC(t_a_2,r_a_2)*y2, and the statistical quantity n1 in the asset information increases the recharge quantity y1, the statistical quantity n2 increases the recharge quantity y2, so in the blockchain ledger Recorded in plain text as [n1+y1,PC(t_a_1,r_a_1)] and [n2+y2,PC(t_a_2,r_a_2)]; at the same time, the value of the income balance remains unchanged.
  • the main balance will gradually decrease; when the main balance is reduced to a certain level or reduced to 0, it will not be able to continue to recharge, so it can be recharged
  • the funds obtained in the income balance are transferred to the main balance in order to maintain the account and participate in the remittance transaction continuously.
  • the remitter can create a combined transaction that includes at least one specified asset amount commitment and the corresponding combined amount; then, submit the combined transaction to the blockchain so that the remitter’s account corresponds to at least one specified above
  • the statistical quantity of the valued asset commitment is reduced by the corresponding combined amount
  • the main balance is increased after the transaction is completed, and the combined commitment is increased, and/or the income balance of the remitter’s account is cleared after the transaction is completed.
  • the main balance adds a corresponding income balance commitment after the transaction is completed; the combined amount commitment is the weighted sum of at least one valued asset commitment specified above and the corresponding combined amount.
  • the merger transaction can merge all the funds contained in the income balance into the main balance, or in some cases at least part of the assets can be merged into the main balance in the form of funds, or it can also merge the funds contained in the income balance into the main balance at the same time.
  • Balance merge at least part of the assets into the main balance in the form of funds.
  • FIG. 10 is an interactive schematic diagram of a merge operation provided by an exemplary embodiment. As shown in Figure 10, this interactive process can simultaneously merge all funds in the income balance and a specified amount of assets into the main balance, which specifically includes the following steps:
  • step 1001 the remittance party determines the asset amount commitment and the combined amount.
  • Step 1002 After the remittance party signs the transaction, it is submitted to the blockchain.
  • the transaction content of the merge transaction generated by the remitter can be Merge ⁇ A:[PC(t_a_1,r_a_1),z1; PC(t_a_2,r_a_2),z2] ⁇ , where "A" represents the account address of the account A , Indicating that the account A needs to be merged, [PC(t_a_1,r_a_1),z1; PC(t_a_2,r_a_2),z2] indicates that the amount of z1 needs to be committed to the assets of PC(t_a_1,r_a_1) and the amount of z2 And the corresponding commitment is the assets of PC (t_a_2, r_a_2) merged into the main balance. And Merge indicates that the current transaction type is a merge transaction, which is used to implement a merge operation for account A.
  • the blockchain node can directly compare the statistical quantity with the merged quantity, so that the transaction can be completed when the statistical quantity is not less than the merged quantity, otherwise the transaction is not allowed to be executed, and no interval proof is required.
  • the remitter uses the private key of the remitter to sign the above transaction content Merge ⁇ A:[PC(t_a_1,r_a_1),z1; PC(t_a_2,r_a_2),z2] ⁇ , and the recharge transaction created after the signature Submit to the blockchain network for verification and execution by all blockchain nodes.
  • Step 1003 the blockchain node verifies the transaction.
  • the blockchain node can verify whether the signature of the merged transaction is correct; if it is not correct, it can refuse to execute the transaction.
  • step 1004 can be transferred to.
  • Step 1004 the blockchain node updates the account.
  • FIG. 11 is a schematic diagram of account changes before and after merger according to an exemplary embodiment. As shown in Figure 11:
  • the main balance before the transaction is Az, which is recorded as the corresponding commitment amount PC (Az, r_Az) in the blockchain ledger
  • the income balance before the transaction is Au, which is recorded as the corresponding commitment amount PC in the blockchain ledger.
  • the pre-transaction asset commitment PC (t_a_1, r_a_1) corresponds to the statistical quantity n1
  • the asset commitment PC (t_a_2, r_a_2) corresponds to the statistical quantity n2.
  • the income balance becomes 0; the statistical quantity n1 corresponding to the asset amount commitment PC (t_a_1, r_a_1) is reduced by the combined quantity z1, updated to n1-z1, and the asset amount commitment PC (t_a_2, r_a_2) corresponds to the statistics
  • the quantity n2 reduces the consolidated quantity z2 and is updated to n2-z2; the main balance increases all the funds of the income balance, z1 quantity of asset commitment PC(t_a_1,r_a_1), z2 quantity of asset commitment PC(t_a_2,r_a_2), Therefore, the main balance commitment recorded in the blockchain ledger is updated to PC(Az,r_Az)+PC(Au,r_Au)+PC(t_a_1,r_a_1)*z1+PC(t_a_2,r_a_2)*z2.
  • the main balance participates in the remittance transaction by the asset information and the income balance to participate in the remittance transaction (the income balance is also collected in the remittance transaction Change amount), the main balance participates in the above-mentioned recharge transactions and consolidation transactions, but it does not mean that each balance can only participate in the above-mentioned types of transactions.
  • the account structure in this manual can also be compatible: the main balance participates in the main balance transfer transaction of the remitted funds, etc., which are introduced below.
  • the main balance transfer transaction can be generated based on the main balance transaction amount between the sender and the recipient.
  • the main balance transfer transaction includes the main balance transaction amount commitment corresponding to the main balance transaction amount, and is used for Proof that the main balance transaction amount is non-negative and not greater than the interval proof of the main balance; then, the remittance party can submit the main balance remittance transaction to the blockchain, so that the main balance deducts the main balance transaction amount commitment and the payee account after the transaction is completed After the transaction is completed, the income balance will increase the transaction amount commitment of the main balance.
  • Fig. 12 is a flow chart of a main balance transfer transaction provided by an exemplary embodiment. As shown in Figure 12, the interaction process between the sender, the recipient and the blockchain node can include the following steps:
  • Step 1201 The remitter determines the remittance amount t_z.
  • the remittance amount t_z can be negotiated between the sender and the recipient.
  • the sender can also determine the remittance amount t_z by itself, and the recipient will confirm it in the subsequent steps.
  • Step 1202 The remitter determines the random number r_z corresponding to the remittance amount t_z.
  • step 1203 the remitter sends (r_z, t_z, T) to the recipient through the off-chain channel.
  • Step 1204 the payee verifies the received (r_z, t_z, T).
  • Step 1205 After the payee passes the verification, it generates a signature and returns to the sender.
  • the payee can use the payee's private key to sign (A, B:T), generate a signature SigB, and return it to the sender.
  • the signature SigB indicates that the recipient agrees that the account A corresponding to the remittance party will implement a remittance transaction with a commitment of T to the account B corresponding to the recipient.
  • Step 1206 After receiving the signature SigB, the remitter generates an interval proof RP based on the main balance Az.
  • the blockchain node in order to ensure the successful completion of the remittance transaction, the blockchain node needs to determine that the remittance amount t_z and the main balance Az meet the following conditions: 0 ⁇ t_z ⁇ Az, so the remittance party can use interval proof technology to generate interval proof RP, For verification by the blockchain node in the subsequent process, the blockchain node can verify whether the transaction meets the above conditions in the ciphertext state.
  • Step 1207 the remitter signs the transaction content PrimaryTransfer (A, B: T, RP; SigB), and generates a signature SigA.
  • A, B T, RP; SigB
  • the remitter can use the remitter's private key to sign the transaction content PrimaryTransfer (A, B: T, RP; SigB) to generate the signature SigA.
  • PrimaryTransfer is used to indicate that the transaction type is a primary balance transfer transaction, so that the remittance amount t_z is deducted from the primary balance of account A.
  • Step 1208 the remittance submits the transaction to the blockchain.
  • the remittance party submits the remittance transaction to a certain blockchain node in the blockchain network, and then is transmitted to all blockchain nodes in the blockchain network, and each blockchain node performs the remittance transaction separately Verification to perform the remittance operation when the verification is passed, and refuse the remittance when the verification fails.
  • Step 1209 the blockchain node checks whether the transaction has been executed.
  • the block chain node here can mean any block chain node in the block chain network, that is, each block chain node in the block chain network will receive the above remittance transaction and pass steps 1209-1211, etc. Implement verification and other operations.
  • the blockchain node After receiving the above remittance transaction, the blockchain node can use the anti-double-spending or anti-replay mechanism in the related technology to verify whether the remittance transaction has been executed; if it has been executed, it can refuse to execute the remittance transaction, otherwise it will transfer Go to step 1210.
  • Step 1210 the blockchain node checks the signature.
  • the blockchain node can check whether the signatures SigA and SigB contained in the remittance transaction are correct; if they are not correct, they can refuse to execute the remittance transaction, otherwise go to step 1211.
  • Step 1211 the blockchain node checks the interval proof RP.
  • Blockchain nodes can check the interval proof RP included in the remittance transaction based on interval proof technology to determine whether 0 ⁇ t_z ⁇ Az is satisfied. If it is not satisfied, the remittance transaction may be refused to be executed; otherwise, the process proceeds to step 1212.
  • Step 1212 The blockchain node updates the account A and account B corresponding to the sender and the recipient respectively in the maintained blockchain ledger.
  • Fig. 13 is a schematic diagram of account changes before and after the main balance remittance provided by an exemplary embodiment. As shown in Figure 13:
  • the main balance before the transaction is Az, which is recorded in the blockchain ledger as the corresponding commitment amount PC (Az, r_Az)
  • the income balance before the transaction is Au, which is recorded in the blockchain ledger as
  • the asset amount commitment PC (t_a_1, r_a_1) before the transaction corresponds to the statistical quantity n1
  • the asset amount commitment PC (t_a_2, r_a_2) corresponds to the statistical quantity n2.
  • the main balance before the transaction is Bz, which is recorded as the corresponding commitment amount PC (Bz, r_Bz) in the blockchain ledger
  • the income balance before the transaction is Bu, which is recorded as The corresponding commitment amount PC (Bu, r_Bu)
  • the asset amount commitment PC (t_b_1, r_b_1) before the transaction corresponds to the statistical amount m1
  • the asset amount commitment PC (t_b_2, r_b_2) corresponds to the statistical amount m2.
  • the main balance is Bz
  • the statistical number n1-n2 remains unchanged
  • the income balance increases the remittance amount t_z, so it is recorded in the blockchain ledger as the corresponding commitment amount PC(Bu,r_Bu)+PC (t_z,r_z).
  • Fig. 14 is a flowchart of another method for implementing confidential transactions in a blockchain network provided by an exemplary embodiment. As shown in Figure 14, the method is applied to blockchain nodes and can include the following steps:
  • Step 1402 Receive a remittance transaction.
  • the remittance transaction includes a remittance amount commitment corresponding to the remittance amount between the remitter and the recipient, at least one asset amount commitment and a corresponding designated amount, used to prove that the remittance amount is non-negative and Proof of the interval not greater than the total amount of assets, the total amount of assets is the weighted sum of the amount of assets corresponding to the at least one asset amount commitment and the corresponding designated amount; wherein, the remitter account on the blockchain ledger corresponding to the remitter Including the income balance recorded as the income balance promise, the corresponding asset amount recorded as the asset amount promise, and the statistical quantity of each valued asset amount promise, where the same asset amount has the same asset amount promise.
  • the remittance amount can be determined through negotiation between the remittance party and the recipient, or it can be determined by the remittance party itself. Based on the determined remittance amount, the appropriate asset can be selected from the remittance party's account to be used to pay the remittance amount.
  • the remitter corresponds to the remitter's account
  • the recipient corresponds to the beneficiary's account
  • both the remitter's account and the beneficiary's account are recorded in the blockchain ledger.
  • Each block chain node in the block chain network maintains a block chain ledger, and the consensus mechanism can ensure that the content of the block chain ledger maintained by all block chain nodes is consistent, so all block chain nodes can be considered Together they maintain a blockchain ledger.
  • account A includes income balance and asset information.
  • the plaintext amount of the income balance is Au, and for the purpose of confidentiality, it is specifically recorded on the blockchain ledger as the corresponding income balance commitment PC(Au, r_Au), where r_Au is a random number.
  • Asset information is used to record the assets held by the remitter. The asset is generated based on the balance held by the remitter, which is different from the transaction output in the UTXO model.
  • the remitter For example, based on the balance held by the remitter with a plaintext amount of t_a_1, it can be combined with the random number r_a_1 to generate the corresponding commitment amount PC (t_a_1, r_a_1), which is equivalent to the remitter holding an asset amount of t_a_1 and an asset amount commitment of PC (t_a_1,r_a_1); similarly, the corresponding commitment amount PC(t_a_2,r_a_2) can be generated based on the balance of the remitter's plaintext amount t_a_2 and the random number r_a_2, which is equivalent to the amount of assets held by the remitter It is t_a_2 and the asset amount commitment is the asset of PC (t_a_2, r_a_2); and so on, other assets with the same or different asset amounts can be generated.
  • PC t_a_1, r_a_1
  • this specification can limit the amount of assets with the same value to necessarily select the same random number.
  • the above asset amount t_a_1 must correspond to the random number r_a_1, and the asset amount t_a_2 must correspond to the random number r_a_2.
  • the asset amount of the same value must correspond to the asset amount commitment of the same value.
  • the asset amount t_a_1 must correspond to the asset amount commitment PC(t_a_1,r_a_1)
  • the asset amount t_a_2 must correspond to the asset amount commitment PC(t_a_2,r_a_2 ).
  • the asset information contained in the remitter’s account can specifically include each valued asset amount commitment and the statistical quantity of each valued asset amount commitment.
  • the asset amount commitment PC(t_a_1, The statistical quantity corresponding to r_a_1) is n1
  • the corresponding statistical quantity of asset commitment PC (t_a_2, r_a_2) is n2
  • the remitter holds n1 asset commitments whose value is PC (t_a_1, r_a_1), and n2 values Commitment to the amount of assets of PC(t_a_2, r_a_2). In this way, it is equivalent to dividing the assets contained in the remitter’s account into groups.
  • All assets in each asset group correspond to the same preset value of the asset amount (or asset amount commitment), and the assets of different asset groups correspond to Asset amounts (or asset amount commitments) with different preset values; of course, all assets can correspond to the same preset value asset amount (or asset amount commitment), which is equivalent to only one asset group.
  • the asset amount commitment corresponding to an asset group in Figure 4 is PC(t_a_1 ,r_a_1), the statistical quantity is n1, the asset amount commitment corresponding to another asset group is PC(t_a_2,r_a_2), and the statistical quantity is n2.
  • the asset amount commitment corresponding to an asset group in Figure 4 is PC(t_a_1 ,r_a_1), the statistical quantity is n1
  • the asset amount commitment corresponding to another asset group is PC(t_a_2,r_a_2)
  • the statistical quantity is n2.
  • the recipient’s account Similar to the remitter’s account, the recipient’s account also contains income balance and asset information.
  • the income balance is recorded as an income balance commitment.
  • the asset information includes the value of the asset commitment and its statistical quantity, including assets with the same amount of assets. Have the same asset amount commitment, so I won’t repeat them here.
  • the remittance transaction adds one or more selected asset commitments in the remitter’s account, and the designated amount corresponding to each selected asset commitment.
  • the remittance amount is t
  • the selected asset amount commitments are PC(t_a_1,r_a_1) and PC(t_a_2,r_a_2), and the corresponding designated quantities are x1 and x2
  • the total asset amount can be determined as (t_a_1 *x1+t_a_2*x2), and should ensure that 0 ⁇ t ⁇ (t_a_1*x1+t_a_2*x2); specifically, an interval certificate can be generated to prove that the remittance amount is non-negative and not greater than the total assets, so as not to expose
  • the interval proof can be used to verify whether 0 ⁇ t ⁇ (t_a_1*x1+t_a_2*x2).
  • Step 1404 Execute the remittance transaction so that the statistical quantity corresponding to each asset amount promised by the remittance exchange will subtract the corresponding designated quantity after the transaction is completed, and the income balance of the remittance party’s account will increase after the transaction is completed.
  • zero amount commitment the income balance of the recipient's account corresponding to the recipient on the blockchain ledger will increase the remittance amount commitment after the transaction is completed.
  • the remittance transaction can be packaged into a block by a blockchain node, and the block is added to the blockchain after consensus, so that the block contains the above Remittance transactions are executed on all blockchain nodes.
  • the blockchain node can verify the remittance transaction, such as verifying the signature of the remittance party and the recipient, verifying the aforementioned interval proof, etc., so that the remittance transaction is allowed to be executed after the verification is passed, otherwise the execution can be resolved.
  • the input of the remittance transaction comes from the assets in the remitter’s account, and the output consists of two parts: one part of the output target is the recipient’s account, the output amount is the remittance amount (the actual record is the remittance amount commitment), and the other part of the output target is the receipt
  • the payer’s account and the output amount are the change amount (the actual record is the change amount commitment).
  • the income balance is dedicated to the realization of remittances (used to remit the change amount as the remittance party, and used to remit the remittance amount as the remittance party), and the assets are dedicated to the realization of remittance.
  • the decoupling between the receipt and remittance of the same account can be realized, so that a user can be the remittance party of the remittance transaction TX1 and the remittance party of the remittance transaction TX2 while participating in the remittance transaction TX1 and TX2 at the same time, realizing the account Concurrency of transactions under the model can improve transaction execution efficiency in the blockchain network.
  • the value of the total amount of assets is only related to the selected asset amount commitment and its designated amount, and does not involve the amount of each asset recorded on the blockchain ledger.
  • the statistical number of promises allows different remittance transactions to generate corresponding interval proofs without affecting each other.
  • the blockchain node can check the specified quantity included in the remittance transaction and the statistics recorded on the blockchain ledger. Direct comparison of quantities: If the specified quantity is not greater than the statistical quantity, the corresponding remittance transaction is allowed to be executed, otherwise the execution is not allowed.
  • the same user can be the remitter of multiple remittance transactions at the same time to achieve transaction concurrency under the account model, which can improve the transaction execution efficiency in the blockchain network; and when the remittance transactions generated later arrive on the blockchain first
  • the blockchain node can preferentially process the remittance transaction that is generated later, without waiting for the execution of the remittance transaction that is generated earlier, to avoid transaction congestion at the blockchain node.
  • the input and output of the account can be decoupled while ensuring transaction privacy, and high concurrent transfer under the account model can be realized.
  • the value of the statistical quantity ie the assets in the account
  • the decline may be less than the specified amount in the remittance transaction and affect the execution of the remittance transaction.
  • the amount of the statistical quantity can be adjusted by recharging regularly or at any time.
  • Blockchain nodes can receive recharge transactions, which include at least one designated asset amount commitment and corresponding recharge quantity, and a proof of interval used to prove that the income balance of the remitter’s account is not less than the recharge amount, and the recharge amount is specified above
  • the recharge quantity and the income balance of the remittance party’s account are reduced by the weighted sum of at least one valued asset commitment specified above and the corresponding recharge quantity.
  • the income balance in the remitter’s account can be divided into at least a part, and this part of the balance can be converted into corresponding assets. These assets can increase the value of the statistical quantity of the corresponding asset amount commitment.
  • the payee's account can also be recharged in the above manner.
  • the asset recharge operation based on the income balance can be implemented in the above manner, when the account participates in more frequent remittance transactions and the remittance amount is large, it may cause frequent recharge, resulting in frequent remittance and remittance of income balance of funds (recharge) , And even make the corresponding influence between the remittance transaction (the transaction of remittance from other accounts to the account) and the recharge transaction, which causes a decrease in efficiency. Therefore, in this specification, further improvements can be made to the account structure shown in Figure 4, and the account structure shown in Figure 7 can be obtained.
  • account A contains a total of three parts: main balance, income balance and asset information.
  • the income balance is exclusively used to collect the transaction amount of inward transactions
  • asset information is exclusively used to participate in outbound transactions
  • main balance is used to recharge asset information, thereby avoiding the recharge task of the income balance and preventing the above-mentioned influences.
  • Blockchain nodes can receive recharge transactions, which include at least one designated asset amount commitment and corresponding recharge quantity, and a proof of interval used to prove that the main balance is not less than the recharge amount.
  • the recharge amount is at least one specified above
  • the corresponding recharge quantity will be increased, and the main balance of the remitter’s account will be reduced after the transaction is completed by the weighted sum of at least one valued asset commitment and the corresponding recharge quantity.
  • FIG. 9 also shows the changes before and after the account is recharged, which will not be repeated here.
  • the main balance will gradually decrease; when the main balance is reduced to a certain level or reduced to 0, it will not be able to continue to recharge, so it can be recharged
  • the funds obtained in the income balance are transferred to the main balance in order to maintain the account and participate in the remittance transaction continuously.
  • the blockchain node can receive a merger transaction that includes at least one designated asset amount commitment and the corresponding merged quantity; the blockchain node executes the merger transaction so that the remitter’s account corresponds to at least one designated transaction
  • the statistical quantity of the value of the asset commitment is reduced by the corresponding combined amount, the main balance is increased after the transaction is completed, and the combined commitment is increased, and/or the income balance of the remitter’s account is cleared after the transaction is completed.
  • the balance will be increased by the corresponding income balance commitment; where the combined commitment is the weighted sum of at least one valued asset commitment specified above and the corresponding combined amount.
  • the merger transaction can merge all the funds contained in the income balance into the main balance, or in some cases at least part of the assets can be merged into the main balance in the form of funds, or it can also merge the funds contained in the income balance into the main balance at the same time.
  • Balance merge at least part of the assets into the main balance in the form of funds.
  • the main balance participates in the remittance transaction by the asset information and the income balance to participate in the remittance transaction (the income balance is also collected in the remittance transaction Change amount), the main balance participates in the above-mentioned recharge transactions and consolidation transactions, but it does not mean that each balance can only participate in the above-mentioned types of transactions.
  • the account structure in this manual is also compatible: the main balance participates in the main balance transfer transaction of the remitted funds, etc.
  • a blockchain node can receive a master balance remittance transaction, which includes a master balance transaction amount commitment corresponding to the master balance transaction amount between the sender and the recipient, and is used to prove that the master balance transaction amount is non-negative and Proof of interval not greater than the main balance; the blockchain node executes the main balance remittance transaction, so that the main balance deducts the main balance transaction amount commitment after the transaction is completed, and the income balance of the recipient account increases the main balance transaction amount commitment after the transaction is completed.
  • FIG. 12 shows the changes of the account before and after the transaction, which will not be repeated here.
  • Fig. 15 is a schematic structural diagram of a device according to an exemplary embodiment. Please refer to FIG. 15.
  • the device includes a processor 1502, an internal bus 1504, a network interface 1506, a memory 1508, and a non-volatile memory 1510. Of course, it may also include hardware required for other services.
  • the processor 1502 reads the corresponding computer program from the non-volatile memory 1510 to the memory 1508 and then runs it to form a device for implementing confidential transactions in a blockchain network on a logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., which means that the execution body of the following processing flow is not limited to each
  • the logic unit can also be a hardware or logic device.
  • the device for implementing confidential transactions in the blockchain network is applied to the remittance device (the hardware structure of the remittance device is shown in Figure 15), which may include:
  • the determining unit 1601 determines the amount of remittance between the remitter and the recipient, the remitter has a corresponding remitter account on the blockchain ledger, and the remitter account includes the income balance recorded as an income balance commitment,
  • the corresponding asset amount is recorded as the statistical quantity of the asset amount promised and each valued asset amount promise, where the assets with the same asset amount have the same asset amount promise;
  • the remittance transaction creation unit 1602 creates a remittance transaction based on the selected asset amount commitment in the remitter’s account and the designated amount corresponding to each selected asset amount commitment, the remittance transaction including the remittance amount commitment corresponding to the remittance amount , Each selected asset amount commitment and the corresponding designated amount, used to prove that the remittance amount is non-negative and not greater than the total amount of assets, the total amount of assets is the amount of assets corresponding to each selected asset amount commitment The weighted sum with the corresponding specified quantity;
  • the remittance transaction submission unit 1603 submits the remittance transaction to the blockchain, so that the statistical quantity corresponding to each selected asset amount commitment is subtracted from the corresponding designated quantity after the transaction is completed, and the income balance of the remitter’s account is in the transaction After completion, the change amount commitment is added, and the income balance of the beneficiary account corresponding to the payee on the blockchain ledger is added to the remittance amount commitment after the transaction is completed.
  • All the assets contained in the remitter’s account correspond to the asset amount of the same preset value; or,
  • the remitter account includes multiple asset groups, all assets of each asset group correspond to the same preset value of asset amounts, and the assets of different asset groups correspond to different preset values of asset amounts.
  • the remitter's account further includes the main balance recorded as the main balance commitment; the device further includes:
  • the first recharge transaction creation unit creates a recharge transaction, the recharge transaction includes at least one designated asset amount commitment and corresponding recharge quantity, and an interval proof for proving that the main balance is not less than the recharge amount, the recharge The amount is the weighted sum of the asset amount corresponding to the specified at least one valued asset amount commitment and the corresponding recharge amount;
  • the first recharge transaction submission unit submits the recharge transaction to the blockchain, so that the statistical quantity of the pledged amount of assets corresponding to the designated at least one valued asset in the remitter’s account increases by the corresponding recharge quantity after the transaction is completed ,
  • the main balance of the remitter’s account is reduced by the weighted sum of the designated at least one valued asset amount commitment and the corresponding recharge amount after the transaction is completed.
  • Optional also includes:
  • a merge transaction creation unit creates a merge transaction, the merge transaction includes at least one designated asset amount commitment and a corresponding merge quantity;
  • the combined transaction submission unit submits the combined transaction to the blockchain, so that the statistical amount of the committed amount of assets in the remitter’s account corresponding to the specified at least one value will be reduced by the corresponding combined amount and the total amount after the transaction is completed.
  • the main balance adds a consolidated amount commitment after the transaction is completed, and/or the income balance of the remitter account is cleared after the transaction is completed, and the main balance of the remitter account adds a corresponding income balance commitment after the transaction is completed;
  • the combined amount commitment is the weighted sum of the specified at least one valued asset amount commitment and the corresponding combined amount.
  • Optional also includes:
  • the main balance remittance transaction creation unit generates a main balance remittance transaction based on the main balance transaction amount between the remitter and the recipient, the main balance remittance transaction including the main balance transaction corresponding to the main balance transaction amount Amount commitment, an interval proof used to prove that the main balance transaction amount is non-negative and not greater than the main balance;
  • the main balance remittance transaction submission unit submits the main balance remittance transaction to the blockchain, so that the main balance deducts the main balance transaction amount commitment after the transaction is completed, and the income balance of the payee account is after the transaction is completed Increase the main balance transaction amount commitment.
  • Optional also includes:
  • the second recharge transaction creation unit creates a recharge transaction, where the recharge transaction includes at least one designated asset amount commitment and the corresponding recharge quantity, and an interval proof for proving that the income balance of the remitter’s account is not less than the recharge amount,
  • the recharge amount is the weighted sum of the amount of assets corresponding to the commitment of the designated value of the asset amount and the recharge quantity;
  • the second recharge transaction submission unit submits the recharge transaction to the blockchain, so that the statistical amount of the committed asset amount corresponding to the specified value in the remitter’s account increases by the corresponding recharge quantity, the The income balance of the remitter’s account is reduced by the weighted sum of the specified at least one valued asset amount commitment and the corresponding recharge amount after the transaction is completed.
  • Fig. 17 is a schematic structural diagram of a device according to an exemplary embodiment.
  • the device includes a processor 1702, an internal bus 1704, a network interface 1706, a memory 1708, and a non-volatile memory 1710.
  • the processor 1702 reads the corresponding computer program from the non-volatile memory 1710 to the memory 1708 and then runs it to form a device for implementing confidential transactions in the blockchain network on a logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., which means that the execution body of the following processing flow is not limited to each
  • the logic unit can also be a hardware or logic device.
  • the device for implementing confidential transactions in the blockchain network is applied to the blockchain node (the hardware structure of the blockchain node is shown in FIG. 17), which may include:
  • the remittance transaction receiving unit 1801 receives a remittance transaction, the remittance transaction includes a remittance amount commitment corresponding to the remittance amount between the remittance party and the remittance party, at least one asset amount commitment and a corresponding designated amount, used to prove the remittance amount
  • An interval proof that is non-negative and not greater than the total amount of assets, the total amount of assets is the weighted sum of the amount of assets corresponding to the at least one asset amount commitment and the corresponding designated amount; wherein, the remitter corresponds to the blockchain ledger
  • the remitter’s account includes the income balance recorded as the income balance commitment, the assets whose corresponding asset amount is recorded as the asset amount commitment, and the statistical quantity of each valued asset commitment, where assets with the same amount of assets have the same amount of assets commitment;
  • the remittance transaction execution unit 1802 executes the remittance transaction, so that the remittance transaction includes the statistical quantity corresponding to each asset amount commitment after the transaction is completed, minus the corresponding designated quantity, and the income balance of the remittance party’s account is completed when the transaction is completed After the change commitment is added, the income balance of the beneficiary account corresponding to the recipient on the blockchain ledger is added to the remittance commitment after the transaction is completed.
  • All the assets contained in the remitter’s account correspond to the asset amount of the same preset value; or,
  • the remitter account includes multiple asset groups, all assets of each asset group correspond to the same preset value of asset amounts, and the assets of different asset groups correspond to different preset values of asset amounts.
  • the remitter's account further includes the main balance recorded as the main balance commitment; the device further includes:
  • the first recharge transaction receiving unit receives a recharge transaction, the recharge transaction including at least one designated asset amount commitment and a corresponding recharge quantity, and an interval proof for proving that the main balance is not less than the recharge amount, the recharge The amount is the weighted sum of the asset amount corresponding to the specified at least one valued asset amount commitment and the corresponding recharge amount;
  • the first recharge transaction execution unit executes the recharge transaction so that the statistical quantity of the pledged amount of assets corresponding to the designated at least one valued asset in the remitter’s account increases by the corresponding recharge quantity and the remittance after the transaction is completed
  • the main balance of the party account is reduced by the weighted sum of the designated at least one valued asset amount commitment and the corresponding recharge amount after the transaction is completed.
  • Optional also includes:
  • a merger transaction receiving unit that receives a merger transaction, the merger transaction including at least one designated asset amount commitment and a corresponding merger quantity;
  • the combined transaction execution unit executes the combined transaction so that the statistical amount of the committed amount of assets in the remitter’s account corresponding to the specified at least one value is reduced by the corresponding combined amount after the transaction is completed, and the main balance is After the transaction is completed, the combined amount commitment is added, and/or the income balance of the remitter’s account is cleared after the transaction is completed, and the main balance of the remitter’s account is increased by the corresponding income balance commitment after the transaction is completed; wherein, the combined The amount commitment is the weighted sum of the specified at least one valued asset amount commitment and the corresponding combined amount.
  • Optional also includes:
  • the main balance remittance transaction receiving unit receives a main balance remittance transaction, the main balance remittance transaction includes a main balance transaction amount commitment corresponding to the main balance transaction amount between the remitter and the recipient, and is used to prove the Proof that the main balance transaction amount is non-negative and not greater than the main balance;
  • the main balance remittance transaction execution unit executes the main balance remittance transaction so that the main balance deducts the main balance transaction amount commitment after the transaction is completed, and the income balance of the payee account increases after the transaction is completed. Commitment of balance transaction amount.
  • Optional also includes:
  • the second recharge transaction receiving unit receives a recharge transaction, the recharge transaction including at least one designated asset amount commitment and a corresponding recharge quantity, and an interval proof for proving that the income balance of the remitter’s account is not less than the recharge amount,
  • the recharge amount is the weighted sum of the amount of assets corresponding to the commitment of the designated value of the asset amount and the recharge quantity;
  • the second recharge transaction execution unit executes the recharge transaction, so that the statistical quantity of the pledged asset amount corresponding to the specified value in the remitter’s account increases by the corresponding recharge quantity and the amount of the remitter’s account after the transaction is completed.
  • the income balance is reduced by the weighted sum of the specified at least one valued asset amount commitment and the corresponding recharge amount after the transaction is completed.
  • 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 computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
  • processors CPU
  • 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 disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may be used in one or more embodiments of this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as "when” or “when” or "in response to determination”.

Abstract

一种区块链网络中实现机密交易的方法及装置,该方法包括:确定汇款方与收款方之间的汇款额;根据汇款方账户中被选取的资产额承诺和每一被选取的资产额承诺对应的指定数量创建汇款交易,汇款交易包含汇款额对应的汇款额承诺、每一被选取的资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明;向区块链提交汇款交易,使得每一被选取的资产额承诺对应的统计数量在交易完成后减去相应的指定数量、汇款方账户的收入余额在交易完成后增加找零额承诺、收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加汇款额承诺。

Description

区块链网络中实现机密交易的方法及装置 技术领域
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种区块链网络中实现机密交易的方法及装置。
背景技术
区块链技术(也被称之为,分布式账本技术)是一种去中性化的分布式数据库技术,具有去中心化、公开透明、不可篡改、可信任等多种特点,适用于诸多对数据可靠性具有高需求的应用场景中。
发明内容
有鉴于此,本说明书一个或多个实施例提供一种区块链网络中实现机密交易的方法及装置。
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:
根据本说明书一个或多个实施例的第一方面,提出了一种区块链网络中实现机密交易的方法,应用于汇款方设备;所述方法包括:
确定汇款方与收款方之间的汇款额,所述汇款方在区块链账本上存在对应的汇款方账户,所述汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
根据所述汇款方账户中被选取的资产额承诺和每一被选取的资产额承诺对应的指定数量创建汇款交易,所述汇款交易包含所述汇款额对应的汇款额承诺、每一被选取的资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为每一被选取的资产额承诺对应的资产额与相应的指定数量的加权和;
向区块链提交所述汇款交易,使得每一被选取的资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
根据本说明书一个或多个实施例的第二方面,提出了一种区块链网络中实现机密交易的方法,应用于区块链节点;所述方法包括:
接收汇款交易,所述汇款交易包含汇款方与收款方之间的汇款额对应的汇款额承诺、至少一个资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为所述至少一个资产额承诺对应的资产额与相应的指定数量的加权和;其中,所述汇款方在区块链账本上对应的汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
执行所述汇款交易,使得所述汇款交易所含每一资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
根据本说明书一个或多个实施例的第三方面,提出了一种区块链网络中实现机密交易的装置,应用于汇款方设备;所述装置包括:
确定单元,确定汇款方与收款方之间的汇款额,所述汇款方在区块链账本上存在对应的汇款方账户,所述汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
创建单元,根据所述汇款方账户中被选取的资产额承诺和每一被选取的资产额承诺对应的指定数量创建汇款交易,所述汇款交易包含所述汇款额对应的汇款额承诺、每一被选取的资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为每一被选取的资产额承诺对应的资产额与相应的指定数量的加权和;
提交单元,向区块链提交所述汇款交易,使得每一被选取的资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
根据本说明书一个或多个实施例的第四方面,提出了一种区块链网络中实现机密交易的装置,应用于区块链节点;所述装置包括:
接收单元,接收汇款交易,所述汇款交易包含汇款方与收款方之间的汇款额对应的汇款额承诺、至少一个资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为所述至少一个资产额承诺对应的资产额与相应的指定数量的加权和;其中,所述汇款方在区块链账本上对应的汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
执行单元,执行所述汇款交易,使得所述汇款交易所含每一资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
根据本说明书一个或多个实施例的第五方面,提出了一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。
根据本说明书一个或多个实施例的第六方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。
根据本说明书一个或多个实施例的第七方面,提出了一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器通过运行所述可执行指令以实现如第二方面所述的方法。
根据本说明书一个或多个实施例的第八方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第二方面所述方法的步骤。
附图说明
图1是一示例性实施例提供的一种示例环境的示意图。
图2是一示例性实施例提供的一种概念架构的示意图。
图3是一示例性实施例提供的一种区块链网络中实现机密交易的方法的流程图。
图4是一示例性实施例提供的一种区块链账户结构的示意图。
图5是一示例性实施例提供的一种隐私保护的汇款交易的流程图。
图6是一示例性实施例提供的一种汇款前后的账户变化情况的示意图。
图7是一示例性实施例提供的另一种区块链账户结构的示意图。
图8是一示例性实施例提供的一种通过主余额进行资产充值的交互示意图。
图9是一示例性实施例提供的一种充值前后的账户变化情况的示意图。
图10是一示例性实施例提供的一种合并操作的交互示意图。
图11是一示例性实施例提供的一种合并前后的账户变化情况的示意图。
图12是一示例性实施例提供的一种主余额转账交易的流程图。
图13是一示例性实施例提供的一种主余额汇款前后的账户变化情况的示意图。
图14是一示例性实施例提供的另一种区块链网络中实现机密交易的方法的流程图。
图15是一示例性实施例提供的一种设备的结构示意图。
图16是一示例性实施例提供的一种区块链网络中实现机密交易的装置的框图。
图17是一示例性实施例提供的另一种设备的结构示意图。
图18是一示例性实施例提供的另一种区块链网络中实现机密交易的装置的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。
图1是一示例性实施例提供的一种示例环境的示意图。如图1所示,示例环境100允许实体参与区块链网络102。区块链网络102可以为公有类型、私有类型或联盟类型的区块链网络。示例环境100可以包括计算设备104、106、108、110、112和网络114;在一实施例中,网络114可以包括局域网(Local Area Network,LAN)、广域网(Wide Area Network,WAN)、因特网或其组合,并连接至网站、用户设备(例如计算设备)和后端系统。在一实施例中,可以通过有线和/或无线通信方式访问网络114。
在某些情况下,计算设备106、108可以是云计算系统的节点(未显示),或者每个计算设备106、108可以是单独的云计算系统,包括由网络互连并作为分布式处理系统工作的多台计算机。
在一实施例中,计算设备104~108可以运行任何适当的计算系统,使其能够作为区块链网络102中的节点;例如,计算设备104~108可以包括但不限于服务器、台式计算机、笔记本电脑、平板电脑计算设备和智能手机。在一实施例中,计算设备104~108可以归属于相关实体并用于实现相应的服务,例如该服务可以用于对某一实体或多个实体之间的交易进行管理。
在一实施例中,计算设备104~108分别存储有区块链网络102对应的区块链账本。计算设备104可以是(或包含)用于提供浏览器功能的网络服务器,该网络服务器可基于网络114提供与区块链网络102相关的可视化信息。在一些情况下,计算设备104可以不参与区块验证,而是监控区块链网络102以确定其他节点(譬如可以包括计算设备106-108)何时达成共识,并据此生成相应的区块链可视化用户界面。
在一实施例中,计算设备104可接收客户端设备(例如计算设备110或计算设备112)针对区块链可视化用户界面发起的请求。在一些情况下,区块链网络102的节点也可以作为客户端设备,比如计算设备108的用户可以使用运行在计算设备108上的浏览器向计算设备104发送上述请求。
响应于上述请求,计算设备104可以基于存储的区块链账本生成区块链可视化用户界面(如网页),并将生成的区块链可视化用户界面发送给请求的客户端设备。如果区块链网络102是私有类型或联盟类型的区块链网络,对区块链可视化用户界面的请求可以包括用户授权信息,在生成区块链可视化用户界面并发送给请求的客户端设备之前,可以由计算设备104对该用户授权信息进行验证,并在验证通过后返回相应的区块链可视化用户界面。
区块链可视化用户界面可以显示在客户端设备上(例如可显示在图1所示的用户界面116中)。当区块链账本发生更新时,用户界面116的显示内容也可以随之发生更新。此外,用户与用户界面116的交互可能导致对其他用户界面的请求,例如显示区块列表、区块详情、交易列表、交易详情、账户列表、账户详情、合约列表、合约详情或者用户对区块链网络实施搜索而产生的搜索结果页面等。
图2是一示例性实施例提供的一种概念架构的示意图。如图2所示,该概念架构200包括实体层202、托管服务层204和区块链网络层206。例如,实体层202可以包括三个实体:实体1、实体2和实体3,每个实体都有各自的交易管理系统208。
在一实施例中,托管服务层204可以包括每个事务管理系统208对应的接口210。例如,各个事务管理系统208使用协议(例如超文本传输协议安全(HTTPS)等)通过网络(例如图1中的网络114)与各自的接口210通信。在一些例子中,每个接口210可以提供各自对应的交易管理系统208与区块链网络层206之间的通信连接;更具体地,接口210可与区块链网络层206的区块链网络212通信。在一些例子中,接口210和区块链网络层206之间的通信可以使用远程过程调用(Remote Procedure Calls,RPCs)而实现。在一些例子中,接口210可以向交易管理系统208提供用于访问区块链网络212的API接口。
如本文所述,区块链网络212以对等网络的形式提供,该对等网络包括多个节点214,这些节点214分别用于对块链数据所形成的区块链账本216进行持久化;其中,图2中仅示出了一份区块链账本216,但区块链网络212中可以存在多份区块链账本216或其副本,比如每一节点214可以分别维护一份区块链账本216或其副本。
区块链一般被划分为三种类型:公有链(Public Blockchain),私有链(Private Blockchain)和联盟链(Consortium Blockchain)。此外,还有多种类型的结合,比如私有链+联盟链、联盟链+公有链等不同组合形式。其中去中心化程度最高的是公有链。公有链以比特币、以太坊为代表,加入公有链的参与者可以读取链上的数据记录、参与交易以及竞争新区块的记账权等。而且,各参与者(即节点)可自由加入以及退出网络,并进行相关操作。私有链则相反,该网络的写入权限由某个组织或者机构控制,数据读取权限受组织规定。简单来说,私有链可以为一个弱中心化系统,参与节点具有严格限制且少。这种类型的区块链更适合于特定机构内部使用。联盟链则是介于公有链以及私有链之间的区块链,可实现“部分去中心化”。联盟链中各个节点通常有与之相对应的实体机构或者组织;参与者通过授权加入网络并组成利益相关联盟,共同维护区块链运 行。
区块链网络中通常采用两种交易模型,即UTXO(Unspent Transaction Output,未花费的交易输出)模型和账户模型。UTXO模型的典型应用场景为比特币区块链,该模型下的链上资产以交易输出的形式存在,当一笔交易存在未花费的交易输出时,该未花费的交易输出归私钥持有者所有;在使用时,可以将一个或多个未花费的交易输出作为输入,并指定一个或多个输出,从而形成新的一笔或多笔未花费的交易输出。虽然UTXO模型被多种区块链网络所采用,但对智能合约的支持很弱,从而对应用场景造成了较大限制。而账户模型的典型应用场景为以太坊区块链,该模型下通过创建账户,将账户持有的链上资产表现为账户地址对应的余额,每笔转账交易可以将资产从一个账户地址转移至另一个账户地址,且交易的金额直接更新至账户地址对应的余额。相比于UTXO模型而言,账户模型能够支持完备的智能合约功能,具有较好的场景扩展性。
通过区块链网络所采用的分布式架构,以及区块所采用的链式结构,使得信息可以永久、无篡改地记录在各个区块链节点统一维护的区块链账本中。但是,由于区块链账本完全公开,导致信息隐私性无法得到保障。例如,任意用户可以在任意区块链节点上查询区块链账本,以获知某一用户持有的资产、某一交易的转账额等信息,而这些可能都是敏感的、需要隐藏的信息。因此,相关技术中提出了基于承诺的机密交易(Confidential Transaction)方案,可以将区块链账本中记录的账户余额、资产额、交易的汇款额等敏感数据均转换为相应的承诺数额,而避免在区块链账本中直接记载这些敏感数据的明文数额。例如,当采用Pedersen承诺机制时,假定原始数额为t,相应的承诺数额可以为PC(r,t)=r×G+t×H,其中G、H为椭圆曲线的生成元,r为随机数,并且r的取值仅由私人(如账户拥有者、资产持有者、交易参与者等)掌握,使得无关人员仅根据PC(r,t)的取值将无法反推出原始数额t。同时,承诺数额还具有同态特性,譬如PC(r1,t1)-PC(r2,t2)=PC(r1-r2,t1-t2),使得承诺数额之间可以直接参与交易过程中的计算。
具体的,在UTXO模型下,可以通过同态加密或同态承诺技术对交易金额进行保护,以及利用区间证明技术保证交易的输出非负等。而在账户模型下,可以通过同态加密或同态承诺技术对交易金额进行保护,以及利用区间证明技术保证交易额非负且账户余额足够支付。
在UTXO模型下,将一个或多个交易输出作为一笔转账交易的输入,并在转账完成后形成一个或多个新的交易输出。可见,一个交易输出只会在一笔转账交易中被花费, 无法被多笔转账交易所花费,使得针对一笔转账交易生成的区间证明仅与该转账交易输入相关,与其他转账交易的输入无关,因而UTXO模型天然地具有高的交易并发性。但是,UTXO模型会导致区块链网络中的资产数量远大于用户数量,可能对区块链存储造成极大的挑战;同时,如前所述,UTXO模型对智能合约的支持很弱,限制了UTXO模型能够使用的场景。
虽然账户模型可以解决UTXO模型对区块链存储造成的挑战,以及通过对智能合约的支持而扩展更多的应用场景,但是:在账户模型下,每笔交易的输入均为账户的余额,每笔交易的区间证明都与账户的余额相关,而账户的余额在每笔交易后都会发生更新,使得同一账户下的所有交易需要按顺序串行执行,即一笔交易结束并导致账户的余额发生更新后,才能够针对下一笔交易生成区间证明、触发实施下一笔交易,否则交易会因为区间证明不合法而被共识节点拒绝执行。因此,在账户模型下使用带有区间证明的隐私保护技术时,会严重地阻碍交易的吞吐量。
为了解决账户模型下的并发性问题,确保对智能合约功能的充分支持,本说明书针对相关技术中的账户模型提出了改进,以使其能够适应于高吞吐量的并发交易。下面结合实施例对本说明书的相关方案进行介绍。
图3是一示例性实施例提供的一种区块链网络中实现机密交易的方法的流程图。如图3所示,该方法应用于汇款方设备,可以包括以下步骤:
步骤302,确定汇款方与收款方之间的汇款额,所述汇款方在区块链账本上存在对应的汇款方账户,所述汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺。
汇款额可以由汇款方与收款方之间协商确定,也可以由汇款方自行确定。基于已确定的汇款额,可以从汇款方账户中选取恰当的资产,以用于支付该汇款额。
汇款方对应于汇款方账户、收款方对应于收款方账户,汇款方账户与收款方账户均记录于区块链账本中。区块链网络中的每一区块链节点分别维护有一份区块链账本,而基于共识机制可以确保所有区块链节点维护的区块链账本的内容一致,因而可以认为所有区块链节点共同维护了一份区块链账本。
如前所述,本说明书针对相关技术中的账户模型进行了改进。例如,图4是一示例性实施例提供的一种区块链账户结构的示意图。假定汇款方账户为如图4所示的账户A, 该账户A包括收入余额和资产信息。其中,收入余额的明文数额为Au,而出于保密的目的,在区块链账本上具体记录为相应的收入余额承诺PC(Au,r_Au),其中r_Au为随机数。
资产信息用于记录汇款方所持有的资产,该资产是基于汇款方所持有的余额而生成,区别于UTXO模型中的交易输出。比如,基于汇款方持有的明文数额为t_a_1的余额,可以结合随机数r_a_1生成相应的承诺数额PC(t_a_1,r_a_1),相当于汇款方持有一份资产额为t_a_1、资产额承诺为PC(t_a_1,r_a_1)的资产;类似地,可以基于汇款方持有的明文数额为t_a_2的余额和随机数r_a_2生成相应的承诺数额PC(t_a_2,r_a_2),相当于汇款方持有一份资产额为t_a_2、资产额承诺为PC(t_a_2,r_a_2)的资产;以此类推,可以生成其他的具有相同或不同资产额的资产。
对于具有相同资产额的不同资产而言,本说明书中可以限定同一取值的资产额必然选取相同的随机数,譬如上述资产额t_a_1必然对应于随机数r_a_1、资产额t_a_2必然对应于随机数r_a_2,使得同一取值的资产额必然对应于相同取值的资产额承诺,比如资产额t_a_1必然对应于资产额承诺PC(t_a_1,r_a_1)、资产额t_a_2必然对应于资产额承诺PC(t_a_2,r_a_2)。因此,汇款方账户所含的资产信息可以具体包含各个取值的资产额承诺和每一取值的资产额承诺的统计数量,比如图4所示的账户A中,资产额承诺PC(t_a_1,r_a_1)对应的统计数量为n1、资产额承诺PC(t_a_2,r_a_2)对应的统计数量为n2,即汇款方持有n1个取值为PC(t_a_1,r_a_1)的资产额承诺、n2个取值为PC(t_a_2,r_a_2)的资产额承诺。这样,相当于将汇款方账户所含的资产进行了组别划分,每一资产组的所有资产对应于同一预设取值的资产额(或资产额承诺),且不同资产组的资产对应于不同预设取值的资产额(或资产额承诺);当然,所有资产可以对应于同一预设取值的资产额(或资产额承诺),相当于仅存在一个资产组。
基于上述方式记录汇款方账户所含的资产,只需要记录各个资产组对应的资产额承诺和每一资产组对应的统计数量,譬如图4中的一个资产组对应的资产额承诺为PC(t_a_1,r_a_1)、统计数量为n1,另一个资产组对应的资产额承诺为PC(t_a_2,r_a_2)、统计数量为n2,而无需分别记录每一资产的详细信息,使得资产发生增减变化时仅需调整对应的统计数量的取值,可以极大地降低资产信息的维护成本,有助于缓解存储压力。
与汇款方账户相类似的,收款方账户同样包含收入余额和资产信息,收入余额被记录为收入余额承诺,资产信息包括资产额承诺的各个取值及其统计数量,其中相同资产额的资产具有相同的资产额承诺,此处不再赘述。
步骤304,根据所述汇款方账户中被选取的资产额承诺和每一被选取的资产额承诺对应的指定数量创建汇款交易,所述汇款交易包含所述汇款额对应的汇款额承诺、每一被选取的资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为每一被选取的资产额承诺对应的资产额与相应的指定数量的加权和。
根据汇款方与收款方之间的汇款额,可以选取汇款方账户所含的一个或多个资产额承诺,以及每一被选取的资产额承诺对应的指定数量。比如,当汇款额为t时,如果选取的资产额承诺分别为PC(t_a_1,r_a_1)和PC(t_a_2,r_a_2),且对应的指定数量分别为x1和x2,那么可以确定资产总额为(t_a_1*x1+t_a_2*x2),并且应当确保0≤t≤(t_a_1*x1+t_a_2*x2);具体的,可以生成用于证明汇款额非负且不大于资产总额的区间证明,从而在不暴露汇款额和资产总额的明文数值的情况下,即可基于该区间证明来验证是否满足0≤t≤(t_a_1*x1+t_a_2*x2)。
步骤306,向区块链提交所述汇款交易,使得每一被选取的资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
汇款交易被提交至区块链后,可由某一区块链节点将该汇款交易打包至区块中,该区块在经过共识后被添加至区块链中,使得该区块所含的上述汇款交易在所有区块链节点上被执行。当然,区块链节点可以针对汇款交易进行验证,比如验证汇款方、收款方的签名、验证上述的区间证明等,从而在通过验证后允许执行该汇款交易,否则可以解决执行。
汇款交易的输入来自汇款方账户中的资产,而输出包括两个部分:一部分的输出目标为收款方账户、输出额为汇款额(实际记录为汇款额承诺),另一部分的输出目标为收款方账户、输出额为找零额(实际记录为找零额承诺)。其中,找零额为上述的资产总额与汇款额之差;比如,当资产总额为(t_a_1*x1+t_a_2*x2)、汇款额为t时,可以确定找零额t’=t_a_1*x1+t_a_2*x2-t,找零额承诺为PC(t’,r’),r’为随机数。
可见,基于本说明书改进后的账户模型,收入余额专用于实现收款(作为汇款方时用于汇入找零额,作为收款方时用于汇入汇款额)、资产专用于实现汇款,可以实现同一账户的收款与汇款之间的解耦,因而可使一个用户作为汇款交易TX1的汇款方、作为汇款交易TX2的收款方而同时参与至汇款交易TX1和TX2中,实现了账户模型下的 交易并发,可以提升区块链网络中的交易执行效率。
同时,由于在生成上述汇款额与资产总额之间的区间证明时,资产总额的取值仅与被选取的资产额承诺及其指定数量相关,并不涉及区块链账本上记录的各个资产额承诺的统计数量,使得不同汇款交易可以分别生成相应的区间证明且互不影响。进一步的,由于在区块链账本上对各个取值的资产额承诺的统计数量采用明文形式进行记录,使得区块链节点可以对汇款交易中包含的指定数量与区块链账本上记录的统计数量进行直接比较:若指定数量不大于统计数量,则允许执行相应的汇款交易,否则不允许执行。因此,同一用户可以同时作为多个汇款交易的汇款方,以实现账户模型下的交易并发,可以提升区块链网络中的交易执行效率;以及,当在后生成的汇款交易优先到达区块链节点时,区块链节点可以优先处理该在后生成的汇款交易,而无需等待在先生成的汇款交易执行完成,避免了区块链节点处的交易阻塞。
下面以作为汇款方的用户A、作为收款方的用户B为例,对本说明书的汇款交易的实施过程进行描述。图5是一示例性实施例提供的一种隐私保护的汇款交易的流程图;如图5所示,汇款方、收款方和区块链节点之间的交互过程可以包括以下步骤:
步骤501,汇款方确定汇款额t。
在起草汇款交易时,汇款额t可由汇款方与收款方之间进行协商。当然,汇款方也可以自行确定汇款额t,由收款方在后续步骤中予以确认。其中,汇款方是指汇款交易中对款项、资产等资源进行汇出的角色,相应地收款方是指汇款交易中对款项、资产等资源进行接收的角色。例如,用户A向用户B进行汇款时,用户A为汇款方、用户B为收款方;同时,当用户B向用户A进行汇款时,用户B为汇款方、用户A为收款方。因此,汇款方、收款方的角色与用户之间并不存在绑定关系,需要根据实际的汇款关系来确定。
假定用户A作为汇款方、用户B作为收款方,由用户A向用户B进行汇款。图6是一示例性实施例提供的一种汇款前后的账户变化的示意图。如图6所示,假定用户A在区块链账本上存在相应的账户A、用户B在区块链账本上存在相应的账户B。如前所述,账户A可以包括收入余额和资产信息,其中收入余额被记录为PC(Au,r_Au)、资产信息被记录为[n1,PC(t_a_1,r_a_1)]和[n2,PC(t_a_2,r_a_2)]等,表明账户A中对应于资产额承诺PC(t_a_1,r_a_1)的资产的统计数量为n1、对应于资产额承诺PC(t_a_2,r_a_2)的资产的统计数量为n2等。类似地,账户B可以包括收入余额和资产信息,其中收入余额被记录为PC(Bu,r_Bu)、资产信息被记录为[m1,PC(t_b_1,r_b_1)]和[m2,PC(t_b_2, r_b_2)]等,表明账户B中对应于资产额承诺PC(t_b_1,r_b_1)的资产的统计数量为m1、对应于资产额承诺PC(t_b_2,r_b_2)的资产的统计数量为m2等。
步骤502,汇款方确定汇款额t对应的随机数r。
汇款方为汇款额t产生随机数r后,可以根据随机数r对汇款额t进行处理得到相应的汇款额承诺T=PC(t,r)。例如,当采用Pedersen承诺机制时,T=PC(t,r)=r*G+t*H。
步骤503,汇款方通过链下通道将(r,t,T)发送至收款方。
通过将(r,t,T)由链下通道而非区块链网络进行发送,可以避免汇款随机数r和汇款额t被记录至区块链账本中,确保汇款额t除汇款方和收款方之外不可知。
步骤504,收款方对收到的(r,t,T)进行验证。
收款方可以对汇款额t进行验证,以确定为希望收取的汇款数额。例如,当汇款额承诺T是基于Perdersen承诺机制而生成时,收款方可以对汇款额承诺T进行验证的过程,即收款方可以通过Perdersen承诺机制对随机数r和汇款额t进行计算,以验证汇款额承诺T=PC(t,r)是否正确,若正确则表明验证通过,否则验证不通过。
步骤505,收款方在验证通过后,生成签名并返回至汇款方。
在验证通过后,收款方可以利用收款方私钥对(A,B:T)进行签名,生成签名SigB并返回至汇款方。该签名SigB表明收款方同意由汇款方对应的账户A向收款方对应的账户B实施汇款额承诺为T的汇款交易。
步骤506,在收到签名SigB后,汇款方根据选取的资产额承诺和指定数量生成区间证明PR。
如前所述,诸如图6所示的账户A中包含若干资产额承诺及其对应的统计数量,比如资产额承诺PC(t_a_1,r_a_1)对应的统计数量为n1、资产额承诺PC(t_a_2,r_a_2)对应的统计数量为n2。与汇款额t相类似的,资产额承诺PC(t_a_1,r_a_1)是根据资产额t_a_1和随机数r_a_1进行计算得到、资产额承诺PC(t_a_2,r_a_2)是根据资产额t_a_2和随机数r_a_2进行计算得到。同时,本说明书中在计算资产额对应的资产额承诺时,限定为:当不同资产的资产额相同时,相应选取的随机数也相同,以确保这些资产额相同的多份资产可以对应产生相同的资产额承诺,因而使得同一账户内存在多份对应于同一资产额承诺的资产,并且不需要具体关注、记录和区分这些资产,只需要记录资产额承诺的取值和资产数量(即统计数量)即可。而花费这些资产时,只需要确定被花费的资产对应 的资产额承诺,并基于花费情况对相应的统计数量进行调整即可,下文将对此进行详述。
根据汇款额t的取值,可以选取恰当的资产组合,以满足汇款需求。假定汇款额t=215,t_a_1=20、t_a_2=100,那么可以选取1份资产额为t_a_1的资产、2份资产额为t_a_2的资产,组合得到t_a_1+t_a_2*2=220>t=215,可以满足汇款需求。因此,汇款方可以选取资产额承诺PC(t_a_1,r_a_1)和资产额承诺PC(t_a_2,r_a_2),并设置资产额承诺PC(t_a_1,r_a_1)对应的指定数量为x1=1、资产额承诺PC(t_a_2,r_a_2)对应的指定数量为x2=2。
而相应地,汇款方可以根据被选取的资产额承诺PC(t_a_1,r_a_1)和资产额承诺PC(t_a_2,r_a_2)、对应的指定数量x1和x2,以及汇款额t,生成区间证明PR,该区间证明PR用于证明:0≤t≤(t_a_1*x1+t_a_2*x2)。本说明书中可以采用相关技术中的Bulletproofs方案、Borromean环签名方案等生成上述的区间证明,本说明书并不对此进行限制;而区块链节点可以在密文状态下验证上述的“0≤t≤(t_a_1*x1+t_a_2*x2)”是否成立,既可以确保汇款交易符合条件,又可以避免暴露汇款额t、资产额t_a_1、资产额t_a_2等的明文取值。
同时,根据上述区间证明PR的生成过程,可以确定:区间证明PR与账户A中各个资产额承诺的统计数量无关,因而除了上述的汇款交易之外,账户A还可以同时参与其他汇款交易,并且均能够顺利生成区间证明而不会相互影响,从而实现并发交易。
步骤507,汇款方对交易内容{A,B:T,[PC(t_a_1,r_a_1),x1;PC(t_a_2,r_a_2),x2],PR;SigB}进行签名,生成签名SigA。
汇款方可以利用汇款方私钥对交易内容{A,B:T,[PC(t_a_1,r_a_1),x1;PC(t_a_2,r_a_2),x2],PR;SigB}进行签名,生成签名SigA。
步骤508,汇款方向区块链提交交易。
汇款方可以将汇款交易提交至区块链网络中的某一区块链节点,该汇款交易还可以进而被传输至区块链网络中的所有区块链节点,并由各个区块链节点分别对该汇款交易进行验证,以在验证通过时执行汇款操作、在验证未通过时拒绝汇款。
步骤509,区块链节点检查交易是否执行过。
此处的区块链节点可以表示区块链网络中的任意一个区块链节点,即区块链网络中的每一区块链节点均会收到上述汇款交易,并通过步骤509~512等实施验证等操作。
区块链节点在收到上述汇款交易后,可以利用相关技术中的防双花或防重放机制,验证该汇款交易是否已经执行过;如果已经执行过,可以拒绝执行该汇款交易,否则转入步骤510。
步骤510,区块链节点检查签名。
在一实施例中,区块链节点可以检查该汇款交易中包含的签名SigA、SigB是否正确;如果不正确,可以拒绝执行该汇款交易,否则转入步骤511。
步骤511,区块链节点检查区间证明PR。
在一实施例中,区块链节点可以基于区间证明技术对该汇款交易包含的区间证明PR进行检查,以确定是否满足0≤t≤(t_a_1*x1+t_a_2*x2)。如果不满足,可以拒绝执行该汇款交易,否则转入步骤512。
步骤512,区块链节点检查统计数量是否不小于指定数量。
由于账户A中各个资产额承诺对应的统计数量以明文形式记录于区块链账本上,且指定数量也以明文形式记录于汇款交易中,使得区块链节点可以直接将统计数量与指定数量进行比较,以确定账户A是否足够支付。以图6所示,由于资产额承诺PC(t_a_1,r_a_1)的统计数量为n1、资产额承诺PC(t_a_2,r_a_2)的统计数量为n2,而汇款交易中资产额承诺PC(t_a_1,r_a_1)对应的指定数量为x1、资产额承诺PC(t_a_2,r_a_2)对应的指定数量为x2,因而只要确定n1≥x1、n2≥x2,即表明账户A足够支付,可以完成汇款交易。
同时,由于采用明文比较,因而不需要在汇款交易中添加账户A足够支付的区间证明,这样既可以省去区间证明的生成过程、提升交易的生成效率,又可以省去区间证明的验证过程、提升交易的执行效率。
步骤513,区块链节点在维护的区块链账本中更新用户A、用户B分别对应的账户。
在通过步骤509~512的验证后,区块链节点可以分别对区块链账本中记载的账户A、账户B进行更新,如图6所示:
在账户A中,交易前的收入余额为Au、在区块链账本中被记录为相应的收入余额承诺PC(Au,r_Au),交易前资产额承诺PC(t_a_1,r_a_1)对应的统计数量为n1、资产额承诺PC(t_a_2,r_a_2)对应的统计数量为n2。在交易完成后,资产额承诺PC(t_a_1, r_a_1)对应的统计数量减小x1、更新为n1-x1,而资产额承诺PC(t_a_2,r_a_2)对应的统计数量减小x2、更新为n2-x2;同时,收入余额增加了找零额t’、对应于找零额承诺PC(t’,r’),因而在区块链账本中记录的收入余额承诺更新为PC(Au,r_Au)+PC(t’,r’)。需要指出的是:虽然上文中并未具体描述,但找零额承诺PC(t’,r’)也被包含于上述的汇款交易中,使得区块链节点在执行该汇款交易时,可以根据找零额承诺PC(t’,r’)对账户A的收入余额进行更新。
在账户B中,交易前的收入余额为Bu、在区块链账本中被记录为相应的收入余额承诺PC(Bu,r_Bu),交易前资产额承诺PC(t_b_1,r_b_1)对应的统计数量为m1、资产额承诺PC(t_b_2,r_b_2)对应的统计数量为m2。在交易完成后,统计数量m1和m2不变,而收入余额Bu则增加了汇款额t,因而在区块链账本中被记录为相应的收入余额承诺PC(Bu,r_Bu)+PC(t,r)。
如上文所述,当账户包含上述的收入余额和资产信息时,可以在保障交易隐私的情况下,实现账户的输入与输出解耦,实现账户模型下的高并发转账。但是,由于汇入账户的资金都记入收入余额、而汇出的资金都从资产信息中扣除(减小统计数量的取值),因而统计数量的取值(即账户内的资产)在不断下降,可能小于汇款交易中的指定数量而影响到汇款交易的执行。为了确保统计数量的数额总是能够处于充足状态、足够完成交易,可以定期或随时通过充值调整统计数量的数额。
以汇款方账户的充值过程为例。可以创建充值交易,该充值交易包含至少一个指定取值的资产额承诺和相应的充值数量、用于证明汇款方账户的收入余额不小于充值额的区间证明,该充值额为指定取值的资产额承诺对应的资产额与充值数量的加权和(如果仅涉及到一个指定取值的资产额承诺,则充值额为该资产额承诺对应的资产额与充值数量的乘积);向区块链提交充值交易,使得汇款方账户中对应于上述指定取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、汇款方账户的收入余额在交易完成后减少上述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。换言之,可以将汇款方账户中的收入余额划分出至少一部分,将这部分余额转换为相应的资产,这些资产可使对应的资产额承诺的统计数量实现取值增大。当然,收款方账户也可以采用上述方式进行充值。
虽然可以按照上述方式实现基于收入余额的资产充值操作,但是当账户参与的汇款交易较为频繁、汇款额较大时,可能导致频繁充值,造成收入余额频繁参与资金的汇入与汇出(充值),甚至使得汇入交易(其他账户向该账户进行汇款的交易)与充值 交易之间相应影响,反而造成效率下降。
因此,本说明书针对图4所示的账户结构提出了进一步改进。例如,图7是一示例性实施例提供的另一种区块链账户结构的示意图。仍以账户A为例,在图4所示账户结构的基础上,除了包含收入余额和资产信息之外,图7所示的账户A可以进一步包含主余额,即账户A总共包含三部分:主余额、收入余额和资产信息。其中,收入余额专用于收取汇入交易的交易额、资产信息专用于参与汇出交易,而主余额用于对资产信息进行充值,从而避免由收入余额承担充值任务,防止产生上文所述的影响。
以汇款方为例。汇款方可以创建充值交易,该充值交易包含指定的至少一个取值的资产额承诺和相应的充值数量、用于证明主余额不小于充值额的区间证明,充值额为上述指定的至少一个取值的资产额承诺对应的资产额与相应的充值数量的加权和;向区块链提交充值交易,使得汇款方账户中对应于上述指定的至少一个取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、汇款方账户的主余额在交易完成后减少上述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。例如,图8是一示例性实施例提供的一种通过主余额进行资产充值的交互示意图。如图8所示,该交互过程可以包括以下步骤:
步骤801,汇款方确定指定取值的资产额和充值数量。
汇款方可以设置指定取值的资产额和充值数量,比如取值为100的资产额对应的充值数量为3、取值为20的资产额对应的充值数量为5,那么可以确定本次总共的充值额h=100*3+20*5=400。
汇款方可以确定账户中已存在的资产额承诺对应的资产额,并将其中的一个或多个资产额作为上述的指定取值的资产额,使得这些已存在的资产额承诺对应的统计数量在完成充值后可以相应增加。或者,汇款方可以设置与已有资产额承诺所对应的资产额不同的其他资产额,比如当账户中已存在取值为100的资产对应的资产额承诺、取值为20的资产对应的资产额承诺时,可以设定上述的指定取值为50,从而充值得到取值为50的资产对应的资产额承诺,而账户所含的资产信息中可以新增该取值为50的资产对应的资产额承诺的统计数量。
虽然汇款方可以手动发起充值交易,但是在一实施例中可以实现自动化的充值操作。例如,可以为账户中各个取值的资产额承诺的统计数量设定水位值,当某一取值的资产额承诺对应的统计数量低于相应的水位值时,可以自动发起充值交易,对该取值 的资产额承诺进行充值,以使得相应的统计数量上升至不低于水位值。
步骤802,汇款方生成区间证明PR。
在一实施例中,由于主余额的取值Az在区块链账本中记录为相应的承诺数额PC(Az,r_Az),其中r_Az为随机数,因而需要通过生成区间证明PR,以用于验证主余额的取值Az≥充值额h≥0。
步骤803,汇款方对交易签名后,提交至区块链。
基于上述步骤,汇款方生成的充值交易的交易内容可以为Topup{A:[PC(t_a_1,r_a_1),y1;PC(t_a_2,r_a_2),y2],PR},“A”代表该账户A的账户地址,[PC(t_a_1,r_a_1),y1;PC(t_a_2,r_a_2),y2]表明充值目标为账户A所含的资产额承诺PC(t_a_1,r_a_1)的充值数量为y1、资产额承诺PC(t_a_2,r_a_2)的充值数量为y2。
同时,交易中可以增加一类型字段,而汇款方在创建每一交易时,可以通过对类型字段进行赋值,以标注所提交的交易的类型,从而对本说明书中所涉及的汇款交易、充值交易以及下文所述的合并交易、主余额汇款交易等进行区分。例如,可以通过取值“Transfer”来标注汇款交易,并可以通过取值“Topup”来标注充值交易。
汇款方采用持有的汇款方私钥对上述的交易内容Topup{A:[PC(t_a_1,r_a_1),y1;PC(t_a_2,r_a_2),y2],PR}进行签名,并将签名后创建的充值交易提交至区块链网络,以由所有区块链节点进行验证和执行。
步骤804,区块链节点验证交易。
区块链节点可以验证上述充值交易的签名是否正确;如果不正确,可以拒绝执行该交易。
区块链节点可以验证上述充值交易所含的区间证明PR,以确定是否满足0≤(t_a_1*y1+t_a_2*y2)≤Az;如果不正确,可以拒绝执行该交易。
当所有验证均通过后,可以转入步骤805。
步骤805,区块链节点更新账户。
在通过步骤804的验证后,区块链节点可以对区块链账本中记载的账户A进行更新。例如,图9是一示例性实施例提供的一种充值前后的账户变化情况的示意图。如图9所示:
交易前的主余额为Az、在区块链账本中被记录为相应的承诺数额PC(Az,r_Az), 交易前的收入余额为Au、在区块链账本中被记录为相应的承诺数额PC(Au,r_Au),交易前的资产额承诺PC(t_a_1,r_a_1)对应于统计数量n1、资产额承诺PC(t_a_2,r_a_2)对应于统计数量n2。
在交易完成后,主余额被扣除了(t_a_1*y1+t_a_2*y2),即前述各个取值的资产额与充值数量的加权和,因而在区块链账本中被记录为PC(Az,r_Az)-PC(t_a_1,r_a_1)*y1-PC(t_a_2,r_a_2)*y2,而资产信息中的统计数量n1增加了充值数量y1、统计数量n2增加了充值数量y2,因而在区块链账本中以明文形式记录为[n1+y1,PC(t_a_1,r_a_1)]和[n2+y2,PC(t_a_2,r_a_2)];同时,收入余额的取值不变。
随着账户中的资产信息不断参与汇出交易,而主余额不断向资产信息进行充值,会导致主余额逐步减少;当主余额减少至一定程度或减少至0时,将无法继续充值,因而可以将收入余额中获得的资金转入主余额中,以便于维持账户不断地参与汇出交易。
以汇款方为例。汇款方可以创建合并交易,该合并交易包含指定的至少一个取值的资产额承诺和相应的合并数量;然后,向区块链提交该合并交易,使得汇款方账户中对应于上述指定的至少一个取值的资产额承诺的统计数量在交易完成后减少相应的合并数量、主余额在交易完成后增加合并额承诺,和/或汇款方账户的收入余额在交易完成后清零、汇款方账户的主余额在交易完成后增加相应的收入余额承诺;其中,合并额承诺为上述指定的至少一个取值的资产额承诺与相应的合并数量的加权和。换言之,合并交易可以将收入余额所含的资金全部并入主余额,或者在一些情况下可以将至少一部分资产以资金形式并入主余额,或者还可以同时将收入余额所含的资金并入主余额、将至少一部分资产以资金形式并入主余额。例如,图10是一示例性实施例提供的一种合并操作的交互示意图。如图10所示,该交互过程可以同时将收入余额中的全部资金和指定数额的资产并入主余额,具体包括以下步骤:
步骤1001,汇款方确定资产额承诺和合并数量。
通过选取一种或多种取值的资产额承诺以及每种资产额承诺对应的合并数量,可以确定汇款方希望合并至主余额的资产额。例如,当被选取的资产额承诺分别为PC(t_a_1,r_a_1)和PC(t_a_2,r_a_2)时,如果资产额承诺PC(t_a_1,r_a_1)对应的合并数量为z1、资产额承诺PC(t_a_2,r_a_2)对应的合并数量为z2,那么可以确定相应的合并额为k=t_a_1*z1+t_a_2*z2。
步骤1002,汇款方对交易签名后,提交至区块链。
基于上述步骤,汇款方生成的合并交易的交易内容可以为Merge{A:[PC(t_a_1,r_a_1),z1;PC(t_a_2,r_a_2),z2]},“A”代表该账户A的账户地址,表明需要对该账户A实施合并操作,[PC(t_a_1,r_a_1),z1;PC(t_a_2,r_a_2),z2]表明需要将z1数量且相应承诺为PC(t_a_1,r_a_1)的资产、z2数量且相应承诺为PC(t_a_2,r_a_2)的资产合并至主余额。而Merge表明当前的交易类型为合并交易,以用于针对账户A实施合并操作。
由于收入余额的全部资金都将转入主余额,因而不需要针对收入余额的资金转移生成区间证明;同时,由于资产信息中采用明文形式记录各个统计数量,合并交易中同样以明文形式记录合并数量,因而区块链节点可以直接将统计数量与合并数量进行比较,从而在统计数量不小于合并数量时促成交易完成、否则不允许交易执行,同样不需要生成区间证明。
汇款方采用持有的汇款方私钥对上述的交易内容Merge{A:[PC(t_a_1,r_a_1),z1;PC(t_a_2,r_a_2),z2]}进行签名,并将签名后创建的充值交易提交至区块链网络,以由所有区块链节点进行验证和执行。
步骤1003,区块链节点验证交易。
区块链节点可以验证上述合并交易的签名是否正确;如果不正确,可以拒绝执行该交易。
区块链节点可以验证上述合并交易中对应于各个资产额承诺的合并数量是否不大于相应的统计数量。比如,以资产额承诺PC(t_a_1,r_a_1)为例,假定合并交易中记录的合并数量为z1=2,而区块链账本上记录的统计数量为n1=5,那么由于z1<n1,允许执行该合并交易;而如果合并数量为z1=4、统计数量为n1=3,那么由于z1>n1,不允许执行该合并交易。
当所有验证均通过后,可以转入步骤1004。
步骤1004,区块链节点更新账户。
在通过步骤1003的验证后,区块链节点可以对区块链账本中记载的账户A进行更新。例如,图11是一示例性实施例提供的一种合并前后的账户变化情况的示意图。如图11所示:
交易前的主余额为Az、在区块链账本中被记录为相应的承诺数额PC(Az,r_Az),交易前的收入余额为Au、在区块链账本中被记录为相应的承诺数额PC(Au,r_Au),交易前的资产额承诺PC(t_a_1,r_a_1)对应于统计数量n1、资产额承诺PC(t_a_2,r_a_2)对 应于统计数量n2。
在交易完成后,收入余额变为0;资产额承诺PC(t_a_1,r_a_1)对应的统计数量n1减少了合并数量z1、更新为n1-z1,而资产额承诺PC(t_a_2,r_a_2)对应的统计数量n2减少了合并数量z2、更新为n2-z2;主余额增加了收入余额的全部资金、z1数量的资产额承诺PC(t_a_1,r_a_1)、z2数量的资产额承诺PC(t_a_2,r_a_2),因而在区块链账本中记录的主余额承诺更新为PC(Az,r_Az)+PC(Au,r_Au)+PC(t_a_1,r_a_1)*z1+PC(t_a_2,r_a_2)*z2。
虽然在本说明书提供的实施例中,针对账户所含的主余额、收入余额、资产信息,可以通过由资产信息参与汇出交易、收入余额参与汇入交易(收入余额也在汇出交易中收取找零额)、主余额参与上述的充值交易和合并交易,但是并不意味着每一余额仅能够参与上述类型的交易。例如,本说明书的账户结构,还可以兼容:由主余额参与汇出资金的主余额转账交易等,下文分别予以介绍。
对于主余额转账交易而言,可以根据汇款方与收款方之间的主余额交易额,生成主余额汇款交易,该主余额汇款交易包含主余额交易额对应的主余额交易额承诺、用于证明主余额交易额非负且不大于主余额的区间证明;然后,汇款方可以向区块链提交主余额汇款交易,使得主余额在交易完成后扣除主余额交易额承诺、收款方账户的收入余额在交易完成后增加主余额交易额承诺。图12是一示例性实施例提供的一种主余额转账交易的流程图。如图12所示,汇款方、收款方和区块链节点之间的交互过程可以包括以下步骤:
步骤1201,汇款方确定汇款额t_z。
在起草汇款交易时,汇款额t_z可由汇款方与收款方之间进行协商。当然,汇款方也可以自行确定汇款额t_z,由收款方在后续步骤中予以确认。
步骤1202,汇款方确定汇款额t_z对应的随机数r_z。
汇款方可以为该汇款额t_z产生随机数r_z,则譬如基于Pedersen承诺机制可以计算出汇款额t_z对应的汇款承诺T=PC(t_z,r_z)。
步骤1203,汇款方通过链下通道将(r_z,t_z,T)发送至收款方。
通过将(r_z,t_z,T)由链下通道而非区块链网络进行发送,可以避免汇款随机数r_z和汇款额t_z被记录至区块链账本中,确保汇款额t_z除汇款方和收款方之外不可知。
步骤1204,收款方对收到的(r_z,t_z,T)进行验证。
收款方可以对汇款额t_z进行验证,以确定为希望收取的汇款数额。以及,收款方可以对汇款承诺T进行验证,即收款方可以通过Perdersen承诺机制对随机数r_z和汇款额t_z进行计算,以验证汇款承诺T=PC(t_z,r_z)是否正确,若正确则表明验证通过,否则验证不通过。
步骤1205,收款方在验证通过后,生成签名并返回至汇款方。
在一实施例中,在验证通过后,收款方可以利用收款方私钥对(A,B:T)进行签名,生成签名SigB并返回至汇款方。该签名SigB表明收款方同意由汇款方对应的账户A向收款方对应的账户B实施承诺为T的汇款交易。
步骤1206,在收到签名SigB后,汇款方根据主余额Az生成区间证明RP。
在一实施例中,为了确保汇款交易顺利完成,区块链节点需要确定汇款额t_z、主余额Az满足下述条件:0≤t_z≤Az,因而汇款方可以利用区间证明技术生成区间证明RP,以供后续过程中由区块链节点进行验证,使得区块链节点在密文状态下即可验证交易是否符合上述条件。
步骤1207,汇款方对交易内容PrimaryTransfer(A,B:T,RP;SigB)进行签名,生成签名SigA。
汇款方可以利用汇款方私钥对交易内容PrimaryTransfer(A,B:T,RP;SigB)进行签名,生成签名SigA。其中,PrimaryTransfer用于表明交易类型为主余额转账交易,使得汇款额t_z从账户A的主余额中扣除。
步骤1208,汇款方向区块链提交交易。
汇款方将汇款交易提交至区块链网络中的某一区块链节点,并进而被传输至区块链网络中的所有区块链节点,并由各个区块链节点分别对该汇款交易进行验证,以在验证通过时执行汇款操作、在验证未通过时拒绝汇款。
步骤1209,区块链节点检查交易是否执行过。
此处的区块链节点可以表示区块链网络中的任意一个区块链节点,即区块链网络中的每一区块链节点均会收到上述汇款交易,并通过步骤1209~1211等实施验证等操作。
区块链节点在收到上述汇款交易后,可以利用相关技术中的防双花或防重放机 制,验证该汇款交易是否已经执行过;如果已经执行过,可以拒绝执行该汇款交易,否则转入步骤1210。
步骤1210,区块链节点检查签名。
区块链节点可以检查该汇款交易中包含的签名SigA、SigB是否正确;如果不正确,可以拒绝执行该汇款交易,否则转入步骤1211。
步骤1211,区块链节点检查区间证明RP。
区块链节点可以基于区间证明技术对该汇款交易包含的区间证明RP进行检查,以确定是否满足0≤t_z≤Az。如果不满足,可以拒绝执行该汇款交易,否则转入步骤1212。
步骤1212,区块链节点在维护的区块链账本中更新汇款方、收款方分别对应的账户A、账户B。
在一实施例中,在通过步骤1209~1211的验证后,区块链节点可以分别对区块链账本中记载的区块链账户1、区块链账户2进行更新。图13是一示例性实施例提供的一种主余额汇款前后的账户变化情况的示意图。如图13所示:
在账户A中,交易前的主余额为Az、在区块链账本中被记录为相应的承诺数额PC(Az,r_Az),交易前的收入余额为Au、在区块链账本中被记录为相应的承诺数额PC(Au,r_Au),交易前的资产额承诺PC(t_a_1,r_a_1)对应于统计数量n1、资产额承诺PC(t_a_2,r_a_2)对应于统计数量n2。在交易完成后,主余额被扣除了上述的交易额t_z,因而在区块链账本中被记录为相应的承诺数额PC(Az,r_Az)-PC(t_z,r_z),而收入余额Au、统计数量n1-n2不变。
在账户B中,交易前的主余额为Bz、在区块链账本中被记录为相应的承诺数额PC(Bz,r_Bz),交易前的收入余额为Bu、在区块链账本中被记录为相应的承诺数额PC(Bu,r_Bu),交易前的资产额承诺PC(t_b_1,r_b_1)对应于统计数量m1、资产额承诺PC(t_b_2,r_b_2)对应于统计数量m2。在交易完成后,主余额为Bz、统计数量n1-n2不变,而收入余额则增加了汇款额t_z,因而在区块链账本中被记录为相应的承诺数额PC(Bu,r_Bu)+PC(t_z,r_z)。
图14是一示例性实施例提供的另一种区块链网络中实现机密交易的方法的流程图。如图14所示,该方法应用于区块链节点,可以包括以下步骤:
步骤1402,接收汇款交易,所述汇款交易包含汇款方与收款方之间的汇款额对应的汇款额承诺、至少一个资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为所述至少一个资产额承诺对应的资产额与相应的指定数量的加权和;其中,所述汇款方在区块链账本上对应的汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺。
汇款额可以由汇款方与收款方之间协商确定,也可以由汇款方自行确定。基于已确定的汇款额,可以从汇款方账户中选取恰当的资产,以用于支付该汇款额。
汇款方对应于汇款方账户、收款方对应于收款方账户,汇款方账户与收款方账户均记录于区块链账本中。区块链网络中的每一区块链节点分别维护有一份区块链账本,而基于共识机制可以确保所有区块链节点维护的区块链账本的内容一致,因而可以认为所有区块链节点共同维护了一份区块链账本。
如前所述,本说明书针对相关技术中的账户模型进行了改进。譬如图4所示,账户A包括收入余额和资产信息。其中,收入余额的明文数额为Au,而出于保密的目的,在区块链账本上具体记录为相应的收入余额承诺PC(Au,r_Au),其中r_Au为随机数。资产信息用于记录汇款方所持有的资产,该资产是基于汇款方所持有的余额而生成,区别于UTXO模型中的交易输出。比如,基于汇款方持有的明文数额为t_a_1的余额,可以结合随机数r_a_1生成相应的承诺数额PC(t_a_1,r_a_1),相当于汇款方持有一份资产额为t_a_1、资产额承诺为PC(t_a_1,r_a_1)的资产;类似地,可以基于汇款方持有的明文数额为t_a_2的余额和随机数r_a_2生成相应的承诺数额PC(t_a_2,r_a_2),相当于汇款方持有一份资产额为t_a_2、资产额承诺为PC(t_a_2,r_a_2)的资产;以此类推,可以生成其他的具有相同或不同资产额的资产。
对于具有相同资产额的不同资产而言,本说明书中可以限定同一取值的资产额必然选取相同的随机数,譬如上述资产额t_a_1必然对应于随机数r_a_1、资产额t_a_2必然对应于随机数r_a_2,使得同一取值的资产额必然对应于相同取值的资产额承诺,比如资产额t_a_1必然对应于资产额承诺PC(t_a_1,r_a_1)、资产额t_a_2必然对应于资产额承诺PC(t_a_2,r_a_2)。因此,汇款方账户所含的资产信息可以具体包含各个取值的资产额承诺和每一取值的资产额承诺的统计数量,比如图4所示的账户A中,资产额承诺PC(t_a_1,r_a_1)对应的统计数量为n1、资产额承诺PC(t_a_2,r_a_2)对应的统计数量为n2,即汇款方持有n1个取值为PC(t_a_1,r_a_1)的资产额承诺、n2个取值为PC(t_a_2, r_a_2)的资产额承诺。这样,相当于将汇款方账户所含的资产进行了组别划分,每一资产组的所有资产对应于同一预设取值的资产额(或资产额承诺),且不同资产组的资产对应于不同预设取值的资产额(或资产额承诺);当然,所有资产可以对应于同一预设取值的资产额(或资产额承诺),相当于仅存在一个资产组。
基于上述方式记录汇款方账户所含的资产,只需要记录各个资产组对应的资产额承诺和每一资产组对应的统计数量,譬如图4中的一个资产组对应的资产额承诺为PC(t_a_1,r_a_1)、统计数量为n1,另一个资产组对应的资产额承诺为PC(t_a_2,r_a_2)、统计数量为n2,而无需分别记录每一资产的详细信息,使得资产发生增减变化时仅需调整对应的统计数量的取值,可以极大地降低资产信息的维护成本,有助于缓解存储压力。
与汇款方账户相类似的,收款方账户同样包含收入余额和资产信息,收入余额被记录为收入余额承诺,资产信息包括资产额承诺的各个取值及其统计数量,其中相同资产额的资产具有相同的资产额承诺,此处不再赘述。
如前所述,汇款交易添加了汇款方账户中被选取的一个或多个资产额承诺,以及每一被选取的资产额承诺对应的指定数量。比如,当汇款额为t时,如果选取的资产额承诺分别为PC(t_a_1,r_a_1)和PC(t_a_2,r_a_2),且对应的指定数量分别为x1和x2,那么可以确定资产总额为(t_a_1*x1+t_a_2*x2),并且应当确保0≤t≤(t_a_1*x1+t_a_2*x2);具体的,可以生成用于证明汇款额非负且不大于资产总额的区间证明,从而在不暴露汇款额和资产总额的明文数值的情况下,即可基于该区间证明来验证是否满足0≤t≤(t_a_1*x1+t_a_2*x2)。
步骤1404,执行所述汇款交易,使得所述汇款交易所含每一资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
汇款交易被提交至区块链后,可由某一区块链节点将该汇款交易打包至区块中,该区块在经过共识后被添加至区块链中,使得该区块所含的上述汇款交易在所有区块链节点上被执行。当然,区块链节点可以针对汇款交易进行验证,比如验证汇款方、收款方的签名、验证上述的区间证明等,从而在通过验证后允许执行该汇款交易,否则可以解决执行。
汇款交易的输入来自汇款方账户中的资产,而输出包括两个部分:一部分的输 出目标为收款方账户、输出额为汇款额(实际记录为汇款额承诺),另一部分的输出目标为收款方账户、输出额为找零额(实际记录为找零额承诺)。其中,找零额为上述的资产总额与汇款额之差;比如,当资产总额为(t_a_1*x1+t_a_2*x2)、汇款额为t时,可以确定找零额t’=t_a_1*x1+t_a_2*x2-t,找零额承诺为PC(t’,r’),r’为随机数。
可见,基于本说明书改进后的账户模型,收入余额专用于实现收款(作为汇款方时用于汇入找零额,作为收款方时用于汇入汇款额)、资产专用于实现汇款,可以实现同一账户的收款与汇款之间的解耦,因而可使一个用户作为汇款交易TX1的汇款方、作为汇款交易TX2的收款方而同时参与至汇款交易TX1和TX2中,实现了账户模型下的交易并发,可以提升区块链网络中的交易执行效率。
同时,由于在生成上述汇款额与资产总额之间的区间证明时,资产总额的取值仅与被选取的资产额承诺及其指定数量相关,并不涉及区块链账本上记录的各个资产额承诺的统计数量,使得不同汇款交易可以分别生成相应的区间证明且互不影响。进一步的,由于在区块链账本上对各个取值的资产额承诺的统计数量采用明文形式进行记录,使得区块链节点可以对汇款交易中包含的指定数量与区块链账本上记录的统计数量进行直接比较:若指定数量不大于统计数量,则允许执行相应的汇款交易,否则不允许执行。因此,同一用户可以同时作为多个汇款交易的汇款方,以实现账户模型下的交易并发,可以提升区块链网络中的交易执行效率;以及,当在后生成的汇款交易优先到达区块链节点时,区块链节点可以优先处理该在后生成的汇款交易,而无需等待在先生成的汇款交易执行完成,避免了区块链节点处的交易阻塞。
如上文所述,当账户包含上述的收入余额和资产信息时,可以在保障交易隐私的情况下,实现账户的输入与输出解耦,实现账户模型下的高并发转账。但是,由于汇入账户的资金都记入收入余额、而汇出的资金都从资产信息中扣除(减小统计数量的取值),因而统计数量的取值(即账户内的资产)在不断下降,可能小于汇款交易中的指定数量而影响到汇款交易的执行。为了确保统计数量的数额总是能够处于充足状态、足够完成交易,可以定期或随时通过充值调整统计数量的数额。
以汇款方账户的充值过程为例。区块链节点可以接收充值交易,该充值交易包含至少一个指定取值的资产额承诺和相应的充值数量、用于证明汇款方账户的收入余额不小于充值额的区间证明,充值额为上述指定取值的资产额承诺对应的资产额与充值数量的加权和;区块链节点执行充值交易,使得汇款方账户中对应于上述指定取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、汇款方账户的收入余额在交易完 成后减少上述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。换言之,可以将汇款方账户中的收入余额划分出至少一部分,将这部分余额转换为相应的资产,这些资产可使对应的资产额承诺的统计数量实现取值增大。当然,收款方账户也可以采用上述方式进行充值。
虽然可以按照上述方式实现基于收入余额的资产充值操作,但是当账户参与的汇款交易较为频繁、汇款额较大时,可能导致频繁充值,造成收入余额频繁参与资金的汇入与汇出(充值),甚至使得汇入交易(其他账户向该账户进行汇款的交易)与充值交易之间相应影响,反而造成效率下降。因此,本说明书中可以针对图4所示的账户结构实施进一步改进,得到如图7所示的账户结构,其在图4所示账户结构的基础上,除了包含收入余额和资产信息之外,进一步包含主余额,即账户A总共包含三部分:主余额、收入余额和资产信息。其中,收入余额专用于收取汇入交易的交易额、资产信息专用于参与汇出交易,而主余额用于对资产信息进行充值,从而避免由收入余额承担充值任务,防止产生上文所述的影响。
以汇款方为例。区块链节点可以接收充值交易,该充值交易包含指定的至少一个取值的资产额承诺和相应的充值数量、用于证明主余额不小于充值额的区间证明,充值额为上述指定的至少一个取值的资产额承诺对应的资产额与相应的充值数量的加权和;区块链节点执行充值交易,使得汇款方账户中对应于上述指定的至少一个取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、汇款方账户的主余额在交易完成后减少上述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。具体的交互过程可以参考图8所示的实施例,以及图9还示出了账户充值前后的变化情况,此处不再赘述。
随着账户中的资产信息不断参与汇出交易,而主余额不断向资产信息进行充值,会导致主余额逐步减少;当主余额减少至一定程度或减少至0时,将无法继续充值,因而可以将收入余额中获得的资金转入主余额中,以便于维持账户不断地参与汇出交易。
以汇款方为例。区块链节点可以接收合并交易,该合并交易包含指定的至少一个取值的资产额承诺和相应的合并数量;区块链节点执行合并交易,使得汇款方账户中对应于上述指定的至少一个取值的资产额承诺的统计数量在交易完成后减少相应的合并数量、主余额在交易完成后增加合并额承诺,和/或汇款方账户的收入余额在交易完成后清零、汇款方账户的主余额在交易完成后增加相应的收入余额承诺;其中,合并额承诺为上述指定的至少一个取值的资产额承诺与相应的合并数量的加权和。换言之,合并 交易可以将收入余额所含的资金全部并入主余额,或者在一些情况下可以将至少一部分资产以资金形式并入主余额,或者还可以同时将收入余额所含的资金并入主余额、将至少一部分资产以资金形式并入主余额。具体的交互过程可以参考图10所示的实施例,以及图11还示出了账户在合并前后的变化情况,此处不再赘述。
虽然在本说明书提供的实施例中,针对账户所含的主余额、收入余额、资产信息,可以通过由资产信息参与汇出交易、收入余额参与汇入交易(收入余额也在汇出交易中收取找零额)、主余额参与上述的充值交易和合并交易,但是并不意味着每一余额仅能够参与上述类型的交易。例如,本说明书的账户结构,还可以兼容:由主余额参与汇出资金的主余额转账交易等。
例如,区块链节点可以接收主余额汇款交易,该主余额汇款交易包含汇款方与收款方之间的主余额交易额对应的主余额交易额承诺、用于证明主余额交易额非负且不大于主余额的区间证明;区块链节点执行主余额汇款交易,使得主余额在交易完成后扣除主余额交易额承诺、收款方账户的收入余额在交易完成后增加主余额交易额承诺。具体的交互过程可以参考图12所示的实施例,以及图13还示出了账户在交易前后的变化情况,此处不再赘述。
图15是一示例性实施例提供的一种设备的示意结构图。请参考图15,在硬件层面,该设备包括处理器1502、内部总线1504、网络接口1506、内存1508以及非易失性存储器1510,当然还可能包括其他业务所需要的硬件。处理器1502从非易失性存储器1510中读取对应的计算机程序到内存1508中然后运行,在逻辑层面上形成区块链网络中实现机密交易的装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
请参考图16,在软件实施方式中,该区块链网络中实现机密交易的装置应用于汇款方设备(汇款方设备的硬件结构如图15所示),可以包括:
确定单元1601,确定汇款方与收款方之间的汇款额,所述汇款方在区块链账本上存在对应的汇款方账户,所述汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
汇款交易创建单元1602,根据所述汇款方账户中被选取的资产额承诺和每一被 选取的资产额承诺对应的指定数量创建汇款交易,所述汇款交易包含所述汇款额对应的汇款额承诺、每一被选取的资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为每一被选取的资产额承诺对应的资产额与相应的指定数量的加权和;
汇款交易提交单元1603,向区块链提交所述汇款交易,使得每一被选取的资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
可选的,
所述汇款方账户所含的所有资产对应于同一预设取值的资产额;或,
所述汇款方账户包含多个资产组,每一资产组的所有资产对应于同一预设取值的资产额,且不同资产组的资产对应于不同预设取值的资产额。
可选的,所述汇款方账户还包括被记录为主余额承诺的主余额;所述装置还包括:
第一充值交易创建单元,创建充值交易,所述充值交易包含指定的至少一个取值的资产额承诺和相应的充值数量、用于证明所述主余额不小于充值额的区间证明,所述充值额为所述指定的至少一个取值的资产额承诺对应的资产额与相应的充值数量的加权和;
第一充值交易提交单元,向区块链提交所述充值交易,使得所述汇款方账户中对应于所述指定的至少一个取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、所述汇款方账户的主余额在交易完成后减少所述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。
可选的,还包括:
合并交易创建单元,创建合并交易,所述合并交易包含指定的至少一个取值的资产额承诺和相应的合并数量;
合并交易提交单元,向区块链提交所述合并交易,使得所述汇款方账户中对应于所述指定的至少一个取值的资产额承诺的统计数量在交易完成后减少相应的合并数量、所述主余额在交易完成后增加合并额承诺,和/或所述汇款方账户的收入余额在交易 完成后清零、所述汇款方账户的主余额在交易完成后增加相应的收入余额承诺;其中,所述合并额承诺为所述指定的至少一个取值的资产额承诺与相应的合并数量的加权和。
可选的,还包括:
主余额汇款交易创建单元,根据所述汇款方与所述收款方之间的主余额交易额,生成主余额汇款交易,所述主余额汇款交易包含所述主余额交易额对应的主余额交易额承诺、用于证明所述主余额交易额非负且不大于所述主余额的区间证明;
主余额汇款交易提交单元,向区块链提交所述主余额汇款交易,使得所述主余额在交易完成后扣除所述主余额交易额承诺、所述收款方账户的收入余额在交易完成后增加所述主余额交易额承诺。
可选的,还包括:
第二充值交易创建单元,创建充值交易,所述充值交易包含至少一个指定取值的资产额承诺和相应的充值数量、用于证明所述汇款方账户的收入余额不小于充值额的区间证明,所述充值额为所述指定取值的资产额承诺对应的资产额与充值数量的加权和;
第二充值交易提交单元,向区块链提交所述充值交易,使得所述汇款方账户中对应于所述指定取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、所述汇款方账户的收入余额在交易完成后减少所述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。
图17是一示例性实施例提供的一种设备的示意结构图。请参考图17,在硬件层面,该设备包括处理器1702、内部总线1704、网络接口1706、内存1708以及非易失性存储器1710,当然还可能包括其他业务所需要的硬件。处理器1702从非易失性存储器1710中读取对应的计算机程序到内存1708中然后运行,在逻辑层面上形成区块链网络中实现机密交易的装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
请参考图18,在软件实施方式中,该区块链网络中实现机密交易的装置应用于区块链节点(该区块链节点的硬件结构如图17所示),可以包括:
汇款交易接收单元1801,接收汇款交易,所述汇款交易包含汇款方与收款方之间的汇款额对应的汇款额承诺、至少一个资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为所述至少一个资产额承诺对 应的资产额与相应的指定数量的加权和;其中,所述汇款方在区块链账本上对应的汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
汇款交易执行单元1802,执行所述汇款交易,使得所述汇款交易所含每一资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
可选的,
所述汇款方账户所含的所有资产对应于同一预设取值的资产额;或,
所述汇款方账户包含多个资产组,每一资产组的所有资产对应于同一预设取值的资产额,且不同资产组的资产对应于不同预设取值的资产额。
可选的,所述汇款方账户还包括被记录为主余额承诺的主余额;所述装置还包括:
第一充值交易接收单元,接收充值交易,所述充值交易包含指定的至少一个取值的资产额承诺和相应的充值数量、用于证明所述主余额不小于充值额的区间证明,所述充值额为所述指定的至少一个取值的资产额承诺对应的资产额与相应的充值数量的加权和;
第一充值交易执行单元,执行所述充值交易,使得所述汇款方账户中对应于所述指定的至少一个取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、所述汇款方账户的主余额在交易完成后减少所述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。
可选的,还包括:
合并交易接收单元,接收合并交易,所述合并交易包含指定的至少一个取值的资产额承诺和相应的合并数量;
合并交易执行单元,执行所述合并交易,使得所述汇款方账户中对应于所述指定的至少一个取值的资产额承诺的统计数量在交易完成后减少相应的合并数量、所述主余额在交易完成后增加合并额承诺,和/或所述汇款方账户的收入余额在交易完成后清零、所述汇款方账户的主余额在交易完成后增加相应的收入余额承诺;其中,所述合并额承 诺为所述指定的至少一个取值的资产额承诺与相应的合并数量的加权和。
可选的,还包括:
主余额汇款交易接收单元,接收主余额汇款交易,所述主余额汇款交易包含所述汇款方与所述收款方之间的主余额交易额对应的主余额交易额承诺、用于证明所述主余额交易额非负且不大于所述主余额的区间证明;
主余额汇款交易执行单元,执行所述主余额汇款交易,使得所述主余额在交易完成后扣除所述主余额交易额承诺、所述收款方账户的收入余额在交易完成后增加所述主余额交易额承诺。
可选的,还包括:
第二充值交易接收单元,接收充值交易,所述充值交易包含至少一个指定取值的资产额承诺和相应的充值数量、用于证明所述汇款方账户的收入余额不小于充值额的区间证明,所述充值额为所述指定取值的资产额承诺对应的资产额与充值数量的加权和;
第二充值交易执行单元,执行所述充值交易,使得所述汇款方账户中对应于所述指定取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、所述汇款方账户的收入余额在交易完成后减少所述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他 数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。

Claims (18)

  1. 一种区块链网络中实现机密交易的方法,应用于汇款方设备;所述方法包括:
    确定汇款方与收款方之间的汇款额,所述汇款方在区块链账本上存在对应的汇款方账户,所述汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
    根据所述汇款方账户中被选取的资产额承诺和每一被选取的资产额承诺对应的指定数量创建汇款交易,所述汇款交易包含所述汇款额对应的汇款额承诺、每一被选取的资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为每一被选取的资产额承诺对应的资产额与相应的指定数量的加权和;
    向区块链提交所述汇款交易,使得每一被选取的资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
  2. 根据权利要求1所述的方法,
    所述汇款方账户所含的所有资产对应于同一预设取值的资产额;或,
    所述汇款方账户包含多个资产组,每一资产组的所有资产对应于同一预设取值的资产额,且不同资产组的资产对应于不同预设取值的资产额。
  3. 根据权利要求1所述的方法,所述汇款方账户还包括被记录为主余额承诺的主余额;所述方法还包括:
    创建充值交易,所述充值交易包含指定的至少一个取值的资产额承诺和相应的充值数量、用于证明所述主余额不小于充值额的区间证明,所述充值额为所述指定的至少一个取值的资产额承诺对应的资产额与相应的充值数量的加权和;
    向区块链提交所述充值交易,使得所述汇款方账户中对应于所述指定的至少一个取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、所述汇款方账户的主余额在交易完成后减少所述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。
  4. 根据权利要求3所述的方法,还包括:
    创建合并交易,所述合并交易包含指定的至少一个取值的资产额承诺和相应的合并数量;
    向区块链提交所述合并交易,使得所述汇款方账户中对应于所述指定的至少一个取 值的资产额承诺的统计数量在交易完成后减少相应的合并数量、所述主余额在交易完成后增加合并额承诺,和/或所述汇款方账户的收入余额在交易完成后清零、所述汇款方账户的主余额在交易完成后增加相应的收入余额承诺;其中,所述合并额承诺为所述指定的至少一个取值的资产额承诺与相应的合并数量的加权和。
  5. 根据权利要求3所述的方法,还包括:
    根据所述汇款方与所述收款方之间的主余额交易额,生成主余额汇款交易,所述主余额汇款交易包含所述主余额交易额对应的主余额交易额承诺、用于证明所述主余额交易额非负且不大于所述主余额的区间证明;
    向区块链提交所述主余额汇款交易,使得所述主余额在交易完成后扣除所述主余额交易额承诺、所述收款方账户的收入余额在交易完成后增加所述主余额交易额承诺。
  6. 根据权利要求1所述的方法,还包括:
    创建充值交易,所述充值交易包含至少一个指定取值的资产额承诺和相应的充值数量、用于证明所述汇款方账户的收入余额不小于充值额的区间证明,所述充值额为所述指定取值的资产额承诺对应的资产额与充值数量的加权和;
    向区块链提交所述充值交易,使得所述汇款方账户中对应于所述指定取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、所述汇款方账户的收入余额在交易完成后减少所述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。
  7. 一种区块链网络中实现机密交易的方法,应用于区块链节点;所述方法包括:
    接收汇款交易,所述汇款交易包含汇款方与收款方之间的汇款额对应的汇款额承诺、至少一个资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为所述至少一个资产额承诺对应的资产额与相应的指定数量的加权和;其中,所述汇款方在区块链账本上对应的汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
    执行所述汇款交易,使得所述汇款交易所含每一资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
  8. 根据权利要求7所述的方法,
    所述汇款方账户所含的所有资产对应于同一预设取值的资产额;或,
    所述汇款方账户包含多个资产组,每一资产组的所有资产对应于同一预设取值的资 产额,且不同资产组的资产对应于不同预设取值的资产额。
  9. 根据权利要求7所述的方法,所述汇款方账户还包括被记录为主余额承诺的主余额;所述方法还包括:
    接收充值交易,所述充值交易包含指定的至少一个取值的资产额承诺和相应的充值数量、用于证明所述主余额不小于充值额的区间证明,所述充值额为所述指定的至少一个取值的资产额承诺对应的资产额与相应的充值数量的加权和;
    执行所述充值交易,使得所述汇款方账户中对应于所述指定的至少一个取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、所述汇款方账户的主余额在交易完成后减少所述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。
  10. 根据权利要求9所述的方法,还包括:
    接收合并交易,所述合并交易包含指定的至少一个取值的资产额承诺和相应的合并数量;
    执行所述合并交易,使得所述汇款方账户中对应于所述指定的至少一个取值的资产额承诺的统计数量在交易完成后减少相应的合并数量、所述主余额在交易完成后增加合并额承诺,和/或所述汇款方账户的收入余额在交易完成后清零、所述汇款方账户的主余额在交易完成后增加相应的收入余额承诺;其中,所述合并额承诺为所述指定的至少一个取值的资产额承诺与相应的合并数量的加权和。
  11. 根据权利要求9所述的方法,还包括:
    接收主余额汇款交易,所述主余额汇款交易包含所述汇款方与所述收款方之间的主余额交易额对应的主余额交易额承诺、用于证明所述主余额交易额非负且不大于所述主余额的区间证明;
    执行所述主余额汇款交易,使得所述主余额在交易完成后扣除所述主余额交易额承诺、所述收款方账户的收入余额在交易完成后增加所述主余额交易额承诺。
  12. 根据权利要求7所述的方法,还包括:
    接收充值交易,所述充值交易包含至少一个指定取值的资产额承诺和相应的充值数量、用于证明所述汇款方账户的收入余额不小于充值额的区间证明,所述充值额为所述指定取值的资产额承诺对应的资产额与充值数量的加权和;
    执行所述充值交易,使得所述汇款方账户中对应于所述指定取值的资产额承诺的统计数量在交易完成后增加相应的充值数量、所述汇款方账户的收入余额在交易完成后减少所述指定的至少一个取值的资产额承诺与相应的充值数量的加权和。
  13. 一种区块链网络中实现机密交易的装置,应用于汇款方设备;所述装置包括:
    确定单元,确定汇款方与收款方之间的汇款额,所述汇款方在区块链账本上存在对应的汇款方账户,所述汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
    创建单元,根据所述汇款方账户中被选取的资产额承诺和每一被选取的资产额承诺对应的指定数量创建汇款交易,所述汇款交易包含所述汇款额对应的汇款额承诺、每一被选取的资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为每一被选取的资产额承诺对应的资产额与相应的指定数量的加权和;
    提交单元,向区块链提交所述汇款交易,使得每一被选取的资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
  14. 一种区块链网络中实现机密交易的装置,应用于区块链节点;所述装置包括:
    接收单元,接收汇款交易,所述汇款交易包含汇款方与收款方之间的汇款额对应的汇款额承诺、至少一个资产额承诺和相应的指定数量、用于证明所述汇款额非负且不大于资产总额的区间证明,所述资产总额为所述至少一个资产额承诺对应的资产额与相应的指定数量的加权和;其中,所述汇款方在区块链账本上对应的汇款方账户包括被记录为收入余额承诺的收入余额、相应资产额被记录为资产额承诺的资产和各个取值的资产额承诺的统计数量,其中相同资产额的资产具有相同的资产额承诺;
    执行单元,执行所述汇款交易,使得所述汇款交易所含每一资产额承诺对应的统计数量在交易完成后减去相应的指定数量、所述汇款方账户的收入余额在交易完成后增加找零额承诺、所述收款方在区块链账本上对应的收款方账户的收入余额在交易完成后增加所述汇款额承诺。
  15. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-6中任一项所述的方法。
  16. 一种计算机可读存储介质,其上存储有计算机指令,其特征在于,该指令被处理器执行时实现如权利要求1-6中任一项所述方法的步骤。
  17. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求7-12中任一项所述的方法。
  18. 一种计算机可读存储介质,其上存储有计算机指令,其特征在于,该指令被处理器执行时实现如权利要求7-12中任一项所述方法的步骤。
PCT/CN2020/071474 2019-07-31 2020-01-10 区块链网络中实现机密交易的方法及装置 WO2021017425A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/779,499 US20200175502A1 (en) 2019-07-31 2020-01-31 Confidential transaction in a blockchain network

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910704690.1 2019-07-31
CN201910704690.1A CN110458561B (zh) 2019-07-31 2019-07-31 区块链网络中实现机密交易的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/779,499 Continuation US20200175502A1 (en) 2019-07-31 2020-01-31 Confidential transaction in a blockchain network

Publications (1)

Publication Number Publication Date
WO2021017425A1 true WO2021017425A1 (zh) 2021-02-04

Family

ID=68484382

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/071474 WO2021017425A1 (zh) 2019-07-31 2020-01-10 区块链网络中实现机密交易的方法及装置

Country Status (3)

Country Link
CN (1) CN110458561B (zh)
TW (1) TW202107361A (zh)
WO (1) WO2021017425A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110458561B (zh) * 2019-07-31 2020-08-04 阿里巴巴集团控股有限公司 区块链网络中实现机密交易的方法及装置
CN111383008B (zh) * 2020-05-29 2021-07-30 支付宝(杭州)信息技术有限公司 基于账户模型的区块链转账方法及装置
CN111401875B (zh) * 2020-05-29 2020-09-01 支付宝(杭州)信息技术有限公司 基于账户模型的区块链转账方法及装置
CN115330532B (zh) * 2022-10-10 2023-03-10 北京百度网讯科技有限公司 基于账户模型的区块链处理方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106549749A (zh) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 一种基于加法同态加密的区块链隐私保护方法
CN109377224A (zh) * 2018-10-25 2019-02-22 阿里巴巴集团控股有限公司 区块链交易方法及装置、电子设备
CN110009492A (zh) * 2019-02-01 2019-07-12 阿里巴巴集团控股有限公司 区块链交易方法及装置、电子设备、存储介质
CN110033370A (zh) * 2019-02-01 2019-07-19 阿里巴巴集团控股有限公司 账户创建方法及装置、电子设备、存储介质
CN110458561A (zh) * 2019-07-31 2019-11-15 阿里巴巴集团控股有限公司 区块链网络中实现机密交易的方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11196747B2 (en) * 2017-12-07 2021-12-07 Bank Of America Corporation Automated event processing computing platform for handling and enriching blockchain data
CN109377215B (zh) * 2018-08-06 2020-04-21 阿里巴巴集团控股有限公司 区块链交易方法及装置、电子设备
CN110033363B (zh) * 2018-12-14 2024-01-23 创新先进技术有限公司 基于区块链的事件处理方法及装置、电子设备
CN109903026A (zh) * 2018-12-14 2019-06-18 阿里巴巴集团控股有限公司 基于区块链的事件处理方法及装置、电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106549749A (zh) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 一种基于加法同态加密的区块链隐私保护方法
CN109377224A (zh) * 2018-10-25 2019-02-22 阿里巴巴集团控股有限公司 区块链交易方法及装置、电子设备
CN110009492A (zh) * 2019-02-01 2019-07-12 阿里巴巴集团控股有限公司 区块链交易方法及装置、电子设备、存储介质
CN110033370A (zh) * 2019-02-01 2019-07-19 阿里巴巴集团控股有限公司 账户创建方法及装置、电子设备、存储介质
CN110458561A (zh) * 2019-07-31 2019-11-15 阿里巴巴集团控股有限公司 区块链网络中实现机密交易的方法及装置

Also Published As

Publication number Publication date
TW202107361A (zh) 2021-02-16
CN110458561B (zh) 2020-08-04
CN110458561A (zh) 2019-11-15

Similar Documents

Publication Publication Date Title
TWI727292B (zh) 區塊鏈交易方法及裝置、電子設備
WO2020258851A1 (zh) 采用环签名的机密区块链交易的实现方法及装置
TWI786282B (zh) 區塊鏈交易方法及裝置、電子設備
WO2021017425A1 (zh) 区块链网络中实现机密交易的方法及装置
US11238447B2 (en) Blockchain transactions with ring signatures
JP2021061021A (ja) 信頼度が低い、または信頼度が皆無の当事者間での価値転送を円滑化する装置、システム、または方法
US20230419316A1 (en) Systems and methods for recording assets and transactions thereof in blockchains
CN110008716B (zh) 区块链交易方法及装置、电子设备、存储介质
US11233660B2 (en) Confidential blockchain transactions
US11170374B2 (en) Method, apparatus and electronic device for blockchain transactions
CN110033370B (zh) 账户创建方法及装置、电子设备、存储介质
JP2018515833A (ja) ブロックチェーン取引記録のシステムおよび方法
WO2020258832A1 (zh) 基于环签名的匿名交易方法及装置
TW202016820A (zh) 區塊鏈交易方法及裝置、電子設備
CN112513906A (zh) 管理区块链网络上的交易
WO2021209043A1 (zh) 基于区块链的流量统计
TWI727642B (zh) 區塊鏈中實現機密交易的方法及裝置
CN110009323B (zh) 区块链交易方法及装置、电子设备、存储介质
CN110009492B (zh) 区块链交易方法及装置、电子设备、存储介质
US20200175502A1 (en) Confidential transaction in a blockchain network
Ojerinde et al. Integration Of Consortium Blockchain Model In The Nigerian Banking Sector
WO2023183494A1 (en) Integrated platform for digital asset registration, tracking and validation

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

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

Country of ref document: EP

Kind code of ref document: A1