A cross-chain atomic exchange method based on high fault tolerance and liquidity of market maker algorithm
By introducing market maker algorithms and smart contract design, cross-chain atomic swaps with high fault tolerance and liquidity are achieved, solving the problems of complex user operations and insufficient liquidity in existing technologies, improving transaction efficiency and security, and adapting to complex market environments.
Patent Information
- Application Number
- CN202411426866.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-10-14
AI Technical Summary
Existing cross-chain exchange technology has deficiencies in decentralization, security, transaction efficiency, and technical compatibility. In particular, it has serious deficiencies in user operation convenience, on-chain liquidity, and fault tolerance, resulting in high risks for user assets, complex transactions, and low efficiency.
The role of market maker is introduced, and exchange requests are matched through the minimum cost maximum flow algorithm. The market maker management smart contract and factory smart contract are designed. Combined with customized security parameters, cross-chain atomic swaps with high fault tolerance and liquidity are achieved. Market makers are used to automatically monitor and send assets, providing on-chain liquidity and security.
It improves the efficiency and success rate of asset exchange, reduces user waiting time and the risk of transaction failure, enhances transaction flexibility and applicability, improves system security and user trust, and increases the degree of decentralization and transaction success rate.
Smart Images

Figure CN119417598B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer science and technology, in particular to a cross-chain atomic exchange method with high fault tolerance and liquidity based on market maker algorithm. BACKGROUND
[0002] The partially centralized mode of famous decentralized exchanges (DEX) and centralized exchanges (CEX) violates the basic principles of the blockchain world and is vulnerable to security attacks. Although decentralized exchanges claim to be decentralized, there is often a certain degree of centralization in their actual operation. For example, their trade matching and order management may rely on a few core nodes, which threatens the security and stability of the entire system. Once these core nodes are attacked or fail, the entire trading system may be paralyzed, and users' assets may be lost. Centralized exchanges are more obviously centralized. Users' assets are completely controlled by exchanges, and exchanges have absolute control over users' assets. This not only increases the risk of misappropriation or theft of users' assets, but also makes exchanges the main target of hacker attacks. Once the exchange is breached, users' assets will face huge losses. In addition, the trading process of these exchanges is often complex and cumbersome, and users need to go through a series of complex operations to complete the transaction, which not only increases the users' use cost, but also reduces the transaction efficiency. Moreover, due to the technical differences and compatibility problems between different blockchains, the existing cross-chain exchange technology has great difficulty in implementation. For example, the differences in consensus mechanisms, data structures, and encryption algorithms between different blockchains make it easy to have data loss, transaction delay, and other problems in the cross-chain exchange process. In summary, the existing cross-chain exchange mode has serious shortcomings in terms of decentralization, security, transaction efficiency, and technical compatibility, and there is an urgent need for a more advanced, secure, and efficient cross-chain exchange technology.
[0003] Atomic Cross-chain Swaps (ACCS) as an important cornerstone of blockchain interoperability technology has many significant problems in current applications. Related Atomic Cross-chain Swaps (ACCS) solutions can generally be divided into three categories: trusted third-party-based methods, hash time-locked contract (HTLC)-based methods, and relay chain-based methods. However, these methods have certain limitations:
[0004] (1) The trusted third-party-based method relies on a trusted third party in asset exchange, storing user assets in a trusted address or entrusting a trusted execution environment (TEE), which introduces significant single-point financial risk. Moreover, this solution assumes that all users have a TEE, which is an expensive requirement.
[0005] (2) The asset exchange method based on HTLC technology, although it can exchange assets in a trustless manner through a smart contract, requires market makers to match the exchange, resulting in poor liquidity, hindering practical application. In addition, in the decentralized finance (DeFi) scenario, it is vulnerable to exchange rate fluctuations and user offline, and its "all or nothing" inherent property limits flexibility in a trustless environment.
[0006] (3) The method based on the relay chain can transfer assets to the intermediate link. However, the current solution requires asset transfer to the relay chain, resulting in high gas costs and only supporting asset exchange between permissioned blockchains, which cannot be universally extended to public blockchains.
[0007] Under the above traditional ACCS mode, users must manually match exchange requests off-chain and continuously monitor the status of other blockchains. This process is not only complex and tedious, but also greatly relies on user manual operation and continuous attention, increasing the burden and operating costs of users. In addition, the lack of on-chain liquidity of ACCS is also a serious problem. Due to the lack of sufficient liquidity, the exchange of assets is often limited, making it difficult to meet the actual needs of users, reducing the practicality and efficiency of the entire system. More importantly, the "all or nothing" property of ACCS greatly limits its feasibility in actual deployment and application. This means that if there is any minor problem or error in the exchange process, the entire exchange will completely fail, resulting in risks to users' assets and seriously affecting users' experience and trust in the technology. In summary, the existing ACCS technology has serious shortcomings in user operation convenience, on-chain liquidity, and fault tolerance, which greatly restricts its widespread application and development in the field of blockchains.
[0008] Based on the above, the present application proposes a high fault tolerance and liquidity cross-chain atomic exchange method based on market maker algorithm to solve the above problems, and studies the cross-chain atomic exchange technology of blockchain technology under the condition of mutual distrust, and ensures the high fault tolerance, liquidity cross-chain atomic exchange solution through market makers. SUMMARY
[0009] 1、The technical problem to be solved by the present application
[0010] The purpose of the present application is to propose a high fault tolerance and liquidity cross-chain atomic exchange method based on market maker algorithm to solve the problems proposed in the background art, so that the users of the blockchain system can safely complete the exchange of assets under the premise of mutual distrust, and greatly improve the fault tolerance and liquidity of the atomic exchange process, meeting the demand of more cross-chain scenarios.
[0011] 2、Technical solutions
[0012] To achieve the above object, the application provides the following technical solutions:
[0013] A cross-chain atomic exchange method based on market maker algorithm, high fault tolerance and liquidity, comprising the following steps:
[0014] S1, Market maker design: introduce an incentive compatible market maker role for atomic exchange, the market maker role actively handles monitoring services, replaces user supervision to replace the state change on the blockchain, and automatically sends assets to the user;
[0015] S2, Exchange request matching design: use multiple market makers to form a complex payment network, users quickly find market makers and match ACCS orders through the minimum cost maximum flow (MCMF) algorithm, providing on-chain liquidity for atomic exchange;
[0016] S3, Smart contract design: design market maker management smart contract (BMSC) and factory smart contract (FSC), provide users with an excuse to query market makers and participate in ACCS mode, so that users can complete the exchange with the lowest cost and highest fault tolerance;
[0017] S4, Security parameter design: design a customized security parameter to help users balance cost and fault tolerance; use the security parameter to divide the assets into shares, ensuring that when the market maker sends a portion of the assets to others, the market maker itself also receives an equivalent asset.
[0018] Preferably, the market maker management smart contract (BMSC) in S3 is used to manage information of all market makers, the market maker holds assets on both chains to register in the market maker management smart contract (BMSC), and at the same time, deposits collateral to prevent malicious behavior.
[0019] Preferably, the factory smart contract (FSC) in S3 is used to manage exchange requests of all users, the factory smart contract (FSC) synchronizes the latest block header on both chains when the user submits an exchange request, calls the Verify function to verify whether the transaction is successfully executed when the exchange is successful, and updates the information of the market maker stored in the market maker management smart contract (BMSC) if the exchange is successful, including the number of successful exchange executions and the number of assets available for payment; if the exchange fails, call the Judge function to deduct the collateral of the malicious broker.
[0020] 3、Beneficial effects
[0021] The application proposes a cross-chain atomic exchange method based on the high fault tolerance and liquidity of market maker algorithm, analyzes the current cross-blockchain atomic exchange scene, combines the actual blockchain demand, and proposes a cross-chain atomic exchange technology that can meet the high fault tolerance and on-chain liquidity in an environment of mutual distrust. The beneficial effects of the application are embodied in:
[0022] (1) greatly improving the efficiency and success rate of asset exchange, reducing the waiting time of users and the risk of transaction failure.
[0023] (2) By introducing a partial asset exchange mode, the flexibility and applicability of transactions are increased, better meeting the diverse needs of users.
[0024] (3) Customized security parameters and smart contracts effectively guarantee the security of assets and the consistency of transactions, enhancing user trust in the system.
[0025] (4) High liquidity and fault tolerance make the system more competitive and adaptable in complex market environments, better able to respond to various emergencies and challenges.
[0026] (5) Compared with the prior art, there is a significant improvement in the degree of decentralization, transaction success rate, and number of ACCS services, bringing new breakthroughs and progress to the development of the blockchain field. BRIEF DESCRIPTION OF DRAWINGS
[0027] Fig. 1 A system model diagram of a cross-chain atomic exchange method based on the high fault tolerance and liquidity of market maker algorithm proposed by the application;
[0028] Fig. 2 A smart contract workflow diagram proposed by the application;
[0029] Fig. 3 An atomic exchange workflow diagram proposed by the application. DETAILED DESCRIPTION
[0030] To make the above-mentioned purposes, features and advantages of the application more obvious and easy to understand, the specific embodiments of the application will be described in detail below with reference to the accompanying drawings.
[0031] In the following description, many specific details are set forth in order to provide a thorough understanding of the application, but the application can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the scope of the application. Therefore, the application is not limited to the specific embodiments disclosed below.
[0032] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.
[0033] See also Figs. 1-3 This paper proposes a linear communication complexity consensus method based on the DAG structure, performs exchange matching based on the minimum cost maximum flow algorithm, and proposes a new cross-blockchain system and a corresponding technical solution for atomic exchange on it. The specific implementation method is as follows:
[0034] Step 1: Market Maker Design: A novel incentive-compatible market maker role is introduced for atomic swaps. The market maker proactively handles monitoring services, overseeing state changes on the alternative blockchain on behalf of the user and automatically transferring assets to the user. This eliminates the need for users to own assets on both blockchains, as the designated account receiving the transferred assets does not need to perform any contract operations. Market makers are required to hold assets on both networks for the swap.
[0035] Step 2. Swap Request Matching Design: Multiple market makers form a complex payment network. Users can quickly find market makers and match ACCS orders through the minimum cost maximum flow (MCMF) algorithm, providing on-chain liquidity for atomic swaps.
[0036] Step 3. Smart Contract Design: To address the challenge of efficiently matching users with participating market makers, this paper designs the Market Maker Management Smart Contract (BMSC) and the Factory Smart Contract (FSC), providing users with an interface for querying market makers and participating in the ACCS model, enabling users to complete exchanges with the lowest cost and highest fault tolerance.
[0037] Step 3.1. The Market Maker Management Smart Contract (BMSC) will manage the information of all market makers, including the market maker's address, the rate paid per unit of asset, the number of successful ACCS services, the total number of ACCS services, and whether they are online. Market makers need to hold assets on both chains to register with the Market Maker Management Smart Contract (BMSC), and they need to deposit collateral to prevent malicious behavior.
[0038] In step 3.2, the Factory Smart Contract (FSC) manages all user swap requests. After a user submits a swap request, the FSC synchronizes the latest block headers on both chains. If the swap is successful, the Verify function is called to verify the transaction. If successful, the market maker's information stored in the Market Maker Management Smart Contract (BMSC) is updated, including the number of successful swaps and the amount of assets available for payment. If the swap fails, the Judge function is called to deduct the malicious broker's collateral.
[0039] Step 4: Security Parameter Design: To address the challenge of ensuring consistency in asset transfers when multiple market makers are involved, this invention designs customized security parameters to help users balance cost and fault tolerance. Dividing assets into equal shares ensures that when a market maker sends a portion of an asset to others, they will also receive an equal value of assets.
[0040] The following describes a highly fault-tolerant and liquid cross-chain atomic swap method based on a market maker algorithm, as proposed in the present invention, with reference to specific examples and accompanying drawings. The details are as follows.
[0041] Example 1:
[0042] The linear communication complexity consensus method based on the DAG structure proposed in this paper is applied to multiple different inter-chain asset exchange cases, such as trusted transfers between two banks and data exchange between medical systems. Specific examples are as follows.
[0043] Step 1: Preparation
[0044] Step 1-1: The market maker registers its exchange information on the Market Maker Management Smart Contract (BMSC), including the market maker's address, the rate paid per unit of asset, the number of successful service ACCS, the total number of service ACCS, and whether it is online.
[0045] Steps 1-2: Atomic swap participants use the BMSC's query interface to search for a list of currently online market makers available for swap execution. This process is performed using the minimum-cost maximum-flow algorithm. Specifically, the DFS algorithm is used to find an augmenting path. The augmenting path with the lowest total payment fee and the highest flow rate is then returned to the user. The user then matches the swap graph based on this result.
[0046] Step 2: Locking Phase
[0047] Step 2-1: User calls factory smart contract (FSC) to generate exchange request, request content includes ID and address of market maker participating in exchange, when n=3 market makers participate in exchange, factory smart contract (FSC) will remotely call market maker management smart contract (BMSC) to increase the number of times of participating in exchange of market maker participating in exchange, then user can split the assets to be transferred into n equal parts and lock in factory smart contract (FSC) using time lock.
[0048] Step 3: Exchange stage
[0049] Step 3-1: When all participants lock their assets in factory smart contract (FSC), market makers will actively transfer assets to the receiving address specified by the participants.
[0050] Step 3-2: After step 3-1 is completed, market makers can submit a transfer transaction to factory smart contract (FSC) for verification, factory smart contract (FSC) will synchronize the latest block header on another blockchain, verify the Merkle proof provided by the market maker and the amount of the transfer, and if both are true, the user's locked assets can be transferred to the market maker. At this time, the exchange is completed, the market maker who successfully executes the exchange will get the corresponding tip and increase his successful exchange execution times in market maker management smart contract (BMSC).
[0051] Step 3-3: If there is a market maker who does not correctly execute the exchange in step 3-2, as a participant, first need to retrieve the assets locked in factory smart contract (FSC), then can submit a transaction to market maker management smart contract (BMSC) to retrieve the assets, which will deduct the market maker's collateral as a punishment.
[0052] The above is only the preferred specific embodiment of the present application, but the protection scope of the present application is not limited to this, any skilled person in the art can make equivalent replacement or change according to the technical solution and improvement concept of the present application within the technical range disclosed by the present application, which should be covered in the protection scope of the present application.
Claims
1. A cross-chain atomic swap method with high fault tolerance and liquidity based on a market maker algorithm, characterized by: The steps include: S1. Market Maker Design: Introducing an incentive-compatible market maker role for atomic swaps. The market maker role actively handles monitoring services, monitors state changes on the alternative blockchain on behalf of users, and automatically sends assets to users. S2. Swap Request Matching Design: Utilizes multiple market makers to form a complex payment network. Users use the minimum cost maximum flow algorithm to quickly find market makers and match ACCS orders, providing on-chain liquidity for atomic swaps. S3. Smart Contract Design: Design market maker management smart contracts and factory smart contracts to provide users with an excuse to query market makers and participate in the ACCS model, allowing users to complete exchanges with the lowest cost and highest fault tolerance; The market maker management smart contract is used to manage the information of all market makers. Market makers must hold assets on both chains to register in the market maker management smart contract and deposit collateral to prevent malicious behavior. S4. Security parameter design: Design customized security parameters to help users balance cost and fault tolerance; The use of security parameters to divide assets into equal shares ensures that when a market maker sends a portion of assets to others, the market maker itself also receives assets of equal value.
2. A cross-chain atomic swap method with high fault tolerance and liquidity based on a market maker algorithm according to claim 1, characterized in that: The factory smart contract described in S3 is used to manage all user swap requests. When a user submits a swap request, the factory smart contract synchronizes the latest block headers on both chains. When the swap is successful, the Verify function is called to verify whether the transaction is successfully executed. If the swap is successful, the market maker's information stored in the market maker management smart contract is updated, including the number of successful swaps and the amount of assets available for payment. If the exchange fails, the Judge function is called to deduct the malicious broker's collateral.
Citation Information
Patent Citations
Token transaction method and device based on blockchain, electronic equipment and storage medium
CN112435121A