Block chain asset circulation cross-chain exchange method based on chameleon hash

Through the blockchain asset circulation cross-chain exchange method based on chameleon hash, the problem of asset exchange between multiple blockchains is solved, the atomicity and privacy of asset exchange are realized, and the risks of privacy leakage and property losses are avoided.

CN119558974AActive Publication Date: 2025-03-04CENTRAL UNIVERSITY OF FINANCE AND ECONOMICS
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411739670.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-04
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

Existing cross-chain technologies are difficult to achieve asset circulation between multiple blockchains, and there is a potential risk that the transaction path is analyzed during the exchange process, which may lead to privacy leakage and property losses.

Method used

The blockchain asset cycle cross-chain exchange method based on chameleon hash is adopted, and asset exchange is realized through three stages: Pre-swap Phase, Commit Phase and Decommit Phase. This method uses the chameleon hash function to generate collision values ​​to ensure the privacy and atomicity of the assets during locking and unlocking.

Benefits of technology

The asset circulation exchange between multiple blockchains is realized. By blinding the correlation between users and user identity information in the path, the atomicity and privacy of cross-chain exchange are ensured, and the risks of privacy leakage and property losses are solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558974A_ABST
    Figure CN119558974A_ABST
Patent Text Reader

Abstract

The invention provides a block chain asset circulation cross-chain exchange method based on chameleon Hash, and the method comprises the steps: a Pre-swap Phase stage: a user sends demand corresponding information to a transaction matching platform, and the transaction matching platform matches an asset transfer path through the operation of an automatic matchmaking transaction algorithm; in the Commit Phase stage, starting from the starting user, a sender of each transfer operation in all the users continuously locks own existing assets according to the sequence of the directed exchange graph; and a Decommit Phase stage: on the basis of a chameleon hash function function, a user sequentially generates collision values in an inverted sequence within a specified time and completes an unlocking operation to obtain a locked asset. According to the method, asset exchange among multiple chains is realized, relevance among users in the path and information related to user identities are blinded through a chameleon hash protocol, atomicity and privacy of cross-chain exchange are ensured, the problem of privacy disclosure caused by analysis of the payment path is solved, and the method has obvious advantages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain asset cyclic cross-chain exchange method based on chameleon hashing. Background Art

[0002] Blockchain is a decentralized distributed ledger where data is stored in blocks and linked in chronological order through hash values. In recent years, with the continuous development and maturity of blockchain technology, more and more industries and fields have begun to incorporate it into business applications.

[0003] As application scenarios continue to expand, various types of blockchain architectures are also emerging. However, due to the independence of blockchain structures, how to achieve secure interconnection between different blockchains has become an urgent problem to be solved.

[0004] In this context, cross-chain technology came into being. Cross-chain technology aims to connect and coordinate different blockchains to achieve data transfer and asset interoperability. In particular, exchanges involving more than two users are called multi-party cross-chain, or circular cross-chain. Currently common cross-chain technologies include notary mechanism, side chain / relay chain, hash locking, distributed private key control, notary + side chain hybrid mechanism, etc. Among them, hash locking does not need to rely on centralized notaries, and is simpler, faster and cheaper than side chain or relay chain construction, so it is more suitable for cross-chain asset transactions between users. Although the current hash locking technology can realize cross-chain exchange, it is limited to asset exchange between two chains. In addition, there is a potential risk of transaction path analysis during the exchange process, especially in sensitive scenarios, which may lead to privacy leakage, thereby bringing the risk of property loss to users. Summary of the invention

[0005] In view of this, the present invention provides a blockchain asset circular cross-chain exchange method based on chameleon hash to solve the above problems.

[0006] The present invention provides a blockchain asset cyclic cross-chain exchange method based on chameleon hash, which includes the following three stages:

