WO2022121624A1 - 一种区块链的三方转账方法及装置 - Google Patents

一种区块链的三方转账方法及装置 Download PDF

Info

Publication number
WO2022121624A1
WO2022121624A1 PCT/CN2021/130447 CN2021130447W WO2022121624A1 WO 2022121624 A1 WO2022121624 A1 WO 2022121624A1 CN 2021130447 W CN2021130447 W CN 2021130447W WO 2022121624 A1 WO2022121624 A1 WO 2022121624A1
Authority
WO
WIPO (PCT)
Prior art keywords
hash value
signature
participant
transaction information
public key
Prior art date
Application number
PCT/CN2021/130447
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 WO2022121624A1 publication Critical patent/WO2022121624A1/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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • 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/3823Payment protocols; Details thereof insuring higher security of transaction combining multiple encryption tools for a transaction
    • 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/401Transaction verification
    • G06Q20/4014Identity check for transactions
    • 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

Definitions

  • the invention relates to the field of blockchain (blockchain) in the field of financial technology (Fintech), in particular to a method and device for three-party transfer of blockchain.
  • the present invention provides a blockchain three-party transfer method and device, which solves the problem of low three-party transfer efficiency in the prior art.
  • the present invention provides a blockchain three-party transfer method, comprising: during the opening of the three-party payment channel, the first participant sends a first signature for the first transaction information to the second participant and the third participant
  • the first transaction information is transaction information initiated by the first participant; the first transaction information includes first balance information; the first balance information records the balance information of the three participants ;
  • the first participant obtains a second signature for the first transaction information from the second participant and a third signature for the first transaction information from the third participant; the first A participant obtains a threshold signature according to the first signature, the second signature and the third signature;
  • the first transaction information is the transaction information for returning assets, after verifying that the threshold signature passes, the first participant calls the first transaction information of the blockchain at least according to the threshold signature and the first transaction information.
  • a smart contract the first smart contract is used to determine that the three participants agree with the first transaction information, so that the blockchain will match the first participant in the first balance information
  • the assets of the returned amount are retrieved from the three-party payment channel.
  • the first participant obtains the threshold signature by interacting with the second participant and the third participant to sign, and at least according to the threshold signature and the first transaction information, the call area is
  • the first smart contract of the blockchain because it is a threshold signature, the blockchain only needs to verify the threshold signature to determine that all three participants agree with the first transaction information, so that the blockchain can transfer the first participant.
  • the assets corresponding to the returned amount in the first balance information are retrieved from the three-party payment channel. This process only requires the first participant who retrieves the assets to call the first smart contract of the blockchain once, which is valid The number of interactions between the participants and the blockchain is reduced.
  • the first participant obtains the first signature in the following manner:
  • the first participant obtains the first signature according to the first hash value, the first transaction information, the first total hash value, the first public key coefficient, the multi-signature total public key and the preset hash algorithm;
  • the first hash value is a hash value generated by the first participant for the first transaction information; the first total hash value is a hash value generated by the three participants for the first transaction information
  • the first public key coefficient is the public key coefficient of the first participant;
  • the multi-signature total public key is the total public key agreed upon by the three participants.
  • the first hash value, the first total hash value, the first public key coefficient, and the multi-signature total public key jointly participate in the generation of the first signature. Therefore, in the process of generating the first signature, both the The information generated by the first participant alone and the information jointly generated by the three parties increases the credibility of the first signature.
  • the first participant obtains the first hash value and the first total hash value in the following manner:
  • the first participant generates a first random number for the first transaction information, and obtains the first hash value according to the first random number and the preset hash algorithm;
  • the first participant sends the first transaction information to the second participant and the third participant;
  • the first party obtains a second hash value for the first transaction information from the second party and a third hash value for the first transaction information from the third party ;
  • the second hash value is obtained according to the second random number and the preset hash algorithm;
  • the third hash value is obtained according to the third random number and the preset hash algorithm;
  • the first participant obtains the first total hash value according to the first hash value, the second hash value and the third hash value.
  • the randomness of the first hash value is increased by the first random number, and the second hash value and the third hash value are also obtained by the random number, so that the combination makes the first total hash value.
  • the value is more random and more difficult to forge.
  • the first participant obtains the value according to the first hash value, the first transaction information, the first total hash value, the first public key coefficient, the multi-signature total public key, and the preset hash algorithm.
  • First signature including:
  • the first transaction information the first total hash value, the multi-signature total public key, the first public key coefficient and the Suppose a hash algorithm, based on a preset elliptic curve algorithm, to obtain the first signature;
  • the first participant obtains a threshold signature according to the first signature, the second signature and the third signature, including:
  • the first participant obtains the threshold signature based on a preset operation according to the first signature, the second signature and the third signature;
  • the first participant verifies the threshold signature in the following manner:
  • the first participant determines the threshold signature, the preset generator, the first total hash value, the first transaction information, and the multi-signature total public key. If a preset relationship is satisfied with the preset hash algorithm, it is determined that the threshold signature verification is passed; the preset relationship is set according to the preset elliptic curve algorithm and the preset operation.
  • the construction method and verification method of the threshold signature are set through the preset elliptic curve algorithm and the preset operation. Since the elliptic curve algorithm has the property of zero-knowledge proof, the confidentiality of private information is stronger.
  • the multi-signature total public key is obtained in the following manner:
  • a public key hash is obtained according to the first public key of the first participant, the second public key of the second participant, the third public key of the third participant and the preset hash algorithm value;
  • the multi-signature total public key is obtained according to the first public key coefficient, the second public key coefficient and the third public key coefficient.
  • the public key hash value is bound to the public keys of the three participants, and the public key coefficients of each participant are generated according to the public key hash value.
  • the public key coefficients are all associated with the three participating parties, so the multi-signature total public key has a stronger correlation with the three participating parties and is more difficult to forge.
  • the first transaction information includes: a first transaction serial number
  • the invoking the first smart contract of the blockchain at least according to the threshold signature and the first transaction information includes:
  • the first transaction information, the first hash value, the second hash value and the third hash value call the first smart contract of the blockchain;
  • the first hash value is The hash value generated by the first participant for the first transaction information;
  • the second hash value is the hash value generated by the second participant for the first transaction information;
  • the third The hash value is the hash value generated by the third party for the first transaction information;
  • the first smart contract is used to verify: whether the first transaction serial number is greater than the maximum transaction serial number recorded in the first smart contract; the first hash value, the second hash value and all Whether the third hash value has not been recorded in the first smart contract.
  • the first transaction information includes: the first transaction serial number, and the first smart contract of the blockchain can be called in combination with the first hash value, the second hash value and the third hash value,
  • the verification of the first smart contract is further increased to ensure the correctness of the asset return.
  • the first transaction information is the transaction information of the off-chain transfer initiated by the first participant, it further includes:
  • the first participant determines that the three participants agree with the transfer.
  • the first transaction information is the transaction information of the off-chain transfer initiated by the first participant, if the first participant verifies that the threshold signature passes, it does not need to call the smart contract, and directly The first balance information is recorded off-chain.
  • the present invention provides a blockchain three-party transfer device, comprising: a data transmission module for sending a first signature for the first transaction information to the second participant and the third party during the opening of the three-party payment channel.
  • a data transmission module for sending a first signature for the first transaction information to the second participant and the third party during the opening of the three-party payment channel.
  • the first transaction information is transaction information initiated by the first participant;
  • the first transaction information includes first balance information;
  • the first balance information records the balance information of the three participants ;
  • the first participant obtaining a threshold signature according to the first signature, the second signature and the third signature;
  • the processing module if the first transaction information is the transaction information of the returned asset, is used to call the first transaction information of the blockchain at least according to the threshold signature and the first transaction information after verifying that the threshold signature is passed. Smart contract; the first smart contract is used to determine that the three participants agree with the first transaction information, so that the blockchain will return the first participant correspondingly in the first balance information The amount of assets is retrieved from the three-party payment channel.
  • processing module is specifically configured to: obtain the first signature in the following manner:
  • the first hash value is a hash value generated by the first participant for the first transaction information; the first total hash value is a hash value generated by the three participants for the first transaction information
  • the first public key coefficient is the public key coefficient of the first participant;
  • the multi-signature total public key is the total public key agreed upon by the three participants.
  • processing module is specifically configured to: obtain the first hash value and the first total hash value in the following manner:
  • the second hash value The value is obtained according to the second random number and the preset hash algorithm;
  • the third hash value is obtained according to the third random number and the preset hash algorithm;
  • the first total hash value is obtained from the first hash value, the second hash value and the third hash value.
  • the processing module is specifically configured to: according to the first hash value, the first transaction information, the first total hash value, the multi-signature total public key, the first public key
  • the key coefficient and the preset hash algorithm are based on the preset elliptic curve algorithm to obtain the first signature; according to the first signature, the second signature and the third signature, based on the preset operation, obtain The threshold signature; based on the preset elliptic curve algorithm, if the threshold signature, the preset generator, the first total hash value, the first transaction information, the multi-signature total public key and the If the preset hash algorithm satisfies a preset relationship, it is determined that the threshold signature verification is passed; the preset relationship is set according to the preset elliptic curve algorithm and the preset operation.
  • the multi-signature total public key is obtained in the following manner:
  • a public key hash is obtained according to the first public key of the first participant, the second public key of the second participant, the third public key of the third participant and the preset hash algorithm value;
  • the multi-signature total public key is obtained according to the first public key coefficient, the second public key coefficient and the third public key coefficient.
  • the first transaction information includes: a first transaction serial number
  • the processing module is specifically used for:
  • the first transaction information, the first hash value, the second hash value and the third hash value call the first smart contract of the blockchain;
  • the first hash value is The hash value generated by the first participant for the first transaction information;
  • the second hash value is the hash value generated by the second participant for the first transaction information;
  • the third The hash value is the hash value generated by the third party for the first transaction information;
  • the first smart contract is used to verify: whether the first transaction serial number is greater than the maximum transaction serial number recorded in the first smart contract; the first hash value, the second hash value and all Whether the third hash value has not been recorded in the first smart contract.
  • the processing module is further configured to: determine the three participating parties if the threshold signature is verified to pass. All parties agree with the transfer, and determine that the balance information of the three participants after the transfer is the first balance information.
  • the present invention provides a computer device, including a program or an instruction, which, when the program or instruction is executed, is used to execute the above-mentioned first aspect and each optional method of the first aspect.
  • the present invention provides a storage medium, including a program or an instruction, which, when the program or instruction is executed, is used to execute the above-mentioned first aspect and each optional method of the first aspect.
  • Figure 1 is a schematic diagram of the structure of the blockchain
  • FIG. 2 is a schematic flowchart of a three-party transfer method of a blockchain provided by an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a three-party transfer device of a blockchain according to an embodiment of the present invention.
  • Blockchain As shown in Figure 1, the blockchain is a chain composed of a series of blocks. In addition to recording the data of this block, each block also records the hash value of the previous block. form a chain.
  • Node Each participant in the network is a node, and the node participates in network formation and data exchange.
  • a node refers to a participant with a unique identity, the node has a complete copy of the ledger, and has the ability to participate in the consensus of the blockchain network and the maintenance of the ledger.
  • Smart Contract A smart contract is a computer protocol designed to inform, verify, or execute a contract. Smart contracts allow for trusted transactions without third parties that are traceable and irreversible.
  • the specific form of smart contracts is the code deployed on the blockchain to complete specific functions.
  • Solidity is a mainstream smart contract programming language. Smart contracts written in Solidity language are called Solidity contracts.
  • a contract address When a smart contract is deployed on the blockchain, a contract address will be generated, and users can call the smart contract through the contract address.
  • the function defined in the smart contract is called the contract interface.
  • the call to the smart contract is to call a contract interface in the contract through the contract address.
  • Hash Algorithm An algorithm that maps digital messages to fixed-length strings (aka message digests, hashes, fingerprints). If the input messages are different, the chance of mapping to the same string can be ignored. Computing its original digital message is not feasible if the hash value is known.
  • State channel refers to a virtual channel (channel) that changes state outside the chain.
  • Payment channel is a special case of a state channel and refers to a trustless mechanism for transactions between two parties.
  • the intermediate commitment transactions are all off-chain, and only the subsequent settlement transactions are finally on the chain, thereby achieving the effect of improving transaction throughput, low latency and fine-grained granularity.
  • Public key refers to the public key parameter in public key cryptography, which needs to be published. Used to encrypt and verify signatures. Under the blockchain account system, the public key corresponds to an account address.
  • Private key refers to the private key parameter in public key cryptography and needs to be properly protected. Used for decryption and signing. Under the blockchain account system, the private key controls the ownership and usage rights of the account.
  • the address is the identification of the account. For external accounts, the address represents the last 20 bytes of the account's public key (usually starting with 0x, for example, 0xcd2a3d9f938e13cd947ec05abc7fe734df8dd826, the address is in hexadecimal notation).
  • an embodiment of the present invention provides a three-party transfer method.
  • Step 201 During the opening of the three-party payment channel, the first participant sends a first signature for the first transaction information to the second participant and the third participant.
  • the first transaction information is transaction information initiated by the first participant; the first transaction information includes first balance information; and the first balance information records the balance information of the three participants.
  • Step 202 the first participant obtains a second signature for the first transaction information from the second participant and a third signature for the first transaction information from the third participant; The first participant obtains a threshold signature according to the first signature, the second signature and the third signature.
  • Step 203 If the first transaction information is the transaction information for returning assets, the first participant, after verifying that the threshold signature passes, calls the block at least according to the threshold signature and the first transaction information.
  • the first smart contract of the chain If the first transaction information is the transaction information for returning assets, the first participant, after verifying that the threshold signature passes, calls the block at least according to the threshold signature and the first transaction information.
  • the first smart contract of the chain If the first transaction information is the transaction information for returning assets, the first participant, after verifying that the threshold signature passes, calls the block at least according to the threshold signature and the first transaction information.
  • the first smart contract of the chain is the transaction information for returning assets.
  • the first smart contract is used to determine that the three participants agree with the first transaction information, so that the blockchain will return the assets corresponding to the amount returned by the first participant in the first balance information. retrieved from the three-party payment channel.
  • step 201 to step 203 for example:
  • the three parties A, B, and C establish a state channel through negotiation. Among them, C is the first participant, A is the second participant, and B is the third participant. Any participant can be authorized to call the openChannel function of the deployed payment channel smart contract.
  • a process for opening a channel may be as follows:
  • the openChannel function will perform a hash operation based on the incoming account addresses of the three parties to calculate a globally unique payment.
  • Channel channelId and set the timeout time of the channel, and set the channel status to open (open).
  • the OpenChannel function can also complete the initialization of the multi-signature total public key.
  • the multi-signature master public key is obtained in the following manner:
  • a public key hash is obtained according to the first public key of the first participant, the second public key of the second participant, the third public key of the third participant and the preset hash algorithm value.
  • the first public key coefficient is obtained according to the first public key, the public key hash value and the preset hash algorithm.
  • a second public key coefficient is obtained according to the second public key, the public key hash value and the preset hash algorithm.
  • a third public key coefficient is obtained according to the third public key, the public key hash value and the preset hash algorithm.
  • the multi-signature total public key is obtained according to the first public key coefficient, the second public key coefficient and the third public key coefficient.
  • the openchannel function will perform the following initialization operations:
  • H is the preset hash algorithm
  • indicates that they are connected together as the input of the preset hash algorithm
  • L is the public key hash value
  • Pc1 Pc*H(Pc
  • Pa1 Pa*H(Pa
  • Pb1 Pb*H(Pb
  • P Pa1+Pb1+Pc1; P is the total public key of multi-signature.
  • the above-mentioned multi-signature public key is jointly calculated according to the public key coefficients of the public keys of multiple participants.
  • the multi-signature total public key can be used together with the threshold signature.
  • Each public key coefficient can obtain an independent signature, and each independent signature can obtain the threshold signature, and the multi-signature total public key can be directly calculated to obtain the threshold signature. Therefore, during verification, the threshold signature can be directly obtained by using the multi-signature total public key, and the step of separately calculating the independent signature again is omitted.
  • multi-signature initialization has been completed, and subsequent A, B, and C can use these public key coefficients to complete multi-signature operations (such as schnorr multi-signature operations).
  • A, B, and C know the channelId, they respectively call the setTotalDeposit (deposit asset) function to deposit the on-chain asset into the smart contract.
  • the setTotalDeposit function will check the channel status and timeout time of the payment channel. If it passes, it will record the asset amount deposited by the caller.
  • the latest balance table is A: 50B: 50C: 200.
  • the transfer serial number is 5.
  • C wants to withdraw 100 assets from the state channel contract for other purposes.
  • C needs to notify A and B, and initiate an instant retrieval request to avoid A and B from going to the blockchain for verification.
  • a first signature needs to be obtained.
  • the first participant acquires the first signature in the following manner (hereinafter referred to as an implementation manner of obtaining a signature based on a total hash value):
  • the first participant obtains the first signature according to the first hash value, the first transaction information, the first total hash value, the first public key coefficient, the multi-signature total public key and the preset hash algorithm.
  • the first hash value is a hash value generated by the first participant for the first transaction information
  • the first total hash value is a hash value generated by the three participants for the first transaction
  • the first public key coefficient is the public key coefficient of the first participant
  • the multi-signature total public key is the total public key agreed upon by the three participants.
  • the first transaction information m (balance list, nonce, status);
  • C needs to sign the latest balance list, namely A: 50B: 50C: 100. It can also include the transfer serial number nonce (6 in this case), transaction status status ("withdraw”) and other information representations.
  • the first participant obtains the first hash value and the first total hash value in the following manner:
  • the manner of generating the first hash value is:
  • the first participant generates a first random number for the first transaction information, and obtains the first hash value according to the first random number and the preset hash algorithm.
  • the manner of generating the first total hash value is:
  • the first participant sends the first transaction information to the second participant and the third participant.
  • the first party obtains a second hash value for the first transaction information from the second party and a third hash value for the first transaction information from the third party .
  • the first participant obtains the first total hash value according to the first hash value, the second hash value and the third hash value.
  • the second hash value is obtained according to the second random number and the preset hash algorithm; the third hash value is obtained according to the third random number and the preset hash algorithm.
  • the implementation of the signature acquisition based on the total hash value the specific implementation of the acquisition of the first signature may be as follows:
  • the first signature is obtained based on a preset elliptic curve algorithm.
  • obtaining the threshold signature may be:
  • the first participant obtains the threshold signature based on a preset operation according to the first signature, the second signature and the third signature.
  • verifying the threshold signature may be:
  • the first participant determines the threshold signature, the preset generator, the first total hash value, the first transaction information, and the multi-signature total public key. If a preset relationship is satisfied with the preset hash algorithm, it is determined that the threshold signature verification passes.
  • the preset relationship is set according to the preset elliptic curve algorithm and the preset operation.
  • C obtains the multi-signature total public key P and its own public key coefficient, that is, the first public key coefficient Pc1 from the smart contract on the blockchain; calculate:
  • C sends the signed data (Rc, Sc) and R to B and A through the client offline.
  • B also performs the above signature operation to obtain (Rb, Sb), and
  • A also performs the above signature operation to obtain (Ra, Sa).
  • a and B send the signature to C.
  • C adds the three signatures Sa, Sb, Sc to obtain the threshold signature S.
  • the threshold signature is calculated by multiple independent signatures. It is not necessary to verify whether each independent signature is correct.
  • the threshold signature can be verified directly. Passing the verification of the threshold signature means that all the independent signatures used to obtain the threshold signature are verified. The signature is verified.
  • the first transaction information includes: the first transaction serial number; step 203 may be performed in the following manner:
  • the first transaction information, the first hash value, the second hash value and the third hash value, the first smart contract of the blockchain is invoked.
  • the first hash value is a hash value generated by the first participant for the first transaction information; the second hash value is generated by the second participant for the first transaction information Hash value; the third hash value is a hash value generated by the third party for the first transaction information.
  • the first smart contract is used to verify: whether the first transaction serial number is greater than the maximum transaction serial number recorded in the first smart contract; the first hash value, the second hash value and all Whether the third hash value has not been recorded in the first smart contract.
  • the first smart contract will verify whether the threshold signature is correct, if not, the transaction will be rejected.
  • the first smart contract checks the three-party threshold signature of A, B, and C uploaded by C, and checks the nonce of this transfer. If it is greater than the nonce recorded in the contract, change the nonce of the contract and change the balance of A, B, and C in the channel. If the signature or nonce verification fails, the transaction fails.
  • the first smart contract judges whether the incoming random number hash Ra, Rb, Rc is already in the random number list. If it exists, it is judged that the signature is reused and the transaction fails. Rc is stored in the list of random numbers in the contract. This step mainly prevents double spending.
  • the first smart contract sends the amount of assets to be withdrawn by C to the address of C.
  • this scheme can introduce the schnorr multi-signature algorithm in the payment channel scheme, and design a new three-party payment channel solution.
  • By designing a new interaction process and payment channel contract it can effectively reduce the need for off-chain signature transmission and signature verification. frequency.
  • schnorr multi-signature Based on schnorr multi-signature, the function of instantly withdrawing assets is supported in the three-party payment channel, without entering the challenge period and closing the channel to withdraw assets, which increases the flexibility of the payment channel.
  • the following steps may also be performed:
  • the first participant determines that the three participants agree with the transfer, and determines the balance information of the three participants after the transfer. is the first balance information.
  • A, B, and C all deposit an asset amount of 100.
  • A is the first participant, and now A wants to transfer 20 to B.
  • the off-chain payment process of the three-party payment channel is as follows:
  • A needs to sign the latest balance table (the first balance information), namely A: 80B: 120C: 100, and the transfer serial number nonce, and the signature algorithm adopts the Schnorr signature algorithm.
  • A initiates a transfer request, generates a random number ra by itself, and saves ra locally.
  • A obtains P and Pa1 from the smart contract on the chain
  • A sends the signed data (Ra, Sa) and R to B offline through the client.
  • B also performs the above steps, substitutes its own random number and public key coefficient, obtains the signature (Rb, Sb), and sends A's signature (Ra, Sa) and its own (Rb, Sb) and R to C.
  • C also performs the above steps to obtain the signature operation to obtain (Rc, Sc), and then C adds the three signatures Sa, Sb, Sc to obtain the threshold signature S.
  • P)*P, Rb+Rb+Rc R is equal. If they are equal, the signature verification is successful, which proves that A, B, and C have all valid signatures. C sends (R, S) to A and B.
  • any of the three parties wants to withdraw from the channel and retrieve the assets in the channel. Then enter the process of closing the payment channel. Note that you need to interact with the smart contract on the chain at this time.
  • A calls the closeChannel function to close the payment channel.
  • the channel ID and the latest balance table and transfer sequence number nonce and threshold signature must be passed in.
  • the signature is A: 50B: 50C: 100 for the latest balance table.
  • the threshold signature process is similar to the process in step 3.
  • the smart contract sets A as the closing party, and B and C as non-closing parties.
  • the smart contract will check whether the threshold signature is correct. If it is not correct, it needs to be resubmitted. After the smart contract checks the A, B, and C three-party threshold signatures uploaded by A pass, record the transfer balance table (A: 50B: 50C: 100) and serial number 10 submitted by A.
  • the non-closing party updates the balance table (challenge period):
  • B and C When B and C know that A initiates a transaction to close the channel, they also check the channel status and check whether the balance table and transfer nonce passed in by A are correct.
  • balance table passed in by A does not agree with the transfer serial number B or C, for example, A just passed in the ninth transfer.
  • the balance table is (A: 100B: 0C: 100), and the transfer serial number is 9. Obviously, the result of this transfer is favorable for A.
  • B and C need to call the updateNonClosingBalanceProof function of the contract to update the balance table and transfer serial number recorded by the channel to prevent A from doing evil.
  • the channel settlement method is as follows:
  • A calls the settleChannel function to settle the channel.
  • the payment channel contract will automatically transfer the previously pledged assets to A, B, and C according to the recorded balance table. and set the channel state to off. At this point, the life cycle of the three-party payment channel ends.
  • the present invention provides a blockchain three-party transfer device, including: a data transmission module 301 for sending the first signature for the first transaction information to the second participant during the opening of the three-party payment channel the first transaction information is transaction information initiated by the first participant; the first transaction information includes first balance information; the first balance information records three participants balance information;
  • the first participant obtaining a threshold signature according to the first signature, the second signature and the third signature;
  • the processing module 302 if the first transaction information is the transaction information of the returned asset, is used to call the first transaction information of the blockchain at least according to the threshold signature and the first transaction information after the verification of the threshold signature is passed. a smart contract; the first smart contract is used to determine that the three participants agree with the first transaction information, so that the blockchain will match the first participant in the first balance information
  • the assets of the returned amount are retrieved from the three-party payment channel.
  • processing module 302 is specifically configured to: obtain the first signature in the following manner:
  • the first hash value is a hash value generated by the first participant for the first transaction information; the first total hash value is a hash value generated by the three participants for the first transaction information
  • the first public key coefficient is the public key coefficient of the first participant;
  • the multi-signature total public key is the total public key agreed upon by the three participants.
  • processing module 302 is specifically configured to: obtain the first hash value and the first total hash value in the following manner:
  • the second hash value The value is obtained according to the second random number and the preset hash algorithm;
  • the third hash value is obtained according to the third random number and the preset hash algorithm;
  • the first total hash value is obtained from the first hash value, the second hash value and the third hash value.
  • the processing module 302 is specifically configured to: according to the first hash value, the first transaction information, the first total hash value, the multi-signature total public key, the first The public key coefficient and the preset hash algorithm are based on the preset elliptic curve algorithm to obtain the first signature; according to the first signature, the second signature and the third signature, based on the preset operation, Obtain the threshold signature; based on the preset elliptic curve algorithm, if the threshold signature, the preset generator, the first total hash value, the first transaction information, and the multi-signature total public key are determined If a preset relationship is satisfied with the preset hash algorithm, it is determined that the threshold signature verification is passed; the preset relationship is set according to the preset elliptic curve algorithm and the preset operation.
  • the multi-signature total public key is obtained in the following manner:
  • a public key hash is obtained according to the first public key of the first participant, the second public key of the second participant, the third public key of the third participant and the preset hash algorithm value;
  • the multi-signature total public key is obtained according to the first public key coefficient, the second public key coefficient and the third public key coefficient.
  • the first transaction information includes: a first transaction serial number
  • the processing module 302 is specifically used for:
  • the first transaction information, the first hash value, the second hash value and the third hash value call the first smart contract of the blockchain;
  • the first hash value is The hash value generated by the first participant for the first transaction information;
  • the second hash value is the hash value generated by the second participant for the first transaction information;
  • the third The hash value is the hash value generated by the third party for the first transaction information;
  • the first smart contract is used to verify: whether the first transaction serial number is greater than the maximum transaction serial number recorded in the first smart contract; the first hash value, the second hash value and all Whether the third hash value has not been recorded in the first smart contract.
  • the processing module 302 is further configured to: if verifying that the threshold signature passes, determine the three All the participants agree with the transfer, and determine that the balance information of the three participants after the transfer is the first balance information.
  • an embodiment of the present invention also provides a computer device, including a program or an instruction, when the program or instruction is executed, such as the three-party transfer method of the blockchain provided by the embodiment of the present invention and any optional The selected method is executed.
  • an embodiment of the present invention also provides a computer-readable storage medium, including a program or an instruction, when the program or instruction is executed, such as the three-party transfer method of the blockchain provided by the embodiment of the present invention and the Any optional method is executed.

Landscapes

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

Abstract

本发明公开了一种区块链的三方转账方法及装置,其中方法为:在三方支付通道开启期间,第一参与方将针对第一交易信息的第一签名发送至第二参与方和第三参与方;所述第一交易信息为所述第一参与方发起的交易信息;所述第一参与方获取来自所述第二参与方的第二签名和来自所述第三参与方的第三签名;所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,获得门限签名;若所述第一交易信息为返还资产的交易信息,所述第一参与方在验证所述门限签名通过后,则至少根据所述门限签名和所述第一交易信息,调用区块链的第一智能合约。上述方法应用于金融科技(Fintech)时,有效减少了参与方与区块链的交互。

Description

一种区块链的三方转账方法及装置
相关申请的交叉引用
本申请要求在2020年12月08日提交中国专利局、申请号为202011441669.6、申请名称为“一种区块链的三方转账方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及金融科技(Fintech)领域中的区块链(blockchain)领域,尤其涉及一种区块链的三方转账方法及装置。
背景技术
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,但由于金融行业的安全性、实时性要求,也对技术提出的更高的要求。目前,基于区块链的不可篡改性,金融科技领域中常通过区块链(blockchain)进行交易。三方转账是区块链领域中一种特殊场景,三方的资产只在三个参与方内部发生转移。在三方转账场景下,在区块链上注册了支付通道后,为了提高转账效率,中间转账的过程在链下进行,在中间转账开始前,区块链只需要记录三个参与方各自的最初余额。
但是,目前的方案中,当某一参与方需要取回资产时,三个参与方都要在区块链上确定结算金额,仍需要和区块链上的支付通道交互,在区块链确定三个参与方都认可了最终余额后,区块链才将该参与方在支付通道内的资产退回给该参与方。显然,目前三方转账的场景下,参与方与区块链的交互次数较多,导致三方转账效率较低,这是一个亟待解决的问题。
发明内容
本发明提供一种区块链的三方转账方法及装置,解决了现有技术中三方转账效率较低的问题。
第一方面,本发明提供一种区块链的三方转账方法,包括:在三方支付通道开启期间,第一参与方将针对第一交易信息的第一签名发送至第二参与方和第三参与方;所述第一交易信息为所述第一参与方发起的交易信息;所述第一交易信息包括第一余额信息;所述第 一余额信息中记录了三个参与方的余额信息;
所述第一参与方获取来自所述第二参与方的针对所述第一交易信息的第二签名和来自所述第三参与方的针对所述第一交易信息的第三签名;所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,获得门限签名;
若所述第一交易信息为返还资产的交易信息,所述第一参与方在验证所述门限签名通过后,则至少根据所述门限签名和所述第一交易信息,调用区块链的第一智能合约;所述第一智能合约用于确定所述三个参与方均认同了所述第一交易信息,使得区块链将所述第一参与方在所述第一余额信息中相应返还金额的资产从所述三方支付通道取回。
上述方法中,在三方支付通道开启期间,第一参与方通过与第二参与方和第三参与方交互签名,获得门限签名,并至少根据所述门限签名和所述第一交易信息,调用区块链的第一智能合约,由于是门限签名,区块链只需要验证门限签名,即可确定三个参与方都认同了第一交易信息,便可以使得区块链将所述第一参与方在所述第一余额信息中相应返还金额的资产,从所述三方支付通道取回,该过程只需要取回资产的第一参与方调用一次区块链的第一智能合约即可,有效减少了参与方与区块链的交互次数。
可选的,所述第一参与方按照以下方式获得所述第一签名:
所述第一参与方根据第一哈希值、所述第一交易信息、第一总哈希值、第一公钥系数、多签总公钥和预设哈希算法,获得第一签名;
所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第一总哈希值是所述三个参与方针对所述第一交易信息生成的总哈希值;所述第一公钥系数是所述第一参与方的公钥系数;所述多签总公钥是所述三个参与方约定的总公钥。
上述方法中,第一哈希值、第一总哈希值、第一公钥系数、多签总公钥联合参与了所述第一签名的生成,因此第一签名生成过程中,既考虑了第一参与方单独生成的信息,三方联合生成的信息,增加了第一签名的可信性。
可选的,所述第一参与方按照以下方式获得所述第一哈希值和所述第一总哈希值:
所述第一参与方生成针对所述第一交易信息的第一随机数,并根据所述第一随机数和所述预设哈希算法,获得所述第一哈希值;
所述第一参与方将所述第一交易信息发送至所述第二参与方和所述第三参与方;
所述第一参与方获取来自所述第二参与方的针对所述第一交易信息的第二哈希值和来自所述第三参与方的针对所述第一交易信息的第三哈希值;所述第二哈希值是根据第二随机数和所述预设哈希算法得到的;所述第三哈希值是根据第三随机数和所述预设哈希算法得到的;
所述第一参与方根据所述第一哈希值、所述第二哈希值和所述第三哈希值,获得所述第一总哈希值。
上述方法中,通过第一随机数增加了第一哈希值的随机性,而第二哈希值和第三哈希值也是通过随机数得到的,从而结合起来使得所述第一总哈希值随机性更强,更加难以伪造。
可选的,所述第一参与方根据第一哈希值、所述第一交易信息、第一总哈希值、第一公钥系数、多签总公钥和预设哈希算法,获得第一签名,包括:
所述第一参与方根据所述第一哈希值、所述第一交易信息、所述第一总哈希值、所述多签总公钥、所述第一公钥系数和所述预设哈希算法,基于预设椭圆曲线算法,获得所述第一签名;
所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,获得门限签名,包括:
所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,基于预设运算,获得所述门限签名;
所述第一参与方按照以下方式验证所述门限签名:
所述第一参与方基于所述预设椭圆曲线算法,若确定所述门限签名、预设生成元、所述第一总哈希值、所述第一交易信息、所述多签总公钥和所述预设哈希算法满足预设关系,则确定所述门限签名验证通过;所述预设关系是根据所述预设椭圆曲线算法和所述预设运算设定的。
上述方式下,通过预设椭圆曲线算法和预设运算,设置了门限签名的构造方法以及验证方法,由于椭圆曲线算法有零知识证明性质,从而对私有信息的保密性更强。
可选的,所述多签总公钥按照以下方式获得:
根据所述第一参与方的第一公钥、所述第二参与方的第二公钥、所述第三参与方的第三公钥和所述预设哈希算法,获得公钥哈希值;
根据所述第一公钥、所述公钥哈希值和所述预设哈希算法,获得所述第一公钥系数;
根据所述第二公钥、所述公钥哈希值和所述预设哈希算法,获得第二公钥系数;
根据所述第三公钥、所述公钥哈希值和所述预设哈希算法,获得第三公钥系数;
根据所述第一公钥系数、所述第二公钥系数和所述第三公钥系数,获得所述多签总公钥。
上述方式下,所述公钥哈希值绑定了三个参与方的公钥,而每个参与方的公钥系数都是根据所述公钥哈希值生成的,因此每个参与方的公钥系数都是和三个参与方关联的,所 以所述多签总公钥和三个参与方的关联性更强,更加难以伪造。
可选的,所述第一交易信息中包括:第一交易序列号;
所述至少根据所述门限签名和所述第一交易信息,调用区块链的第一智能合约,包括:
至少根据所述门限签名、所述第一交易信息、第一哈希值、第二哈希值和第三哈希值,调用区块链的第一智能合约;所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第二哈希值是所述第二参与方针对所述第一交易信息生成的哈希值;所述第三哈希值是所述第三参与方针对所述第一交易信息生成的哈希值;
所述第一智能合约用于验证:所述第一交易序列号是否大于所述第一智能合约中记录的最大交易序列号;所述第一哈希值、所述第二哈希值和所述第三哈希值是否未在所述第一智能合约中记录过。
上述方式下,所述第一交易信息中包括:第一交易序列号,并且可以结合第一哈希值、第二哈希值和第三哈希值一同调用区块链的第一智能合约,从而进一步增加所述第一智能合约的验证,保证资产返还的正确性。
可选的,若所述第一交易信息为所述第一参与方发起的链下转账的交易信息,还包括:
所述第一参与方若验证所述门限签名通过,则所述第一参与方确定所述三个参与方均认同了此次转账。
上述方法下,若所述第一交易信息为所述第一参与方发起的链下转账的交易信息,所述第一参与方若验证所述门限签名通过后,不需要调用智能合约,直接在链下记录了所述第一余额信息。
第二方面,本发明提供一种区块链的三方转账装置,包括:数据传输模块,用于在三方支付通道开启期间,将针对第一交易信息的第一签名发送至第二参与方和第三参与方;所述第一交易信息为第一参与方发起的交易信息;所述第一交易信息包括第一余额信息;所述第一余额信息中记录了三个参与方的余额信息;
以及用于获取来自所述第二参与方的针对所述第一交易信息的第二签名和来自所述第三参与方的针对所述第一交易信息的第三签名;所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,获得门限签名;
处理模块,若所述第一交易信息为返还资产的交易信息,用于在验证所述门限签名通过后,则至少根据所述门限签名和所述第一交易信息,调用区块链的第一智能合约;所述第一智能合约用于确定所述三个参与方均认同了所述第一交易信息,使得区块链将所述第一参与方在所述第一余额信息中相应返还金额的资产从所述三方支付通道取回。
可选的,所述处理模块具体用于:按照以下方式获得所述第一签名:
根据第一哈希值、所述第一交易信息、第一总哈希值、第一公钥系数、多签总公钥和预设哈希算法,获得第一签名;
所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第一总哈希值是所述三个参与方针对所述第一交易信息生成的总哈希值;所述第一公钥系数是所述第一参与方的公钥系数;所述多签总公钥是所述三个参与方约定的总公钥。
可选的,所述处理模块具体用于:按照以下方式获得所述第一哈希值和所述第一总哈希值:
生成针对所述第一交易信息的第一随机数,并根据所述第一随机数和所述预设哈希算法,获得所述第一哈希值;
将所述第一交易信息发送至所述第二参与方和所述第三参与方;
获取来自所述第二参与方的针对所述第一交易信息的第二哈希值和来自所述第三参与方的针对所述第一交易信息的第三哈希值;所述第二哈希值是根据第二随机数和所述预设哈希算法得到的;所述第三哈希值是根据第三随机数和所述预设哈希算法得到的;
根据所述第一哈希值、所述第二哈希值和所述第三哈希值,获得所述第一总哈希值。
可选的,所述处理模块具体用于:根据所述第一哈希值、所述第一交易信息、所述第一总哈希值、所述多签总公钥、所述第一公钥系数和所述预设哈希算法,基于预设椭圆曲线算法,获得所述第一签名;根据所述第一签名、所述第二签名和所述第三签名,基于预设运算,获得所述门限签名;基于所述预设椭圆曲线算法,若确定所述门限签名、预设生成元、所述第一总哈希值、所述第一交易信息、所述多签总公钥和所述预设哈希算法满足预设关系,则确定所述门限签名验证通过;所述预设关系是根据所述预设椭圆曲线算法和所述预设运算设定的。
可选的,所述多签总公钥按照以下方式获得:
根据所述第一参与方的第一公钥、所述第二参与方的第二公钥、所述第三参与方的第三公钥和所述预设哈希算法,获得公钥哈希值;
根据所述第一公钥、所述公钥哈希值和所述预设哈希算法,获得所述第一公钥系数;
根据所述第二公钥、所述公钥哈希值和所述预设哈希算法,获得第二公钥系数;
根据所述第三公钥、所述公钥哈希值和所述预设哈希算法,获得第三公钥系数;
根据所述第一公钥系数、所述第二公钥系数和所述第三公钥系数,获得所述多签总公钥。
可选的,所述第一交易信息中包括:第一交易序列号;
所述处理模块具体用于:
至少根据所述门限签名、所述第一交易信息、第一哈希值、第二哈希值和第三哈希值,调用区块链的第一智能合约;所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第二哈希值是所述第二参与方针对所述第一交易信息生成的哈希值;所述第三哈希值是所述第三参与方针对所述第一交易信息生成的哈希值;
所述第一智能合约用于验证:所述第一交易序列号是否大于所述第一智能合约中记录的最大交易序列号;所述第一哈希值、所述第二哈希值和所述第三哈希值是否未在所述第一智能合约中记录过。
可选的,若所述第一交易信息为所述第一参与方发起的链下转账的交易信息,所述处理模块还用于:若验证所述门限签名通过,则确定所述三个参与方均认同了此次转账,并确定此次转账后所述三个参与方的余额信息为所述第一余额信息。
上述第二方面及第二方面各个可选装置的有益效果,可以参考上述第一方面及第一方面各个可选方法的有益效果,这里不再赘述。
第三方面,本发明提供一种计算机设备,包括程序或指令,当所述程序或指令被执行时,用以执行上述第一方面及第一方面各个可选的方法。
第四方面,本发明提供一种存储介质,包括程序或指令,当所述程序或指令被执行时,用以执行上述第一方面及第一方面各个可选的方法。
本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为区块链的结构示意图;
图2为本发明实施例提供的一种区块链的三方转账方法的流程示意图;
图3为本发明实施例提供的一种区块链的三方转账装置的结构示意图。
具体实施方式
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有 其它实施例,都属于本发明保护的范围。
下面首先解释本申请实施例中出现的名词。
区块链:如图1所示,区块链是由一系列区块组成的一条链,每个块上除了记录本块的数据还会记录上一块的哈希(Hash)值,通过这种方式组成一条链。区块链的核心理念有两个,一个是密码学技术,另一个是去中心化思想,基于这两个理念做到区块链上的历史信息无法被篡改。
节点:网络中的每一个参与者就是一个节点,节点参与网络组建和数据交换。在区块链网络中,一个节点是指一个具有唯一身份的参与者,该节点具有一份完整的账本拷贝,具有参与区块链网络共识和账本维护的能力。
智能合约:智能合约是一种旨在以信息化方式传播、验证或执行合同的计算机协议。智能合约允许在没有第三方的情况下进行可信交易,这些交易可追踪且不可逆转。智能合约具体形式为部署在区块链上,完成特定功能的代码。举例来说,Solidity是一种主流的智能合约编程语言,用Solidity语言编写的智能合约,叫Solidity合约。当智能合约被部署到区块链上时,会产生合约地址,用户可通过合约地址调用此智能合约。智能合约中定义的函数,称为合约接口,对智能合约的调用,就是通过合约地址调用合约中的某个合约接口。
哈希算法:一个将数字消息映射到长度固定的字符串(又称消息摘要,哈希值,指纹)的算法。若输入的消息不同,映射到相同字符串的机率可以忽略。若已知哈希值,计算其原始的数字消息不可行。
状态通道:是指在链外状态变化的虚拟通道(channel)。
支付通道:支付通道是状态通道的特例,指双方交易的无信任机制。中间的承诺交易都是链下(offchain)的,只有后面的结算交易最终上链,从而达到提高交易的吞吐量、低延迟和精细粒度的效果。
公钥:公钥指公钥密码学中的公开密钥参数,需要公布。用于加密和验证签名。区块链账户体系下,公钥对应一个账户地址。
私钥:私钥指公钥密码学中的私有密钥参数,需要妥善保护。用于解密和进行签名。区块链账户体系下,私钥控制着账户的所有权和使用权。
地址:地址是账户的标识。对于外部账户来说,地址表示的是该账户公钥的后20字节(通常会以0x开头,例如,0xcd2a3d9f938e13cd947ec05abc7fe734df8dd826,该地址使用的是16进制表示法)。
在金融机构(银行机构、保险机构或证券机构)在进行业务(如银行的贷款业务、存款业务等)运转过程中,基于区块链的不可篡改性,金融科技领域中常通过区块链进行交 易。三方转账是区块链领域中一种特殊场景,三方的资产只在三个参与方内部发生转移。在三方转账场景下,参与方的资产返还方式与区块链的交互较多。这种情况不符合银行等金融机构的需求,无法保证金融机构各项业务的高效运转。为此,如图2所示,本发明实施例提供一种三方转账方法。
步骤201:在三方支付通道开启期间,第一参与方将针对第一交易信息的第一签名发送至第二参与方和第三参与方。
所述第一交易信息为所述第一参与方发起的交易信息;所述第一交易信息包括第一余额信息;所述第一余额信息中记录了三个参与方的余额信息。
步骤202:所述第一参与方获取来自所述第二参与方的针对所述第一交易信息的第二签名和来自所述第三参与方的针对所述第一交易信息的第三签名;所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,获得门限签名。
步骤203:若所述第一交易信息为返还资产的交易信息,所述第一参与方在验证所述门限签名通过后,则至少根据所述门限签名和所述第一交易信息,调用区块链的第一智能合约。
所述第一智能合约用于确定所述三个参与方均认同了所述第一交易信息,使得区块链将所述第一参与方在所述第一余额信息中相应返还金额的资产从所述三方支付通道取回。
需要说明的是,步骤201~步骤203的方法中,举例来说:
A,B,C三个参与方通过协商建立状态通道。其中,C为第一参与方,A为第二参与方,B为第三参与方。可以授权任意一参与方调用已部署的支付通道智能合约的openChannel(开启通道)函数。
一种开启通道的过程可以如下:
开启通道需传入A,B,C三个参与方的账户地址,账户公钥和通道超时时间,openChannel函数会根据传入的三个参与方的账户地址进行hash运算,计算出全局唯一的支付通道channeId,并设置通道的超时时间,将通道状态置为开启(open)。
OpenChannel函数同时也可以完成多签总公钥的初始化。一种可选实施方式中,所述多签总公钥按照以下方式获得:
根据所述第一参与方的第一公钥、所述第二参与方的第二公钥、所述第三参与方的第三公钥和所述预设哈希算法,获得公钥哈希值。
根据所述第一公钥、所述公钥哈希值和所述预设哈希算法,获得所述第一公钥系数。
根据所述第二公钥、所述公钥哈希值和所述预设哈希算法,获得第二公钥系数。
根据所述第三公钥、所述公钥哈希值和所述预设哈希算法,获得第三公钥系数。
根据所述第一公钥系数、所述第二公钥系数和所述第三公钥系数,获得所述多签总公钥。
具体来说,可能的情形如下:
假设传入的A,B,C的公钥分别为第一公钥(Pc),第二公钥(Pa),第二公钥(Pb),openchannel函数会进行如下初始化操作:
计算L=H(Pa||Pb||Pc),并保存L。
其中,H为所述预设哈希算法,||表示连接起来一同作为所述预设哈希算法的输入,L为公钥哈希值。
分别计算A,B,C的公钥系数,并存入区块链的支付通道智能合约中。
Pc1=Pc*H(Pc||L);Pc1为所述第一公钥系数。
Pa1=Pa*H(Pa||L);Pa1为所述第二公钥系数。
Pb1=Pb*H(Pb||L);Pb1为所述第三公钥系数。
计算用于多签总公钥,并保存:
P=Pa1+Pb1+Pc1;P为多签总公钥。
上述多签公钥是根据多个参与方公钥的公钥系数共同计算得到的。多签总公钥可以和门限签名一同使用,每个公钥系数可以得到独立的签名,各独立的签名可以得到门限签名,而多签总公钥直接计算也可以得到门限签名。因此,在验证时,使用多签总公钥可以直接得到门限签名,省略再次分别计算独立签名的步骤。
此时,多签初始化已完成,后续A,B,C可以通过这些公钥系数完成多签操作(如schnorr多签操作)。
进一步地,A,B,C知道通道channeId后,分别调用setTotalDeposit(存入资产)函数存入链上资产到智能合约。setTotalDeposit函数会校验支付通道的通道状态和超时时间,如果通过,则记录调用者存入的资产金额。
至此,A,B,C均在支付通道存入了资产。下面开启链下转账,注意此时的转账都是链下执行,无须跟区块链交互。
现假设多次转账后,最新余额表为A:50B:50C:200。转账序列号为5。C想从状态通道合约中提取100资产作为它用。C需通知A和B,发起即时取回请求,即时取回为了避免A和B再到区块链做验证。
首先要获得第一签名,一种可选实施方式下,所述第一参与方按照以下方式(以下称为基于总哈希值的签名获取实施方式)获得所述第一签名:
所述第一参与方根据第一哈希值、所述第一交易信息、第一总哈希值、第一公钥系数、 多签总公钥和预设哈希算法,获得第一签名。
其中,所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第一总哈希值是所述三个参与方针对所述第一交易信息生成的总哈希值;所述第一公钥系数是所述第一参与方的公钥系数;所述多签总公钥是所述三个参与方约定的总公钥。
本方案设计流程如下:
第一交易信息m=(balance list,nonce,status);
C需要对最新的余额表(balance list)即A:50B:50C:100,进行签名。还可以包括转账序列号nonce(此时为6),交易状态status(“withdraw”)等信息表示。
基于总哈希值的签名获取实施方式下,一种可能的情形中,所述第一参与方按照以下方式获得所述第一哈希值和所述第一总哈希值:
生成所述第一哈希值的方式为:
所述第一参与方生成针对所述第一交易信息的第一随机数,并根据所述第一随机数和所述预设哈希算法,获得所述第一哈希值。
生成所述第一总哈希值的方式为:
所述第一参与方将所述第一交易信息发送至所述第二参与方和所述第三参与方。
所述第一参与方获取来自所述第二参与方的针对所述第一交易信息的第二哈希值和来自所述第三参与方的针对所述第一交易信息的第三哈希值。
所述第一参与方根据所述第一哈希值、所述第二哈希值和所述第三哈希值,获得所述第一总哈希值。
所述第二哈希值是根据第二随机数和所述预设哈希算法得到的;所述第三哈希值是根据第三随机数和所述预设哈希算法得到的。
基于总哈希值的签名获取实施方式,获得第一签名的具体实施方式可以如下:
所述第一参与方根据所述第一哈希值、所述第一交易信息、所述第一总哈希值、所述多签总公钥、所述第一公钥系数和所述预设哈希算法,基于预设椭圆曲线算法,获得所述第一签名。
进一步地,基于总哈希值的签名获取实施方式,获得所述门限签名可以为:
所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,基于预设运算,获得所述门限签名。
进一步地,基于总哈希值的签名获取实施方式,验证所述门限签名可以为:
所述第一参与方基于所述预设椭圆曲线算法,若确定所述门限签名、预设生成元、所述第一总哈希值、所述第一交易信息、所述多签总公钥和所述预设哈希算法满足预设关系, 则确定所述门限签名验证通过。
所述预设关系是根据所述预设椭圆曲线算法和所述预设运算设定的。
基于总哈希值的签名获取实施方式,具体交互流程如下:
C向A,B索要此次签名的随机数的哈希Ra(第二哈希值),Rb(第三哈希值),C生成随机数rc,保存rc在本地,然后哈希得到Rc(第一哈希值),计算第一总哈希值R=Ra+Rb+Rc。
C从区块链上的智能合约获取多签总公钥P和自己的公钥系数即第一公钥系数Pc1;计算:
Sc=rc+H(m||R||P)*Pa1;最后得到C的第一签名Sc。
C将签名后的数据(Rc,Sc)以及R通过客户端线下发送给B和A。B也进行如上的签名操作得到(Rb,Sb),A也进行如上签名得到(Ra,Sa)。A和B将签名发送给C。
C将三个签名Sa,Sb,Sc相加得到门限签名S。
C验证S*G=R+H(m||R||P)*P是否相等。如果相等,则证明A,B,C均已有效签名。
显然,门限签名是由多个独立签名共同运算而来,验证时并不需要验证每个独立的签名是否正确,直接验证门限签名即可,门限签名通过验证便意味着用于得到门限签名的所有独立签名通过验证。
C将(R,S)发送给A和B。A和B均保留此次转账凭证。
一种可能的情形中,所述第一交易信息中包括:第一交易序列号;步骤203可以按照以下方式执行:
至少根据所述门限签名、所述第一交易信息、第一哈希值、第二哈希值和第三哈希值,调用区块链的第一智能合约。
所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第二哈希值是所述第二参与方针对所述第一交易信息生成的哈希值;所述第三哈希值是所述第三参与方针对所述第一交易信息生成的哈希值。
所述第一智能合约用于验证:所述第一交易序列号是否大于所述第一智能合约中记录的最大交易序列号;所述第一哈希值、所述第二哈希值和所述第三哈希值是否未在所述第一智能合约中记录过。
C将调用第一智能合约中的withdrawImmediately函数,第一智能合约中的withdrawImmediately函数逻辑如下:
第一智能合约会验证门限签名是否正确,不正确则拒绝此次交易。
第一智能合约检验C上传的A,B,C三方门限签名通过后,检查此次转账nonce,如 果大于合约记录的nonce,则更改合约的nonce并更改A,B,C在通道的余额。如果签名或者nonce校验失败,则交易失败。
第一智能合约判断传入的此次的随机数哈希Ra,Rb,Rc是否已经在随机数列表中,如果存在,则判定为签名重复使用,交易失败,如果成功,则将Ra,Rb,Rc存入合约中的随机数列表中。此步骤主要可以防止双花。
第一智能合约将C要提取的资产额度发送给C的地址。
withdrawImmediately函数调用成功后,至此即时取回成功。可以继续进行链下转账。
上述方式下,本方案在支付通道方案中可以引入schnorr多签算法,设计了新的三方支付通道解决方案,通过设计新的交互流程和支付通道合约,有效的减少链下传递签名和验证签名的次数。基于schnorr多签,在三方支付通道中支持即时取回资产功能,而无需进入挑战期和关闭通道才能取回资产,增加了支付通道的灵活性。
另一种可能的情形中,若所述第一交易信息为所述第一参与方发起的链下转账的交易信息,还可以执行如下步骤:
所述第一参与方若验证所述门限签名通过,则所述第一参与方确定所述三个参与方均认同了此次转账,并确定此次转账后所述三个参与方的余额信息为所述第一余额信息。
现假设A,B,C三方均存入资产金额100。此时A为第一参与方,现在A想给B转账20。三方支付通道链下支付流程如下:
A需要对最新的余额表(所述第一余额信息)即A:80B:120C:100,以及转账序列号nonce进行签名,签名算法采用Schnorr签名算法。
举例来说,具体交互流程如下:
A发起转账请求,自己生成随机数ra,保存ra在本地。
链下通知B和C发起转账请求,B和C接到请求分别产生随机数rb,rc。保存到本地后,分别计算Rb=H(rb),Rc=H(rc),然后将Rb和Rc发送给A。
A最后计算此轮多签的总随机数R=Ra+Rb+Rc;
A从链上智能合约获取P和Pa1;
A计算自己的签名Sa=ra+H(m||R||P)*Pa1。
A将签名后的数据(Ra,Sa)以及R通过客户端线下发送给B。
B也进行以上的步骤,代入自己的随机数和公钥系数,签名得到(Rb,Sb),并将A的签名(Ra,Sa)以及自己的(Rb,Sb)以及R发送给C。
C也进行以上的步骤,得到签名操作得到(Rc,Sc),然后C将三个签名Sa,Sb,Sc相加得到门限签名S。
C验证等式S*G=R+H(m||R||P)*P,Rb+Rb+Rc=R是否相等。如果相等,验签成功,则证明A,B,C均已有效签名。C将(R,S)发送给A和B。
至此A,B,C均已对余额表进行多签,此轮转账成功。
如果验签出错,可以沟通让对方重发,或者直接关闭支付通道。
需要说明的是,在一种可能情形的方式中,经过多次链下转账后,三方中任意一方想退出通道,取回通道里的资产。则进入关闭支付通道的流程。注意此时需要跟链上智能合约交互。
现假设多次转账后,最新余额表为A:50B:50C:100。转账序列号为10。
以A作为关闭方为例,A调用closeChannel函数关闭支付通道。须传入通道channeId和最新的余额表和转账序列号nonce和门限签名。签名即对最新余额表为A:50B:50C:100。转账序列号为10的签名。门限签名流程跟步骤3的流程类似。
closeChannel函数逻辑如下:
智能合约将A置为关闭方,B和C则为非关闭方。智能合约会门限签名是否正确。不正确则需重新提交。智能合约检验A上传的A,B,C三方门限签名通过后,记录下A提交的转账余额表(A:50B:50C:100)和序列号10。
将通道状态置为close。A成功调用closeChannel函数后此时支付通道进入挑战期。A等待B和C校验自己提交的余额和转账nonce是否正确。
非关闭方更新余额表(挑战期内):
B和C知道A发起关闭通道的交易,则也去查询通道状态,检查A传入的余额表和转账nonce是否正确,如果正确直接进行通道结算,否则执行以下步骤:
如果A传入的余额表和转账序列号B或C不认同,比如A只是传入了第9次的转账。余额表为(A:100B:0C:100),转账序列号为9。显然此次转账结果对A有利。则B和C需要调用合约的updateNonClosingBalanceProof函数更新通道记录的余额表和转账序列号,防止A作恶。
通道结算的方式如下:
B和C检查余额后,等待挑战期结束,A调用settleChannel函数结算通道。支付通道合约会按记录的余额表自动将之前质押的资产转给A,B,C。并将通道状态置为关闭。至此三方支付通道生命周期结束。
如图3所示,本发明提供一种区块链的三方转账装置,包括:数据传输模块301,用于在三方支付通道开启期间,将针对第一交易信息的第一签名发送至第二参与方和第三参与方;所述第一交易信息为第一参与方发起的交易信息;所述第一交易信息包括第一余额 信息;所述第一余额信息中记录了三个参与方的余额信息;
以及用于获取来自所述第二参与方的针对所述第一交易信息的第二签名和来自所述第三参与方的针对所述第一交易信息的第三签名;所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,获得门限签名;
处理模块302,若所述第一交易信息为返还资产的交易信息,用于在验证所述门限签名通过后,则至少根据所述门限签名和所述第一交易信息,调用区块链的第一智能合约;所述第一智能合约用于确定所述三个参与方均认同了所述第一交易信息,使得区块链将所述第一参与方在所述第一余额信息中相应返还金额的资产从所述三方支付通道取回。
可选的,所述处理模块302具体用于:按照以下方式获得所述第一签名:
根据第一哈希值、所述第一交易信息、第一总哈希值、第一公钥系数、多签总公钥和预设哈希算法,获得第一签名;
所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第一总哈希值是所述三个参与方针对所述第一交易信息生成的总哈希值;所述第一公钥系数是所述第一参与方的公钥系数;所述多签总公钥是所述三个参与方约定的总公钥。
可选的,所述处理模块302具体用于:按照以下方式获得所述第一哈希值和所述第一总哈希值:
生成针对所述第一交易信息的第一随机数,并根据所述第一随机数和所述预设哈希算法,获得所述第一哈希值;
将所述第一交易信息发送至所述第二参与方和所述第三参与方;
获取来自所述第二参与方的针对所述第一交易信息的第二哈希值和来自所述第三参与方的针对所述第一交易信息的第三哈希值;所述第二哈希值是根据第二随机数和所述预设哈希算法得到的;所述第三哈希值是根据第三随机数和所述预设哈希算法得到的;
根据所述第一哈希值、所述第二哈希值和所述第三哈希值,获得所述第一总哈希值。
可选的,所述处理模块302具体用于:根据所述第一哈希值、所述第一交易信息、所述第一总哈希值、所述多签总公钥、所述第一公钥系数和所述预设哈希算法,基于预设椭圆曲线算法,获得所述第一签名;根据所述第一签名、所述第二签名和所述第三签名,基于预设运算,获得所述门限签名;基于所述预设椭圆曲线算法,若确定所述门限签名、预设生成元、所述第一总哈希值、所述第一交易信息、所述多签总公钥和所述预设哈希算法满足预设关系,则确定所述门限签名验证通过;所述预设关系是根据所述预设椭圆曲线算法和所述预设运算设定的。
可选的,所述多签总公钥按照以下方式获得:
根据所述第一参与方的第一公钥、所述第二参与方的第二公钥、所述第三参与方的第三公钥和所述预设哈希算法,获得公钥哈希值;
根据所述第一公钥、所述公钥哈希值和所述预设哈希算法,获得所述第一公钥系数;
根据所述第二公钥、所述公钥哈希值和所述预设哈希算法,获得第二公钥系数;
根据所述第三公钥、所述公钥哈希值和所述预设哈希算法,获得第三公钥系数;
根据所述第一公钥系数、所述第二公钥系数和所述第三公钥系数,获得所述多签总公钥。
可选的,所述第一交易信息中包括:第一交易序列号;
所述处理模块302具体用于:
至少根据所述门限签名、所述第一交易信息、第一哈希值、第二哈希值和第三哈希值,调用区块链的第一智能合约;所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第二哈希值是所述第二参与方针对所述第一交易信息生成的哈希值;所述第三哈希值是所述第三参与方针对所述第一交易信息生成的哈希值;
所述第一智能合约用于验证:所述第一交易序列号是否大于所述第一智能合约中记录的最大交易序列号;所述第一哈希值、所述第二哈希值和所述第三哈希值是否未在所述第一智能合约中记录过。
可选的,若所述第一交易信息为所述第一参与方发起的链下转账的交易信息,所述处理模块302还用于:若验证所述门限签名通过,则确定所述三个参与方均认同了此次转账,并确定此次转账后所述三个参与方的余额信息为所述第一余额信息。
基于同一发明构思,本发明实施例还提供了一种计算机设备,包括程序或指令,当所述程序或指令被执行时,如本发明实施例提供的区块链的三方转账方法及任一可选方法被执行。
基于同一发明构思,本发明实施例还提供了一种计算机可读存储介质,包括程序或指令,当所述程序或指令被执行时,如本发明实施例提供的区块链的三方转账方法及任一可选方法被执行。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (9)

  1. 一种区块链的三方转账方法,其特征在于,包括:
    在三方支付通道开启期间,第一参与方将针对第一交易信息的第一签名发送至第二参与方和第三参与方;所述第一交易信息为所述第一参与方发起的交易信息;所述第一交易信息包括第一余额信息;所述第一余额信息中记录了三个参与方的余额信息;所述第一交易信息中包括:第一交易序列号,所述第一交易序列号为所述第一交易的转账次数的序列号;
    所述第一参与方获取来自所述第二参与方的针对所述第一交易信息的第二签名和来自所述第三参与方的针对所述第一交易信息的第三签名;所述第一参与方根据所述第一签名、所述第二签名和所述第三签名,基于预设运算,获得门限签名;所述预设运算为将所述第一签名、所述第二签名和所述第三签名相加;
    若所述第一交易信息为返还资产的交易信息,所述第一参与方在验证所述门限签名通过后,则至少根据所述门限签名、所述第一交易信息、第一哈希值、第二哈希值和第三哈希值,调用区块链的第一智能合约;所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第二哈希值是所述第二参与方针对所述第一交易信息生成的哈希值;所述第三哈希值是所述第三参与方针对所述第一交易信息生成的哈希值;
    所述第一智能合约用于验证:所述第一交易序列号是否大于所述第一智能合约中记录的最大交易序列号;所述第一哈希值、所述第二哈希值和所述第三哈希值是否未在所述第一智能合约中记录过,所述最大交易序列号为所述第一智能合约中记录的转账次数的序列号;
    所述第一智能合约用于确定所述三个参与方均认同了所述第一交易信息,使得区块链将所述第一参与方在所述第一余额信息中相应返还金额的资产从所述三方支付通道取回。
  2. 如权利要求1所述的方法,其特征在于,所述第一参与方按照以下方式获得所述第一签名:
    所述第一参与方根据第一哈希值、所述第一交易信息、第一总哈希值、第一公钥系数、多签总公钥和预设哈希算法,获得第一签名;
    所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第一总哈希值是所述三个参与方针对所述第一交易信息生成的总哈希值;所述第一公钥系数是所述第一参与方的公钥系数;所述多签总公钥是所述三个参与方约定的总公钥。
  3. 如权利要求2所述的方法,其特征在于,所述第一参与方按照以下方式获得所述 第一哈希值和所述第一总哈希值:
    所述第一参与方生成针对所述第一交易信息的第一随机数,并根据所述第一随机数和所述预设哈希算法,获得所述第一哈希值;
    所述第一参与方将所述第一交易信息发送至所述第二参与方和所述第三参与方;
    所述第一参与方获取来自所述第二参与方的针对所述第一交易信息的第二哈希值和来自所述第三参与方的针对所述第一交易信息的第三哈希值;所述第二哈希值是根据第二随机数和所述预设哈希算法得到的;所述第三哈希值是根据第三随机数和所述预设哈希算法得到的;
    所述第一参与方根据所述第一哈希值、所述第二哈希值和所述第三哈希值,获得所述第一总哈希值。
  4. 如权利要求2所述的方法,其特征在于,所述第一参与方根据第一哈希值、所述第一交易信息、第一总哈希值、第一公钥系数、多签总公钥和预设哈希算法,获得第一签名,包括:
    所述第一参与方根据所述第一哈希值、所述第一交易信息、所述第一总哈希值、所述多签总公钥、所述第一公钥系数和所述预设哈希算法,基于预设椭圆曲线算法,获得所述第一签名;
    所述第一参与方按照以下方式验证所述门限签名:
    所述第一参与方基于所述预设椭圆曲线算法,若确定所述门限签名、预设生成元、所述第一总哈希值、所述第一交易信息、所述多签总公钥和所述预设哈希算法满足预设关系,则确定所述门限签名验证通过;所述预设关系是根据所述预设椭圆曲线算法和所述预设运算设定的。
  5. 如权利要求2所述的方法,其特征在于,所述多签总公钥按照以下方式获得:
    根据所述第一参与方的第一公钥、所述第二参与方的第二公钥、所述第三参与方的第三公钥和所述预设哈希算法,获得公钥哈希值;
    根据所述第一公钥、所述公钥哈希值和所述预设哈希算法,获得所述第一公钥系数;
    根据所述第二公钥、所述公钥哈希值和所述预设哈希算法,获得第二公钥系数;
    根据所述第三公钥、所述公钥哈希值和所述预设哈希算法,获得第三公钥系数;
    根据所述第一公钥系数、所述第二公钥系数和所述第三公钥系数,获得所述多签总公钥。
  6. 如权利要求1-5任一项所述的方法,其特征在于,若所述第一交易信息为所述第一参与方发起的链下转账的交易信息,还包括:
    所述第一参与方若验证所述门限签名通过,则所述第一参与方确定所述三个参与方均认同了此次转账,并确定此次转账后所述三个参与方的余额信息为所述第一余额信息。
  7. 一种区块链的三方转账装置,其特征在于,包括:
    数据传输模块,用于在三方支付通道开启期间,将针对第一交易信息的第一签名发送至第二参与方和第三参与方;所述第一交易信息为第一参与方发起的交易信息;所述第一交易信息包括第一余额信息;所述第一余额信息中记录了三个参与方的余额信息;所述第一交易信息中包括:第一交易序列号,所述第一交易序列号为所述第一交易的转账次数的序列号;
    以及用于获取来自所述第二参与方的针对所述第一交易信息的第二签名和来自所述第三参与方的针对所述第一交易信息的第三签名;根据所述第一签名、所述第二签名和所述第三签名,基于预设运算,获得门限签名;所述预设运算为将所述第一签名、所述第二签名和所述第三签名相加;
    处理模块,若所述第一交易信息为返还资产的交易信息,用于在验证所述门限签名通过后,则至少根据所述门限签名、所述第一交易信息、第一哈希值、第二哈希值和第三哈希值,调用区块链的第一智能合约;所述第一哈希值是所述第一参与方针对所述第一交易信息生成的哈希值;所述第二哈希值是所述第二参与方针对所述第一交易信息生成的哈希值;所述第三哈希值是所述第三参与方针对所述第一交易信息生成的哈希值;
    所述第一智能合约用于验证:所述第一交易序列号是否大于所述第一智能合约中记录的最大交易序列号;所述第一哈希值、所述第二哈希值和所述第三哈希值是否未在所述第一智能合约中记录过,所述最大交易序列号为所述第一智能合约中记录的转账次数的序列号;所述第一智能合约用于确定所述三个参与方均认同了所述第一交易信息,使得区块链将所述第一参与方在所述第一余额信息中相应返还金额的资产从所述三方支付通道取回。
  8. 一种计算机设备,其特征在于,包括程序或指令,当所述程序或指令被执行时,如权利要求1至6中任意一项所述的方法被执行。
  9. 一种计算机可读存储介质,其特征在于,包括程序或指令,当所述程序或指令被执行时,如权利要求1至6中任意一项所述的方法被执行。
PCT/CN2021/130447 2020-12-08 2021-11-12 一种区块链的三方转账方法及装置 WO2022121624A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011441669.6 2020-12-08
CN202011441669.6A CN112488682B (zh) 2020-12-08 2020-12-08 一种区块链的三方转账方法及装置

Publications (1)

Publication Number Publication Date
WO2022121624A1 true WO2022121624A1 (zh) 2022-06-16

Family

ID=74940098

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/130447 WO2022121624A1 (zh) 2020-12-08 2021-11-12 一种区块链的三方转账方法及装置

Country Status (2)

Country Link
CN (1) CN112488682B (zh)
WO (1) WO2022121624A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115660679A (zh) * 2022-10-14 2023-01-31 重庆移通学院 一种基于哈希锁定的去中心化安全交易方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112488682B (zh) * 2020-12-08 2021-08-31 深圳前海微众银行股份有限公司 一种区块链的三方转账方法及装置
CN112927083A (zh) * 2021-03-30 2021-06-08 上海万向区块链股份公司 基于区块链的批量清结算方法、系统及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180060836A1 (en) * 2016-08-29 2018-03-01 Bank Of America Corporation Application life-cycle transition record recreation system
CN108924092A (zh) * 2018-06-07 2018-11-30 北京航空航天大学 基于区块链的可公开仲裁分布式云存储方法及系统
CN109461076A (zh) * 2018-10-09 2019-03-12 哈希(武汉)网络科技有限公司 一种区块链交易方法
CN110147994A (zh) * 2019-04-13 2019-08-20 山东公链信息科技有限公司 一种基于同态加密的区块链的即时执行方法
CN111932258A (zh) * 2020-08-18 2020-11-13 广西捷算资产交易市场服务有限公司 一种企业银行转账基于区块链加密支付防篡改技术方法
CN112488682A (zh) * 2020-12-08 2021-03-12 深圳前海微众银行股份有限公司 一种区块链的三方转账方法及装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106779707B (zh) * 2016-12-23 2021-04-09 中钞信用卡产业发展有限公司杭州区块链技术研究院 基于区块链的数字货币交易信息的监管方法、装置及系统
US11544708B2 (en) * 2017-12-29 2023-01-03 Ebay Inc. User controlled storage and sharing of personal user information on a blockchain
CN108494558B (zh) * 2018-02-13 2021-04-30 克洛斯比尔有限公司 用于实现公平交换的方法和系统
CN109949019A (zh) * 2018-11-15 2019-06-28 陕西医链区块链集团有限公司 一种基于医疗区块链的支付系统
CN111210344A (zh) * 2018-11-21 2020-05-29 北京京东金融科技控股有限公司 区块链网络的交易方法、装置及存储介质
CN110060055B (zh) * 2019-03-18 2022-04-08 杭州秘猿科技有限公司 一种区块链中的数字资产托管方法、装置和电子设备
KR102296831B1 (ko) * 2019-04-08 2021-09-02 어드밴스드 뉴 테크놀로지스 씨오., 엘티디. 블록체인 네트워크에 기반한 디지털 티켓의 전송
CN110097346A (zh) * 2019-04-18 2019-08-06 杭州宇链科技有限公司 一种基于区块链的支付方式及装置
CN111325628B (zh) * 2020-03-25 2022-05-13 武汉大学 一种基于区块链的多方支付通道交易方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180060836A1 (en) * 2016-08-29 2018-03-01 Bank Of America Corporation Application life-cycle transition record recreation system
CN108924092A (zh) * 2018-06-07 2018-11-30 北京航空航天大学 基于区块链的可公开仲裁分布式云存储方法及系统
CN109461076A (zh) * 2018-10-09 2019-03-12 哈希(武汉)网络科技有限公司 一种区块链交易方法
CN110147994A (zh) * 2019-04-13 2019-08-20 山东公链信息科技有限公司 一种基于同态加密的区块链的即时执行方法
CN111932258A (zh) * 2020-08-18 2020-11-13 广西捷算资产交易市场服务有限公司 一种企业银行转账基于区块链加密支付防篡改技术方法
CN112488682A (zh) * 2020-12-08 2021-03-12 深圳前海微众银行股份有限公司 一种区块链的三方转账方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115660679A (zh) * 2022-10-14 2023-01-31 重庆移通学院 一种基于哈希锁定的去中心化安全交易方法
CN115660679B (zh) * 2022-10-14 2023-07-14 重庆移通学院 一种基于哈希锁定的去中心化安全交易方法

Also Published As

Publication number Publication date
CN112488682B (zh) 2021-08-31
CN112488682A (zh) 2021-03-12

Similar Documents

Publication Publication Date Title
WO2022121624A1 (zh) 一种区块链的三方转账方法及装置
JP7461417B2 (ja) セキュアなオフチェーンのブロックチェーントランザクション
CN109937557B (zh) 用于信息保护的系统和方法
TWI712306B (zh) 在區塊鏈網路中的跨資產交易的方法、電腦可讀儲存媒體及系統
CN110089069B (zh) 用于信息保护的系统和方法
JP7194127B2 (ja) ネットワークの障害時におけるオフ・ブロックチェーン・チャネルに関して生じるセキュリティ関連脆弱性に対処するためのシステム及び方法
CN108833081B (zh) 一种基于区块链的设备组网认证方法
US11895248B2 (en) Method and apparatus for generating blockchain transaction
WO2021023200A1 (zh) 跨链交易方法、装置、多区块链系统及计算设备
WO2021184885A1 (zh) 用于更新区块链节点处的公钥集合的方法及装置
JP2020507222A (ja) 情報保護のためのシステム及び方法
WO2021008117A1 (zh) 用于进行交易验证的方法及装置
TWI759793B (zh) 由橋接設備執行的電腦實施方法、基於區塊鏈的容錯系統及用於實現基於區塊鏈的容錯系統的裝置
WO2021135857A1 (zh) 对信任节点信息进行更新的方法及装置
JP2020502856A (ja) 情報保護のためのシステム及び方法
TW202008272A (zh) 區塊鏈交易方法及裝置、電子設備
CN112818368A (zh) 一种基于区块链智能合约的数字证书认证方法
CN113544722A (zh) 使用区块链的方法
WO2021228239A1 (zh) 资产类型一致性证据生成、交易、交易验证方法及系统
TW202034247A (zh) 向區塊鏈系統提供交易資料以進行處理的方法和設備
US20200259663A1 (en) One-Time Data Signature System and Method with Untrusted Server Assistance
JP2020525874A (ja) 読み書きセットモデルベースのブロックチェーン技術における二重消費問題を回避するための方法および装置
CN111738857B (zh) 应用于区块链的隐匿支付证明的生成与验证方法及装置
US11943346B2 (en) Techniques for single round multi-party computation for digital signatures
Zhang et al. Multi-party electronic contract signing protocol based on blockchain

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

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/09/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21902331

Country of ref document: EP

Kind code of ref document: A1