CN112671540A - Contract signing method, system and medium based on block chain and fair exchange - Google Patents

Contract signing method, system and medium based on block chain and fair exchange Download PDF

Info

Publication number
CN112671540A
CN112671540A CN202011467816.7A CN202011467816A CN112671540A CN 112671540 A CN112671540 A CN 112671540A CN 202011467816 A CN202011467816 A CN 202011467816A CN 112671540 A CN112671540 A CN 112671540A
Authority
CN
China
Prior art keywords
transaction
signature
alice
fuzzy
bob
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202011467816.7A
Other languages
Chinese (zh)
Inventor
周由胜
钟天琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University of Post and Telecommunications
Original Assignee
Chongqing University of Post and Telecommunications
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 Chongqing University of Post and Telecommunications filed Critical Chongqing University of Post and Telecommunications
Priority to CN202011467816.7A priority Critical patent/CN112671540A/en
Publication of CN112671540A publication Critical patent/CN112671540A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention requests to protect a contract signing method, a system and a medium based on block chain and fair exchange. The method comprises the following steps: and in the fuzzy signature exchange stage, the initiator and the receiver exchange respective fuzzy signatures according to a concurrent signature algorithm based on bilinear pairings, and verify the fuzzy signatures. In the transaction stage, the initiator and the receiver generate corresponding blockchain transactions according to the key number hash value in the fuzzy signature of the other party. And in the disclosing stage, the initiator and the receiver disclose the corresponding secret values of the initiator and the receiver through blockchain transaction, and bind the fuzzy signature. The transaction verification phase will verify the exchange in conjunction with the blockchain state. The invention realizes the security properties of non-forgeability, fairness, non-tamper property and the like without a traditional credible third party. The computational and storage pressures of the server are no longer an issue. All of the computational pressure will be shared by the block link points, and the computational overhead is maintained at a low level.

Description

