A blockchain asset cyclic cross-chain exchange method based on chameleon hashing

Through the Pre-swap Phase, Commit Phase and Decommit Phase stages of the Chameleon Hash protocol, asset exchanges between multiple blockchains are realized, solving the privacy leakage problem caused by the analysis of transaction paths in the existing technology, and ensuring the security and privacy of cross-chain transactions.

CN119558974BActive Publication Date: 2025-08-26CENTRAL UNIVERSITY OF FINANCE AND ECONOMICS
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing hash locking technology can only realize asset exchange between two chains, and there is a risk of privacy leakage caused by transaction paths being analyzed, especially in sensitive scenarios that may lead to property losses.

Method used

The chameleon hash protocol is adopted to realize asset exchange between multiple chains through three stages: Pre-swap Phase, Commit Phase and Decommit Phase. The chameleon hash function is used to generate commitment values ​​and unlock conditions to ensure that assets are transferred safely within a limited time, and information is transmitted through private channels, blinding the correlation between users.

Benefits of technology

The asset exchange between multiple blockchains is realized, ensuring the atomicity and privacy of the exchange, preventing privacy leakage caused by the analysis of payment paths, and improving the security and privacy protection of cross-chain transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558974B_ABST
    Figure CN119558974B_ABST
Patent Text Reader

Abstract

This invention provides a chameleon hash-based method for cyclic cross-chain exchange of blockchain assets. The method includes a Pre-swap Phase, in which users send information corresponding to their needs to a transaction matching platform, which then matches asset transfer paths by running an automatic matching transaction algorithm. A Commit Phase follows, in which, starting with the initial user, all users who send transfer operations continuously lock their existing assets according to the order of a directed exchange graph. Finally, a Decommit Phase follows, in which, based on the chameleon hash function, users sequentially generate collision values ​​in reverse order within a specified timeframe and complete unlocking operations to obtain locked assets. This method enables asset exchange across multiple chains. Using the chameleon hash protocol, it blinds the associations between users in the path and their identities, ensuring the atomicity and privacy of cross-chain exchanges. This addresses the privacy issues associated with payment path analysis, offering significant 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 that stores data in blocks and links them in chronological order via 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 their business applications.

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

[0004] Against this backdrop, cross-chain technology has emerged. It aims to connect and coordinate different blockchains, enabling data transfer and asset interoperability. Specifically, exchanges involving two or more users are referred to as multi-party cross-chain or circular cross-chain. Common cross-chain technologies currently include notary mechanisms, sidechains / relay chains, hash locking, distributed private key control, and hybrid notary + sidechain mechanisms. Hash locking, among other mechanisms, eliminates the need for centralized notaries and is simpler, faster, and less costly to build than sidechains or relay chains, making it ideal for cross-chain asset transactions between users. While current hash locking technology enables cross-chain exchanges, it is limited to exchanging assets between two chains. Furthermore, there is a potential risk of transaction paths being analyzed during the exchange process, which can lead to privacy breaches, especially in sensitive scenarios, and potentially expose users to financial losses. Summary of the Invention

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

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

[0007] Pre-swap Phase: Users send the corresponding information of their needs to the transaction matching platform, and the transaction matching platform 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 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; constructs 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; after each user confirms that the existing assets of the previous user are locked, they create and broadcast their own transaction; when the last user's lock transaction is broadcast to the blockchain 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 is generated for the committed value 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 their existing assets; after each user obtains the required existing assets, they send an asset arrival signal 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 can obtain the asset from the commitment contract of the starting user.

[0011] In one implementation, the commitment value is generated for each user by the following 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)mod n and r i Generate Chameleon hash value μ i =H i (μ (i+1)mod n ,r i); For users u2 and u1, a random value r0 is selected and μ0 = Hash(r0) is calculated; user u1 generates and locally stores 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 ) makes H 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 u1 and the receiver is u2, TX u1 locking The created HTLC commitment is different from that of other users, and its unlocking condition is: if the recipient u2 can provide the value r0 before T(1) so that Hash(r0) == μ0, the asset a1 will be transferred to u2; if the recipient u2 fails to provide the correct r0 value before T(1), u1 will withdraw the asset a1.

[0014] The asset unlocking steps include: the initial user determines whether the remaining time is sufficient to unlock, and if the remaining time is sufficient to unlock, generates a collision for the committed value and fills in TX un locking For i=2,3,...,n-1 and j=i+1modn, u1 sends the random value r through a private channel. i Send to other users j , enabling it to unlock existing assets a i .

