A blockchain state channel method for secure multi-hop interaction
By introducing a secure multi-hop interaction blockchain state channel method into the blockchain channel network, combining the mechanisms of public key broadcasting, initialization transactions and multi-hop hash time locking, the problems of wormholes and sad attacks have been solved, and the problems of sad attacks have been improved. The security and scalability of the blockchain channel network reduces user waiting time and opportunity costs.
Patent Information
- Application Number
- CN202210613960.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-06-01
AI Technical Summary
There are wormhole attacks and sad attacks in the blockchain channel network, which leads to users' reluctance to participate in multi-hop interactions, which seriously hinders the development of the blockchain channel network.
Adopting a secure multi-hop interaction blockchain state channel method, through the process of public key broadcasting between users, regulators and third-party monitoring service providers, the establishment of initialized transactions and refund transactions, single-hop and multi-hop updates, As well as the mechanism of normal closing and disputed closing, combined with the mechanism of multi-hop hash time locking, the locking and unlocking sub-stages are designed to ensure the safety and reliability of the channel state.
Effectively resist wormhole attacks and sad attacks, reduce user waiting time, reduce opportunity costs, and protect user privacy, improving the security and scalability of blockchain channel networks.
Smart Images

Figure SMS_36 
Figure SMS_80 
Figure FDA0005064500400000014
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a blockchain state channel method for secure multi-hop interaction. Background Art
[0002] Blockchain technology is a credible distributed data storage technology with the characteristics of decentralization and immutability. However, the distributed blockchain is limited by the number of nodes and consensus algorithms, resulting in low performance in terms of throughput and scalability, which cannot meet the needs of applications in some fields, thus limiting the application of blockchain technology.
[0003] In order to solve the scalability and throughput problems of blockchain, scholars have proposed blockchain channel technology to expand blockchain from the off-chain to improve the scalability and throughput of blockchain. At present, this type of solution is mainly based on payment channels and state channels. However, in the multi-hop interaction process of the blockchain channel network based on hash time lock, malicious users can trigger wormhole attacks and sad attacks. First, in order to achieve interaction between different nodes, the hash time contract sets a long time interval △ for each hop, and it increases linearly with the increase of the multi-hop interaction path length L. Once there are multiple malicious users among the intermediate users who delay time, the remaining users will wait for a long time, thereby increasing the user's opportunity cost. Malicious users will deliberately extend the waiting time. This attack method that increases the opportunity cost by extending the waiting time is called a sad attack. Secondly, the existing channel network adopts the hash time lock mechanism and uses the same original image to perform multi-hop interaction. If there are two attackers in the multi-hop path, they can lock the multi-hop interaction path according to the same original image, thereby carrying out malicious attacks. This attack method is also called a wormhole attack. The existence of these two attacks makes channel users unwilling to participate in multi-hop interaction, which seriously hinders the further development of the blockchain channel network. Summary of the invention
[0004] The present invention aims to solve the security problem when blockchain uses channel technology.
[0005] The technical solution adopted by the present invention is:
[0006] A secure multi-hop interactive blockchain state channel method, comprising the following steps:
[0007] (1) Users, regulators, and third-party monitoring service provider WSP broadcast their public keys through the network to inform other roles, and all roles retain the corresponding public key information locally;
[0008] (2) Users interact with each other to determine the initial status of both parties, and contact the WSP to construct initialization transactions and refund transactions to establish a channel;
[0009] (3) Users interact with each other and update the established channel status. At the same time, the third-party monitoring service provider WSP records the intermediate status for the users. The update phase is divided into single-hop update and multi-hop update based on the different transaction target roles of the users.
[0010] (4) After the interaction between users is completed, the channel is closed according to the final channel status. Channel closure is divided into normal closure and dispute closure. Normal closure is when the channel users reach a closure agreement under normal circumstances. Dispute closure is when one user initiates the closure and the other party or WSP raises an objection.
[0011] Furthermore, step (2) specifically includes the following steps:
[0012] Step 201: User u and user l who participate in the WSP interaction negotiate the initial funding status of the channel between the two parties and
[0013] Step 202: After the negotiation is successful, user u generates a random number Nonce to represent the transaction version number, generates a random number CID to represent the unique identifier of the state channel, and then creates an initial transaction state Create refund transaction status wsp u ,wsp l denote the WSP and fee of user u and user l respectively. u ,fee l denote the routing costs of user u and user l respectively, They respectively represent the channel fund status of user u and user l when the status channel is closed;
[0014] Step 203: User u returns the refund transaction status St refund Generate signature u (St refund ) sent to user l;
[0015] Step 204: User l receives and verifies the other party's signature σ u (St refund ) and then the refund transaction status St refund Generate signature l (St refund ) is sent to user u;
[0016] Step 205: User u receives and verifies the other party's signature σ l (St refund ) will initialize the transaction status St funding Generate signature u (St funding) and send it to user l;
[0017] Step 206: User l receives and verifies the other party's signature σ u (St funding ) will initialize the transaction status St funding Generate signature l (St funding ) is sent to user u; user l initializes the transaction state St funding , signature σ u (St funding ) and σ l (St funding )Send to wsp l ;
[0018] Step 207: User u receives and verifies the other party's signature σ l (St funding ) will initialize the transaction status St funding , signature σ u (St funding ) and σ l (St funding )Send to wsp u ;
[0019] Step 208: wsp l After receiving and verifying the signature, generate And send to user l;wsp u After receiving and verifying the signature, generate And send it to user u;
[0020] Step 209: User l receives and verifies the signature Then send it to user u;
[0021] Step 210: User u receives and verifies the signature and After that, submit the channel contract CC and initialize the transaction to the blockchain Build a channel, the channel status is
[0022] Step 211: wsp u Construct transactions based on channel status Submit the watchtower contract, where deposit is wsp u fines in case of default;
[0023] Step 212: wsp l Construct transactions based on channel status Submit the watchtower contract, where deposit is wsp l Penalties in case of default.
[0024] Furthermore, step (3) specifically includes the following steps:
[0025] Single-hop update process:
[0026] Step 301: User u and user l interact off-chain to agree on the channel status i represents the i-th off-chain interaction between user u and user l, Indicates the fund status of user u in the channel during the i-th off-chain interaction, Indicates the fund status of user l in the channel during the i-th off-chain interaction;
[0027] Step 302: User u creates a committed transaction state Where t is the effective date of the transaction, user u generates a signature and sends {St com ,σ u (St com ),σ u (cid,Nonce+i)} is sent to user l;
[0028] Step 303: User l receives {St com ,σ u (St com ),σ u (cid,Nonce+i)}, verify the signature σ u (St com ) and σ u (cid,Nonce+i), if user l agrees with the distribution method of this committed transaction status, then sign and send σ l (St com ) and σ l (cid,Nonce+i) to user u;
[0029] Step 304: User u verifies user l's σ l (St com ) and σ l (cid,Nonce+i) and then use the supervisor's public key pk sp {St com ,σ u (St com ),σ l (St com )} Encryption generation Finally, the encrypted channel status information Send to wsp u ;
[0030] Step 305: wsp uVerify the three signatures of the channel cid status information sent by user u σ l (cid,Nonce+i) and σ u (cid,Nonce+i), after the signature verification is passed, wsp u Save the history status for user u
[0031] Step 306: wsp u Send a receipt to user u
[0032] Step 307: After receiving and verifying the receipt, user u sends a u Make offline payments;
[0033] Step 308: User l uses the supervisor's public key pk sp {St com ,σ u (St com ),σ l (St com )} Encryption generation Finally, the encrypted channel status information Send to wsp l ;
[0034] Step 309: wsp l Verify the three signatures of the channel cid status information sent by user l σ l (cid,Nonce+i) and σ u (cid,Nonce+i), after the signature verification is passed, wsp l Save the history status for user l
[0035] Step 310: wsp l Send a receipt to user l
[0036] Step 311: After receiving and verifying the receipt, user l sends the l Make offline payments;
[0037] Step 312: Repeat steps 301 to 311 until both parties or one of them intends to close the channel;
[0038] Multi-hop update process:
[0039] The multi-hop update is implemented based on the mechanism of multi-hop hash time lock, that is, multiple transactions use the same hash original image y=H(x) to determine the multi-hop path to achieve multi-hop interaction; it includes a locking sub-phase and an unlocking sub-phase. The locking sub-phase generates a multi-hop locking state in each hop of the path, and the unlocking sub-phase generates a multi-hop unlocking state in each hop of the path.
[0040] Furthermore, the specific implementation process of the locking sub-phase is as follows:
[0041] Step 3001: Set up user u and user l with the help of intermediate users u1, u2, ..., u n Interaction: User l generates a random number x for the channel and calculates the hash value y, satisfying y = H(x), and sends the hash value y to user u, who is regarded as the current user.
[0042] Step 3002: After the current user determines the interaction path, the next hop user u i Send multi-hop interaction request Req i and use user u i The public key pk ui Encrypted, including the next hop target u i , hash value y, interaction content a, waiting time t w , lock time t lock and the interaction request Req to the next hop i+1 ,Right now
[0043] Step 3003: A certain hop user u i Receive Req i After that, the new channel generates a multi-hop lock state Then user u i It is the multi-hop locking state St lock Generate signature σ ui (St lock ) and σ ui (cid,Nonce+j,y), send two signatures and St lock To user u i+1 ; where j represents the jth off-chain interaction of channel cid, Indicates user u in the jth off-chain interaction i The state of funds in the channel, Indicates user u in the jth off-chain interaction i+1 The status of funds in the channel;
[0044] Step 3004: User u i+1 Verify the previous hop user u i After returning the two signatures, generate the signature σ ui+1 (St lock) and σ ui+1 (cid,Nonce+j,y) is sent to u i , save the multi-hop locking state, and set user u i As the current user, i=i+1. Return to step 3002.
[0045] Furthermore, the specific implementation process of the unlocking sub-stage is as follows:
[0046] Step 3011: When user l is in t w If no multi-hop interaction request is received within the time, the user u of the previous hop i Send False to cancel the transaction. i Roll back the state and notify u i-1 , 1≤i≤n;
[0047] Step 3012: When user l is in t w After receiving the update request within the time, the user u of the previous jump i Send x; where x is the original image of the hash value y of the locked sub-phase;
[0048] Step 3013: User u i After receiving x, generate multi-hop unlocking status Next is St unlock Generate signature σ ui (St unlock ) and σ ui (cid,Nonce+j,y i ,x i ), send two signatures and St unlock To user u i-1 ; Where x is the original image of the hash value y of the locking sub-phase;
[0049] Step 3014: User u i-1 Verify user u i After returning the two signatures, the signature σ is generated ui-1 (St unlock ) and σ ui-1 (cid,Nonce+j,y i ,x i )Send to u i ;
[0050] Step 3015: User u i All unlocked unlock Execute the hash algorithm to generate H(St unlock )=Hash(St unlock ), then u i Unlock multi-hop status H(St unlock ),σui-1 (cid,Nonce+j,y i ,x i ),σ ui (cid,Nonce+j,y i ,x i ),σ ui (H(St unlock ))}Send it to its corresponding WSP;
[0051] Step 3016: WSP verifies user u i The signature and hash y i =H(x i ) after passing, for user u i Save the new history state
[0052] Step 3017: WSP generates a status receipt signature and sends it to the corresponding user u i Delivery Status Receipt
[0053] Step 3018: User u i After receiving and verifying the receipt, make offline payment to WSP.
[0054] Furthermore, step (4) specifically includes the following steps:
[0055] Normal shutdown process:
[0056] Step 4001: After m interactions, user u and user l agree to close the channel state.
[0057] Step 4002: User u signs the closed channel state and generates σ u (St clo ), and {St clo ,σ u (St clo )}Send to another user l;
[0058] Step 4003: User l receives {St clo ,σ u (St clo )}, after verifying the signature, if the allocation method of the closed channel state is agreed, the signature generation σ l (St clo ), send {St clo ,σ u (St clo ),σ l (St clo )} to the blockchain to close the channel;
[0059] Dispute closing process:
[0060] Step 4011: After m interactions, one of the users u submits a transaction with the old state to close the channel {St com ,σ u (St com ),σ l (St com )}, where
[0061] Step 4012: When user l is online, within time t, submit a channel closing transaction for building the latest channel state {St com ,σ u (St com ),σ l (St com )}, where After the blockchain receives the latest valid state within time t, it verifies the signature. After successful verification, it will accept the transaction submitted by user l to close the channel; among them, represents the fund status of user u in the channel during the j-th off-chain interaction, represents the fund status of user l in the channel during the j-th off-chain interaction, represents the fund status of user u in the channel during the m-th off-chain interaction, represents the fund status of user l in the channel during the m-th off-chain interaction, j < m, indicating that the fund status at the j-th time is the old state;
[0062] Step 4013: When user l is offline, within time t, the WSP of user l submits the latest {cid, Nonce + m, σ u (cid, Nonce + m),σ l (cid, Nonce + m),σ wsp (cid, Nonce + m)}. If j < m is satisfied, the channel will send the set fee l to the WSP, and then close the channel in a way that punishes user u, that is, user l gets User u obtains the fee u .
[0063] The present invention has the following advantages compared with the prior art:
[0064] The present invention realizes anti-wormhole attack. During the multi-hop process, the present invention designs a multi-secret interaction method, which breaks the hash identity of the original scheme, making it impossible for the adversary to update the hash value to infer the multi-hop interaction path, thus realizing anti-wormhole attack.
[0065] The present invention realizes resistance to sadness attacks. In the multi-hop process, the present invention adopts a novel multi-hop interaction protocol, which changes the original hop-by-hop interaction mode into a parallel interaction mode, reduces the waiting time of users in the path, reduces the opportunity cost, and realizes resistance to sadness attacks.
[0066] When the existing AMCU is used to resist the sad attack, multiple users are required to sign for a transaction at the same time, which leads to the problem of privacy leakage. In the present invention, although there are still multiple transactions, each transaction is signed by only two related users. Compared with the existing technology, user privacy can be effectively protected.
[0067] The existing AMHL technology does not consider the anti-sadness attack situation when realizing anti-wormhole attack. However, in the present invention, both anti-sadness attack and anti-wormhole attack are taken into account. DETAILED DESCRIPTION
[0068] The embodiment of the present invention provides a secure multi-hop interactive blockchain state channel method, which specifically includes the following steps:
[0069] (1) Users, regulators, and third-party monitoring service provider WSP broadcast their public keys through the network to inform other roles, and all roles retain the corresponding public key information locally;
[0070] (2) Users interact with each other to determine the initial status of both parties, contact the WSP, construct initialization transactions and refund transactions, and establish a channel; specifically, the following steps are included:
[0071] Step 201: User u and user l who participate in the WSP interaction negotiate the initial funding status of the channel between the two parties and
[0072] Step 202: After the negotiation is successful, user u generates a random number Nonce to represent the transaction version number, generates a random number CID to represent the unique identifier of the state channel, and then creates an initial transaction state Create refund transaction status wsp u ,wsp l denote the WSP and fee of user u and user l respectively. u ,fee l denote the routing costs of user u and user l respectively, They respectively represent the channel fund status of user u and user l when the status channel is closed;
[0073] Step 203: User u returns the refund transaction status St refund Generate signature u (St refund ) sent to user l;
[0074] Step 204: User l receives and verifies the other party's signature σ u (St refund ) and then the refund transaction status St refund Generate signature l (St refund ) is sent to user u;
[0075] Step 205: User u receives and verifies the other party's signature σ l (St refund ) will initialize the transaction status St funding Generate signature u (St funding ) and send it to user l;
[0076] Step 206: User l receives and verifies the other party's signature σ u (St funding ) will initialize the transaction status St funding Generate signature l (St funding ) is sent to user u; user l initializes the transaction state St funding , signature σ u (St funding ) and σ l (St funding )Send to wsp l ;
[0077] Step 207: User u receives and verifies the other party's signature σ l (St funding ) will initialize the transaction status St funding , signature σ u (St funding ) and σ l (St funding )Send to wsp u ;
[0078] Step 208: wsp l After receiving and verifying the signature, generate And send to user l;wsp u After receiving and verifying the signature, generate And send it to user u;
[0079] Step 209: User l receives and verifies the signature Then send it to user u;
[0080] Step 210: User u receives and verifies the signature and After that, submit the channel contract CC and initialize the transaction to the blockchain Build a channel, the channel status is
[0081] Step 211: wsp u Construct transactions based on channel status Submit the watchtower contract, where deposit is wsp u fines in case of default;
[0082] Step 212: wsp l Construct transactions based on channel status Submit the watchtower contract, where deposit is wsp l Penalties in case of default.
[0083] (3) Users interact with each other and update the established channel status. At the same time, the third-party monitoring service provider WSP records the intermediate status for the users. The update phase is divided into single-hop update and multi-hop update based on the different transaction target roles of the users.
[0084] Single-hop update process:
[0085] Step 301: User u and user l interact off-chain to agree on the channel status i represents the i-th off-chain interaction between user u and user l, Indicates the fund status of user u in the channel during the i-th off-chain interaction, Indicates the fund status of user l in the channel during the i-th off-chain interaction;
[0086] Step 302: User u creates a committed transaction state Where t is the effective date of the transaction, user u generates a signature and sends {St com ,σ u (St com ),σ u (cid,Nonce+i)} is sent to user l;
[0087] Step 303: User l receives {St com ,σ u (St com ),σ u (cid,Nonce+i)}, verify the signature σ u (St com ) and σ u (cid,Nonce+i), if user l agrees with the distribution method of this committed transaction status, then sign and send σ l (St com ) and σ l(cid,Nonce+i) to user u;
[0088] Step 304: User u verifies user l's σ l (St com ) and σ l (cid,Nonce+i) and then use the supervisor's public key pk sp {St com ,σ u (St com ),σ l (St com )} Encryption generation Finally, the encrypted channel status information Send to wsp u ;
[0089] Step 305: wsp u Verify the three signatures of the channel cid status information sent by user u σ l (cid,Nonce+i) and σ u (cid,Nonce+i), after the signature verification is passed, wsp u Save the history status for user u
[0090] Step 306: wsp u Send a receipt to user u
[0091] Step 307: After receiving and verifying the receipt, user u sends a u Make offline payments;
[0092] Step 308: User l uses the supervisor's public key pk sp {St com ,σ u (St com ),σ l (St com )} Encryption generation Finally, the encrypted channel status information Send to wsp l ;
[0093] Step 309: wsp l Verify the three signatures of the channel cid status information sent by user l σ l (cid,Nonce+i) and σ u (cid,Nonce+i), after the signature verification is passed, wsp l Save the history status for user l
[0094] Step 310: wsp l Send a receipt to user l
[0095] Step 311: After receiving and verifying the receipt, user l sends the l Make offline payments;
[0096] Step 312: Repeat steps 301 to 311 until both parties or one of them intends to close the channel;
[0097] Multi-hop update process:
[0098] The multi-hop update is implemented based on the mechanism of multi-hop hash time lock, that is, multiple transactions use the same hash original image y=H(x) to determine the multi-hop path to achieve multi-hop interaction; it includes a locking sub-phase and an unlocking sub-phase. The locking sub-phase generates a multi-hop locking state in each hop of the path, and the unlocking sub-phase generates a multi-hop unlocking state in each hop of the path.
[0099] The specific implementation process of the locking sub-phase is as follows:
[0100] Step 3001: Set up user u and user l with the help of intermediate users u1, u2, ..., u n Interaction: User l generates a random number x for the channel and calculates the hash value y, satisfying y = H(x), and sends the hash value y to user u, who is regarded as the current user.
[0101] Step 3002: After the current user determines the interaction path, the next hop user u i Send multi-hop interaction request Req i and use user u i The public key pk ui Encrypted, including the next hop target u i , hash value y, interaction content a, waiting time t w , lock time t lock and the interaction request Req to the next hop i+1 ,Right now
[0102] Step 3003: A certain hop user u i Receive Req i After that, the new channel generates a multi-hop lock state Then user u i It is the multi-hop locking state St lock Generate signature σ ui (St lock ) and σ ui(cid,Nonce+j,y), send two signatures and St lock To user u i+1 ; where j represents the jth off-chain interaction of channel cid, Indicates user u in the jth off-chain interaction i The state of funds in the channel, Indicates user u in the jth off-chain interaction i+1 The status of funds in the channel;
[0103] Step 3004: User u i+1 Verify the previous hop user u i After returning the two signatures, generate the signature σ ui+1 (St lock ) and σ ui+1 (cid,Nonce+j,y) is sent to u i , save the multi-hop locking state, and set user u i As the current user, i=i+1. Return to step 3002.
[0104] The specific implementation process of the unlocking sub-stage is as follows:
[0105] Step 3011: When user l is in t w If no multi-hop interaction request is received within the time, the user u of the previous hop i Send False to cancel the transaction. i Roll back the state and notify u i-1 , 1≤i≤n;
[0106] Step 3012: When user l is in t w After receiving the update request within the time, the user u of the previous jump i Send x; where x is the original image of the hash value y of the locked sub-phase;
[0107] Step 3013: User u i After receiving x, generate multi-hop unlocking status Next is St unlock Generate signature σ ui (St unlock ) and σ ui (cid,Nonce+j,y i ,x i ), send two signatures and St unlock To user u i-1 ; Where x is the original image of the hash value y of the locking sub-phase;
[0108] Step 3014: User u i-1 Verify user u i After returning the two signatures, the signature σ is generatedui-1 (St unlock ) and σ ui-1 (cid,Nonce+j,y i ,x i )Send to u i ;
[0109] Step 3015: User u i All unlocked unlock Execute the hash algorithm to generate H(St unlock )=Hash(St unlock ), then u i Unlock multi-hop status H(St unlock ),σ ui-1 (cid,Nonce+j,y i ,x i ),σ ui (cid,Nonce+j,y i ,x i ),σ ui (H(St unlock ))}Send it to its corresponding WSP;
[0110] Step 3016: WSP verifies user u i The signature and hash y i =H(x i ) after passing, for user u i Save the new history state
[0111] Step 3017: WSP generates a status receipt signature and sends it to the corresponding user u i Delivery Status Receipt
[0112] Step 3018: User u i After receiving and verifying the receipt, make offline payment to WSP.
[0113] (4) After the interaction between users is over, the channel is closed according to the final channel status; channel closure is divided into normal closure and dispute closure. Normal closure is when the channel users reach a closure agreement under normal circumstances, and dispute closure is when one user initiates the closure and the other party or WSP raises an objection. The specific steps include:
[0114] Normal shutdown process:
[0115] Step 4001: After m interactions, user u and user l agree to close the channel state.
[0116] Step 4002: After user u signs for the closed channel status, σ is generated. u (St clo ), and {St clo , σ u (St clo )} is sent to another user l.
[0117] Step 4003: After user l receives {St clo , σ u (St clo )}, after verifying the signature, if agreeing to this allocation method for the closed channel status, then sign to generate σ l (St clo ), and send {St clo , σ u (St clo ), σ l (St clo )} to the blockchain to close the channel.
[0118] Dispute closing process:
[0119] Step 4011: After m interactions, one of the users u submits a transaction with the old status to close the channel {St com , σ u (St com ), σ l (St com )}, where
[0120] Step 4012: When user l is online, within time t, submit a transaction to close the channel constructed with the latest channel status {St com , σ u (St com ), σ l (St com )}, where After the blockchain receives the latest valid status within time t, verify the signature, and if the verification passes, accept the transaction submitted by user l to close the channel; among them, represents the fund status of user u in the channel during the j-th off-chain interaction, represents the fund status of user l in the channel during the j-th off-chain interaction, represents the fund status of user u in the channel during the m-th off-chain interaction, represents the fund status of user l in the channel during the m-th off-chain interaction, j < m, indicating that the fund status at the j-th time is the old status;
[0121] Step 4013: When user l is offline, within time t, user l's WSP submits the latest {cid, Nonce+m,σ u (cid,Nonce+m),σ l (cid,Nonce+m),σ wsp (cid,Nonce+m)}, if j<m, the channel will send the set fee to WSP l , and then close the channel by punishing user u, that is, user l gets User u gets fee u .
Claims
1. A secure multi-hop interactive blockchain state channel method, characterized in that: The following steps are involved: (1) Users, regulators, and third-party monitoring service provider WSP broadcast their public keys through the network to inform other roles, and all roles retain the corresponding public key information locally; (2) Users interact with each other to determine the initial status of both parties, and contact the WSP to construct initialization transactions and refund transactions to establish a channel; (3) Users interact with each other and update the established channel status. At the same time, the third-party monitoring service provider WSP records the intermediate status for the users. The update phase is divided into single-hop update and multi-hop update based on the different transaction target roles of the users. (4) After the interaction between users is completed, the channel is closed according to the final channel status. Channel closure is divided into normal closure and dispute closure. Normal closure is when the channel users reach a closure agreement under normal circumstances. Dispute closure is when one user initiates the closure and the other party or WSP raises an objection. Wherein, step (2) specifically comprises the following steps: Step 201: User u and user l who participate in the WSP interaction negotiate the initial funding status of the channel between the two parties and Step 202: After the negotiation is successful, user u generates a random number Nonce to represent the transaction version number, generates a random number CID to represent the unique identifier of the state channel, and then creates an initial transaction state Create refund transaction status wsp u ,wsp l denote the WSP and fee of user u and user l respectively. u ,fee l denote the routing costs of user u and user l respectively, They respectively represent the channel fund status of user u and user l when the status channel is closed; Step 203: User u returns the refund transaction status St refund Generate signature u (St refund ) sent to user l; Step 204: User l receives and verifies the other party's signature σ u (St refund ) and then the refund transaction status St refund Generate signature l (St refund ) is sent to user u; Step 205: User u receives and verifies the other party's signature σ l (St refund ) will initialize the transaction status St funding Generate signature u (St funding ) and send it to user l; Step 206: User l receives and verifies the other party's signature σ u (St funding ) will initialize the transaction status St funding Generate signature l (St funding ) is sent to user u; user l initializes the transaction state St funding , signature σ u (St funding ) and σ l (St funding )Send to wsp l ; Step 207: User u receives and verifies the other party's signature σ l (St funding ) will initialize the transaction status St funding , signature σ u (St funding ) and σ l (St funding )Send to wsp u ; Step 208: wsp l After receiving and verifying the signature, generate And send to user l;wsp u After receiving and verifying the signature, generate And send it to user u; Step 209: User l receives and verifies the signature Then send it to user u; Step 210: User u receives and verifies the signature and After that, submit the channel contract CC and initialize the transaction to the blockchain Build a channel, the channel status is Step 211: wsp u Construct transactions based on channel status Submit the watchtower contract, where deposit is wsp u fines in case of default; Step 212: wsp l Construct transactions based on channel status Submit the watchtower contract, where deposit is wsp l fines in case of default; Wherein, step (3) specifically comprises the following steps: Single-hop update process: Step 301: User u and user l interact off-chain to agree on the channel status i represents the i-th off-chain interaction between user u and user l, Indicates the fund status of user u in the channel during the i-th off-chain interaction, Indicates the fund status of user l in the channel during the i-th off-chain interaction; Step 302: User u creates a committed transaction state Where t is the effective date of the transaction, user u generates a signature and sends {St com ,σ u (St com ),σ u (cid,Nonce+i)} is sent to user l; Step 303: User l receives {St com ,σ u (St com ),σ u (cid,Nonce+i)}, verify the signature σ u (St com ) and σ u (cid,Nonce+i), if user l agrees with the distribution method of this committed transaction status, then sign and send σ l (St com ) and σ l (cid,Nonce+i) to user u; Step 304: User u verifies user l's σ l (St com ) and σ l (cid,Nonce+i) and then use the supervisor's public key pk sp {St com ,σ u (St com ),σ l (St com )} Encryption generation Finally, the encrypted channel status information Send to wsp u ; Step 305: wsp u Verify the three signatures of the channel cid status information sent by user u σ l (cid,Nonce+i) and σ u (cid,Nonce+i), after the signature verification is passed, wsp u Save the history status for user u Step 306: wsp u Send a receipt to user u Step 307: After receiving and verifying the receipt, user u sends a u Make offline payments; Step 308: User l uses the supervisor's public key pk sp {St com ,σ u (St com ),σ l (St com )} Encryption generation Finally, the encrypted channel status information Send to wsp l ; Step 309: wsp l Verify the three signatures of the channel cid status information sent by user l σ l (cid,Nonce+i) and σ u (cid,Nonce+i), after the signature verification is passed, wsp l Save the history status for user l Step 310: wsp l Send a receipt to user l Step 311: After receiving and verifying the receipt, user l sends the l Make offline payments; Step 312: Repeat steps 301 to 311 until both parties or one of them intends to close the channel; Multi-hop update process: Multi-hop update is implemented based on the mechanism of multi-hop hash time lock, that is, multiple transactions use the same hash original image y=H(x) to determine the multi-hop path to achieve multi-hop interaction; it includes a locking sub-phase and an unlocking sub-phase. The locking sub-phase generates a multi-hop locking state in each hop of the path, and the unlocking sub-phase generates a multi-hop unlocking state in each hop of the path. Among them, the specific implementation process of the locking sub-phase is as follows: Step 3001: Set up user u and user l with the help of intermediate users u1, u2, ..., u n Interaction: User l generates a random number x for the channel and calculates the hash value y, satisfying y = H(x), and sends the hash value y to user u, who is regarded as the current user. Step 3002: After the current user determines the interaction path, the next hop user u i Send multi-hop interaction request Req i and use user u i The public key pk ui Encrypted, including the next hop target u i , hash value y, interaction content a, waiting time t w , lock time t lock and the interaction request Req to the next hop i+1 ,Right now Step 3003: A certain hop user u i Receive Req i After that, the new channel generates a multi-hop lock state Then user u i It is the multi-hop locking state St lock Generate signature σ ui (St lock ) and σ ui (cid,Nonce+j,y), send two signatures and St lock To user u i+1 ; where j represents the jth off-chain interaction of channel cid, Indicates user u in the jth off-chain interaction i The state of funds in the channel, Indicates user u in the jth off-chain interaction i+1 The status of funds in the channel; Step 3004: User u i+1 Verify the previous hop user u i After returning the two signatures, generate the signature σ ui+1 (St lock ) and σ ui+1 (cid,Nonce+j,y) is sent to u i , save the multi-hop locking state, and set user u i As the current user, i=i+1, and return to step 3002; Among them, the specific implementation process of the unlocking sub-stage is as follows: Step 3011: When user l is in t w If no multi-hop interaction request is received within the time, the user u of the previous hop i Send False to cancel the transaction. i Roll back the state and notify u i-1 , 1≤i≤n; Step 3012: When user l is in t w After receiving the update request within the time, the user u of the previous jump i Send x; where x is the original image of the hash value y of the locked sub-phase; Step 3013: User u i After receiving x, generate multi-hop unlocking status Next is St unlock Generate signature σ ui (St unlock ) and σ ui (cid,Nonce+j,y i ,x i ), send two signatures and St unlock To user u i-1 ; Where x is the original image of the hash value y of the locking sub-phase; Step 3014: User u i-1 Verify user u i After returning the two signatures, the signature σ is generated ui-1 (St unlock ) and σ ui-1 (cid,Nonce+j,y i ,x i )Send to u i ; Step 3015: User u i All unlocked unlock Execute the hash algorithm to generate H(St unlock )=Hash(St unlock ), then u i Unlock multi-hop status Send it to its corresponding WSP; Step 3016: WSP verifies user u i The signature and hash y i =H(x i ) after passing, for user u i Save the new history state Step 3017: WSP generates a status receipt signature and sends it to the corresponding user u i Delivery Status Receipt Step 3018: User u i After receiving and verifying the receipt, make offline payment to WSP.
2. The secure multi-hop interactive blockchain state channel method according to claim 1 is characterized in that: Step (4) specifically includes the following steps: Normal shutdown process: Step 4001: After m interactions, user u and user l agree to close the channel state. Step 4002: User u signs the closed channel state and generates σ u (St clo ), and {St clo ,σ u (St clo )}Send to another user l; Step 4003: User l receives {St clo ,σ u (St clo )}, after verifying the signature, if the allocation method of the closed channel state is agreed, the signature generation σ l (St clo ), send {St clo ,σ u (St clo ),σ l (St clo )} to the blockchain to close the channel; Dispute closure process: Step 4011: After m interactions, one of the users u submits a transaction with the old state to close the channel {St com ,σ u (St com ),σ l (St com )},in Step 4012: When user l is online, within time t, submit a closing channel transaction for building the latest channel status {St com , σ u (St com ), σ l (St com )}, where After the blockchain receives the latest valid status within time t, it verifies the signature. After successful verification, it will accept the transaction submitted by user l to close the channel; where represents the fund status of user u in the channel during the j-th off-chain interaction, represents the fund status of user l in the channel during the j-th off-chain interaction, represents the fund status of user u in the channel during the m-th off-chain interaction, represents the fund status of user l in the channel during the m-th off-chain interaction, j < m, indicating that the fund status at the j-th time is the old status; Step 4013: When user l is offline, within time t, user l's WSP submits the latest {cid, Nonce+m,σ u (cid,Nonce+m),σ l (cid,Nonce+m),σ wsp (cid,Nonce+m)}, if j<m, the channel will send the set fee to WSP l , and then close the channel by punishing user u, that is, user l gets User u gets fee u .
Citation Information
Patent Citations
Blockchain anonymous transaction method based on cross-node multi-hop payment
CN112150144A
Multi-hop cross-block chain transaction system, platform and method
CN112737771A
Anonymous multi-hop data transmission method based on block chain payment channel
CN113923015A
Secure control of transactions using blockchain
US20190205873A1