[0007] Pre-swap Phase: Users send the corresponding information of their needs to the transaction matching platform, which matches the asset transfer path by running the automatic matching transaction algorithm; Commit Phase: Starting from the starting user, the sender of each transfer operation among all users continuously locks their existing assets according to the order of the directed exchange graph; Decommit Phase: Based on the chameleon hash function, users generate collision values ​​in reverse order within the specified time and complete the unlocking operation to obtain the locked assets.

[0008] The Pre-swap Phase includes: the transaction matching platform checks the legitimacy of user assets and finds matching exchange objects for all users; builds a directed exchange graph for all users, determines the transaction user sequence and the corresponding asset transfer sequence, and selects one user as the starting user; the starting user completes key negotiation with other users to establish a private channel network connection; the starting user selects a random value and generates a commitment value for each user.

[0009] The Commit Phase includes: in each transfer operation of the exchange, the sender broadcasts the lock transaction to the blockchain network where it is located; after each user confirms that the existing assets of the previous user are locked, he creates and broadcasts his own transaction; when the last user's lock transaction is broadcast to the blockchain where it is located and confirmed by the starting user, the Commit Phase ends.

[0010] The Decommit Phase includes: the starting user determines whether the remaining time is sufficient to unlock. If the remaining time is sufficient to unlock, a collision for the committed value is generated and the locking script initiated by the last user is filled in; the starting user sends the corresponding random value generated in the Pre-swap Phase to each other user through a private channel, so that they can unlock the existing assets; after each user obtains the required existing assets, the asset arrival signal is sent to the starting user through a private channel. When the starting user receives the signal, it will continue to send the corresponding random value pair to the next user to unlock the asset; the Pre-swap Phase ends when the starting user sends the random number to the successor in the user sequence through a private channel, so that the successor gets the asset from the commitment contract of the starting user.

[0011] In one implementation, a commitment value is generated for each user by the following steps: 1 Pick a random value r 1 ∈Z * q , using x and r 1 Calculate the corresponding chameleon hash value μ 1 =H 1 (x,r 1 ); for each user u i ,u 1 Pick a random value r i ∈Z * q , using the previous user's commitment value μ (i+1)mod n and r i Generate Chameleon hash value μ i =H i (μ (i+1)modn ,r i ); for user u 2 ,u 1 Pick a random value r 0 , calculate μ 0 =Hash(r 0 ); user u 1 Generate and locally store the commitment value list L and random number list R in the order of user asset exchange.

[0012] In each transfer operation of the exchange, the sender broadcasts the lock transaction to the blockchain network where it is located through the following steps: each user except the starting user is used as the sender to obtain the corresponding lock value from the starting user, and uses the lock transaction to create an HTLC commitment implemented by a smart contract between it and the receiver. The HTLC commitment temporarily locks the existing assets before a limited time and uses the commitment value to set the unlocking conditions. The unlocking conditions are as follows: If the receiver u j Before T(i) can provide the value (p j ,r i ) i (H j (p j ),r i )==μ i , asset a i will be transferred to u j ; If the receiver u j If the correct value is not provided before T(i), then u i Will withdraw asset a i .

[0013] When the sender is u 1 , the receiver is u 2 When, TX u1 locking The HTLC commitment created is different from other users, and its unlocking condition is: if the recipient u 2 Before T(1) the value r can be provided 0 Make Hash(r 0 )==μ 0 , asset a 1 will be transferred to u 2 ; If the receiver u 2 Failure to provide the correct r before T(1) 0 value, then u 1 Will withdraw asset a 1 .

[0014] The asset unlocking steps include: the initial user determines whether the remaining time is sufficient to unlock. If the remaining time is sufficient to unlock, a collision is generated for the committed value and TX is filled in. unlocking , for i = 2, 3, ..., n-1 and j = i + 1 mod n, u 1 Send the random value r through a private channel i Send to other users j , enabling it to unlock existing assets a i .