[0015] This invention provides a chameleon hash-based method for cyclical cross-chain exchange of blockchain assets, enabling asset exchange across multiple chains. Using the chameleon hash protocol, it blinds the associations between users in the path and their identities, ensuring the atomicity and privacy of cross-chain exchanges. From both theoretical and practical perspectives, this invention offers significant advantages by addressing the privacy issues associated with payment path analysis. 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 stage.

[0020] Figure 5 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 flowchart of the Commit and Decommit phases of the instance. DETAILED DESCRIPTION

[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. It should be noted that the embodiments described 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 making creative efforts are within the scope of protection of the present invention.

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

[0024] Pre-swap Phase: Users send their demand information to the trading matching platform, which matches asset transfer paths by running an automatic matching transaction algorithm. Specifically, the platform performs the following operations: checks the legitimacy of user assets and finds corresponding exchange partners for all users; constructs a directed exchange graph for all users, determines the sequence of trading users and the corresponding asset transfer sequence, and selects 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 with 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. In each transfer operation of the exchange, the sender broadcasts the lock transaction to the blockchain network. In this step, each user, except the starting user, acts as a sender and obtains the corresponding lock value from the starting user. Using the lock transaction, they create an HTLC (Hash Time Lock Contract) commitment implemented by a smart contract between themselves 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 have been locked, they create and broadcast their own transaction. When the last user's lock transaction is broadcast to its blockchain 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 so, a collision is generated for the committed value 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 their existing assets. After each user obtains the required existing assets, they send an asset arrival signal to the starting user through a private channel. Once the starting user receives the signal, they 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, allowing the successor to obtain the asset from the commitment contract of the starting user.

[0028] See also Figure 1 、 2 The present invention provides a chameleon hash-based blockchain asset circular cross-chain exchange method, 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 correspondence information (b i ,a i ,gi ) 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 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 {u1,u2,…,u n After each user in the transaction finds a matching exchange partner, the platform constructs a directed exchange graph P for all users and sends the next adjacent user identity 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 recorded as {u1,u2,…,u n Among all participating users, one will be selected as the initiator, i.e. u1 is the initiator, and other users will complete key negotiation with u1 and establish a private network connection.

[0032] Finally, u1 selects a random value x and generates a commitment value for each user through the following steps:

[0033] (1) User u1 selects a random value r1∈Z * q , use x and r1 to calculate the corresponding chameleon hash value μ1=H1(x,r1).

[0034] (2) For each user u i , u1 selects 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 users u2 and u1, a random value r0 is selected and μ0 = Hash(r0) is calculated.

[0036] (4) u1 generates and locally stores 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 a Chameleon hash function. In cryptographic terms, "hash function" refers to a one-way function, while "Chameleon Hash Function" refers to a hash function with a trapdoor, a primitive formally proposed by Krawczyk and Rabin in 1997. For a Chameleon hash function, if the trapdoor is known, collisions can be efficiently calculated for any input data. This means changing the input to any value without changing the hash value of the hash function output. If the trapdoor is unknown, the Chameleon hash function has the same collision resistance as a regular hash function.

[0038] Commit (U, B, A, OP) phase: Figure 3 This is the specific implementation process of the Commit phase. In this phase, starting from initiator u1, the sender of each transfer operation locks her / his assets continuously 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 In a network with i=2,3,...,n, for j=(i+1)mod n, user u i Get μ from user u1 i , use TX ui locking On the sender u i and the receiver u j Create an HTLC commitment implemented by a smart contract between the two parties, which promises to transfer asset a to i Temporarily lock it 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 ) makes H i (H j (p j ),r i )==μ i , asset ai 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 u1 and the receiver is u2, TX u1 locking The HTLC commitment created is different from other users, and its unlocking conditions are:

[0042] (1) If the receiver u2 can provide the value r0 before T(1) so that Hash(r0) == μ 0, Asset a1 will be transferred to u2.

[0043] (2) If the receiver u2 fails to provide the correct value of r0 before T(1), u1 will withdraw the asset a1.

[0044] When each user confirms that the previous user's assets are locked, the user will perform his own TX ui locking The creation and broadcast of the transaction. When the last user u n TX un locking Also broadcast to b n After it is accepted and confirmed by u1, the Commit phase ends.

[0045] Decommit (U, B, A) phase: Figure 4 This is the specific implementation process of the Decommit phase. Initiator u1 first determines 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, u1 uses its private key and secret value x to generate a collision for H1(x,r1), that is, x' and r1' that satisfy H1(x,r1)=H1(x',r1'), and sets p1=(x',r1') and r n Fill in the entry in blockchain b n Transaction TX in un locking .

[0046] At the same time, for i=2,3,...,n-1 and j=i+1modn, u1 sends r 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 commitment i Among them, it is worth noting that each user u j In acquiring the required assets i After that, it will send a receive signal to u1 through the private channel. When u1 receives it, it will continue to the next user u i Send r i-1 Unlock the assets.

[0047] When j=2, u1 sends r0 to u2 through a private channel, so that u2 can get a1 from u1's HTLC commitment, and the entire exchange process ends.

[0048] Example:

[0049] In the chameleon hash-based blockchain asset cyclic cross-chain exchange method of the present invention, the actual cross-chain asset transaction occurs between the following four chains. This embodiment demonstrates the asset exchange process 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 rights, 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 multiple 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 for 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 gamer 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 5 The exchange diagram shown here describes the exchange process. Figure 5 The vertices in the ,represent the users who participate in the exchange, and the edges represent ,each transfer operation. Figure 5 As can be seen from the figure, this exchange is essentially 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 game points to Lily; on the catering chain, Lily transfers 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 r0 for Bob such that μ0 = Hash(r0), so that Bob can obtain copyright from Alice during 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 Then, Alice promises to Bob that if Bob can provide a value r0 within a given time, so that Hash(r0) = μ0, Alice will pay the copyright to Bob. Bob promises to Eric that if Eric can provide a value (p E ,r B ), so that H B (H E (p E ),r B) in a given time with μ B Collision, Bob will pay Eric for video software VIP. Eric promised 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 vouchers.

[0059] More specifically, for users other than Lily, such as Bob or Eric, if they do not have 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 people.

[0061] The same rules apply to all users in turn, and in terms of privacy, 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, Lily receives Alice's r EAfter 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 ) forwards a promise to Bob to obtain the video software VIP he wants. Alice then sends r0 to Bob through a dedicated channel, and Bob uses r0 to obtain the copyright from Alice. Finally, all nodes use the promised assets to pay.

[0065] In summary, this invention provides a chameleon hash-based method for cyclical cross-chain exchange of blockchain assets, enabling asset exchange across multiple chains. The chameleon hash protocol blinds the associations between users in the path and information about their identities, ensuring the atomicity and privacy of cross-chain exchanges. From both theoretical and practical perspectives, this invention offers significant advantages by addressing the privacy issues associated with payment path analysis.

[0066] It should be noted that the present invention may be a method, system, apparatus, and / or computer program product. A computer program product includes a computer-readable storage medium carrying computer-readable program instructions for causing 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, private, and consortium blockchain development platforms.

[0067] A computer-readable storage medium can be a tangible device that can retain and store instructions used by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. The computer-readable program instructions described herein can be downloaded from the 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 blockchain refers to a blockchain that anyone in the world can access at any time to read data, send verifiable transactions, and compete for ledgers. A public blockchain development platform refers to an interactive platform that provides public blockchain development tools, services, and resources, helping developers build decentralized applications (DApps) and maintain the public blockchain ecosystem. A private blockchain development platform is a blockchain development platform provided for specific organizations or enterprises to build internal blockchain solutions. A consortium blockchain development platform is a blockchain jointly managed by multiple organizations, with each organization managing one or more nodes, and data is only accessible to specific organizations 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 flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

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

[0070] While various embodiments of the present invention have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled 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 Hash, characterized by: Pre-swap Phase: Users send their demand information to the trading matching platform, which matches asset transfer paths by running an automatic matching transaction algorithm. The platform checks the legitimacy of user assets and finds matching exchange partners for all users. It constructs a directed exchange graph for all users, determines the sequence of trading users 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. The commitment value is generated for each user through the following 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 mod n and r i Generate Chameleon hash value µ i =H i (µ i+1 mod n , r i ); For users u2 and u1, a random value r0 is selected and µ0 = Hash(r0) is calculated. User u1 generates and locally stores the commitment value list L and random number list R in the order of user asset exchange; Commit Phase: Starting from the initial 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.

2. 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.

3. 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 so, a collision is generated for the committed value and the locking script initiated by the last user is filled in. The starting user sends the corresponding random value r generated in the Pre-swap Phase through a private channel i Sent to every other user, enabling them to unlock existing assets; After each user obtains the required existing assets, they send an asset arrival signal to the starting user through a private channel. When the starting user receives the signal, they will continue to send the corresponding random value r to the next user. i Unlock assets; The Pre-swap Phase ends when the starting user sends the random value r0 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.

4. The method according to claim 2, 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 locked value from the starting user. A lock transaction is used to create an HTLC commitment implemented by a smart contract between the sender 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 ) makes H 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 .

5. The method according to claim 4, 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.

6. The method according to claim 3, characterized in that The asset unlocking step includes: 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 a 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