WO2019119632A1 - 基于区块链的多账本转账方法、电子装置及可读存储介质 - Google Patents

基于区块链的多账本转账方法、电子装置及可读存储介质 Download PDF

Info

Publication number
WO2019119632A1
WO2019119632A1 PCT/CN2018/075881 CN2018075881W WO2019119632A1 WO 2019119632 A1 WO2019119632 A1 WO 2019119632A1 CN 2018075881 W CN2018075881 W CN 2018075881W WO 2019119632 A1 WO2019119632 A1 WO 2019119632A1
Authority
WO
WIPO (PCT)
Prior art keywords
account
user
balance
book
ciphertext
Prior art date
Application number
PCT/CN2018/075881
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 深圳壹账通智能科技有限公司
Publication of WO2019119632A1 publication Critical patent/WO2019119632A1/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/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a blockchain-based multi-book transfer method, an electronic device, and a readable storage medium.
  • blockchain technology Due to its decentralization and unchangeable information, blockchain technology is increasingly favored by companies in the fields of finance and insurance, especially the use of blockchain technology to achieve multi-party trading events (for example, transfer Events such as transactions, payment transactions, etc. are becoming more and more the focus of attention.
  • transfer Events such as transactions, payment transactions, etc. are becoming more and more the focus of attention.
  • Bank A wants to sell 100 tickets to Bank B
  • all other nodes on the blockchain The transaction will be verified, the advantage is that other participants can participate in confirming the accuracy of the transaction, but can not interpret (decrypt) the data (also known as zero knowledge detection).
  • the purpose of the present application is to provide a blockchain-based multi-book transfer method, an electronic device, and a readable storage medium, which are designed to ensure multi-book transfer operations in a blockchain technology scenario when transaction information is secure.
  • the present application provides a blockchain-based multi-book transfer method, which is applied to an electronic device, and the blockchain-based multi-book transfer method includes:
  • the first user account of the first user in the first account in the blockchain initiates a transaction request with the second user account of the second user under the second account, receiving the first user generated by the first user in advance
  • the ciphertext is a request for redeeming a preset exchange transaction share according to a preset exchange rate
  • the first ciphertext is a preset exchange transaction share using a second preset password formula and a corresponding transaction share privacy secret
  • the present application further provides an electronic device, where the electronic device includes a memory and a processor, and the memory stores a blockchain-based multi-book transfer system operable on the processor.
  • the blockchain-based multi-book transfer system is implemented by the processor to implement the following steps:
  • the transaction request is a request for redeeming a preset exchange transaction share at a preset exchange rate
  • the first ciphertext is a preset exchange transaction share using a second preset password formula and a corresponding transaction share privacy key. Encrypting the generated first ciphertext;
  • the present application further provides a computer readable storage medium storing a blockchain-based multi-book transfer system, the blockchain-based multi-book transfer system
  • the step of the blockchain-based multi-book transfer method as described above may be performed by at least one processor.
  • the blockchain-based multi-book transfer method, system and readable storage medium proposed by the present application in the blockchain, the first user account of the first user under the first account and the second user of the second account After the user account defaults the redemption transaction share to the redemption transaction request, the first user receives the second default password formula and the corresponding transaction share privacy key for the default redemption transaction share.
  • Generating a first ciphertext generating, by the first preset redemption calculation formula, a credit exchange transaction share of the second ledger for the second ledger calculation based on the preset exchange rate and the first ciphertext a second ciphertext of the corresponding transaction share privacy key; based on the first ciphertext and the second ciphertext, and completing the first user account and the first user of the first user under the first account book according to a preset rule The transaction of the second user account of the second user under the second account.
  • the first ciphertext can be generated by using the second preset password formula and the corresponding transaction share privacy key to encrypt the preset redemption transaction share of the first user account under the first account, and the second transcript is generated for the second account book.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a blockchain-based multi-book transfer system 10 according to the present application;
  • FIG. 2 is a schematic flowchart diagram of an embodiment of a multi-book transfer method based on a blockchain in the present application.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a blockchain-based multi-book transfer system 10 of the present application.
  • the blockchain-based multi-book transfer system 10 is installed and operated in the electronic device 1.
  • the electronic device 1 may include, but is not limited to, a memory 11, a processor 12, and a network interface 13.
  • Figure 1 shows only the electronic device 1 with components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the electronic device 1 is connected to the network through a network interface 13 (not shown in FIG. 1) to obtain information.
  • the network may be an intranet, an Internet, a Global System of Mobile communication (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, or a 5G network.
  • Wireless or wired networks such as networks, Bluetooth, Wi-Fi, and call networks.
  • the memory 11 is at least one type of readable computer storage medium, which in some embodiments may be an internal storage unit of the electronic device 1, such as a hard disk or memory of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC), and a secure digital device. (Secure Digital, SD) card, flash card, etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 is configured to store application software and various types of data installed in the electronic device 1, such as program code of the blockchain-based multi-book transfer system 10, and the like.
  • the memory 11 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 12 in some embodiments, may be a central processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 11, for example
  • CPU central processing unit
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 11, for example
  • the blockchain-based multi-book transfer system 10 and the like are executed.
  • the network interface 13 may comprise a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the electronic device 1 and other electronic devices.
  • the blockchain-based multi-book transfer system 10 includes at least one computer readable instructions stored in the memory 11, the at least one computer readable instructions being executable by the processor 12 to implement various embodiments of the present application.
  • the blockchain-based multi-book transfer system 10 is executed by the processor 12 to implement the following steps:
  • Step S1 if the first user account of the first user in the first account in the block chain initiates a transaction request with the second user account of the second user under the second account, receiving the first user generated by the first user a ciphertext;
  • the transaction request is a request for redeeming a default redemption transaction share according to a preset exchange rate, and the first ciphertext is a preset exchange transaction share using a second preset password formula and corresponding transaction share privacy
  • the secret key is encrypted to generate the first ciphertext.
  • the user or the institution in the blockchain first encrypts the balance of each user account under each account by using the first preset password formula and the corresponding balance privacy key, and encrypts itself.
  • the encrypted balance of each user account under a ledger is written to the shared asset book on each node of the blockchain through the smart contract of the blockchain.
  • the first ledger eg, the first ledger may be a renminbi ledger
  • the first user of the first user initiates a second user with the second ledger (eg, the second ledger may be a US dollar ledger)
  • the account will be redeemed by the first user for the default exchange transaction share at the preset exchange rate (the default exchange transaction share and the preset exchange rate can be set in advance in the smart contract)
  • the transaction share is encrypted by the second preset password formula and the corresponding transaction share privacy key to generate the first ciphertext.
  • t ij represents the i-th book
  • z ij represents the redemption transaction share privacy key of the jth user account under the i-th account
  • t' 1ij represents the encryption of the jth first user account under the i-th account
  • g and h are bases
  • h is a n-th power of g
  • n is a positive integer
  • i and j are positive integers.
  • Step S2 calculating, by the first preset redemption calculation formula, based on the preset exchange rate and the first ciphertext, the exchange transaction share and the encrypted exchange transaction share of the second ledger for the second ledger Corresponding transaction share privacy key, and generating a second ciphertext of the encrypted exchange transaction share of the second book and the corresponding transaction share privacy key.
  • the exchange is passed by the smart contract. Presetting the calculation formula and calculating the exchange transaction share, the encrypted exchange transaction share and the corresponding transaction share privacy key of the second book for the second book based on the preset exchange rate e and the first ciphertext, and in the smart The contract directly generates the encrypted exchange transaction share of the second book and the second ciphertext of the corresponding transaction share privacy key.
  • the first preset transaction conversion formula is or, Where t ij *e represents the redemption transaction share of the jth user account under the i-th account, z ij *e represents the exchange transaction share privacy key of the j-th user account under the i-th account, t' 2ij represents the The encrypted exchange transaction share of the jth second user account under the i-book, g and h are bases, h is a n-th power of g, n is a positive integer, and i and j are positive integers.
  • Step S3 based on the first ciphertext and the second ciphertext, and completing a first user account of the first user under the first account and a second user of the second user under the second account according to a preset rule The transaction of the account.
  • the transaction of the first user account of the first user under the first account and the second user account of the second user under the second account may be completed based on the first ciphertext and the second ciphertext.
  • the default redemption transaction share may be transferred between the first user account of the first user under the first book and the second user account of the second user under the second book at a preset exchange rate.
  • the first user may also be updated simultaneously with all user accounts under the first ledger (eg, the first ledger may be a renminbi ledger) and the second ledger (eg, the second ledger may be a US dollar ledger) (eg, balance update), the second user is in the first ledger (eg, the first ledger may be a RMB ledger) and the second ledger (eg, the second ledger may be a US dollar ledger) for all users
  • the account is updated at the same time (for example, balance update). For example, if A wants to exchange RMB with US dollars, then the accounts of RMB and USD of A and B in this embodiment can be simultaneously updated to complete the private transaction of multiple account transfer under the blockchain technology scenario.
  • the first user account of the first user in the first account in the blockchain is initiated, and the second user account of the second user in the second account is preset by default.
  • the exchange rate is exchanged
  • the first ciphertext generated by the first user to be encrypted by using the second preset password formula and the corresponding transaction share privacy key for the preset redemption transaction share is received;
  • the first ciphertext can be generated by using the second preset password formula and the corresponding transaction share privacy key to encrypt the preset redemption transaction share of the first user account under the first account, and the second transcript is generated for the second account book. Determining, by the first ciphertext and the second ciphertext, the first user account and the first account under the first ciphertext and the second ciphertext of the corresponding transaction share privacy key a transaction operation of the second user account under the second book, in which only the first user or the second user can decrypt the first ciphertext or the second ciphertext to obtain the specific exchange transaction share data of the transaction, the blockchain The other nodes on the other cannot interpret the specific exchange transaction share data, so as to realize the multi-book transfer operation in the case of effectively ensuring the transaction information security in the blockchain technology scenario.
  • the method specifically includes:
  • the first ciphertext after the electronic signature is sent by the first user to the second user, if the second user is The first ciphertext confirms the preset exchange transaction share and the preset exchange rate, and the second user performs electronic signature generation on the first ciphertext.
  • the electronically signed first ciphertext is written to a shared asset book on each node of the blockchain.
  • the first user sends the first ciphertext to the second user; if the second user confirms the preset redemption transaction share and the preset exchange rate, the second user performs the electronic on the first ciphertext.
  • the first account for example, the first book may be a RMB book
  • the first user account of the first user is initiated and the second account book (for example, the second account book may be a US dollar account)
  • the smart contract of the blockchain updates the first user account of the first user under the first book according to the first ciphertext And a balance of the third account of the second user under the first book, and updating the balance of the fourth account of the first user and the second user of the second account according to the second ciphertext The balance of the second user account.
  • the first user account and the fourth account are both accounts of the first user, respectively being the account of the first user under the first account book and the second account book, for example, the first user account is the first user's RMB account book.
  • the account, the fourth account is the first user's dollar account book account.
  • the second user account and the third account are both accounts of the second user, respectively being the account of the second user under the second book and the first book, for example, the second user account is the dollar account account of the second user,
  • the third account is the RMB account account of the second user.
  • the step of updating the balance of the first user account of the first user under the first account and the balance of the third account of the second user under the first account according to the first ciphertext comprises:
  • the smart contract deducts the preset redemption transaction share from the balance of the first user account of the first user under the first account according to the first preset balance calculation formula, and calculates the first user of the first user under the first account book.
  • the first new balance of the account, and the calculated first new balance is updated to the shared asset book.
  • a 1ij represents the balance of the jth first user account under the i-th account
  • x 1ij represents the balance privacy key of the jth first user account under the i-th account
  • a 1ij represents the i-book
  • the encrypted new balance of the jth first user account, g and h are the base, h is a nth power of g, i and j are positive integers, and “a 1ij -t ij ” represents the jth under the i-th account
  • the new balance of the first user account, "x 1ij -z ij " represents the new confused balance privacy key of the jth first user account under the i-th account
  • t ij represents the jth first user under the i-th account
  • the trading share of the account, z ij represents the trading share privacy key of the jth first user account under the i-th account.
  • the smart contract adds the preset redemption transaction share to the balance of the third account of the second user under the first book according to the second preset balance calculation formula, and calculates the third account of the second user under the first book
  • the second new balance is updated and the calculated second new balance is updated to the shared asset book.
  • the balance of the jth third account under the Y 3ij represents the balance privacy key of the jth third account under the i-th account
  • a 3ij ” represents the encrypted new balance of the jth third account under the i-th account
  • g and h are bases
  • h is a n-th power of g
  • i and j are positive integers
  • the step of updating the balance of the fourth account of the first user under the second book and the balance of the second user account of the second user under the second book according to the second ciphertext comprises:
  • the smart contract deducts the preset redemption transaction share from the balance of the second user account of the second user under the second account according to the third preset balance calculation formula, and calculates the second user of the second user under the second account book.
  • the third new balance of the account, and the calculated third new balance is updated to the shared asset book.
  • the balance privacy key of the user account a 2ij ” represents the encrypted new balance of the jth second user account under the i-book, g and h are based, h is a n-
  • the smart contract adds the preset redemption transaction share to the balance of the fourth account of the first user under the second book according to the fourth preset balance calculation formula, and calculates the fourth account of the first user under the second account book.
  • the fourth new balance is updated and the calculated fourth new balance is updated to the shared asset book.
  • the balance privacy key, a 4ij ” represents the encrypted new balance of the jth fourth account under the i-book, g and h are based, h is a n-
  • the third preset balance calculation formula may further increase the preset redemption transaction share in the balance of the third account of the second user under the first book, and calculate the second user's number under the first account book.
  • the second new balance of the three accounts, and the calculated second new balance is updated to the shared asset book.
  • the third preset balance calculation formula may also be that the preset exchange transaction share is deducted from the balance of the fourth account of the first user under the second ledger, and the fourth account of the first user under the second ledger is calculated.
  • the fourth new balance is updated and the calculated fourth new balance is updated to the shared asset book.
  • step S2 is replaced by the following steps:
  • the first user passes the first preset redemption calculation formula and based on the preset exchange rate e and the first ciphertext
  • the second ledger calculates the exchange transaction share of the second ledger, the encrypted exchange transaction share and the corresponding transaction share privacy key, and generates a second exchange transcript of the second exchange of the encrypted exchange transaction share of the second ledger and the corresponding transaction share privacy key.
  • the first user sends the first ciphertext and the second ciphertext to the second user.
  • the second user If the second user confirms the preset exchange transaction share and the preset exchange rate, the second user electronically signs the first ciphertext and the second ciphertext, and the first ciphertext and the first after the electronic signature
  • the second ciphertext is written to the shared asset book on each node of the blockchain through the smart contract of the blockchain, or the second user sends the first ciphertext and the second ciphertext after the electronic signature to the
  • the first user for the first user, writes the electronically signed first ciphertext and the second ciphertext to the shared asset book on each node of the blockchain through the smart contract of the blockchain.
  • the third, fourth or even more books can be simultaneously transferred.
  • it can be achieved through the following steps: (1) setting the third book book and the first book book or the exchange amount of the second book book on the smart contract; ), the smart contract or the first user calculates the transfer amount of the corresponding account on the third ledger by using the first preset redemption calculation formula and the exchange amount f; (3) setting a fifth preset balance on the third ledger
  • the calculation formula and the sixth preset balance calculation formula are used to increase and deduct the share on the corresponding account through the smart contract.
  • Account 1 and Account 2 takes Account 1 and Account 2 as examples for example:
  • Step 1 The balance of each user account under each account is encrypted with a cryptographic formula with additive homomorphism. Only the owner of the account can decrypt the balance of his account through his own “account privacy key”.
  • Pederson Commitment and ECC elliptic curve
  • other methods such as RSA, Diffie-Hellman, and the like are not limited.
  • account A should be used to balance the balance of account 1 with the balance of account B in account book 2, such as A (in account 1) and B (in account 2), A will be in account 1 Part of the RMB balance is transferred to B, and B will transfer his US dollar to A in the book.
  • a2 A account book 2 balance
  • a2' password
  • x2 A account book 2 balance privacy key
  • Step 2 If A wants to exchange the balance of B in Book 2 with the balance of Book 1, A will create two ciphertexts, the first one is the share of the book 1 protected by the addition of homomorphic ciphertext, and the second is by encryption. Confusing the exchange price of book 1 and book 2 (such as exchange rate).
  • the transfer initiator (A) will generate the homomorphic privacy key for the first ciphertext and the privacy secret key for the second ciphertext and send them to the counterparty with the first ciphertext and the second ciphertext (b). And after obtaining B approval and digitally signing the first ciphertext and the second ciphertext, the entire transaction and the signature of Party B are sent to the blockchain network (the digital signature of Party B represents the recognition of the transaction share and exchange rate), such as Send it to the smart contract on the blockchain.
  • Step 3 After receiving the transaction request, the blockchain will update the ledger 2 while updating the ledger 1.
  • the steps of updating the ledger 2 have the following three sub-steps:
  • step 3A the transaction share is deducted from the account balance of account 1 and the transaction share is increased in the balance of account B of account book 1 at the same time.
  • a account new balance a1-t
  • a account new confused privacy key x1 ' (x1-z)
  • Step 3B the smart contract on the blockchain calculates the transaction share corresponding to the transfer operation required in the book 2 by the transaction amount (first ciphertext) and the exchange rate.
  • the operation needs to be performed without decrypting the transaction amount.
  • step 3C the transaction share is added to the balance of the account A of the book 2, and the transaction share is also subtracted from the account balance of the account B.
  • FIG. 2 is a schematic flowchart of a blockchain-based multi-book transfer method according to an embodiment of the present invention.
  • the blockchain-based multi-book transfer method includes the following steps:
  • Step S10 if the first user account of the first user in the first account in the block chain initiates a transaction request with the second user account of the second user under the second account, receiving the first user generated by the first user a ciphertext;
  • the transaction request is a request for redeeming a default redemption transaction share according to a preset exchange rate, and the first ciphertext is a preset exchange transaction share using a second preset password formula and corresponding transaction share privacy
  • the secret key is encrypted to generate the first ciphertext.
  • the user or the institution in the blockchain first encrypts the balance of each user account under each account by using the first preset password formula and the corresponding balance privacy key, and encrypts itself.
  • the encrypted balance of each user account under a ledger is written to the shared asset book on each node of the blockchain through the smart contract of the blockchain.
  • the first ledger eg, the first ledger may be a renminbi ledger
  • the first user of the first user initiates a second user with the second ledger (eg, the second ledger may be a US dollar ledger)
  • the account will be redeemed by the first user for the default exchange transaction share at the preset exchange rate (the default exchange transaction share and the preset exchange rate can be set in advance in the smart contract)
  • the transaction share is encrypted by the second preset password formula and the corresponding transaction share privacy key to generate the first ciphertext.
  • t ij represents the i-th book
  • z ij represents the redemption transaction share privacy key of the jth user account under the i-th account
  • t' 1ij represents the encryption of the jth first user account under the i-th account
  • g and h are bases
  • h is a n-th power of g
  • n is a positive integer
  • i and j are positive integers.
  • Step S20 calculating, by the first preset redemption calculation formula, based on the preset exchange rate and the first ciphertext, the exchange transaction share and the encrypted exchange transaction share of the second ledger for the second ledger Corresponding transaction share privacy key, and generating a second ciphertext of the encrypted exchange transaction share of the second book and the corresponding transaction share privacy key.
  • the exchange is passed by the smart contract. Presetting the calculation formula and calculating the exchange transaction share, the encrypted exchange transaction share and the corresponding transaction share privacy key of the second book for the second book based on the preset exchange rate e and the first ciphertext, and in the smart The contract directly generates the encrypted exchange transaction share of the second book and the second ciphertext of the corresponding transaction share privacy key.
  • the first preset transaction conversion formula is or, Where t ij *e represents the redemption transaction share of the jth user account under the i-th account, z ij *e represents the exchange transaction share privacy key of the j-th user account under the i-th account, t' 2ij represents the The encrypted exchange transaction share of the jth second user account under the i-book, g and h are bases, h is a n-th power of g, n is a positive integer, and i and j are positive integers.
  • Step S30 based on the first ciphertext and the second ciphertext, and completing a first user account of the first user under the first account and a second user of the second user under the second account according to a preset rule The transaction of the account.
  • the transaction of the first user account of the first user under the first account and the second user account of the second user under the second account may be completed based on the first ciphertext and the second ciphertext.
  • the default redemption transaction share may be transferred between the first user account of the first user under the first book and the second user account of the second user under the second book at a preset exchange rate.
  • the first user may also be updated simultaneously with all user accounts under the first ledger (eg, the first ledger may be a renminbi ledger) and the second ledger (eg, the second ledger may be a US dollar ledger) (eg, balance update), the second user is in the first ledger (eg, the first ledger may be a RMB ledger) and the second ledger (eg, the second ledger may be a US dollar ledger) for all users
  • the account is updated at the same time (for example, balance update). For example, if A wants to exchange RMB with US dollars, then the accounts of RMB and USD of A and B in this embodiment can be simultaneously updated to complete the private transaction of multiple account transfer under the blockchain technology scenario.
  • the first user account of the first user in the first account in the blockchain is initiated, and the second user account of the second user in the second account is preset by default.
  • the exchange rate is exchanged
  • the first ciphertext generated by the first user to be encrypted by using the second preset password formula and the corresponding transaction share privacy key for the preset redemption transaction share is received;
  • the first ciphertext can be generated by using the second preset password formula and the corresponding transaction share privacy key to encrypt the preset redemption transaction share of the first user account under the first account, and the second transcript is generated for the second account book. Determining, by the first ciphertext and the second ciphertext, the first user account and the first account under the first ciphertext and the second ciphertext of the corresponding transaction share privacy key a transaction operation of the second user account under the second book, in which only the first user or the second user can decrypt the first ciphertext or the second ciphertext to obtain the specific exchange transaction share data of the transaction, the blockchain The other nodes on the other cannot interpret the specific exchange transaction share data, so as to realize the multi-book transfer operation in the case of effectively ensuring the transaction information security in the blockchain technology scenario.
  • the step S30 specifically includes:
  • the first ciphertext after the electronic signature is sent by the first user to the second user, if the second user is The first ciphertext confirms the preset exchange transaction share and the preset exchange rate, and the second user performs electronic signature generation on the first ciphertext.
  • the electronically signed first ciphertext is written to a shared asset book on each node of the blockchain.
  • the first user sends the first ciphertext to the second user; if the second user confirms the preset redemption transaction share and the preset exchange rate, the second user performs the electronic on the first ciphertext.
  • the first account for example, the first book may be a RMB book
  • the first user account of the first user is initiated and the second account book (for example, the second account book may be a US dollar account)
  • the smart contract of the blockchain updates the first user account of the first user under the first book according to the first ciphertext And a balance of the third account of the second user under the first book, and updating the balance of the fourth account of the first user and the second user of the second account according to the second ciphertext The balance of the second user account.
  • the first user account and the fourth account are both accounts of the first user, respectively being the account of the first user under the first account book and the second account book, for example, the first user account is the first user's RMB account book.
  • the account, the fourth account is the first user's dollar account book account.
  • the second user account and the third account are both accounts of the second user, respectively being the account of the second user under the second book and the first book, for example, the second user account is the dollar account account of the second user,
  • the third account is the RMB account account of the second user.
  • the step of updating the balance of the first user account of the first user under the first account and the balance of the third account of the second user under the first account according to the first ciphertext comprises:
  • the smart contract deducts the preset redemption transaction share from the balance of the first user account of the first user under the first account according to the first preset balance calculation formula, and calculates the first user of the first user under the first account book.
  • the first new balance of the account, and the calculated first new balance is updated to the shared asset book.
  • a 1ij represents the balance of the jth first user account under the i-th account
  • x 1ij represents the balance privacy key of the jth first user account under the i-th account
  • a 1ij represents the i-book
  • the encrypted new balance of the jth first user account, g and h are the base, h is a nth power of g, i and j are positive integers, and “a 1ij -t ij ” represents the jth under the i-th account
  • the new balance of the first user account, "x 1ij -z ij " represents the new confused balance privacy key of the jth first user account under the i-th account
  • t ij represents the jth first user under the i-th account
  • the trading share of the account, z ij represents the trading share privacy key of the jth first user account under the i-th account.
  • the smart contract adds the preset redemption transaction share to the balance of the third account of the second user under the first book according to the second preset balance calculation formula, and calculates the third account of the second user under the first book
  • the second new balance is updated and the calculated second new balance is updated to the shared asset book.
  • the balance of the jth third account under the Y 3ij represents the balance privacy key of the jth third account under the i-th account
  • a 3ij ” represents the encrypted new balance of the jth third account under the i-th account
  • g and h are bases
  • h is a n-th power of g
  • i and j are positive integers
  • the step of updating the balance of the fourth account of the first user under the second book and the balance of the second user account of the second user under the second book according to the second ciphertext comprises:
  • the smart contract deducts the preset redemption transaction share from the balance of the second user account of the second user under the second account according to the third preset balance calculation formula, and calculates the second user of the second user under the second account book.
  • the third new balance of the account, and the calculated third new balance is updated to the shared asset book.
  • the balance privacy key of the user account a 2ij ” represents the encrypted new balance of the jth second user account under the i-book, g and h are based, h is a n-
  • the smart contract adds the preset redemption transaction share to the balance of the fourth account of the first user under the second book according to the fourth preset balance calculation formula, and calculates the fourth account of the first user under the second account book.
  • the fourth new balance is updated and the calculated fourth new balance is updated to the shared asset book.
  • the balance privacy key, a 4ij ” represents the encrypted new balance of the jth fourth account under the i-book, g and h are based, h is a n-
  • the third preset balance calculation formula may further increase the preset redemption transaction share in the balance of the third account of the second user under the first book, and calculate the second user's number under the first account book.
  • the second new balance of the three accounts, and the calculated second new balance is updated to the shared asset book.
  • the third preset balance calculation formula may also be that the preset exchange transaction share is deducted from the balance of the fourth account of the first user under the second ledger, and the fourth account of the first user under the second ledger is calculated.
  • the fourth new balance is updated and the calculated fourth new balance is updated to the shared asset book.
  • step S20 can be replaced by the following steps:
  • the first user passes the first preset redemption calculation formula and based on the preset exchange rate e and the first ciphertext
  • the second ledger calculates the exchange transaction share of the second ledger, the encrypted exchange transaction share and the corresponding transaction share privacy key, and generates a second exchange transcript of the second exchange of the encrypted exchange transaction share of the second ledger and the corresponding transaction share privacy key.
  • the first user sends the first ciphertext and the second ciphertext to the second user.
  • the second user If the second user confirms the preset exchange transaction share and the preset exchange rate, the second user electronically signs the first ciphertext and the second ciphertext, and the first ciphertext and the first after the electronic signature
  • the second ciphertext is written to the shared asset book on each node of the blockchain through the smart contract of the blockchain, or the second user sends the first ciphertext and the second ciphertext after the electronic signature to the
  • the first user for the first user, writes the electronically signed first ciphertext and the second ciphertext to the shared asset book on each node of the blockchain through the smart contract of the blockchain.
  • the third, fourth or even more books can be simultaneously transferred.
  • it can be achieved through the following steps: (1) setting the third book book and the first book book or the exchange amount of the second book book on the smart contract; ), the smart contract or the first user calculates the transfer amount of the corresponding account on the third ledger by using the first preset redemption calculation formula and the exchange amount f; (3) setting a fifth preset balance on the third ledger
  • the calculation formula and the sixth preset balance calculation formula are used to increase and deduct the share on the corresponding account through the smart contract.
  • Account 1 and Account 2 takes Account 1 and Account 2 as examples for example:
  • Step 1 The balance of each user account under each account is encrypted with a cryptographic formula with additive homomorphism. Only the owner of the account can decrypt the balance of his account through his own “account privacy key”.
  • Pederson Commitment and ECC elliptic curve
  • other methods such as RSA, Diffie-Hellman, and the like are not limited.
  • account A should be used to balance the balance of account 1 with the balance of account B in account book 2, such as A (in account 1) and B (in account 2), A will be in account 1 Part of the RMB balance is transferred to B, and B will transfer his US dollar to A in the book.
  • a2 A account book 2 balance
  • a2' password
  • x2 A account book 2 balance privacy key
  • Step 2 If A wants to exchange the balance of B in Book 2 with the balance of Book 1, A will create two ciphertexts, the first one is the share of the book 1 protected by the addition of homomorphic ciphertext, and the second is by encryption. Confusing the exchange price of book 1 and book 2 (such as exchange rate).
  • the transfer initiator (A) will generate the homomorphic privacy key for the first ciphertext and the privacy secret key for the second ciphertext and send them to the counterparty with the first ciphertext and the second ciphertext (b). And after obtaining B approval and digitally signing the first ciphertext and the second ciphertext, the entire transaction and the signature of Party B are sent to the blockchain network (the digital signature of Party B represents the recognition of the transaction share and exchange rate), such as Send it to the smart contract on the blockchain.
  • Step 3 After receiving the transaction request, the blockchain will update the ledger 2 while updating the ledger 1.
  • the steps of updating the ledger 2 have the following three sub-steps:
  • step 3A the transaction share is deducted from the account balance of account 1 and the transaction share is increased in the balance of account B of account book 1 at the same time.
  • a account new balance a1-t
  • a account new confused privacy key x1 ' (x1-z)
  • Step 3B the smart contract on the blockchain calculates the transaction share corresponding to the transfer operation required in the book 2 by the transaction amount (first ciphertext) and the exchange rate.
  • the operation needs to be performed without decrypting the transaction amount.
  • step 3C the transaction share is added to the balance of the account A of the book 2, and the transaction share is also subtracted from the account balance of the account B.
  • the present application also provides a computer readable storage medium storing a blockchain-based multi-book transfer system, the blockchain-based multi-book transfer system being configurable by at least one processor Executing, in order for the at least one processor to perform the step of the blockchain-based multi-book transfer method as in the above embodiment, the specific implementation process of the block chain-based multi-book transfer method steps S10, S20, S30 As described above, it will not be described here.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and can also be implemented by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本申请涉及一种基于区块链的多账本转账方法、电子装置及可读存储介质,该方法包括:若区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户将预设兑换交易份额按预设兑换率进行兑换的交易请求,接收第一用户预先加密生成的第一密文;第一密文为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成;通过第一预设兑换计算公式并基于预设兑换率和第一密文,计算出第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成第二账本的第二密文;基于第一密文和第二密文完成交易。本申请能在有效保证区块链技术场景中交易信息安全的情况下,实现多账本转账操作。