[0015] The present invention provides a blockchain asset cyclic cross-chain exchange method based on chameleon hashing, realizes asset exchange between multiple chains, blinds the association between users in the path and information about user identities through the chameleon hashing protocol, and ensures the atomicity and privacy of cross-chain exchange. From the perspective of theory and application, the present invention solves the problem of privacy leakage caused by the analysis of payment paths and has obvious advantages. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a flow chart of the steps of the present invention.

[0017] Figure 2 For Figure 1 Corresponding overall flow chart of the present invention.

[0018] Figure 3 This is a schematic diagram of the specific implementation process of the Commit phase.

[0019] Figure 4 This is a schematic diagram of the specific implementation process of the Decommit phase.

[0020] Figure 5 It is a directed graph of the exchange order of each blockchain asset determined in the Pre-swap phase of the instance.

[0021] Figure 6 This is a specific flow chart of the Commit and Decommit phases of the instance. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. It should be noted that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] The method provided by the present invention specifically comprises the following three steps:

[0024] Pre-swap Phase: The user sends the corresponding information of the demand to the transaction matching platform. The transaction matching platform matches the asset transfer path by running the automatic matching transaction algorithm. Specifically, the following operations need to be performed: Check the legitimacy of the user's assets and find the corresponding exchange objects for all users; Build a directed exchange graph for all users, determine the transaction user sequence and the corresponding asset transfer sequence, and select a user as the starting user; The starting user completes key negotiation with other users to establish a private channel network connection; The starting user selects a random value and generates a commitment value for each user;

[0025] Commit Phase: Starting from the starting user, the sender of each transfer operation among all users will continuously lock their existing assets according to the order of the directed exchange graph; in each transfer operation of the exchange, the sender broadcasts the lock transaction to the blockchain network where it is located. In this step, except for the starting user, each user as the sender obtains the corresponding lock value from the starting user, and uses the lock transaction to create an HTLC (Hash Time Lock Contract) commitment implemented by a smart contract between it and the receiver. The HTLC promises to temporarily lock the existing assets before a limited time and uses the commitment value to set the unlocking conditions; after each user confirms that the existing assets of the previous user are locked, it creates and broadcasts its own transaction. When the lock transaction of the last user is broadcast to the blockchain where it is located and confirmed by the starting user, the Commit Phase ends;

[0026] It should be understood that HTLC commitment is a hashed time-locked contract commitment.

[0027] Decommit Phase: The starting user determines whether the remaining time is sufficient to unlock. If the remaining time is sufficient to unlock, a collision for the committed value is generated and the locking script initiated by the last user is filled in. The starting user sends the corresponding random value generated in the Pre-swap Phase to each other user through a private channel, enabling them to unlock the existing assets. After each user obtains the required existing assets, they send an asset arrival signal to the starting user through a private channel. After the starting user receives the signal, it will continue to send the corresponding random value pair to the next user to unlock the asset. The process ends when the starting user sends the random number to the successor in the user sequence through a private channel, so that the successor gets the asset from the commitment contract of the starting user.

[0028] See also Figure 1 , 2The present invention discloses a blockchain asset cyclic cross-chain exchange method based on chameleon hash, which includes a Pre-swap Phase (U, B, A, G), a Commit Phase (U, B, A, OP) and a Decommit Phase (U, B, A).

[0029] Specifically, the steps of each stage in the scheme of the present invention are described in detail below:

[0030] Pre-swap (U, B, A, G) phase: First, each user u who wants to participate in the exchange i The demand corresponding information (b i ,a i ,g i ) is sent to the transaction matching platform, which runs an automatic matching transaction algorithm to match asset transfer paths in a decentralized manner under multi-party and multi-chain situations. Specifically, the platform first checks the legitimacy of the user's assets, and then analyzes each user's existing assets. i and the target asset g i Then for each user u i Find the target asset a j ≥g i User u j As an exchange object.