Contract signing method, system and medium based on block chain and fair exchange
Technical Field
The invention belongs to the technical fields of information security technology and Internet of things, and relates to a block chain-based fair exchange scheme which can be used for services such as contract signing in the fields of e-commerce and e-government affairs.
Background
Fair exchange plays a key role in businesses such as contract signing in the fields of e-commerce and e-government. Taking contract signing as an example, two parties signing a signature by a traditional paper contract are carried out in the same physical environment in the same place, and the two parties signing the signature are mutually supervised to finish the signature, so that the unfair problem hardly occurs. In a network environment, because both sides signing a contract have no trust basis, how to ensure the rights and interests of both sides exchanging, especially the fairness, is an important problem in the fields of e-commerce, e-government affairs and the like. A fair exchange protocol is an important protocol to solve this problem, so-called fair exchange, i.e. at the end of the exchange, each participant receives the desired item, or all participants do not receive it, the exchange is fair.
In the existing fair exchange scheme oriented to internet application, a solution with higher cost based on mutual trust of both sides of a service of a trusted third party is generally adopted. The application provides a block chain-based fair exchange scheme, an exchange model uses concurrent signatures, both exchange parties have own key numbers, and the key numbers are released through block chain transaction to bind respective signatures. The safety certification based on formalization and the performance test based on BitcoinCore show that the application has higher safety and better performance.
The invention designs a block chain-based fair exchange protocol, which is realized by using a concurrent signature technology, a bit currency P2SH and a time locking technology and by using the shunting of bit currency scripts, so that the fairness of exchange is ensured. The security analysis and the performance analysis show that the invention still has more ideal performance on the premise of ensuring the unforgeability and the fairness.
Disclosure of Invention
The present invention is directed to solving the above problems of the prior art. A contract signing method based on block chain and fair exchange is provided. The technical scheme of the invention is as follows:
a contract signing method based on block chain and fair exchange comprises the following steps:
fuzzy signature exchange stage: the initiator and the receiver exchange respective fuzzy signatures according to a concurrent signature algorithm based on bilinear pairings, and verify the fuzzy signatures;
a transaction stage: the initiator and the receiver generate corresponding bitcoin-based blockchain transaction according to the key number hash value in the fuzzy signature of the other party;
and (3) a disclosure stage: the initiator and the receiver disclose the corresponding secret values through blockchain transaction and bind the fuzzy signature;
a transaction verification stage: the exchange will be verified in connection with the blockchain status.
Further, in the fuzzy signature exchange stage, the concurrent signature algorithm based on bilinear pairings specifically includes:
the specific construction of the concurrent signature algorithm comprises four steps, specifically system setting, fuzzy signature and fuzzy signature verification, wherein the signature verification comprises the following steps:
the system is set up by giving a safety parameter l, selecting large prime numbers p and q, q | p-1, q length l-bit, G1Is a q-order addition group, G2Is a group of q factorials, G being G1G, bilinear mapping e1×G1→G2Two cryptographically secure hash functions H1,H2:{0,1}*→ZqThe domains S, F, K are defined as S.ident.F ═ Zq,K={0,1}*Private key xiRandomly from ZqOf (1) public key Xi=xiG; fuzzy signature by<Xi,Xj,xi,f,M>As input, wherein Xi,Xj≠XiIs a public key, xi∈ZqIs XiCorresponding private key, F belongs to F and is a hash value corresponding to the key number, M is the message to be signed, and the algorithm selects a random number r belongs to ZqAnd the following operations are carried out:
h=H2(e(rG,fXj))||M) (1)
h1=h-fmod q (2)
s=r-h1ximod q (3)
algorithm output σ ═<s,h1,f>(ii) a Wherein H2Is a cryptographically secure hash function, h is ANDInformation-dependent hash value, h1S is a parameter for subsequent fuzzy signature verification;
fuzzy signature verification by taking S as<σ,Xi,Xj,M>As input, S is only a parameter set<σ,Xi,Xj,M>For convenience of description, wherein σ ═<s,h1,f>And checking an algorithm:
h1+f=H2(e(sG+h1Xi,fXj)||M) (4)
signature verification by<k,S,R>As input, where k ∈ ZqIs the corresponding key number, R ═ kxi -1G and R are parameters for verifying the key number k, and the algorithm checks:
f=H1(k) (5)
e(R,Xi)=e(G,G)k (6)
H1r is a parameter for the authentication key number k, which is a cryptographically secure hash function.
Further, in the fuzzy signature exchange stage, the bilinear pairs specifically include:
let the security parameter be l, select large prime numbers p and q, q | p-1, q length be l-bit, G1Is a q-order addition group, G2Is a group of q factorials, G being G1If e is mapped to G1×G1→G2The following properties are satisfied and are called bilinear pairs:
1) bilinear: for any a, b ∈ Zq,P,Q∈G1E (aP, bQ) ═ e (P, Q)ab(ii) a P and Q are additive groups G1Any of (1);
2) non-degradability: presence of P, Q ∈ G1,e(P,Q)≠1;
3) Calculability: for any P, Q ∈ G1There is an efficient algorithm to compute e (P, Q).
Further, the transaction stage adopts a bitcoin transaction form, specifically:
the transaction committed by TxCommit can be carried out in two waysRedemption, a transaction redeemed by the recipient through the disclosure of the corresponding key number, a transaction redeemed by the exchange originator after a certain time with its own signature, assuming the exchange was initiated by Alice and received by Bob, assuming Alice prepared a sufficient amount of transaction input In advance, In txcomp transaction, whose input is a transaction prepared In advance by the exchange originator with sufficient UTXO, referenced by txcomp, In-script unlocks the transaction through its own signature for the originator, using UTXO therein, Out-script is a condition for using txcomp output, one is to provide k such that k (k) f is satisfied, one is to provide ver after time tA(body,σ2) Redeeming the transaction output of TxCommit, Val representing the amount of money of the transaction output, and Tlock representing the lock time of the transaction output.
Further, the fuzzy signature exchange stage specifically includes the following steps:
alice is used as an initiator of the agreement, Bob is used as a receiver of the agreement, and Alice's public and private key pair<xA,XA>Public and private key pair of Bob<xB,XB>The fuzzy signature switching node is specifically implemented as follows: alice selects a random number kA∈ZqAs a key number, and calculating f ═ H1(kA),RA=kAxA -1G, Alice runs ASIGN algorithm and inputs<XA,XB,xA,f,M>To obtain a fuzzy signature sigmaA=<s,h1,f>Will be<σA,RA>Together sent to Bob;
when Bob receives the fuzzy signature from Alice, the AVERIFY algorithm is executed, and the input of the algorithm is S ═<σA,XA,XB,M>. If AVERIFY (σ)A,XA,XBM) TRUE, Bob receives the message and selects a random number kB∈ZqAs a key number, and calculating a key number hash value f ═ H1(kB),RB=kBxB -1G, running ASIGN algorithm, inputting<XB,XA,xB,f',M>To obtain a fuzzy signature sigmaA=<s',h1',f'>Will be<σB,RB>Sending the data to Alice together;
when Alice receives the fuzzy signature of Bob, AVERIFY algorithm is executed, and the input of the algorithm is S ═<σB,XB,XA,M>If AVERIFY (σ)B,XB,XAM) TRUE, Alice accepts the message.
Further, the implementation of the transaction stage specifically includes: after the exchange of the fuzzy signatures is completed, the two transaction parties construct the bitcoin transaction meeting the agreement;
transaction for initiator Alice to create x-bit coins
Figure BDA0002835061330000041
The ID of the transaction is IDAConditional payments and time lock settings involving bitcoins will be made in the UTXO of the transaction and Alice will make a lock script<f'>Set therein, Bob is expected to provide its original image to redeem the output;
for this transaction, Bob may release his key number k by releasing his own key numberBTo redeem the transaction, Alice may redeem the transaction after time t with his own signature, and the responder Bob will create a transaction in x bitcoins
Figure BDA0002835061330000042
The ID of the transaction is IDBConditional payments and time-lock settings involving bitcoins will be involved in the UTXO of the transaction, and Bob will be in the lock script<f>Set therein, it is expected that Alice provides a corresponding pre-image to redeem the output; for this transaction, Alice releases its key number kATo redeem the transaction, Bob can redeem the transaction after time t with his own signature.
Further, the disclosure stage specifically includes the steps of:
if the transaction phase is successfully completed, Alice and Bob will jointly complete the disclosure phase;
alice quote transaction
Figure BDA0002835061330000051
And are provided with<Alice’s Sig><kA>True as an unlocking script, generating a transaction
Figure BDA0002835061330000055
The transaction ID is recorded as ID'AThis step is equal to the public Alice's key number kAAnd publicly verifying that f is H1(kA);
Bob through ID'ASearching the transaction, analyzing the unlocking script used by Alice to generate the transaction<Alice’s Sig><kA>True, k from which Alice's is extractedA. Bob will sign σ the fuzzy signature received from AliceAVerification was performed using equation (6):
Figure BDA0002835061330000052
if the last step of verification passes, Bob transacts by reference
Figure BDA0002835061330000053
And are provided with<Bob’s Sig><kB>True as an unlocking script, generating a transaction
Figure BDA0002835061330000056
The transaction ID is ID'B. Equivalent to the disclosure kBAnd verifying f' ═ H1(kB),
Alice passes ID'BRetrieve transactions, extract Bob's key number k from themB. Alice will sign σ the ambiguity received from BobBVerify using equation (6):
Figure BDA0002835061330000054
further, the transaction verification stage specifically includes:
TXVERIFY(<k,S>,<k',S'>,<IDA,IDA'>,<IDB,IDB'>)
where k represents Alice's key number kAS represents the set of parameters of Alice<σA,XA,XB,M>And k' represents the key number k of BobBS' represents the parameter set of Bob<σB,XB,XA,M>The input to the algorithm is the transaction ID, and when the amount is redeemed with the key hash's primitive, the algorithm outputs True; when redeemed by the originator of the transaction with its own signature after a time t determined by the time-lock, the algorithm outputs False, for the purposes of redeeming the transaction txcomp, there are two different possibilities, when the transaction is redeemed by disclosing the correct keystone, the new transaction generated is called TxOpen; when the transaction is redeemed after time lock t, by its originator's own signature, the resulting transaction is called TxReturn; let the transaction ID of TxCommit be ID at this timeARedemption of TxCommit transaction ID as IDA';
A secondary algorithm:
Quote(<k,S>,<IDA,IDA'>)=True
checking IDAWhether the locking script references the key hash value f, ID in SA' whether the unlocking script refers to a key number k or not, and if yes, the output is True;
Quote(<k',S'>,<IDB,IDB'>)=True
in the same way, if the above are True,
TXVERIFY(<k,S>,<k',S'>,<IDA,IDA'>,<IDB,IDB'>) And returning True, otherwise, returning False.
A block chain and fair exchange contract signing system, comprising: the initiator: as an initiator of the protocol, firstly selecting a key number of the initiator, generating a corresponding key number hash value, generating a fuzzy signature through a fuzzy signature algorithm, and sending the fuzzy signature to a receiver;
the receiver: after receiving the fuzzy signature of the initiator, the receiver checks the signature correspondingly, and if the signature passes the corresponding check, the receiver generates the fuzzy signature of the receiver as the initiator according to the protocol requirement and sends the fuzzy signature to the initiator;
block chains: and when the initiator and the receiver both receive the fuzzy signature of the other party, generating corresponding blockchain transactions according to the key number hash value of the other party. The blockchain node packages the transactions for uplink. The issuer will initiate a transaction of the passkey number at the open stage in order to redeem the amount in the blockchain transaction. In the verification stage, the algorithm reads the state of the blockchain transaction to complete verification.
A medium storing computer executable instructions for implementing the method of any one of claims 1 to 8 when executed.
The invention has the following advantages and beneficial effects:
the invention provides a fair exchange scheme realized by a concurrent signature scheme based on a block chain, which takes the transaction state of the block chain as a verification condition for successful exchange and does not need to invest money with the same value as a contract to be signed in the block chain transaction as a guarantee by an exchange participant. The blockchain transaction involved in the scheme can be completed by a native system completely using bitcoin without additionally developing an intelligent contract.
The invention is a fair exchange scheme realized based on a block chain, and can realize safety, fairness and usability under the condition of not participating by a trusted third party. In general, the computational and storage pressures of the server are no longer an issue since there are no traditional trusted third parties. All the computing pressure is shared by all the nodes, the scheme has higher efficiency under the current computing environment, and the computing cost is maintained at a lower level.
The invention is based on the characteristic of concurrent signature of claim 2, both sides of contract exchange can exchange fuzzy signature and carry on the preliminary verification, the fuzzy signature can not bind with concrete signer, the verification algorithm is based on the characteristic of bilinear pairing of claim 3, can disclose the verification fuzzy signature under the condition that the secret value is not disclosed. In conjunction with the bitcoin-based blockchain transaction embodiment of claim 4, exchange participants can be given the opportunity to publish key numbers or redeem transactions by initiating new transactions. In particular, the exchange participant discloses the corresponding key numbers in claim 6 and claim 7, respectively. The signature verification algorithm according to claim 2 can verify that the key number is correct after the key number is disclosed and bind the identity of the signer with its signature so that the signature is no longer ambiguous.
Finally, the biggest difference from the existing solutions is based on the transaction verification algorithm described in claim 8. The blockchain transaction in the invention does not need to include the equivalent blockchain currency of the exchange contract in the transaction, and the application range can be greatly improved. The impossibility of tampering with the blockchain is heavily applied, so that the transaction status is unchangeable. And the transactions in claim 6 and claim 7 may publicly verify the key number. In general terms rights 1-8 fulfill the need for a fair exchange of contract endorsements in an internet environment and a blockchain based implementation can make the exchange publicly verifiable and tamper-proof.
Drawings
FIG. 1 is a diagram of a system model in accordance with a preferred embodiment of the present invention;
FIG. 2 is a diagram of a transaction model of the present invention;
fig. 3 is a transaction flow diagram of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described in detail and clearly with reference to the accompanying drawings. The described embodiments are only some of the embodiments of the present invention.
The technical scheme for solving the technical problems is as follows:
the frame of the system is described below in conjunction with fig. 1.
The initiator: as an initiator of the protocol, the initiator selects a key number of the initiator and generates a corresponding key number hash value, generates a fuzzy signature through a fuzzy signature algorithm, and sends the fuzzy signature to a receiver.
The receiver: after receiving the fuzzy signature of the initiator, the receiver checks the signature correspondingly, and if the signature passes the corresponding check, the receiver generates the fuzzy signature of the receiver as the initiator according to the protocol requirement and sends the fuzzy signature to the initiator.
Block chains: and when the initiator and the receiver both receive the fuzzy signature of the other party, generating corresponding blockchain transactions according to the key number hash value of the other party. The blockchain node packages the transactions for uplink. The issuer will initiate a transaction of the passkey number at the open stage in order to redeem the amount in the blockchain transaction. In the verification stage, the algorithm reads the state of the blockchain transaction to complete verification.
The bitcoin transaction model of the present invention is described in further detail below with reference to fig. 2. The method comprises the following specific steps:
the txcommt committed transaction herein can be redeemed in two ways, one by the recipient through the disclosure of a corresponding key number (key) and one by the exchange originator after a certain time through its own signature. For purposes of illustration, this section assumes that the exchange is initiated by Alice and received by Bob. Assuming Alice prepares a transaction input of sufficient amount In advance, the transaction process is as shown In FIG. 2, In TxCommit transaction, where its input is enough UTXO transaction prepared In advance for the exchange initiator, referenced by TxCommit, In-script unlocks the transaction for the initiator by its own signature, UTXO is used, Out-script is the condition for using TxCommit output, one is to provide k so that K (k) ═ f is satisfied, one is to satisfy ver by providing it after time tA(body,σ2) The signature of (c) redeems the transaction output of txcommt. Val represents the amount of the transaction output and Tlock represents the lock time for the transaction output.
The transaction flow of the present invention is further described in detail with reference to fig. 3, which specifically includes the following modules and steps:
1) bilinear pairings:
let the security parameter be l, select the large prime numbers p and q (q | p-1, q length l-bit). G1Is a q-order addition group, G2Is a q-factorial group. G is G1The generator of (1). If mapping e: G1×G1→G2The following properties are satisfied and are called bilinear pairs:
bilinear: for any a, b ∈ Zq,P,Q∈G1P and Q are additive groups G1Any element in (b) is e (P, Q) ═ e (aP, bQ)ab
Non-degradability: presence of P, Q ∈ G1,e(P,Q)≠1。
Calculability: for any P, Q ∈ G1There is an efficient algorithm to compute e (P, Q).
2) And (3) concurrent signature algorithm:
the specific construction of the concurrent signature algorithm based on bilinear pairings (SETUP, ASIGN, averfy, VERIFY) is as follows:
the system sets up that given a security parameter l, large prime numbers p and q (q | p-1, q length l-bit) are chosen. G1Is a q-order addition group, G2Is a q-factorial group. G is G1The generator of (1). Bilinear mapping e G1×G1→G2. Two cryptographically secure hash functions H1,H2:{0,1}*→Zq. The domains S, F, K are defined as S ≡ F ═ Zq,K={0,1}*Private key xiRandomly from ZqTo select. Public key Xi=xiG. Fuzzy signature-the algorithm will be<Xi,Xj,xi,f,M>As an input. Wherein Xi,Xj≠XiIs a public key. x is the number ofi∈ZqIs XiThe corresponding private key. F ∈ F is a hash value corresponding to the key number. M is the message to be signed. The algorithm selects a random number r epsilon ZqAnd the following operations are carried out:
h=H2(e(rG,fXj))||M) (7)
h1=h-fmod q (8)
s=r-h1ximod q (9)
algorithm output σ ═<s,h1,f>. Wherein H2For cryptographically secure hash functions, h is associated with the message
Hash value of h1And s is a parameter for subsequent verification of the fuzzy signature.
Fuzzy signature verificationIt is verified that the algorithm will be expressed as S<σ,Xi,Xj,M>As an input. Wherein σ ═<s,h1,f>. And (3) checking an algorithm:
h1+f=H2(e(sG+h1Xi,fXj)||M) (10)
signature verification algorithm to<k,S,R>As an input. Wherein k ∈ ZqIs the corresponding key number. R ═ kxi -1G. And (3) checking an algorithm:
f=H1(k) (11)
e(R,Xi)=e(G,G)k (12)
H1r is a parameter for the authentication key number k, which is a cryptographically secure hash function.
3) A fair switching scheme:
a block chain based fair switching scheme. Without loss of generality, Alice is used as the initiator of the protocol, and Bob is used as the responder of the protocol. Public and private key pair of Alice<xA,XA>Public and private key pair of Bob<xB,XB>。
The scheme is divided into four stages, namely a fuzzy signature exchange stage, a transaction stage, an open stage and a transaction verification stage. The details are as follows.
Fuzzy signature exchange stage: alice selects a random number kA∈ZqAs a critical number. And calculating f ═ H1(kA)。RA=kAxA -1G. Alice runs the ASIGN algorithm. Input device<XA,XB,xA,f,M>To obtain a fuzzy signature sigmaA=<s,h1,f>. Will be provided with<σA,RA>Sent to Bob together.
When Bob receives the fuzzy signature from Alice, averfy algorithm is performed. The algorithm input is S ═<σA,XA,XB,M>. If AVERIFY (σ)A,XA,XBM) TRUE, Bob receives the message and selects a random number kB∈ZqAs a critical number.And calculating the key hash value f ═ H1(kB),RB=kBxB -1G. The ASIGN algorithm is run. Input device<XB,XA,xB,f',M>To obtain a fuzzy signature sigmaA=<s',h1',f'>. Will be provided with<σB,RB>Sent to Alice together.
When Alice receives Bob's fuzzy signature, the AVERIFY algorithm is executed. The algorithm input is S ═<σB,XB,XA,M>. If AVERIFY (σ)B,XB,XAM) TRUE, Alice accepts the message. A transaction stage: after the exchange of the fuzzy signatures is completed, the two parties to the transaction will construct a bitcoin transaction that satisfies the agreement.
The transaction forms used in the article are described in detail herein using bitcoin as an example. These requirements must be met by the script herein, which refers to script opcodes such as literature, since in the schema construction, the redemption of the same UTXO under different conditions, and the time-lock on the UTXO are involved[24]As shown. One powerful function of bitcoin scripting is flow control, but since bitcoin scripting is stack-based language, logical conditions occur before if.
Initiator Alice creates a transaction in x bitcoins
Figure BDA0002835061330000111
The ID of the transaction is IDA. The conditional payment and time lock setting involving the bitcoin will be in the UTXO for the transaction. In the locking script Alice will handle<f'>Where Bob is expected to provide its original image to redeem the output. Specific transaction scripts are as follows in table 1:
TABLE 1
Figure BDA0002835061330000112
Locking scripts
Table1
Figure BDA0002835061330000113
Lock script
Figure BDA0002835061330000114
For this transaction, Bob may release his key number k by releasing his own key numberBTo redeem the transaction, Alice may redeem the transaction after time t with his own signature.
The responder Bob will create a transaction in x bitcoins
Figure BDA0002835061330000115
The ID of the transaction is IDB. The conditional payment and time lock setting involving the bitcoin will be in the UTXO for the transaction. In the locked script Bob will set f in it, expecting Alice to provide a corresponding pre-image to redeem the output. The specific transaction script is shown in table 2:
TABLE 2
Figure BDA0002835061330000116
Locking scripts
Table2
Figure BDA0002835061330000117
Lock script
Figure BDA0002835061330000118
For this transaction, Alice releases its key number kATo redeem the transaction, Bob can redeem the transaction after time t with his own signature.
And (3) a disclosure stage: if the transaction phase is successfully completed, Alice and Bob will collectively complete the disclosure phase.
Alice quote transaction
Figure BDA0002835061330000121
And are provided with<Alice’s Sig><kA>True as an unlocking script, generating a transaction
Figure BDA0002835061330000126
The transaction ID is recorded as ID'A. This step is equal to the critical number k of public AliceAAnd publicly verifying that f is H1(kA)。
Bob through ID'ASearching the transaction, analyzing the unlocking script used by Alice to generate the transaction<Alice’s Sig><kA>And (6) True. K from which Alice is extractedA. Bob will sign σ the fuzzy signature received from AliceAVerification was performed using equation (6):
Figure BDA0002835061330000122
if the last step of verification passes, Bob transacts by reference
Figure BDA0002835061330000123
And are provided with<Bob’s Sig><kB>True as an unlocking script, generating a transaction
Figure BDA0002835061330000124
The transaction ID is ID'B. Key number k equivalent to Bob of the publicationBAnd verifying f' ═ H1(kB)。
Alice passes ID'BRetrieve transaction from which Bob's key number k is advancedB. Alice will sign σ the ambiguity received from BobBVerify using equation (6):
Figure BDA0002835061330000125
a transaction verification stage:
TXVERIFY(<k,S>,<k',S'>,<IDA,IDA'>,<IDB,IDB'>)
where k represents Alice's key number kAS represents the set of parameters of Alice<σA,XA,XB,M>And k' represents the key number k of BobBS' represents the parameter set of Bob<σB,XB,XA,M>. The input to the algorithm is the transaction ID, and when the amount is redeemed with the key hash's primitive, the algorithm outputs True. When redeemed with its signature by the originator of the transaction after a time t determined by the time-lock, the algorithm outputs False. Specifically, from the transaction model diagram of FIG. 2, it can be seen that there are two different possibilities for redeeming the transaction TxCommit. When the transaction is redeemed by disclosing the correct keystone, the new transaction generated we call TxOpen. When the transaction is redeemed after time lock t, by the transaction's originator's own signature, the resulting transaction we call TxReturn. For the sake of brevity of the following description. Let us assume the transaction ID of TxCommit at this time as IDARedemption of TxCommit transaction ID as IDA'。
A secondary algorithm:
Quote(<k,S>,<IDA,IDA'>)=True
checking IDAWhether the locking script references the key hash value f, ID in SAWhether the unlock script of' refers to the key number k. If so, the output is True.
Quote(<k',S'>,<IDB,IDB'>)=True
As above. If the values above are all True,
TXVERIFY(<k,S>,<k',S'>,<IDA,IDA'>,<IDB,IDB'>) And returning True, otherwise, returning False.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above examples are to be construed as merely illustrative and not limitative of the remainder of the disclosure. After reading the description of the invention, the skilled person can make various changes or modifications to the invention, and these equivalent changes and modifications also fall into the scope of the invention defined by the claims.

Claims (10)

1. A contract signing method based on block chain and fair exchange is characterized by comprising the following steps:
fuzzy signature exchange stage: the initiator and the receiver exchange respective fuzzy signatures according to a concurrent signature algorithm based on bilinear pairings, and verify the fuzzy signatures;
a transaction stage: the initiator and the receiver generate corresponding bitcoin-based blockchain transaction according to the key number hash value in the fuzzy signature of the other party;
and (3) a disclosure stage: the initiator and the receiver disclose the corresponding secret values through blockchain transaction and bind the fuzzy signature;
a transaction verification stage: the exchange will be verified in connection with the blockchain status.
2. The contract signing method based on block chain and fair exchange according to claim 1, wherein in the fuzzy signature exchange stage, the concurrent signature algorithm based on bilinear pairings specifically includes:
the specific construction of the concurrent signature algorithm comprises four steps, specifically system setting, fuzzy signature and fuzzy signature verification, wherein the signature verification comprises the following steps:
the system is set up by giving a safety parameter l, selecting large prime numbers p and q, q | p-1, q length l-bit, G1Is a q-order addition group, G2Is a group of q factorials, G being G1G, bilinear mapping e1×G1→G2Two cryptographically secure hash functions H1,H2:{0,1}*→ZqThe domains S, F, K are defined as S.ident.F ═ Zq,K={0,1}*Private key xiRandomly from ZqOf (1) public key Xi=xiG; fuzzy signature by<Xi,Xj,xi,f,M>As input, wherein Xi,Xj≠XiIs a public key, xi∈ZqIs XiCorresponding private key, F belongs to F and is a hash value corresponding to the key number, M is the message to be signed, and the algorithm selects a random number r belongs to ZqAnd the following operations are carried out:
h=H2(e(rG,fXj))||M) (1)
h1=h-f mod q (2)
s=r-h1ximod q (3)
algorithm output σ ═<s,h1,f>(ii) a Wherein H2Is a cryptographically secure hash function, h is a hash value associated with the message, h1S is a parameter for subsequent fuzzy signature verification;
fuzzy signature verification by taking S as<σ,Xi,Xj,M>As input, S is only a parameter set<σ,Xi,Xj,M>For convenience of description, wherein σ ═<s,h1,f>And checking an algorithm:
h1+f=H2(e(sG+h1Xi,fXj)||M) (4)
signature verification by<k,S,R>As input, where k ∈ ZqIs the corresponding key number, R ═ kxi -1G and R are parameters for verifying the key number k, and the algorithm checks:
f=H1(k) (5)
e(R,Xi)=e(G,G)k (6)
H1r is a parameter for the authentication key number k, which is a cryptographically secure hash function.
3. The contract signing method based on block chain and fair exchange according to claim 2, wherein in the fuzzy signature exchange stage, the bilinear pairings specifically include:
let the security parameter be l, select large prime numbers p and q, q | p-1, q length be l-bit, G1Is a q-order addition group, G2Is a group of q factorials, G being G1If e is mapped to G1×G1→G2The following properties are satisfied and are called bilinear pairs:
1) bilinear: for any a, b ∈ Zq,P,Q∈G1E (aP, bQ) ═ e (P, Q)ab(ii) a P and Q are additive groups G1Any of (1);
2) non-degradability: presence of P, Q ∈ G1,e(P,Q)≠1;
3) Countable meterCalculability: for any P, Q ∈ G1There is an efficient algorithm to compute e (P, Q).
4. The contract signing method based on block chain and fair exchange according to claim 3, characterized in that the transaction phase adopts a bitcoin transaction form, specifically:
the redemption can be carried Out In two ways, one is carried Out by a receiver through disclosing a corresponding key number keystone, the other is carried Out by an exchange initiator through a signature of the exchange initiator after a certain time, the exchange is assumed to be initiated by Alice, the exchange is received by Bob, the Alice is assumed to prepare transaction input with enough money In advance, In the TxCommit transaction, the transaction input is prepared for the exchange initiator In advance and has enough UTXO, the transaction is quoted by TxCommit, In-script is used for the initiator to unlock the transaction through the signature of the initiator, UTXO is used, Outscript is used as a condition for using TxCommit output, the other is to provide k, so that K (k) f is satisfied, and the other is carried Out by providing a condition of satisfying ver after the time tA(body,σ2) Redeeming the transaction output of TxCommit, Val representing the amount of money of the transaction output, and Tlock representing the lock time of the transaction output.
5. The contract signing method based on block chain and fair exchange according to claim 2, wherein the fuzzy signature exchange stage specifically comprises the following steps:
alice is used as an initiator of the agreement, Bob is used as a receiver of the agreement, and Alice's public and private key pair<xA,XA>Public and private key pair of Bob<xB,XB>The fuzzy signature switching node is specifically implemented as follows:
alice selects a random number kA∈ZqAs a key number, and calculating f ═ H1(kA),RA=kAxA -1G, Alice runs ASIGN algorithm and inputs<XA,XB,xA,f,M>To obtain a fuzzy signature sigmaA=<s,h1,f>Will be<σA,RA>Together sent to Bob;
when Bob receives the fuzzy signature from Alice, the AVERIFY algorithm is executed, and the input of the algorithm is S ═<σA,XA,XB,M>. If AVERIFY (σ)A,XA,XBM) TRUE, Bob receives the message and selects a random number kB∈ZqAs a key number, and calculating a key number hash value f ═ H1(kB),RB=kBxB -1G, running ASIGN algorithm, inputting<XB,XA,xB,f',M>To obtain a fuzzy signature sigmaA=<s',h1',f'>Will be<σB,RB>Sending the data to Alice together;
when Alice receives the fuzzy signature of Bob, AVERIFY algorithm is executed, and the input of the algorithm is S ═<σB,XB,XA,M>If AVERIFY (σ)B,XB,XAM) TRUE, Alice accepts the message.
6. The contract signing method based on block chain and fair exchange according to claim 5, wherein the specific implementation of the transaction phase specifically comprises: after the exchange of the fuzzy signatures is completed, the two transaction parties construct the bitcoin transaction meeting the agreement;
transaction TxCommit in which initiator Alice creates an x-bit currencyIDAThe ID of the transaction is IDAConditional payments and time lock settings involving bitcoins will be made in the UTXO of the transaction and Alice will make a lock script<f'>Set therein, Bob is expected to provide its original image to redeem the output;
for this transaction, Bob may release his key number k by releasing his own key numberBTo redeem the transaction, Alice may redeem the transaction after time t with his own signature, and the responder Bob will create a transaction in x bitcoins
Figure FDA0002835061320000041
The ID of the transaction is IDBAt UT of the transactionConditional payments and time lock settings in XO will involve bitcoins, and Bob will hold in the lock script<f>Set therein, it is expected that Alice provides a corresponding pre-image to redeem the output; for this transaction, Alice releases its key number kATo redeem the transaction, Bob can redeem the transaction after time t with his own signature.
7. The contract signing method based on block chain and fair exchange according to claim 6, characterized in that the publishing phase specifically comprises the following steps:
if the transaction phase is successfully completed, Alice and Bob will jointly complete the disclosure phase;
alice quote transaction
Figure FDA0002835061320000042
And are provided with<Alice’s Sig><kA>True as an unlocking script, generating a transaction
Figure FDA0002835061320000043
The transaction ID is recorded as ID'AThis step is equal to the public Alice's key number kAAnd publicly verifying that f is H1(kA);
Bob through ID'ASearching the transaction, analyzing the unlocking script used by Alice to generate the transaction<Alice’s Sig><kA>True, k from which Alice's is extractedA. Bob will sign σ the fuzzy signature received from AliceAVerification was performed using equation (6):
Figure FDA0002835061320000044
if the last step of verification passes, Bob transacts by reference
Figure FDA0002835061320000045
And are provided with<Bob’s Sig><kB>True as an unlocking script, generating a transaction
Figure FDA0002835061320000046
The transaction ID is ID'B. Equivalent to the disclosure kBAnd verifying f' ═ H1(kB),
Alice passes ID'BRetrieve transactions, extract Bob's key number k from themB. Alice will sign σ the ambiguity received from BobBVerify using equation (6):
Figure FDA0002835061320000047
8. the contract signing method based on block chain and fair exchange according to claim 7, wherein the transaction verification stage specifically comprises:
TXVERIFY(<k,S>,<k',S'>,<IDA,IDA'>,<IDB,IDB'>)
where k represents Alice's key number kAS represents the set of parameters of Alice<σA,XA,XB,M>And k' represents the key number k of BobBS' represents the parameter set of Bob<σB,XB,XA,M>The input to the algorithm is the transaction ID, and when the amount is redeemed with the key hash's primitive, the algorithm outputs True; when redeemed by the originator of the transaction with its own signature after a time t determined by the time-lock, the algorithm outputs False, for the purposes of redeeming the transaction txcomp, there are two different possibilities, when the transaction is redeemed by disclosing the correct keystone, the new transaction generated is called TxOpen; when the transaction is redeemed after time lock t, by its originator's own signature, the resulting transaction is called TxReturn; let the transaction ID of TxCommit be ID at this timeARedemption of TxCommit transaction ID as IDA';
A secondary algorithm:
Quote(<k,S>,<IDA,IDA'>)=True
checking IDAWhether the locking script references the key hash value f, ID in SA' whether the unlocking script refers to a key number k or not, and if yes, the output is True;
Quote(<k',S'>,<IDB,IDB'>)=True
in the same way, if the above are True,
TXVERIFY(<k,S>,<k',S'>,<IDA,IDA'>,<IDB,IDB'>) And returning True, otherwise, returning False.
9. A contract signing system of block chain and fair exchange based on the method of any one of claims 1-8, comprising: the initiator: as an initiator of the protocol, firstly selecting a key number of the initiator, generating a corresponding key number hash value, generating a fuzzy signature through a fuzzy signature algorithm, and sending the fuzzy signature to a receiver;
the receiver: after receiving the fuzzy signature of the initiator, the receiver checks the signature correspondingly, and if the signature passes the corresponding check, the receiver generates the fuzzy signature of the receiver as the initiator according to the protocol requirement and sends the fuzzy signature to the initiator;
block chains: and when the initiator and the receiver both receive the fuzzy signature of the other party, generating corresponding blockchain transactions according to the key number hash value of the other party. The blockchain node packages the transactions for uplink. The issuer will initiate a transaction of the passkey number at the open stage in order to redeem the amount in the blockchain transaction. In the verification stage, the algorithm reads the state of the blockchain transaction to complete verification.
10. A medium storing computer executable instructions for implementing the method of any one of claims 1 to 8 when executed.
CN202011467816.7A 2020-12-14 2020-12-14 Contract signing method, system and medium based on block chain and fair exchange Pending CN112671540A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011467816.7A CN112671540A (en) 2020-12-14 2020-12-14 Contract signing method, system and medium based on block chain and fair exchange

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011467816.7A CN112671540A (en) 2020-12-14 2020-12-14 Contract signing method, system and medium based on block chain and fair exchange

Publications (1)

Publication Number Publication Date
CN112671540A true CN112671540A (en) 2021-04-16

Family

ID=75405745

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011467816.7A Pending CN112671540A (en) 2020-12-14 2020-12-14 Contract signing method, system and medium based on block chain and fair exchange

Country Status (1)

Country Link
CN (1) CN112671540A (en)

Similar Documents

Publication Publication Date Title
US11936774B2 (en) Determining a common secret for the secure exchange of information and hierarchical, deterministic cryptographic keys
CN112215608B (en) Data processing method and device
CN109377215B (en) Block chain transaction method and device and electronic equipment
CN109359971B (en) Block chain transaction method and device and electronic equipment
CN111886831A (en) Computer-implemented system and method for implementing zero-knowledge proof
KR20200141502A (en) Computer-implemented systems and methods suitable for increasing the security of immediate offline blockchain transactions
TW201947482A (en) Computer-implemented systems and methods for using a blockchain to perform an atomic swap
WO2013031414A1 (en) Signature verification device, signature verification method, program, and recording medium
CN112801649B (en) Flow statistical system, method and device based on block chain
Yeh et al. A robust mobile payment scheme with smart contract-based transaction repository
CN111738857B (en) Generation and verification method and device of concealed payment certificate applied to block chain
CN111523892B (en) Block chain cross-chain transaction method and device
Lee et al. Privacy-preserving identity management system
Ni et al. Dual-anonymous off-line electronic cash for mobile payment
CN112184245B (en) Transaction identity confirmation method and device for cross-region block chain
CN116389164B (en) Data detection method and device
CN113902439A (en) Alliance chain cross-chain transaction method and device based on threshold signature
CN111539719B (en) Audit coin-mixing service method and system model based on blind signature
Li et al. A regulatable data privacy protection scheme for energy transactions based on consortium blockchain
Wang et al. A novel blockchain identity authentication scheme implemented in fog computing
CN112837064B (en) Signature method, signature verification method and signature verification device for alliance chain
CN112671540A (en) Contract signing method, system and medium based on block chain and fair exchange
Dotan et al. Haze: A compliant privacy mixer
Abadi et al. Recurring contingent payment for proofs of retrievability
Dai et al. A supervised anonymous issuance scheme of central bank digital currency based on blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210416

RJ01 Rejection of invention patent application after publication