Description

基于区块链的多账本转账方法、电子装置及可读存储介质
本申请要求于2017年12月20日提交中国专利局、申请号为201711382545.3、发明名称为“基于区块链的多账本转账方法、电子装置及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种基于区块链的多账本转账方法、电子装置及可读存储介质。
背景技术
区块链技术因其具备的去中心化、信息不可篡改性等特点,越来越受到金融、保险等领域的公司的青睐,尤其是运用区块链技术实现多方参与的交易事件(例如,转账交易、支付交易等事件)越来越成为人们关注的焦点,例如,当银行A要卖100票据给银行B,如果这笔交易在区块链上进行,那么所有其他在区块链上的节点都会验证这笔交易,好处是其他参与方可以一起参与确认交易准确性,但又不能解读(解密)数据(又称零知识检测)。
为了保证交易的隐私性,目前业界通常会在交易中采用隐私交易加/解密算法。然而,现有的隐私交易加/解密算法一般仅局限于区块链技术场景下一个账本内的操作,例如把一个资产账本内的x份额从甲账户转到乙账户。然而,在实际区块链技术场景中,每一笔转账都有可能牵扯两个或多个账本,则这种现有隐私交易加/解密算法将无法实现区块链技术场景下的这种隐私交易。
因此,如何在有效保证区块链技术场景中交易信息安全的情况下,实现多账本转账操作,已经成为一种亟待解决的技术问题。
发明内容
本申请的目的在于提供一种基于区块链的多账本转账方法、电子装置及可读存储介质,旨在保证交易信息安全的情况下,实现区块链技术场景中的多账本转账操作。
为实现上述目的,本申请提供一种基于区块链的多账本转账方法,应用于电子装置,所述基于区块链的多账本转账方法包括:
A、若区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户的交易请求,则接收所述第一用户预先加密生成的第一密文;所述交易请求为将预设兑换交易份额按预设兑换率进行兑换的请求,所述第一密文为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文;
B、通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文, 为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;
C、基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。
此外,为实现上述目的,本申请还提供一种电子装置,所述电子装置包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的基于区块链的多账本转账***,所述基于区块链的多账本转账***被所述处理器执行时实现如下步骤:
若区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户的交易请求,则接收所述第一用户预先加密生成的第一密文;所述交易请求为将预设兑换交易份额按预设兑换率进行兑换的请求,所述第一密文为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文;
通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;
基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。
进一步地,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有基于区块链的多账本转账***,所述基于区块链的多账本转账***可被至少一个处理器执行,以使所述至少一个处理器执行如上述的基于区块链的多账本转账方法的步骤。
本申请提出的基于区块链的多账本转账方法、***及可读存储介质,在区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户将预设兑换交易份额按预设兑换率进行兑换的交易请求后,接收所述第一用户预先为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文;通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。由于能对第一账本下第一用户账户的预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成第一密文,并为所述第二账本计算生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文,基于所述第一密文和第二密文来完成所述第一账本下第一用户账户与所述第二账本下第二用户账户的交易操作,在交易过程中只有第一用户或第二用户能解 密所述第一密文或第二密文以获知交易具体的兑换交易份额数据,区块链上的其他节点无法解读具体的兑换交易份额数据,从而在有效保证区块链技术场景中交易信息安全的情况下,实现多账本转账操作。
附图说明
图1为本申请基于区块链的多账本转账***10较佳实施例的运行环境示意图;
图2为本申请基于区块链的多账本转账方法一实施例的流程示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
本申请提供一种基于区块链的多账本转账***。请参阅图1,是本申请基于区块链的多账本转账***10较佳实施例的运行环境示意图。
在本实施例中,所述的基于区块链的多账本转账***10安装并运行于电子装置1中。该电子装置1可包括,但不仅限于,存储器11、处理器12及网络接口13。图1仅示出了具有组件11-13的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
所述电子装置1通过网络接口13连接网络(图1未标出),获取资讯。所述网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯***(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi、通话网络等无线或有线网络。
所述存储器11为至少一种类型的可读计算机存储介质,所述存储器11在一些实施例中可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘或内存。所述存储器11在另一些实施例中也可以是所述电子装置1的外部存储设备,例如所述电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括所述电子装置1的内部 存储单元也包括外部存储设备。所述存储器11用于存储安装于所述电子装置1的应用软件及各类数据,例如所述基于区块链的多账本转账***10的程序代码等。所述存储器11还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行所述存储器11中存储的程序代码或处理数据,例如执行所述基于区块链的多账本转账***10等。
所述网络接口13可包括无线网络接口或有线网络接口,该网络接口13通常用于在所述电子装置1与其他电子设备之间建立通信连接。
基于区块链的多账本转账***10包括至少一个存储在所述存储器11中的计算机可读指令,该至少一个计算机可读指令可被所述处理器12执行,以实现本申请各实施例。
其中,上述基于区块链的多账本转账***10被所述处理器12执行时实现如下步骤:
步骤S1,若区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户的交易请求,则接收所述第一用户预先加密生成的第一密文;所述交易请求为将预设兑换交易份额按预设兑换率进行兑换的请求,所述第一密文为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文。
本实施例中,首先由区块链中的用户或者机构将自己在每一个账本下每一个用户账户的余额采用第一预设密码公式及对应的余额隐私秘钥进行加密,并将自己在每一个账本下每一个用户账户加密后的余额通过区块链的智能合约写到该区块链的各个节点上的共享资产账本上。例如,采用Pederson Commitment算法,所述第一预设密码公式为a' ij=g^a ij*h^x ij,或者,a' ij=h^a ij*g^x ij,其中,a ij代表第i账本下的第j个用户账户的余额,x ij代表第i账本下的第j个用户账户的余额隐私秘钥,a' ij代表第i账本下的第j个用户账户的加密余额,g和h为离散对数问题中的基,h=g^c,c为未知数,i和j为正整数。
在第一账本(例如,该第一账本可以是人民币账本)下第一用户的第一用户账户发起与第二账本(例如,该第二账本可以是美元账本)下第二用户的第二用户账户将预设兑换交易份额按预设兑换率进行兑换(该预设兑换交易份额和该预设兑换率可在智能合约中提前设置)的交易请求之前,由该第一用户为该预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成第一密文。例如,所述第二预设密码公式为t' 1ij=g^t ij*h^z ij,或者,t' 1ij=h^t ij*g^z ij,其中,t ij代表第i账本下的第j个用户账户的兑换交易份额,z ij代表第i账本下的第j个用户账户的兑换交易份额隐私秘钥,t' 1ij代表第i账本下的第j个第一用户账户的加密兑换交易份额,g和h为基,h是g的一个n次方,n为正整数,i和j为正整数。
步骤S2,通过第一预设兑换计算公式并基于所述预设兑换率和所述第 一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文。
本实施例中,若确认该交易是将该预设兑换交易份额采用预设兑换率e(例如,人民币对美元的兑换率是7,那么e=7)进行兑换,则由智能合约通过第一预设兑换计算公式并基于所述预设兑换率e和第一密文,为第二账本计算出第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并在智能合约里面直接生成第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文。例如,所述第一预设交易兑换计算公式为
Figure PCTCN2018075881-appb-000001
Figure PCTCN2018075881-appb-000002
或者,
Figure PCTCN2018075881-appb-000003
其中,t ij*e代表第i账本下的第j个用户账户的兑换交易份额,z ij*e代表第i账本下的第j个用户账户的兑换交易份额隐私秘钥,t' 2ij代表第i账本下的第j个第二用户账户的加密兑换交易份额,g和h为基,h是g的一个n次方,n为正整数,i和j为正整数。
步骤S3,基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。
本实施例中,可基于所述第一密文和第二密文完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。例如,可将预设兑换交易份额按预设兑换率在所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户之间进行转账交易。还可将第一用户在所述第一账本(例如,该第一账本可以是人民币账本)以及所述第二账本(例如,该第二账本可以是美元账本)下的所有用户账户同时进行更新(例如余额更新),将第二用户在所述第一账本(例如,该第一账本可以是人民币账本)以及所述第二账本(例如,该第二账本可以是美元账本)下的所有用户账户同时进行更新(例如余额更新)。例如,如果甲要与乙用人民币兑换美元,则本实施例中甲和乙的人民币和美元的账户可以实现同时更新,完成区块链技术场景下多账本转账的隐私交易。
与现有技术相比,本实施例在区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户将预设兑换交易份额按预设兑换率进行兑换的交易请求后,接收所述第一用户预先为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文;通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。由于能对第一账本下第一用户账户的预设兑换交易份 额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成第一密文,并为所述第二账本计算生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文,基于所述第一密文和第二密文来完成所述第一账本下第一用户账户与所述第二账本下第二用户账户的交易操作,在交易过程中只有第一用户或第二用户能解密所述第一密文或第二密文以获知交易具体的兑换交易份额数据,区块链上的其他节点无法解读具体的兑换交易份额数据,从而在有效保证区块链技术场景中交易信息安全的情况下,实现多账本转账操作。
在一可选的实施例中,在上述图1的实施例的基础上,所述基于区块链的多账本转账***10被所述处理器12执行实现所述步骤S3时,具体包括:
接收电子签名后的第一密文;所述电子签名后的第一密文为所述第一用户将所述第一密文发给所述第二用户后,若所述第二用户根据所述第一密文确认预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文进行电子签名生成。将所述电子签名后的第一密文写到区块链的各个节点上的共享资产账本上。本实施例中,第一用户将第一密文发给第二用户;若该第二用户确认该预设兑换交易份额和预设兑换率,则该第二用户对该第一密文进行电子签名,并将电子签名后的第一密文通过该区块链的智能合约写到该区块链的各个节点上的共享资产账本上,或者,该第二用户将电子签名后的第一密文送给该第一用户,供该第一用户将电子签名后的第一密文通过该区块链的智能合约写到该区块链的各个节点上的共享资产账本上。
根据所述第一密文更新所述第一账本下第一用户的第一用户账户的余额和所述第一账本下第二用户的第三账户的余额,并根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额。
本实施例中,在该第一账本(例如,该第一账本可以是人民币账本)下第一用户的第一用户账户发起与第二账本(例如,该第二账本可以是美元账本)下第二用户的第二用户账户的预设交易份额和预设兑换价的交易请求后,该区块链的智能合约根据所述第一密文更新该第一账本下第一用户的第一用户账户的余额和该第一账本下第二用户的第三账户的余额,并根据所述第二密文更新该第二账本下第一用户的第四账户的余额和该第二账本下第二用户的第二用户账户的余额。其中,第一用户账户和第四账户都是第一用户的账户,分别为第一用户在该第一账本和该第二账本下的账户,例如,第一用户账户为第一用户的人民币账本账户,第四账户为第一用户的美元账本账户。第二用户账户和第三账户都是第二用户的账户,分别为第二用户在该第二账本和该第一账本下的账户,例如,第二用户账户为第二用户的美元账本账户,第三账户为第二用户的人民币账本账户。
具体地,所述根据所述第一密文更新该第一账本下第一用户的第一用户账户的余额和该第一账本下第二用户的第三账户的余额的步骤包括:
智能合约根据第一预设余额计算公式在该第一账本下第一用户的第一用户账户的余额中扣除所述预设兑换交易份额,计算出该第一账本下第一用户的第一用户账户的第一新余额,并将计算出的第一新余额更新到共享资产账本上。例如,所述第一预设余额计算公式为a 1ij”=a 1ij'/t 1ij'=(g^a 1ij*h^x 1ij)/(g^t ij*h^z ij)=g^(a 1ij–t ij)*h^(x 1ij–z ij),或者,a 1ij”=h^(a 1ij–t ij)*g^(x 1ij–z ij)。其中,a 1ij代表第i账本下的第j个第一用户账户的余额,x 1ij代表第i账本下的第j个第一用户账户的余额隐私秘钥,a 1ij”代表第i账本下的第j个第一用户账户的加密新余额,g和h为基,h是g的一个n次方,i和j为正整数,“a 1ij-t ij”代表第i账本下的第j个第一用户账户的新余额,“x 1ij-z ij”代表第i账本下的第j个第一用户账户的新混淆余额隐私秘钥,t ij代表第i账本下的第j个第一用户账户的交易份额,z ij代表第i账本下的第j个第一用户账户的交易份额隐私秘钥。
智能合约根据第二预设余额计算公式在该第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出该第一账本下第二用户的第三账户的第二新余额,并将计算出的第二新余额更新到共享资产账本上。例如,所述第二预设余额计算公式为a 3ij”=a 3ij'*t 1ij'=(g^a 3ij*h^y 3ij)*(g^t ij*h^z ij)=g^(a 3ij+t ij)*h^(y 3ij+z ij),或者,a 3ij”=h^(a 3ij+t ij)*g^(y 3ij+z ij),a 3ij代表第i账本下的第j个第三账户的余额,Y 3ij代表第i账本下的第j个第三账户的余额隐私秘钥,a 3ij”代表第i账本下的第j个第三账户的加密新余额,g和h为基,h是g的一个n次方,i和j为正整数,“a 3ij+t ij”代表第i账本下的第j个第三账户的新余额,“y 3ij+z ij”代表第i账本下的第j个第三账户的新混淆余额隐私秘钥,t ij代表第i账本下的第j个第三账户的交易份额,z ij代表第i账本下的第j个第三账户的交易份额隐私秘钥。
所述根据所述第二密文更新该第二账本下第一用户的第四账户的余额和该第二账本下第二用户的第二用户账户的余额的步骤包括:
智能合约根据第三预设余额计算公式在该第二账本下第二用户的第二用户账户的余额中扣除所述预设兑换交易份额,计算出该第二账本下第二用户的第二用户账户的第三新余额,并将计算出的第三新余额更新到共享资产账本上。例如,所述第三预设余额计算公式为a 2ij”=a 2ij'/t 2ij'=(g^a 2ij*h^x 2ij)/(g^(t ij*e)*h^(z ij*e))=g^(a 2ij-(t ij*e))*h^(x 2ij-(z ij*e)),或者a 2ij”=h^(a 2ij-(t ij*e))*g^(x 2ij-(z ij*e)),其中,a 2ij代表第i账本下的第j个第二用户账户的余额,x 2ij代表第i账本下的第j个第二用户账户的余额隐私秘钥,a 2ij”代表第i账本下的第j个第二用户账户的加密新余额,g和h为基,h是g的一个n次方,i和j为正整数,“a 2ij-(t ij*e)”代表第i账本下的第j个第二用户账户的新余额,“x 2ij-(z ij*e)”代表第i账本下的第j个第二用户账户的新混淆余额隐私秘钥,“t ij*e”代表第i账本下的第j个第二用户账户的交易份额,“z ij*e”代表第i账本下的第j个第二用户账户的交易份额隐私秘钥。
智能合约根据第四预设余额计算公式在该第二账本下第一用户的第四账户的余额中增加所述预设兑换交易份额,计算出该第二账本下第一用户的 第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。例如,所述第四预设余额计算公式为a 4ij”=a 4ij'*t 2ij'=(g^a 4ij*h^y 4ij)*(g^(t ij*e)*h^(z ij*e))=g^(a 4ij+(t ij*e))*h^(y 4ij+(z ij*e)),或者,a 4ij”=h^(a 4ij+(t ij*e))*g^(y 4ij+(z ij*e)),a 4ij代表第i账本下的第j个第四账户的余额,Y 4ij代表第i账本下的第j个第四账户的余额隐私秘钥,a 4ij”代表第i账本下的第j个第四账户的加密新余额,g和h为基,h是g的一个n次方,i和j为正整数,“a 4ij+(t ij*e)”代表第i账本下的第j个第四账户的新余额,“y 4ij+(z ij*e)”代表第i账本下的第j个第四账户的新混淆余额隐私秘钥,“t ij*e”代表第i账本下的第j个第四账户的交易份额,“z ij*e”代表第i账本下的第j个第四账户的交易份额隐私秘钥。
进一步地,第三预设余额计算公式也可以是在该第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出该第一账本下第二用户的第三账户的第二新余额,并将计算出的第二新余额更新到共享资产账本上。第三预设余额计算公式也可以是在该第二账本下第一用户的第四账户的余额中扣除所述预设兑换交易份额,计算出该第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。
在一可选的实施例中,所述步骤S2替换为如下步骤:
接收电子签名后的第一密文和第二密文,并将电子签名后的第一密文和第二密文写到区块链的各个节点上的共享资产账本上;其中,所述电子签名后的第一密文和第二密文的生成过程如下:
由所述第一用户通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;所述第一用户将所述第一密文和所述第二密文发给所述第二用户;若所述第二用户确认所述预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文和所述第二密文进行电子签名。
本实施例中,若确认为该预设兑换交易份额采用预设兑换率e,则由第一用户通过第一预设兑换计算公式并基于所述预设兑换率e和第一密文,为第二账本计算出第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文。该第一用户将第一密文和第二密文发给第二用户。若该第二用户确认该预设兑换交易份额和预设兑换率,则该第二用户对该第一密文和第二密文进行电子签名,并将电子签名后的第一密文和第二密文通过该区块链的智能合约写到该区块链的各个节点上的共享资产账本上,或者,该第二用户将电子签名后的第一密文和第二密文发送给该第一用户,供该第一用户将电子签名后的第一密文和第二密文通过该区块链的智能合约写到该区块链的各个节点上的共享资产账本上。
进一步地,在上述实施例的基础上,本实施例中还可以依此创建第三个,第四个甚至更多账本的同时转账。例如,如果有第三账本需要实时进行份额兑换,可以通过以下几个步骤实现:(1)、在智能合约上设定第三账本与第一账本或与第二账本的兑换额f;(2)、由智能合约或第一用户通过第一预设兑换计算公式和兑换额f计算出需要在第三账本上对应账户的转账额;(3)、在第三账本上设立第五预设余额计算公式和第六预设余额计算公式,通过智能合约增加并扣除对应账户上的份额。
在一具体的实施方式中,以下以账本1和账本2为例进行举例说明:
步骤一:为每一个账本下每一个用户账户的余额用一种具有加法同态特性的密码公式加密,只有账户的拥有者可以通过自己的“账户隐私秘钥”解密读取自己账户的余额。在此以Pederson Commitment以及ECC(椭圆曲线)为例进行说明,当然,也不限定采用其他如RSA、Diffie-Hellman等。
如可用Pederson Commitment代表每个账户,甲账户要用在账本1的余额换取账户乙在账本2的余额,例如甲用人民币(账本1)跟乙兑换美元(账本2),甲会在账本1把部分人民币余额转给乙,而乙则会在账本2把自己的美元转给甲。对于账本1,定义a1=甲账户账本1余额,a1’=密码混淆后的甲账户账本1余额,x1=甲账户账本1余额隐私秘钥,则甲账户余额为:a1’=g^a1*h^x1(椭圆曲线公式为:a1’=a1G+x1H)。定义b1=乙账户人民币余额,b1’=密码混淆后的乙账户人民币余额,y1=乙账户人民币余额隐私秘钥,则乙账户余额为:b1’=g^b1*h^y1(椭圆曲线公式为:b1’=b1G+y1H)。对于账本2,定义a2=甲账户账本2余额,a2’=密码混淆后的甲账户账本2余额,x2=甲账户账本2余额隐私秘钥,则甲账户余额为:a2’=g^a2*h^x2(椭圆曲线公式为:a2’=a2G+x2H)。定义b2=乙账户人民币余额,b2’=密码混淆后的乙账户人民币余额,y2=乙账户人民币余额隐私秘钥,则乙账户余额为:b2’=g^b2*h^y2(椭圆曲线公式为:b2’=b2G+y2H)。
步骤二:如果甲要用账本1的余额交换乙在账本2的余额,甲会创建两个密文,第一个是用加法同态密文保护的账本1交易份额,第二个是通过加密混淆的账本1与账本2的兑换价(如汇率)。
转账发起方(甲)会自行生成第一密文用的同态隐私秘钥和第二密文用的隐私秘钥并将它们和第一密文与第二密文发给交易对方(乙),并在获得乙认可和对第一密文和第二密文数字签名后将整个交易以及乙方的签名发到区块链网络上(乙方数字签名代表对交易份额与兑换率的认可),如发到区块链的智能合约上。如定义t=账本1交易份额,t’=密码混淆后的交易份额,z=交易份额隐私秘钥,则第一密文(交易份额)为:t’=g^t*h^z(椭圆曲线公式为:t’=tG+zH)。定义e=兑换率。
步骤三:区块链在收到交易请求后,会在更新账本1的同时更新账本2,更新账本2的步骤有如下三个子步骤:
步骤三A,在账本1的甲账户余额中扣除交易份额,并同时在账本1的乙账户余额中增加交易份额。甲账户在账本1新份额:a1”=a1’/t’,a1”=(g^a1*h^x1)/(g^t*h^z),a1”=g^(a1-t)*h^(x1-z)(椭圆曲线公式为:a1”=(a1-t)G+(x1-z)H)。甲账户新余额=a1-t,甲账户新混淆隐私秘钥x1’=(x1-z),乙账户在账本1新份额:b1”=b1’*t’,b1”=(g^b1*h^y1)*(g^t*h^z),b1”=g^(b1+t)*h^(y1+z)(椭圆曲线公式为:b1”=(b1+t)G+(y1+z)H)。乙账户新余额b1’=b1+t,乙账户新混淆隐私秘钥y1’=y1+z。
步骤三B,区块链上的智能合约通过交易额(第一密文)与兑换率算出需要在账本2进行转账操作对应的交易份额。该操作需在不对交易额解密的情况下进行,第一密文(交易份额):t’=g^t*h^z(椭圆曲线公式为:t’=tG+zH),定义交易兑换率:e。
在不解密状态下算出甲账户和乙账户在账本2转让的份额;由于t代表账本1交易份额,e代表兑换率,所以te代表账户甲和账户乙在账本2的转让份额。则账本2交易份额=t2=t*e=te,账本2交易份额(密文)t2’=(g^t*h^z)^e=(g^te*h^ze)(椭圆曲线公式为:t2’=(tG+zH)*e=teG+zeH)。
步骤三C,在账本2的甲账户余额中加上交易份额,并同时在账本2乙账户余额中减去交易份额。甲账户在账本2新份额:a2”=a2’*t2’,a2”=(g^a2*h^x2)*(g^te*h^ze),a2”=g^(a2+te)*h^(x2+ze)(椭圆曲线公式为:a2”=(a2+te)G+(x2+ze)H)。甲账户新余额a2’=a2+te,甲账户新混淆隐私秘钥x2’=x2+ze。乙账户在账本1新份额:b2”=b2’/t’,b2”=(g^b2*h^y2)/(g^te*h^ze),b2”=g^(b2-te)*h^(y2-ze)(椭圆曲线公式为:b2”=(b2-te)G+(y2-ze)H),乙账户新余额b2’=b2-te,乙账户新混淆隐私秘钥y2’=y2-ze。
如图2所示,图2为本申请基于区块链的多账本转账方法一实施例的流程示意图,该基于区块链的多账本转账方法包括以下步骤:
步骤S10,若区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户的交易请求,则接收所述第一用户预先加密生成的第一密文;所述交易请求为将预设兑换交易份额按预设兑换率进行兑换的请求,所述第一密文为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文。
本实施例中,首先由区块链中的用户或者机构将自己在每一个账本下每一个用户账户的余额采用第一预设密码公式及对应的余额隐私秘钥进行加密,并将自己在每一个账本下每一个用户账户加密后的余额通过区块链的智能合约写到该区块链的各个节点上的共享资产账本上。例如,采用Pederson Commitment算法,所述第一预设密码公式为a' ij=g^a ij*h^x ij,或者,a' ij=h^a ij*g^x ij,其中,a ij代表第i账本下的第j个用户账户的余额,x ij代表第i账本下的第j个用户账户的余额隐私秘钥,a' ij代表第i账本下的第j个用户账户的加密余额,g和h为离散对数问题中的基,h=g^c,c为未知数,i和j为正 整数。
在第一账本(例如,该第一账本可以是人民币账本)下第一用户的第一用户账户发起与第二账本(例如,该第二账本可以是美元账本)下第二用户的第二用户账户将预设兑换交易份额按预设兑换率进行兑换(该预设兑换交易份额和该预设兑换率可在智能合约中提前设置)的交易请求之前,由该第一用户为该预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成第一密文。例如,所述第二预设密码公式为t' 1ij=g^t ij*h^z ij,或者,t' 1ij=h^t ij*g^z ij,其中,t ij代表第i账本下的第j个用户账户的兑换交易份额,z ij代表第i账本下的第j个用户账户的兑换交易份额隐私秘钥,t' 1ij代表第i账本下的第j个第一用户账户的加密兑换交易份额,g和h为基,h是g的一个n次方,n为正整数,i和j为正整数。
步骤S20,通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文。
本实施例中,若确认该交易是将该预设兑换交易份额采用预设兑换率e(例如,人民币对美元的兑换率是7,那么e=7)进行兑换,则由智能合约通过第一预设兑换计算公式并基于所述预设兑换率e和第一密文,为第二账本计算出第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并在智能合约里面直接生成第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文。例如,所述第一预设交易兑换计算公式为
Figure PCTCN2018075881-appb-000004
Figure PCTCN2018075881-appb-000005
或者,
Figure PCTCN2018075881-appb-000006
其中,t ij*e代表第i账本下的第j个用户账户的兑换交易份额,z ij*e代表第i账本下的第j个用户账户的兑换交易份额隐私秘钥,t' 2ij代表第i账本下的第j个第二用户账户的加密兑换交易份额,g和h为基,h是g的一个n次方,n为正整数,i和j为正整数。
步骤S30,基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。
本实施例中,可基于所述第一密文和第二密文完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。例如,可将预设兑换交易份额按预设兑换率在所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户之间进行转账交易。还可将第一用户在所述第一账本(例如,该第一账本可以是人民币账本)以及所述第二账本(例如,该第二账本可以是美元账本)下的所有用户账户同时进行更新(例如余额更新),将第二用户在所述第一账本(例如,该第一账本可以是人民币账本)以及所述第二账本(例如,该第二账本可以是美元账本)下的所有用户账户同时进行更新(例如余额更新)。例如,如果甲要与 乙用人民币兑换美元,则本实施例中甲和乙的人民币和美元的账户可以实现同时更新,完成区块链技术场景下多账本转账的隐私交易。
与现有技术相比,本实施例在区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户将预设兑换交易份额按预设兑换率进行兑换的交易请求后,接收所述第一用户预先为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文;通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。由于能对第一账本下第一用户账户的预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成第一密文,并为所述第二账本计算生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文,基于所述第一密文和第二密文来完成所述第一账本下第一用户账户与所述第二账本下第二用户账户的交易操作,在交易过程中只有第一用户或第二用户能解密所述第一密文或第二密文以获知交易具体的兑换交易份额数据,区块链上的其他节点无法解读具体的兑换交易份额数据,从而在有效保证区块链技术场景中交易信息安全的情况下,实现多账本转账操作。
在一可选的实施例中,在上述实施例的基础上,所述步骤S30具体包括:
接收电子签名后的第一密文;所述电子签名后的第一密文为所述第一用户将所述第一密文发给所述第二用户后,若所述第二用户根据所述第一密文确认预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文进行电子签名生成。将所述电子签名后的第一密文写到区块链的各个节点上的共享资产账本上。本实施例中,第一用户将第一密文发给第二用户;若该第二用户确认该预设兑换交易份额和预设兑换率,则该第二用户对该第一密文进行电子签名,并将电子签名后的第一密文通过该区块链的智能合约写到该区块链的各个节点上的共享资产账本上,或者,该第二用户将电子签名后的第一密文送给该第一用户,供该第一用户将电子签名后的第一密文通过该区块链的智能合约写到该区块链的各个节点上的共享资产账本上。
根据所述第一密文更新所述第一账本下第一用户的第一用户账户的余额和所述第一账本下第二用户的第三账户的余额,并根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额。
本实施例中,在该第一账本(例如,该第一账本可以是人民币账本)下第一用户的第一用户账户发起与第二账本(例如,该第二账本可以是美元账本)下第二用户的第二用户账户的预设交易份额和预设兑换价的交易请求 后,该区块链的智能合约根据所述第一密文更新该第一账本下第一用户的第一用户账户的余额和该第一账本下第二用户的第三账户的余额,并根据所述第二密文更新该第二账本下第一用户的第四账户的余额和该第二账本下第二用户的第二用户账户的余额。其中,第一用户账户和第四账户都是第一用户的账户,分别为第一用户在该第一账本和该第二账本下的账户,例如,第一用户账户为第一用户的人民币账本账户,第四账户为第一用户的美元账本账户。第二用户账户和第三账户都是第二用户的账户,分别为第二用户在该第二账本和该第一账本下的账户,例如,第二用户账户为第二用户的美元账本账户,第三账户为第二用户的人民币账本账户。
具体地,所述根据所述第一密文更新该第一账本下第一用户的第一用户账户的余额和该第一账本下第二用户的第三账户的余额的步骤包括:
智能合约根据第一预设余额计算公式在该第一账本下第一用户的第一用户账户的余额中扣除所述预设兑换交易份额,计算出该第一账本下第一用户的第一用户账户的第一新余额,并将计算出的第一新余额更新到共享资产账本上。例如,所述第一预设余额计算公式为a 1ij”=a 1ij'/t 1ij'=(g^a 1ij*h^x 1ij)/(g^t ij*h^z ij)=g^(a 1ij–t ij)*h^(x 1ij–z ij),或者,a 1ij”=h^(a 1ij–t ij)*g^(x 1ij–z ij)。其中,a 1ij代表第i账本下的第j个第一用户账户的余额,x 1ij代表第i账本下的第j个第一用户账户的余额隐私秘钥,a 1ij”代表第i账本下的第j个第一用户账户的加密新余额,g和h为基,h是g的一个n次方,i和j为正整数,“a 1ij-t ij”代表第i账本下的第j个第一用户账户的新余额,“x 1ij-z ij”代表第i账本下的第j个第一用户账户的新混淆余额隐私秘钥,t ij代表第i账本下的第j个第一用户账户的交易份额,z ij代表第i账本下的第j个第一用户账户的交易份额隐私秘钥。
智能合约根据第二预设余额计算公式在该第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出该第一账本下第二用户的第三账户的第二新余额,并将计算出的第二新余额更新到共享资产账本上。例如,所述第二预设余额计算公式为a 3ij”=a 3ij'*t 1ij'=(g^a 3ij*h^y 3ij)*(g^t ij*h^z ij)=g^(a 3ij+t ij)*h^(y 3ij+z ij),或者,a 3ij”=h^(a 3ij+t ij)*g^(y 3ij+z ij),a 3ij代表第i账本下的第j个第三账户的余额,Y 3ij代表第i账本下的第j个第三账户的余额隐私秘钥,a 3ij”代表第i账本下的第j个第三账户的加密新余额,g和h为基,h是g的一个n次方,i和j为正整数,“a 3ij+t ij”代表第i账本下的第j个第三账户的新余额,“y 3ij+z ij”代表第i账本下的第j个第三账户的新混淆余额隐私秘钥,t ij代表第i账本下的第j个第三账户的交易份额,z ij代表第i账本下的第j个第三账户的交易份额隐私秘钥。
所述根据所述第二密文更新该第二账本下第一用户的第四账户的余额和该第二账本下第二用户的第二用户账户的余额的步骤包括:
智能合约根据第三预设余额计算公式在该第二账本下第二用户的第二用户账户的余额中扣除所述预设兑换交易份额,计算出该第二账本下第二用户的第二用户账户的第三新余额,并将计算出的第三新余额更新到共享资产 账本上。例如,所述第三预设余额计算公式为a 2ij”=a 2ij'/t 2ij'=(g^a 2ij*h^x 2ij)/(g^(t ij*e)*h^(z ij*e))=g^(a 2ij-(t ij*e))*h^(x 2ij-(z ij*e)),或者a 2ij”=h^(a 2ij-(t ij*e))*g^(x 2ij-(z ij*e)),其中,a 2ij代表第i账本下的第j个第二用户账户的余额,x 2ij代表第i账本下的第j个第二用户账户的余额隐私秘钥,a 2ij”代表第i账本下的第j个第二用户账户的加密新余额,g和h为基,h是g的一个n次方,i和j为正整数,“a 2ij-(t ij*e)”代表第i账本下的第j个第二用户账户的新余额,“x 2ij-(z ij*e)”代表第i账本下的第j个第二用户账户的新混淆余额隐私秘钥,“t ij*e”代表第i账本下的第j个第二用户账户的交易份额,“z ij*e”代表第i账本下的第j个第二用户账户的交易份额隐私秘钥。
智能合约根据第四预设余额计算公式在该第二账本下第一用户的第四账户的余额中增加所述预设兑换交易份额,计算出该第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。例如,所述第四预设余额计算公式为a 4ij”=a 4ij'*t 2ij'=(g^a 4ij*h^y 4ij)*(g^(t ij*e)*h^(z ij*e))=g^(a 4ij+(t ij*e))*h^(y 4ij+(z ij*e)),或者,a 4ij”=h^(a 4ij+(t ij*e))*g^(y 4ij+(z ij*e)),a 4ij代表第i账本下的第j个第四账户的余额,Y 4ij代表第i账本下的第j个第四账户的余额隐私秘钥,a 4ij”代表第i账本下的第j个第四账户的加密新余额,g和h为基,h是g的一个n次方,i和j为正整数,“a 4ij+(t ij*e)”代表第i账本下的第j个第四账户的新余额,“y 4ij+(z ij*e)”代表第i账本下的第j个第四账户的新混淆余额隐私秘钥,“t ij*e”代表第i账本下的第j个第四账户的交易份额,“z ij*e”代表第i账本下的第j个第四账户的交易份额隐私秘钥。
进一步地,第三预设余额计算公式也可以是在该第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出该第一账本下第二用户的第三账户的第二新余额,并将计算出的第二新余额更新到共享资产账本上。第三预设余额计算公式也可以是在该第二账本下第一用户的第四账户的余额中扣除所述预设兑换交易份额,计算出该第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。
在一可选的实施例中,所述步骤S20可替换为如下步骤:
接收电子签名后的第一密文和第二密文,并将电子签名后的第一密文和第二密文写到区块链的各个节点上的共享资产账本上;其中,所述电子签名后的第一密文和第二密文的生成过程如下:
由所述第一用户通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;所述第一用户将所述第一密文和所述第二密文发给所述第二用户;若所述第二用户确认所述预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文和所述第二密文进行电子签名。
本实施例中,若确认为该预设兑换交易份额采用预设兑换率e,则由第一用户通过第一预设兑换计算公式并基于所述预设兑换率e和第一密文,为第二账本计算出第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文。该第一用户将第一密文和第二密文发给第二用户。若该第二用户确认该预设兑换交易份额和预设兑换率,则该第二用户对该第一密文和第二密文进行电子签名,并将电子签名后的第一密文和第二密文通过该区块链的智能合约写到该区块链的各个节点上的共享资产账本上,或者,该第二用户将电子签名后的第一密文和第二密文发送给该第一用户,供该第一用户将电子签名后的第一密文和第二密文通过该区块链的智能合约写到该区块链的各个节点上的共享资产账本上。
进一步地,在上述实施例的基础上,本实施例中还可以依此创建第三个,第四个甚至更多账本的同时转账。例如,如果有第三账本需要实时进行份额兑换,可以通过以下几个步骤实现:(1)、在智能合约上设定第三账本与第一账本或与第二账本的兑换额f;(2)、由智能合约或第一用户通过第一预设兑换计算公式和兑换额f计算出需要在第三账本上对应账户的转账额;(3)、在第三账本上设立第五预设余额计算公式和第六预设余额计算公式,通过智能合约增加并扣除对应账户上的份额。
在一具体的实施方式中,以下以账本1和账本2为例进行举例说明:
步骤一:为每一个账本下每一个用户账户的余额用一种具有加法同态特性的密码公式加密,只有账户的拥有者可以通过自己的“账户隐私秘钥”解密读取自己账户的余额。在此以Pederson Commitment以及ECC(椭圆曲线)为例进行说明,当然,也不限定采用其他如RSA、Diffie-Hellman等。
如可用Pederson Commitment代表每个账户,甲账户要用在账本1的余额换取账户乙在账本2的余额,例如甲用人民币(账本1)跟乙兑换美元(账本2),甲会在账本1把部分人民币余额转给乙,而乙则会在账本2把自己的美元转给甲。对于账本1,定义a1=甲账户账本1余额,a1’=密码混淆后的甲账户账本1余额,x1=甲账户账本1余额隐私秘钥,则甲账户余额为:a1’=g^a1*h^x1(椭圆曲线公式为:a1’=a1G+x1H)。定义b1=乙账户人民币余额,b1’=密码混淆后的乙账户人民币余额,y1=乙账户人民币余额隐私秘钥,则乙账户余额为:b1’=g^b1*h^y1(椭圆曲线公式为:b1’=b1G+y1H)。对于账本2,定义a2=甲账户账本2余额,a2’=密码混淆后的甲账户账本2余额,x2=甲账户账本2余额隐私秘钥,则甲账户余额为:a2’=g^a2*h^x2(椭圆曲线公式为:a2’=a2G+x2H)。定义b2=乙账户人民币余额,b2’=密码混淆后的乙账户人民币余额,y2=乙账户人民币余额隐私秘钥,则乙账户余额为:b2’=g^b2*h^y2(椭圆曲线公式为:b2’=b2G+y2H)。
步骤二:如果甲要用账本1的余额交换乙在账本2的余额,甲会创建两 个密文,第一个是用加法同态密文保护的账本1交易份额,第二个是通过加密混淆的账本1与账本2的兑换价(如汇率)。
转账发起方(甲)会自行生成第一密文用的同态隐私秘钥和第二密文用的隐私秘钥并将它们和第一密文与第二密文发给交易对方(乙),并在获得乙认可和对第一密文和第二密文数字签名后将整个交易以及乙方的签名发到区块链网络上(乙方数字签名代表对交易份额与兑换率的认可),如发到区块链的智能合约上。如定义t=账本1交易份额,t’=密码混淆后的交易份额,z=交易份额隐私秘钥,则第一密文(交易份额)为:t’=g^t*h^z(椭圆曲线公式为:t’=tG+zH)。定义e=兑换率。
步骤三:区块链在收到交易请求后,会在更新账本1的同时更新账本2,更新账本2的步骤有如下三个子步骤:
步骤三A,在账本1的甲账户余额中扣除交易份额,并同时在账本1的乙账户余额中增加交易份额。甲账户在账本1新份额:a1”=a1’/t’,a1”=(g^a1*h^x1)/(g^t*h^z),a1”=g^(a1-t)*h^(x1-z)(椭圆曲线公式为:a1”=(a1-t)G+(x1-z)H)。甲账户新余额=a1-t,甲账户新混淆隐私秘钥x1’=(x1-z),乙账户在账本1新份额:b1”=b1’*t’,b1”=(g^b1*h^y1)*(g^t*h^z),b1”=g^(b1+t)*h^(y1+z)(椭圆曲线公式为:b1”=(b1+t)G+(y1+z)H)。乙账户新余额b1’=b1+t,乙账户新混淆隐私秘钥y1’=y1+z。
步骤三B,区块链上的智能合约通过交易额(第一密文)与兑换率算出需要在账本2进行转账操作对应的交易份额。该操作需在不对交易额解密的情况下进行,第一密文(交易份额):t’=g^t*h^z(椭圆曲线公式为:t’=tG+zH),定义交易兑换率:e。
在不解密状态下算出甲账户和乙账户在账本2转让的份额;由于t代表账本1交易份额,e代表兑换率,所以te代表账户甲和账户乙在账本2的转让份额。则账本2交易份额=t2=t*e=te,账本2交易份额(密文)t2’=(g^t*h^z)^e=(g^te*h^ze)(椭圆曲线公式为:t2’=(tG+zH)*e=teG+zeH)。
步骤三C,在账本2的甲账户余额中加上交易份额,并同时在账本2乙账户余额中减去交易份额。甲账户在账本2新份额:a2”=a2’*t2’,a2”=(g^a2*h^x2)*(g^te*h^ze),a2”=g^(a2+te)*h^(x2+ze)(椭圆曲线公式为:a2”=(a2+te)G+(x2+ze)H)。甲账户新余额a2’=a2+te,甲账户新混淆隐私秘钥x2’=x2+ze。乙账户在账本1新份额:b2”=b2’/t’,b2”=(g^b2*h^y2)/(g^te*h^ze),b2”=g^(b2-te)*h^(y2-ze)(椭圆曲线公式为:b2”=(b2-te)G+(y2-ze)H),乙账户新余额b2’=b2-te,乙账户新混淆隐私秘钥y2’=y2-ze。
此外,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有基于区块链的多账本转账***,所述基于区块链的多账本转账***可被至少一个处理器执行,以使所述至少一个处理器执行如上述实施例中的基于区块链的多账本转账方法的步骤,该基于区块链的多账本转账方法的步骤S10、S20、S30等具体实施过程如上文所述,在此不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上参照附图说明了本申请的优选实施例,并非因此局限本申请的权利范围。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。另外,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本领域技术人员不脱离本申请的范围和实质,可以有多种变型方案实现本申请,比如作为一个实施例的特征可用于另一实施例而得到又一实施例。凡在运用本申请的技术构思之内所作的任何修改、等同替换和改进,均应在本申请的权利范围之内。

Claims (20)

  1. 一种基于区块链的多账本转账方法,应用于电子装置,其特征在于,所述基于区块链的多账本转账方法包括:
    A、若区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户的交易请求,则接收所述第一用户预先加密生成的第一密文;所述交易请求为将预设兑换交易份额按预设兑换率进行兑换的请求,所述第一密文为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文;
    B、通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;
    C、基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。
  2. 如权利要求1所述的基于区块链的多账本转账方法,其特征在于,所述步骤C包括:
    接收电子签名后的第一密文;所述电子签名后的第一密文为所述第一用户将所述第一密文发给所述第二用户后,若所述第二用户根据所述第一密文确认预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文进行电子签名生成;
    将所述电子签名后的第一密文写到区块链的各个节点上的共享资产账本上;
    根据所述第一密文更新所述第一账本下第一用户的第一用户账户的余额和所述第一账本下第二用户的第三账户的余额,并根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额。
  3. 如权利要求2所述的基于区块链的多账本转账方法,其特征在于,所述根据所述第一密文更新所述第一账本下第一用户的第一用户账户的余额和所述第一账本下第二用户的第三账户的余额的步骤包括:
    根据第一预设余额计算公式在所述第一账本下第一用户的第一用户账户的余额中扣除所述预设兑换交易份额,计算出所述第一账本下第一用户的第一用户账户的第一新余额,并将计算出的第一新余额更新到共享资产账本上;
    根据第二预设余额计算公式在所述第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出所述第一账本下第二用户的第三账户的第二新余额,并将计算出的第二新余额更新到共享资产账本上。
  4. 如权利要求2所述的基于区块链的多账本转账方法,其特征在于,所述根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额的步骤包括:
    根据第三预设余额计算公式在所述第二账本下第二用户的第二用户账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第二用户的第二用户账户的第三新余额,并将计算出的第三新余额更新到共享资产账本上;
    根据第四预设余额计算公式在所述第二账本下第一用户的第四账户的余额中增加所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。
  5. 如权利要求3所述的基于区块链的多账本转账方法,其特征在于,所述根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额的步骤包括:
    根据第三预设余额计算公式在所述第二账本下第二用户的第二用户账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第二用户的第二用户账户的第三新余额,并将计算出的第三新余额更新到共享资产账本上;
    根据第四预设余额计算公式在所述第二账本下第一用户的第四账户的余额中增加所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。
  6. 如权利要求4或5所述的基于区块链的多账本转账方法,其特征在于,所述第三预设余额计算公式还用于在所述第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出所述第一账本下第二用户的第三账户的第二新余额;或者,所述第三预设余额计算公式还用于在所述第二账本下第一用户的第四账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额。
  7. 如权利要求1所述的基于区块链的多账本转账方法,其特征在于,所述步骤B替换为如下步骤:
    接收电子签名后的第一密文和第二密文,并将电子签名后的第一密文和第二密文写到区块链的各个节点上的共享资产账本上;其中,所述电子签名后的第一密文和第二密文的生成过程如下:
    由所述第一用户通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;所述第一用户将所述第一密文和所述第二密文发给所述第二用户;若所述第二用户确认所述预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文和所述第二密文进行电子签名。
  8. 一种电子装置,其特征在于,所述电子装置包括存储器、处理器,所 述存储器上存储有可在所述处理器上运行的基于区块链的多账本转账***,所述基于区块链的多账本转账***被所述处理器执行时实现如下步骤:
    若区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户的交易请求,则接收所述第一用户预先加密生成的第一密文;所述交易请求为将预设兑换交易份额按预设兑换率进行兑换的请求,所述第一密文为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文;
    通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;
    基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。
  9. 如权利要求8所述的电子装置,其特征在于,所述基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易的步骤包括:
    接收电子签名后的第一密文;所述电子签名后的第一密文为所述第一用户将所述第一密文发给所述第二用户后,若所述第二用户根据所述第一密文确认预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文进行电子签名生成;
    将所述电子签名后的第一密文写到区块链的各个节点上的共享资产账本上;
    根据所述第一密文更新所述第一账本下第一用户的第一用户账户的余额和所述第一账本下第二用户的第三账户的余额,并根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额。
  10. 如权利要求9所述的电子装置,其特征在于,所述根据所述第一密文更新所述第一账本下第一用户的第一用户账户的余额和所述第一账本下第二用户的第三账户的余额的步骤包括:
    根据第一预设余额计算公式在所述第一账本下第一用户的第一用户账户的余额中扣除所述预设兑换交易份额,计算出所述第一账本下第一用户的第一用户账户的第一新余额,并将计算出的第一新余额更新到共享资产账本上;
    根据第二预设余额计算公式在所述第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出所述第一账本下第二用户的第三账户的第二新余额,并将计算出的第二新余额更新到共享资产账本上。
  11. 如权利要求9所述的电子装置,其特征在于,所述根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额的步骤包括:
    根据第三预设余额计算公式在所述第二账本下第二用户的第二用户账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第二用户的第二用户账户的第三新余额,并将计算出的第三新余额更新到共享资产账本上;
    根据第四预设余额计算公式在所述第二账本下第一用户的第四账户的余额中增加所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。
  12. 如权利要求10所述的电子装置,其特征在于,所述根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额的步骤包括:
    根据第三预设余额计算公式在所述第二账本下第二用户的第二用户账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第二用户的第二用户账户的第三新余额,并将计算出的第三新余额更新到共享资产账本上;
    根据第四预设余额计算公式在所述第二账本下第一用户的第四账户的余额中增加所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。
  13. 如权利要求11或12所述的电子装置,其特征在于,所述第三预设余额计算公式还用于在所述第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出所述第一账本下第二用户的第三账户的第二新余额;或者,所述第三预设余额计算公式还用于在所述第二账本下第一用户的第四账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额。
  14. 如权利要求8所述的电子装置,其特征在于,所述通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文的步骤可替换为如下步骤:
    接收电子签名后的第一密文和第二密文,并将电子签名后的第一密文和第二密文写到区块链的各个节点上的共享资产账本上;其中,所述电子签名后的第一密文和第二密文的生成过程如下:
    由所述第一用户通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;所述第一用户将所述第一密文和所述第二密文发给所述第二用户;若所述第二用户确认所述预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文和所述第二密文进行电子签名。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质 上存储有基于区块链的多账本转账***,所述基于区块链的多账本转账***被处理器执行时实现如下步骤:
    若区块链中第一账本下第一用户的第一用户账户发起与第二账本下第二用户的第二用户账户的交易请求,则接收所述第一用户预先加密生成的第一密文;所述交易请求为将预设兑换交易份额按预设兑换率进行兑换的请求,所述第一密文为预设兑换交易份额采用第二预设密码公式及对应的交易份额隐私秘钥进行加密生成的第一密文;
    通过第一预设兑换计算公式并基于所述预设兑换率和所述第一密文,为所述第二账本计算出所述第二账本的兑换交易份额、加密兑换交易份额及对应的交易份额隐私秘钥,并生成所述第二账本的加密兑换交易份额及对应的交易份额隐私秘钥的第二密文;
    基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述基于所述第一密文和第二密文,并按预设规则完成所述第一账本下第一用户的第一用户账户与所述第二账本下第二用户的第二用户账户的交易的步骤包括:
    接收电子签名后的第一密文;所述电子签名后的第一密文为所述第一用户将所述第一密文发给所述第二用户后,若所述第二用户根据所述第一密文确认预设兑换交易份额和预设兑换率,则所述第二用户对所述第一密文进行电子签名生成;
    将所述电子签名后的第一密文写到区块链的各个节点上的共享资产账本上;
    根据所述第一密文更新所述第一账本下第一用户的第一用户账户的余额和所述第一账本下第二用户的第三账户的余额,并根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述根据所述第一密文更新所述第一账本下第一用户的第一用户账户的余额和所述第一账本下第二用户的第三账户的余额的步骤包括:
    根据第一预设余额计算公式在所述第一账本下第一用户的第一用户账户的余额中扣除所述预设兑换交易份额,计算出所述第一账本下第一用户的第一用户账户的第一新余额,并将计算出的第一新余额更新到共享资产账本上;
    根据第二预设余额计算公式在所述第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出所述第一账本下第二用户的第三账户的第二新余额,并将计算出的第二新余额更新到共享资产账本上。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额的步骤包括:
    根据第三预设余额计算公式在所述第二账本下第二用户的第二用户账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第二用户的第二用户账户的第三新余额,并将计算出的第三新余额更新到共享资产账本上;
    根据第四预设余额计算公式在所述第二账本下第一用户的第四账户的余额中增加所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。
  19. 如权利要求17所述的计算机可读存储介质,其特征在于,所述根据所述第二密文更新所述第二账本下第二用户的第二用户账户的余额和所述第二账本下第一用户的第四账户的余额的步骤包括:
    根据第三预设余额计算公式在所述第二账本下第二用户的第二用户账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第二用户的第二用户账户的第三新余额,并将计算出的第三新余额更新到共享资产账本上;
    根据第四预设余额计算公式在所述第二账本下第一用户的第四账户的余额中增加所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额,并将计算出的第四新余额更新到共享资产账本上。
  20. 如权利要求18或19所述的计算机可读存储介质,其特征在于,所述第三预设余额计算公式还用于在所述第一账本下第二用户的第三账户的余额中增加所述预设兑换交易份额,计算出所述第一账本下第二用户的第三账户的第二新余额;或者,所述第三预设余额计算公式还用于在所述第二账本下第一用户的第四账户的余额中扣除所述预设兑换交易份额,计算出所述第二账本下第一用户的第四账户的第四新余额。
PCT/CN2018/075881 2017-12-20 2018-02-08 基于区块链的多账本转账方法、电子装置及可读存储介质 WO2019119632A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711382545.3 2017-12-20
CN201711382545.3A CN108241979B (zh) 2017-12-20 2017-12-20 基于区块链的多账本转账方法、电子装置及可读存储介质

Publications (1)

Publication Number Publication Date
WO2019119632A1 true WO2019119632A1 (zh) 2019-06-27

Family

ID=62700289

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/075881 WO2019119632A1 (zh) 2017-12-20 2018-02-08 基于区块链的多账本转账方法、电子装置及可读存储介质

Country Status (2)

Country Link
CN (1) CN108241979B (zh)
WO (1) WO2019119632A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11943360B2 (en) 2021-06-22 2024-03-26 International Business Machines Corporation Generative cryptogram for blockchain data management

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109003081B (zh) * 2018-07-13 2021-11-02 北京创世智链信息技术研究院 一种基于区块链的交易方法、***及存储介质
CN109102286B (zh) * 2018-08-02 2023-04-07 平安科技(深圳)有限公司 跨账本交易方法及装置
CN109257336B (zh) * 2018-08-24 2021-03-16 维沃移动通信有限公司 一种基于区块链的密码信息处理方法、终端设备
CN110197433B (zh) 2018-10-25 2021-07-27 腾讯科技(深圳)有限公司 数值转移方法、装置及***
CN110009316A (zh) * 2018-12-14 2019-07-12 阿里巴巴集团控股有限公司 基于区块链的事件处理方法及装置、电子设备
CN110033363B (zh) * 2018-12-14 2024-01-23 创新先进技术有限公司 基于区块链的事件处理方法及装置、电子设备
CN110033370B (zh) * 2019-02-01 2020-04-24 阿里巴巴集团控股有限公司 账户创建方法及装置、电子设备、存储介质
WO2019120331A2 (en) * 2019-04-12 2019-06-27 Alibaba Group Holding Limited Retrieving values of digital tickets using smart contracts in blockchain networks
CN110505046B (zh) * 2019-07-29 2020-11-24 深圳壹账通智能科技有限公司 多数据提供方加密数据跨平台零知识校验方法、装置及介质
CN113570373B (zh) * 2021-09-23 2022-02-11 北京理工大学 一种基于区块链的可追责交易方法及***

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105681301A (zh) * 2016-01-16 2016-06-15 杭州复杂美科技有限公司 区块链上的结算方法
WO2017000061A1 (en) * 2015-07-02 2017-01-05 Royal Bank Of Canada Secure processing of electronic payments
CN106960388A (zh) * 2017-03-01 2017-07-18 中钞***产业发展有限公司北京智能卡技术研究院 跨区块链的数字资产流转的方法和装置
CN107077675A (zh) * 2016-12-30 2017-08-18 深圳前海达闼云端智能科技有限公司 基于区块链的货币管理方法和***
CN107240001A (zh) * 2017-06-06 2017-10-10 北京汇通金财信息科技有限公司 一种数字资产的交易方法和***

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105719185B (zh) * 2016-01-22 2019-02-15 杭州复杂美科技有限公司 区块链的数据对比及共识方法
CN106549749B (zh) * 2016-12-06 2019-12-24 杭州趣链科技有限公司 一种基于加法同态加密的区块链隐私保护方法
CN107133796A (zh) * 2017-04-18 2017-09-05 杭州复杂美科技有限公司 区块链跨链汇兑方法
CN107358424B (zh) * 2017-06-26 2020-09-29 中国人民银行数字货币研究所 一种基于数字货币的交易方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017000061A1 (en) * 2015-07-02 2017-01-05 Royal Bank Of Canada Secure processing of electronic payments
CN105681301A (zh) * 2016-01-16 2016-06-15 杭州复杂美科技有限公司 区块链上的结算方法
CN107077675A (zh) * 2016-12-30 2017-08-18 深圳前海达闼云端智能科技有限公司 基于区块链的货币管理方法和***
CN106960388A (zh) * 2017-03-01 2017-07-18 中钞***产业发展有限公司北京智能卡技术研究院 跨区块链的数字资产流转的方法和装置
CN107240001A (zh) * 2017-06-06 2017-10-10 北京汇通金财信息科技有限公司 一种数字资产的交易方法和***

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11943360B2 (en) 2021-06-22 2024-03-26 International Business Machines Corporation Generative cryptogram for blockchain data management

Also Published As

Publication number Publication date
CN108241979B (zh) 2021-03-16
CN108241979A (zh) 2018-07-03

Similar Documents

Publication Publication Date Title
WO2019119632A1 (zh) 基于区块链的多账本转账方法、电子装置及可读存储介质
WO2019144612A1 (zh) 基于区块链的零知识多账本兑换转账方法、装置及存储介质
JP6908700B2 (ja) 情報保護のためのシステム及び方法
JP6714156B2 (ja) 情報保護のためのシステム及び方法
CN111783114B (zh) 区块链交易方法及装置、电子设备
JP6483827B2 (ja) 契約合意方法、合意検証方法、契約合意システム、合意検証装置、契約合意装置、契約合意プログラム及び合意検証プログラム
WO2018137316A1 (zh) 基于区块链的安全交易方法、电子装置、***及存储介质
KR101984254B1 (ko) 블록체인 네트워크를 구성하는 노드 장치 및 그 노드 장치의 동작 방법
TW202013929A (zh) 基於區塊鏈的交易方法、裝置和匯出方設備
KR20200066257A (ko) 정보 보호를 위한 시스템 및 방법
TW202014950A (zh) 基於區塊鏈的交易方法、裝置和匯出方設備
KR20200066260A (ko) 정보 보호를 위한 시스템 및 방법
CN111768304A (zh) 区块链交易方法及装置、电子设备
CN107358440B (zh) 数字货币定制追踪的方法和***
KR101976027B1 (ko) 암호 화폐의 전자 지갑 생성 및 백업 방법 및 이를 이용한 단말 장치와 서버
WO2020051710A1 (en) System and process for managing digitized security tokens
US11151553B2 (en) Time and geographically restrained blockchain services
US11436597B1 (en) Biometrics-based e-signatures for pre-authorization and acceptance transfer
US20220138707A1 (en) Methods, systems, and devices for on-chain stable transaction in decentralized cryptocurrencies
CN111291122B (zh) 基于区块链的竞标方法及装置
TWI734729B (zh) 實現電子簽章的方法、裝置及簽章伺服器
CN112352399A (zh) 用于使用物理上不可克隆函数在板上生成密码密钥的方法
CN111861462B (zh) 基于区块链的金融产品交易方法及装置
CN111523892B (zh) 一种区块链的跨链交易方法及装置
CN114514550A (zh) 将请求分区成区块链的交易

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.10.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18892853

Country of ref document: EP

Kind code of ref document: A1