[0031] When the platform is {u 1 ,u 2 ,…,u n After each user in} finds a matching exchange object, the platform constructs a directed exchange graph P for all users and sends the identity of the next adjacent user in the transaction user sequence to the corresponding user participating in the exchange. At this time, user u i Know all the information about this exchange that it needs as a participant, such as u (i+1)mod n =u j , that is, the downstream user with which it exchanges is u j Furthermore, after the exchange graph is generated, the user sequence U and the corresponding asset transfer sequence OP are determined, and the user sequence sequence is denoted as {u 1 ,u 2 ,…,u n}, among which one of all participating users will be selected as the initiator, that is, u 1 as initiator, and other users are respectively 1 Complete key negotiation and establish a private network connection.

[0032] Finally, u 1Pick a random value x and generate a commitment value for each user by following these steps:

[0033] (1) User u 1 Pick a random value r 1 ∈Z * q , using x and r 1 Calculate the corresponding chameleon hash value μ 1 =H 1 (x,r 1 ).

[0034] (2) For each user u i ,u 1 Pick a random value r i ∈Z * q , using the previous user's commitment value μ (i+1)mod n and r i Generate Chameleon hash value μ i =H i (μ (i+1)mod n ,r i ).

[0035] (3) For user u 2 ,u 1 Pick a random value r 0 , calculate μ 0 =Hash(r 0 ).

[0036] (4)u 1 Generate and locally store the commitment value list L and random number list R in the order of user asset exchange.

[0037] Among them, function Hash is a hash function, function H i ,i=1,2,…n, is the Chameleon Hash Function. Here, the cryptographic term "hash function" is a one-way function, and the "Chameleon Hash Function" is a hash function with a trapdoor, which was formally proposed by Krawczyk and Rabin in 1997. For the Chameleon Hash Function, if the trapdoor information is known, the collision of any input data can be efficiently calculated, that is, the input is changed to any value without changing the hash value output by the hash function. If the trapdoor information is unknown, the Chameleon Hash Function has the above-mentioned anti-collision property just like the ordinary hash function.

[0038] Commit (U, B, A, OP) phase: Figure 3This is the specific implementation process of the Commit phase. In this phase, from the initiator u 1 Initially, the sender of each transfer operation locks her / his assets consecutively according to the order of the exchange graph. i In the example, the sender u i The "locked transaction" TX ui locking Broadcast to blockchain b i When i = 2, 3, ..., n, for j = (i + 1) mod n, user u i From user u 1 Get μ i , use TX ui locking On the sender u i and the receiver u j A HTLC commitment is created between two parties, which is implemented by a smart contract and transfers asset a to i Temporarily lock and set the following unlocking conditions using the commitment value:

[0039] (1) If the receiver u j Before T(i) can provide the value (p j ,r i ) i (H j (p j ),r i )==μ i , asset a i will be transferred to u j .

[0040] (2) If the receiver u j If the correct value is not provided before T(i), then u i Will withdraw asset a i .

[0041] When the sender is u 1 , the receiver is u 2 When, TX u1 locking The HTLC commitment created is different from other users, and its unlocking conditions are:

[0042] (1) If the receiver u 2 Before T(1) the value r can be provided 0 Make Hash(r 0 )==μ 0, Asset a 1 will be transferred to u 2 .

[0043] (2) If the receiver u 2 Failure to provide the correct r before T(1) 0 value, then u 1 Will withdraw asset a 1 .

[0044] When each user confirms that the previous user’s assets are locked, the user will perform his own TX ui locking Creation and broadcast of transactions. When the last user u n TX un locking Also broadcast to b n In and by 1 After confirmation, the Commit phase ends.

[0045] Decommit (U, B, A) phase: Figure 4 It is the specific implementation process of the Decommit phase. 1 First, determine whether the remaining time is sufficient to unlock (from the current time t cur Whether the time to T(n) covers blockchain b n Transaction broadcast and confirmation delay t r n , that is, T(n)-t cur ≥t r n ), if time is sufficient, u 1 Then use its private key and secret value x to generate 1 (x,r 1 ) collision, that is, satisfying H 1 (x,r 1 )=H 1 (x',r 1 ') of x' and r 1 ', and p 1 =(x',r 1 ') and r n Fill in the address located in blockchain b n Transaction TX in un locking .

[0046] At the same time, for i = 2, 3, ..., n-1 and j = i + 1 mod n, u 1 Send r via private channel i Send to u j . So other users u j You can also generate the corresponding values ​​in reverse order of locking assets (p j ,r i ), and then obtain a from the corresponding HTLC commitmenti Among them, it is worth noting that each user u j In acquiring the required assets i After that, it will be sent to u through private channel 1 Send receive signal, when u 1 After receiving it, it will continue to the next user u i Send i-1 Unlock assets.

[0047] When j = 2, u 1 r 0 Send to u via private channel 2 , so u 2 From u 1 Get a from the HTLC commitment 1 , the entire exchange process is completed.

[0048] Example:

[0049] In the blockchain asset circular cross-chain exchange method based on chameleon hash of the present invention, the actual cross-chain asset transaction occurs between the following four chains. This embodiment demonstrates the process of asset exchange between users Alice, Bob, Eric and Lily.

[0050] There are four blockchains: copyright chain, game chain, film and television chain, and catering chain. Each blockchain has different types of assets: copyright, game points, video software VIP permissions, and catering vouchers. Users on these blockchains have the following exchange intentions:

[0051] (1) Alice has accounts on both the copyright chain and the restaurant chain. She is a writer who has published several novels and uses the copyright chain to manage the copyrights of her novels. Now she wants to exchange the copyrights of her novels for vouchers on the restaurant chain.

[0052] (2) Bob has accounts on both the copyright chain and the film and television chain. He is the head of a film and television company. He wants to use the VIP privileges of the video software to exchange Alice’s novel copyright for film and television creation.

[0053] (3) Eric has accounts on both the film and television chain and the game chain. He is a professional game player and wants to use game points to exchange for Bob’s video software VIP privileges.

[0054] (4) Lily has accounts on both the game chain and the restaurant chain. She has the restaurant vouchers that Alice wants, and she also wants Eric’s game points on the game chain.

[0055] Based on the above exchange intention, a cross-chain exchange involving four blockchains is established. Figure 5The exchange diagram shown is used to describe the exchange process. Figure 5 The vertices in the ,represent the users participating in the exchange, and the edges represent each transfer operation. Figure 5 It can be seen that this exchange is actually achieved through multiple transfer operations on four blockchains: on the copyright chain, Alice transfers the copyright to Bob; on the film and television chain, Bob transfers the video software VIP rights to Eric; on the game chain, Eric transfers the game points to Lily; on the catering chain, Lily transfers the catering vouchers to Alice.

[0056] First, Alice selects a random value x, and then generates commitment values ​​for herself, Bob, Eric, and Lily: μ A =H A (x,r A ), μ B =H B (μ E ,r B ), μ E =H E (μ L ,r E ), μ L =H L (μ A ,r L ). Additionally, Alice generates a certificate r for Bob alone. 0 So that μ 0 =Hash(r 0 ), so that Bob can obtain copyright from Alice in the Decommit phase.

[0057] The subsequent exchange process is divided into two stages: Commit and Decommit. The overall exchange process is as follows: Figure 6 As shown:

[0058] Commit: Alice sends μ through a dedicated channel B ,μ E ,μ L to Bob, Eric, and Lily. Then, Alice promises Bob that if Bob can provide the value r within a given time 0 , so that Hash(r 0 )=μ 0 , Alice will pay the copyright to Bob. Bob promises Eric that if Eric can provide a value (p E ,r B ), so that H B (H E (p E ),rB ) in a given time with μ B Collision, Bob will pay Eric for video software VIP. Eric promises Lily that if Lily can provide (p L ,r E ), so that μ E ==H E (H L (p L ),r E ), Eric will pay Lily the promised game points. Lily promises Alice that if Alice can provide (p A ,r L ), so that μ L ==H L (H A (p A ),r L ), Lily will pay Alice the promised food voucher.

[0059] More specifically, for users other than Lily, such as Bob or Eric, without Lily’s private key, the Chameleon hash function H L are irreversible, so they cannot unlock the meal voucher that Alice wants to redeem from Lily.

[0060] In addition, since Lily does not know how to enter r E Make μ E =H E (μ L ,r E ), so she cannot unlock it early and get the assets she wants from Eric. This is because at this stage, Alice is the only one who has r E person.

[0061] The same rules apply to all users in turn, and in terms of privacy protection, Lily cannot see any interaction between Bob and Eric because Bob and Eric's commitments appear to be regular transactions on the blockchain.

[0062] Decommit: Alice uses her private key and secret value x to generate a A (x,r A ) and H A (x,r A ) and p A =(x',r A ') and r L Sent to Lily.

[0063] Similarly, when Lily receives Alice’s rE After that, first check r E Whether μ is satisfied E =H E (μ L ,r E ) and then generate the condition that satisfies H L (p L ) and μ L Collision p L , and forward (p L ,r E )Promise to Eric.

[0064] After this operation is verified by Game Chain, Alice receives the verification result and sends r B Send it to Eric, so that Eric can generate a solution that satisfies H B (H E (p E ),r B ) and μ B Collision p E , and (p E ,r B ) to Bob to obtain the video software VIP he wants. Then, Alice sends r 0 Send it to Bob, who uses r 0 Get the copyright from Alice. Finally, all nodes pay with the committed assets.

[0065] In summary, the present invention provides a blockchain asset cyclic cross-chain exchange method based on chameleon hashing, realizes asset exchange between multiple chains, blinds the association between users in the path and information about user identities through the chameleon hashing protocol, and ensures the atomicity and privacy of cross-chain exchange. From the perspective of theory and application, the present invention solves the problem of privacy leakage caused by the analysis of payment paths, and has obvious advantages.

[0066] It should be noted that the present invention may be a method, system, device and / or computer program product. The computer program product includes a computer-readable storage medium on which computer-readable program instructions are loaded for enabling a processor to implement various aspects of the present invention; it also includes blockchain applications such as smart contracts and chain codes deployed on public chain development platforms, private chain development platforms and alliance chain development platforms.

[0067] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. A public chain refers to a blockchain in which anyone in the world can access the system at any time to read data, send verifiable transactions, and compete for accounting. A public chain development platform refers to an interactive platform that provides public chain development tools, services, and resources. It helps developers build decentralized applications (DApps) and maintain a public chain ecosystem. A private chain development platform is a blockchain development platform provided for specific organizations or enterprises to build internal blockchain solutions. A consortium chain development platform is a blockchain jointly managed by multiple institutions. Each organization or institution manages one or more nodes, and its data is only allowed to be read, written, and sent by different institutions within the system. Computer programs for performing operations of the present invention may be written in any combination of one or more programming languages, including Smalltalk, C++, Python, JavaScript, Solidity, Golang, Rust, etc.

[0068] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0069] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0070] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A blockchain asset cyclic cross-chain exchange method based on chameleon hashing, characterized by: Pre-swap Phase: Users send information corresponding to their needs to the transaction matching platform, which matches the asset transfer path by running an automatic matching transaction algorithm; Commit Phase: Starting from the starting user, the sender of each transfer operation among all users will continuously lock their existing assets according to the order of the directed exchange graph; Decommit Phase: Based on the Chameleon hash function, users generate collision values ​​in reverse order within the specified time and complete the unlocking operation to obtain the locked assets.

2. The blockchain asset cyclic cross-chain exchange method based on chameleon hash according to claim 1 is characterized in that: The Pre-swap Phase includes: The transaction matching platform checks the legitimacy of user assets and finds matching exchange partners for all users; Construct a directed exchange graph for all users, determine the transaction user sequence and the corresponding asset transfer sequence, and select one user as the starting user; The initiating user completes key negotiation with other users to establish a private channel network connection; The initial user picks a random value and generates a commitment value for each user.

3. The blockchain asset cyclic cross-chain exchange method based on chameleon hash according to claim 1 is characterized in that: The Commit Phase includes: In each transfer operation of the exchange, the sender broadcasts the locking transaction to the blockchain network; After each user confirms that the previous user's existing assets are locked, they create and broadcast their own transactions; The CommitPhase phase ends when the last user's locking transaction is broadcast to the blockchain where it is located and confirmed by the starting user.

4. The blockchain asset cyclic cross-chain exchange method based on chameleon hash according to claim 1 is characterized in that: The Decommit Phase includes: The starting user determines whether the remaining time is sufficient to unlock. If the remaining time is sufficient to unlock, a collision against the committed value is generated and filled in with the locking script initiated by the last user; The starting user sends the corresponding random value generated in the Pre-swap Phase to each other user through a private channel, enabling them to unlock their existing assets; After each user obtains the required existing assets, he / she will send an asset arrival signal to the starting user through a private channel. After the starting user receives the signal, he / she will continue to send the corresponding random value pair to the next user to unlock the asset. The Pre-swap Phase ends when the starting user sends the random number to the successor in the user sequence through a private channel, so that the successor obtains the asset from the commitment contract of the starting user.

5. The method according to claim 2, characterized in that: Generate a commitment value for each user by following these steps: User u1 selects a random value r1∈Z * q , use x and r1 to calculate the corresponding chameleon hash value μ1=H1(x,r1); For each user u i , u1 selects a random value r i ∈Z * q , using the previous user's commitment value μ (i+1)modn and r i Generate Chameleon hash value μ i =H i (μ (i+1)modn ,r i ); For user u2, u1 selects a random value r0 and calculates μ0 = Hash(r0); User u1 generates and locally stores the commitment value list L and random number list R in the order of user asset exchange.

6. The method according to claim 3, characterized in that In each transfer operation of the exchange, the sender broadcasts the lock transaction to the blockchain network through the following steps: Each user except the starting user is used as a sender to obtain the corresponding lock value from the starting user, and a lock transaction is used to create an HTLC commitment implemented by a smart contract between it and the receiver. The HTLC commitment temporarily locks the existing assets before a limited time, and uses the commitment value to set the unlocking conditions. The unlocking conditions are as follows: If the receiver u j Before T(i) can provide the value (p j ,r i ) i (H j (p j ),r i )==μ i , asset a i will be transferred to u j ; If the receiver u j If the correct value is not provided before T(i), then u i Will withdraw asset a i .

7. The method according to claim 6, characterized in that When the sender is u1 and the receiver is u2, TX u1 locking The HTLC commitment created is different from other users, and its unlocking conditions are: If the receiver u2 can provide the value r0 before T(1) so that Hash(r0) == μ0, the asset a1 will be transferred to u2; if the receiver u2 fails to provide the correct r0 value before T(1), u1 will withdraw the asset a1.

8. The method according to claim 4, characterized in that The asset unlocking steps include: The initial user determines whether the remaining time is sufficient to unlock. If the remaining time is sufficient to unlock, a collision is generated for the committed value and TX is filled in. un locking , for i = 2, 3, ..., n-1 and j = i + 1 mod n, user u1 sends the random value r through the private channel i Send to other users j , enabling it to unlock existing assets a i .

Citation Information

Patent Citations

  • Block chain cross-chain transaction method and device based on chameleon hash, and storage medium

    CN114553429A

  • Dynamic cross-chain data consistency decentration verification method

    CN115632791A

  • Low-cost alliance chain cross-chain method based on chameleon hash tree

    CN117149822A

  • Universally trusted bridges for heterogenous blockchain networks

    US20230073337A1