Universal atom cross-chain switching method for relieving abortion attack
By using verifiable discrete logarithmic time and adapter signature primitives, combined with off-chain pre-signature and reverse freeze mechanisms, the problem of cross-chain exchange abort attacks is solved, realizing a secure, reliable, and universal exchange method across different blockchains.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG UNIV
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-08
AI Technical Summary
Existing cross-chain exchange technologies lack effective protection mechanisms against abort attacks, resulting in assets being locked for extended periods and unable to complete the expected exchange. Furthermore, they lack versatility and are difficult to apply to blockchains that do not support complex scripts.
By employing verifiable discrete logarithmic time and adapter signature primitives, a two-step frozen transaction structure is designed through off-chain pre-signing and reverse freezing mechanisms, and a fair completion mechanism is introduced to ensure the security and reliability of the exchange process.
It effectively mitigates abort attacks, ensures the fairness and robustness of the exchange process, enhances the universality and availability of cross-chain exchange solutions, is applicable to a wide range of blockchain ecosystems, and reduces the risk of asset loss.
Smart Images

Figure CN121998643A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a swapping method, and more particularly to a universal atomic cross-chain swapping method for mitigating abort attacks. Background Technology
[0002] With the rapid development and diversification of blockchain technology, the number of global cryptocurrencies and blockchains has surged, leading to the dispersion of on-chain assets and data across diverse systems. This has created a significant "data silo" problem, severely hindering the interconnectivity and widespread application of the blockchain ecosystem. Against this backdrop, cross-chain exchange technology has emerged as a key primitive for enabling asset exchange between different blockchains. Its core principle lies in ensuring the atomicity of transactions, guaranteeing that a transaction either succeeds entirely or fails completely and is rolled back, thereby maintaining fairness and security. In recent years, the scale of cross-chain transactions has experienced explosive growth, further highlighting the urgent need for efficient, secure, and universal cross-chain exchange methods.
[0003] To meet these needs, existing technologies have mainly developed two types of decentralized cross-chain exchange solutions: script-based solutions and signature-based solutions. Script-based solutions are represented by Hash Time Lock Contracts (HTLCs), which use preset hash locks and time lock mechanisms to ensure atomicity.For example, CrossChannel (X. Luo, K. Xue, Q. Sun, and J. Lu, “Crosschannel: Efficient and scalable cross-chain transactions through cross-and-off-blockchain micropayment channel,” IEEE Transactions on Deependable and Secure Computing, 2024.) improved transaction scalability by building cross-chain channels; Jia (X. Jia, Z. Yu, J. Shao, R. Lu, G. Wei, and Z. Liu, “Cross-chain virtualpayment channels,” IEEE Transactions on Information Forensics and Security, vol. 18, pp. 3401–3413, 2023.) et al. designed a virtual payment channel connecting Bitcoin and Ethereum to reduce on-chain confirmation overhead; Tsabary (I. Tsabary, M. Yechieli, A. Manuskin, and I. Eyal, “Mad-htlc: because htlc is crazy-cheap to attack,” in 2021 IEEE The MAD-HTLC proposed by Symposium on Security and Privacy (SP). IEEE, 2021, pp. 1230–1248. uses multi-path settlement to resist incentive manipulation; while zkCross (Y. Guo, M. Xu, X. Cheng, D. Yu, W. Qiu, G. Qu, W. Wang, and M. Song, “zkcross: A novel architecture for cross-chain privacypreserving auditing,” in 33rd USENIX Security Symposium (USENIXSecurity 24), 2024, pp. 6219–6235.) uses zero-knowledge proofs to achieve privacy-preserving cross-chain auditing.Although such solutions perform well on specific chains, their reliance on blockchain scripting or smart contract functionality makes them difficult to apply on chains that lack flexible scripting support, such as Zcash, Ripple, and Monero, thus limiting their versatility.
[0004] In comparison, signature-based schemes achieve cross-chain swaps by extending or modifying digital signature algorithms, offering better portability and versatility. For example, Thyagarajan et al. (SA Thyagarajan, G. Malavolta, and P. Moreno-Sanchez, “Universal atomic swaps: Secure exchange of coins across all blockchains,” in 2022 IEEE Symposium on Security and Privacy (SP). IEEE, 2022, pp. 1299–1316.) proposed a universal atomic swap protocol applicable to all blockchains using primitives such as adapter signatures; PipeSwap (P. Ni, A. Tian, and J. Xu, “Pipeswap: Forcing the timely release of a secret for atomic cross-chain swaps,” in 2025 IEEE Symposium on Security and Privacy (SP). IEEE, 2025.) proposed an improved mechanism to address the timing defects of secret release in this scheme; Sleepy Channel extends its ideas to payment channels to improve scalability. This type of technology has been practically applied on multiple platforms such as Komodo and Firo, as well as cross-chain bridges such as Cosmos, becoming one of the core technologies for achieving cross-chain swaps. However, despite the improvements in the versatility of signature-based schemes, they still face severe security and availability challenges in actual implementation, especially being vulnerable to "absconding attacks." In this attack scenario, participating parties may delay or refuse to fulfill key obligations (such as freezing assets, releasing signature materials, broadcasting transactions, or executing refunds), causing the entire exchange process to fail and assets to be locked for an extended period, preventing the expected exchange from being completed. Existing schemes have not yet systematically eliminated the motivation and feasibility of such attacks in their mechanism design, nor do they possess a robust mechanism to ensure that the honest party can still complete the exchange or securely refund in the event of abortion by the other party, thus exposing significant reliability shortcomings in real-world deployments.
[0005] Therefore, existing cross-chain swapping technologies still have significant shortcomings in terms of versatility, security, and especially resistance to abort attacks. There is an urgent need for a new atomic swapping method that can balance broad applicability with robust security. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention discloses a universal atomic cross-chain swapping method to mitigate abort attacks, the technical solution of which is as follows:
[0007] This method is based on verifiable discrete log-time and adapter signature primitives and involves the first participant. With the second participant Cross-chain asset swaps between [chains], the method comprising:
[0008] Preparation phase: and The first joint address was generated off-chain. With the second joint address And witnesses to each based on their respective chosen adapters. and Generate public adapter declaration Both parties used the adapter signature algorithm to... The parameter is used for the exchange transaction of transferring assets from the joint address to the designated address of the other party. Perform off-chain pre-signing;
[0009] Locking Phase: Both parties construct and pre-sign a two-step freeze transaction off-chain, the transaction including: transferring assets from the original address or Lock to intermediate union address and The first step is to freeze the transaction. And a second-step reverse freeze transaction for ultimately locking assets from the intermediate joint address to the first or second joint address. , wherein The transaction is designed to reveal partial adapter witnesses after it is broadcast on its chain. or ;
[0010] Completion Phase: Both parties publish the aforementioned information on the blockchain in sequence. and The transaction, by extracting a partial witness from the on-chain transaction signature, allows both parties to independently calculate the complete adapter witness. Each subsequently released a fully signed version. The transaction completes the asset swap;
[0011] Timeout Phase: If one party fails to release the information as agreed during the lockout phase. If the transaction is terminated, the other party, after the agreed timeout period, can force open the transaction using a verifiable discrete log-time primitive. Algorithm, recovers and broadcasts refund transactions To safely retrieve their own assets.
[0012] This invention also discloses a system for implementing the above-mentioned general atomic cross-chain swapping method to mitigate abort attacks, characterized in that the system comprises:
[0013] The parameter negotiation and pre-signing module is used to enable... and The time parameter negotiation, joint address generation, and public adapter declaration calculation are completed off-chain, and all exchange transactions are pre-signed and verified off-chain.
[0014] An off-chain locking building block is used to construct transaction structures that include a two-step freeze operation, generate and manage corresponding pre-signatures, and integrate a reverse freeze mechanism, wherein the reverse freeze mechanism freezes the transaction in the second step. The timeout deadline is set much later than the first step of freezing the transaction. The deadline for implementation;
[0015] The on-chain execution and fair completion module is used to control the sequential publication of on-chain transactions by both parties, extract partial adapter witnesses from the published transactions, and ensure that after the two-step freeze is completed, both parties can independently generate the complete signature of the final exchange transaction.
[0016] The timeout monitoring and asset security recovery module is used to monitor the transaction publication status of the other party. When an abortion is detected, it triggers the forced recovery function of the verifiable discrete logarithmic time primitive after the timeout, and generates and broadcasts the refund transaction.
[0017] The present invention also discloses a non-volatile storage medium, characterized in that the non-volatile storage medium includes a stored program, wherein the program, when running, controls the device where the non-volatile storage medium is located to execute the above-described method.
[0018] The present invention also discloses a terminal device, characterized in that the terminal device includes: a processor, a memory, a communication interface, and a bus; the processor, the memory, and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to execute the method described above.
[0019] Beneficial effects
[0020] (1) Effectively mitigates abort attacks and enhances exchange security: This invention introduces a reverse freeze mechanism, placing the assets of the party refusing to fulfill its freeze obligations under a longer lock-up period, significantly increasing the economic cost of launching an abort attack and thus deterring such malicious behavior from the motivational level. Combined with the off-chain pre-signature reorganization workflow, the key commitment and signing steps are moved off-chain, avoiding placing assets in an irrevocable locked state in the early stages of the exchange, fundamentally reducing the risk of asset loss due to abort by one party.
[0021] (2) Ensuring the fairness and robustness of the exchange process: Through a fair completion mechanism, after both parties have frozen their assets, any honest participant can independently calculate all the cryptographic materials required to complete the final exchange (i.e., adapter witness y = y0 + y1) and independently publish the final transaction. This ensures that one party cannot prevent the other party from completing the exchange by unilaterally refusing to cooperate, thus guaranteeing the final completion of the exchange or the fair return of assets even if some participants do not cooperate.
[0022] (3) Enhancing the universality and usability of cross-chain exchange schemes: The core of this invention is built upon general cryptographic primitives such as adapter signatures and verifiable discrete logarithmic time, without relying on the scripts or smart contract functions of any specific blockchain. Therefore, this method can be applied to a wide range of blockchain ecosystems, including those blockchains that do not support complex scripts (such as Zcash, Monero, etc.), solving the fundamental defect of insufficient universality of script-based schemes. At the same time, the clear phase division and timeout handling mechanism make the protocol logic clear, easy to integrate and deploy on different chains, and improve practicality and user experience. Attached Figure Description
[0023] Figure 1 A schematic diagram of the overall process of signature-based cross-chain exchange;
[0024] Figure 2 A schematic diagram of the overall process of the ShieldSwap method. Detailed Implementation
[0025] The purpose of this invention is to propose a signature-based cross-chain swap method to mitigate abort attacks—the ShieldSwap method. This scheme is a signature-based cross-chain swap method designed to ensure that honest participants can complete the swap once they make a commitment.
[0026] The relevant information of this invention is as follows:
[0027] 1.1.1 Verifiable Discrete Logarithmic Time
[0028] Verifiable Discrete Log-Time (VTD) is one of the key primitives in signature-based cross-chain swapping methods. This scheme primarily binds a secret exponent to a publicly verifiable commitment with a defined time constraint. The algorithm for this scheme is defined as follows:
[0029] The algorithm is based on the given secret. Random numbers and time parameters Generate a commitment and proof ;
[0030] The algorithm was verified. Is it For a valid commitment, output a single bit b, representing the verification result. It is a group element, representing a group. One of the elements in It is a generator of the group.
[0031] The algorithm uses input commitments The specific structure, output secret Random numbers .
[0032] This algorithm consumes time recover .
[0033] 1.1.2 Adapter Signature
[0034] Adapter signing is one of the important primitives in signature-based cross-chain swapping methods. The algorithm for this scheme is defined as follows:
[0035] The pre-signature algorithm accepts a private key. ,information and statement As input, output a pre-signature .
[0036] The pre-verification algorithm accepts a public key. ,information ,statement and pre-signature As input, output one bit. , indicating the verification result.
[0037] The adaptation algorithm accepts pre-signatures. and witness As input, output a signature. .
[0038] The extraction algorithm accepts signatures. Pre-signature and statement As input, output a witness. Alternatively, output ⊥ (indicating that no valid witness was found).
[0039] 1.1.3 Signature-based cross-chain exchange
[0040] like Figure 1 As shown, the overall process of signature-based cross-chain exchange
[0041] 1. Preparation Phase
[0042] During this phase, the participants and Jointly generate a union address for temporarily storing their assets. and Each party prepares a refund transaction with verifiable time constraints. and These transactions are implemented using verifiable discrete log-time (VTD) primitives. These primitives ensure that refund operations can only be verified after a specified timeout. Refund transactions are bound to a time parameter. and ,in ∆, a constant greater than 0, establishes the temporal order relationship between the two chains. After verifying the refund proof, both parties broadcast their fund transactions. The assets of the person in question will be frozen at the joint address.
[0043] 2. Lockdown Phase
[0044] At this stage, both parties define the exchange transaction. and And perform a two-party computation (2PC) process to link their signatures. After this step, one party designates a participant (e.g., )get Full signature The other party only It can only be deduced after being published on the blockchain. signature .
[0045] 3. Completion Phase
[0046] First of all Broadcast to the blockchain. From this on-chain signature, the recipient can deduce... and subsequently released To complete the exchange.
[0047] 4. Timeout Phase
[0048] If it is at an earlier deadline If the exchange was not completed beforehand, each participant can broadcast their refund transaction after their respective timeout. or In order to recover its assets.
[0049] 1.1.4 Abort the attack
[0050] In signature-based cross-chain exchange methods, multiple participants exchange assets on different blockchains to achieve decentralized transactions. These methods are typically designed to complete the exchange in multiple phases, each with specific obligations and time constraints. These obligations include freezing assets, releasing signatures, and broadcasting transactions, designed to ensure the exchange process is completed within a predetermined timeframe. However, in practice, some participants may delay fulfilling these obligations, causing the entire method to fail or incur losses; this is known as a "suspension attack."
[0051] In signature-based cross-chain swaps, participating parties typically have several key obligations:
[0052] Asset Freezing: After both parties exchange and verify the refund transaction, the designated escrow account or assets will be frozen. This operation must be completed within the specified time to ensure the process can conclude on schedule.
[0053] Release of signature materials: During the exchange, the participants need to release the appropriate signature or adapter materials in order to continue to complete the subsequent steps.
[0054] Broadcast exchange transactions: When the method allows, both parties need to broadcast the transaction in a timely manner and obtain confirmation.
[0055] Refund Transaction: If the transaction is not completed within the timeout period, the participating party needs to broadcast the refund transaction to recover its assets.
[0056] If a participant fails to fulfill the above obligations on time, a stop attack may be launched. The impact of such an attack is that assets may be locked, preventing further exchange, or the method may fail to execute, preventing the completion of the expected asset exchange.
[0057] This invention, ShieldSwap, mitigates the impact of abort attacks by employing three complementary mechanisms on top of a signature-based cross-chain swap process. First, a reverse freeze mechanism allows each party to freeze the other's output, preventing situations where one party completes the freeze while the other terminates. Second, the method reorganizes the workflow by completing all interaction steps and pre-signing transactions off-chain before any on-chain operations. This avoids the previous interleaved pattern where aborts after asset locking caused severe disruption. Third, a fair completion mechanism restructures the transaction design, allowing both parties to independently generate the final signature required to complete the swap after freezing, ensuring completion for both parties.
[0058] ShieldSwap process
[0059] In a typical setup, there are two participating parties. and Each holding the fund key and and in the blockchain ledger and Asset allocation and ,in This represents the collection of various funds held by participants on the blockchain ledger, using... Indicates all The transaction, Indicates all The transaction. Here. As a wildcard, all transactions matching a similar format have similar meanings. The overall process is as follows: Figure 2 As shown.
[0060] Preparation stage
[0061] The purpose of this phase is to complete all preparatory work related to the exchange, including negotiating timeout parameters, generating joint addresses, and obtaining and exchanging transaction pre-signatures through a method jointly calculated by both parties. Unlike existing signature-based cross-chain exchange methods, all steps performed by ShieldSwap in this phase are off-chain operations, so if either party terminates at any time, on-chain tokens will not be locked. More importantly, the adapter witness value... Generated jointly by both parties, in the form of Instead of being controlled by one party, this prevents holding onto [the assets] during the completion phase of the exchange. The participating parties initiated a stop-attack.
[0062] To achieve the above design, both parties agreed on a consistent timeline. , and ,in . Specifies the maximum waiting time for an exchange transaction during the exchange completion phase, while and Then specify in and The maximum waiting time for frozen tokens. Subsequently, both parties agreed to do so during public hours. Each entity generates its own private key for the unified address. , , and And together they calculated the two joint addresses. and Each party generates a commitment. And verified by VTD algorithm Verify the other party. Once verification is successful, and Select each and ,exchange and And calculate the common adapter declaration. .
[0063] for Every asset on Define a transaction ,in for The address provided is specifically for this exchange. Both parties will use [the specified address] for this transaction. and using their respective private keys. and Joint calculation Signed via adapter The algorithm performs pre-signing to obtain the pre-signature of the transaction. .
[0064] for Every asset on Define a transaction ,in for The address provided is specifically for this exchange. Both parties will use [the specified address] for this transaction. and using their respective private keys. and Joint calculation Signed via adapter The algorithm performs pre-signing to obtain the pre-signature of the transaction. .
[0065] All pre-signatures are exchanged between the two parties and then signed via the adapter. The algorithm was validated.
[0066] Lockdown phase
[0067] Similar to the exchange setup phase in our methodology, all interactions in this phase are conducted off-chain, therefore, an abort attack at this phase will not result in the locking of on-chain tokens. This phase primarily focuses on two key issues that arise when preparing to freeze tokens. First, since both parties each hold a portion of the adapter key... and The method must ensure that these keys are revealed fairly so that each party can independently complete the exchange after both parties issue a freeze transaction. Secondly, the method must also ensure that both parties have sufficient incentives to perform their respective freeze operations, preventing one party from attempting to abort the operation while the other party is completing its freeze operation.
[0068] To solve the first problem, we first redesigned the frozen transactions so that each transaction contains a unique key, namely... or Once the two frozen transactions are broadcast, their on-chain signatures will reveal... and This allows both sides to restore the synthesized adapter. .
[0069] To address the second issue, we introduced an anti-freeze mechanism. The core idea is that both parties first lock their own tokens in a joint address and agree on two intermediate periods. and An agreement has been reached. The timeout parameter in existing signature-based cross-chain exchanges has been adjusted. different, and This is not considered a waiting limit for the entire exchange process. If one party issues a freeze order, the other party's tokens will be re-locked to another joint address, and the timeout period will be extended. This design reverses the locking relationship, so that the party that refuses to freeze and chooses to abort will have its tokens locked for a longer period of time, thus eliminating the incentive to launch an abort attack.
[0070] The specific process for this stage is as follows:
[0071] generate And Send to Then, both parties used the VTD algorithm during common time. and Internally generated union address and Each party holds a portion of the private key to the joint address. Each party generates a commitment. And verified by VTD algorithm Verify the other party.
[0072] Subsequently, both parties defined the first step of freezing the transaction: , The second step of the unfreezing transaction is used to defreeze the account. , .
[0073] Finally, all transactions will be pre-signed off-chain using a specified adapter declaration. Specifically, using... for Pre-signed, used for Pre-signed, used for Pre-signature. The generated pre-signature. , and It is recorded and verified.
[0074] Completion Phase
[0075] In this phase, both parties perform a series of on-chain operations in sequence, completing the first step of freezing, the second step of unfreezing, and finally issuing an exchange transaction to complete the exchange. It is important to note that after both parties complete the two-step freezing process, each party can complete the exchange independently.
[0076] exist Previously, both parties announced the transaction. and On the chain. (Observed) After being added to the blockchain, Use adapter signing Algorithm extracts witness value .Then, use and Signed via adapter The algorithm obtains The real signature, and Previously released.
[0077] Then according to the on-chain Signed using the adapter Algorithm Revealed Subsequently, use To adapt and in Previous release ,Towards reveal .
[0078] After obtaining two adapters, each side calculates... ,use exist Pre-signed for the adapter exchange, and in Previously published transactions: and Thus, the exchange is completed.
[0079] Timeout phase
[0080] This phase handles situations where one party aborts, allowing the other party to return their assets after the appropriate timeout. Unlike existing signature-based cross-chain swaps, our design only needs to handle interruptions during the freeze process. When one party broadcasts... This happens when the other party does not broadcast. If Published ,but If the operation is stopped, it will time out locally. back, Calling VTD Algorithm to restore refund transactions ,broadcast Get back the pledged funds. If Stop operation, and It was broadcast ,but Calling VTD Algorithm to restore refund transactions Broadcast Get back the pledged funds.
[0081] Example 2
[0082] Based on Embodiment 1, this embodiment discloses a system for implementing a universal atomic cross-chain swapping method to mitigate abort attacks, the system comprising:
[0083] The parameter negotiation and pre-signing module is used to enable... and The time parameter negotiation, federated address generation, and public adapter declaration calculation are completed off-chain, and all exchange transactions are pre-signed and verified off-chain. The time parameter negotiation unit is used to... , , An agreement was reached;
[0084] The joint address generation unit is based on a verifiable discrete logarithmic time (VTD) algorithm. and Securely generate joint addresses and ;
[0085] The adapter management unit is used to generate, exchange, and calculate adapter declarations. as well as ;
[0086] Pre-signed unit, calling the adapter signature algorithm Generate a pre-signature for the exchange transaction. and call Verification is required.
[0087] An off-chain locking building block is used to construct transaction structures that include a two-step freeze operation, generate and manage corresponding pre-signatures, and integrate a reverse freeze mechanism, wherein the reverse freeze mechanism freezes the transaction in the second step. The timeout deadline is set much later than the first step of freezing the transaction. The deadline for implementation is specified. The off-chain locking construction module specifically includes: an intermediate address generation unit, used to generate transitional intermediate joint addresses. and Two-step transaction building units, each building... Trading and Transactions; pre-signed and incentive-constrained units, using different adapter declarations. The transaction is pre-signed, and its timeout deadline is set to... This makes it much longer than Deadline for the transaction or This constitutes a reverse freeze incentive.
[0088] The on-chain execution and fair completion module controls the sequential publication of on-chain transactions by both parties, extracts partial adapter witnesses from published transactions, and ensures that after the two-step freeze is completed, both parties can independently generate the complete signature of the final exchange transaction. Specifically, the on-chain execution and fair completion module includes: a transaction publication scheduling unit, which, based on... and Time sequence, control and Transaction publishing; witness extraction and adaptation unit, integrated adapter signature algorithm and It is used to extract partial witnesses from on-chain transactions and adapt them to generate subsequent transaction signatures; all are released After the transaction, each party can calculate independently. And finally complete all Signing and publishing transactions.
[0089] The timeout monitoring and asset security recovery module monitors the transaction publication status of the other party. Upon detecting an aborted transaction, it triggers a verifiable discrete logarithmic time primitive-based forced recovery function after the timeout, generating and broadcasting a refund transaction. Specifically, the timeout monitoring and asset security recovery module includes: a transaction status monitoring unit, which continuously monitors the blockchain to confirm whether the other party is... or The agreement was released earlier. Transaction; Forced recovery trigger unit, which, upon detecting that the other party has failed to publish the transaction on time, triggers a verifiable discrete logarithmic time primitive at the local timeout. Algorithm; Secure refund execution unit, utilizing The algorithm recovers the secret, constructs and broadcasts the refund transaction. This ensures that assets can be recovered if the other party ceases its attack.
[0090] Example 3
[0091] A non-volatile storage medium, characterized in that the non-volatile storage medium includes a stored program, wherein the program, when running, controls the device where the non-volatile storage medium is located to execute the method of Embodiment 1.
[0092] Example 4
[0093] A terminal device, characterized in that the terminal device includes: a processor, a memory, a communication interface, and a bus; the processor, the memory, and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to execute the method described in Embodiment 1.
[0094] In summary, this invention provides a universal and highly secure atomic cross-chain swap method (ShieldSwap) and corresponding system. This method innovatively combines three complementary technologies: a reverse freeze mechanism, an off-chain pre-signature reorganization workflow, and a fair completion mechanism. This systematically solves the prevalent and serious "abrupt attack" problem in existing signature-based cross-chain swap schemes. This invention ensures the atomicity, fairness, and robustness of the swap process; even against uncooperative parties, honest participants can complete the swap or securely recover their assets. Furthermore, its design based on universal cryptographic primitives gives it excellent cross-chain versatility. This invention can be widely applied to decentralized finance (DeFi), cross-chain asset bridges, decentralized exchanges (DEXs), and any scenario requiring secure and reliable value transfer between heterogeneous blockchains, providing crucial infrastructure support for building a secure and interconnected multi-chain ecosystem.
[0095] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A universal atomic cross-chain swapping method to mitigate abort attacks, characterized in that, Based on verifiable discrete log-time and adapter signature primitives, this involves the first participant. With the second participant Cross-chain asset swaps between [chains], the method comprising: Preparation phase: and The first joint address is generated off-chain through secure computation by both parties. With the second joint address And witnesses to each based on their respective chosen adapters. and Generate public adapter declaration Both parties used the adapter signature algorithm to... The parameter is used for the exchange transaction of transferring assets from the joint address to the designated address of the other party. Perform off-chain pre-signing; among which, and Witness the adapters selected by both parties. and These are the corresponding witness data; Locking Phase: Both parties construct and pre-sign a two-step freeze transaction off-chain, the transaction including: transferring assets from the original address or Lock to intermediate union address and The first step is to freeze the transaction. And a second-step reverse freeze transaction for ultimately locking assets from the intermediate joint address to the first or second joint address. , wherein The transaction is designed to reveal partial adapter witnesses after it is broadcast on its chain. or ; Completion Phase: Both parties publish the aforementioned information on the blockchain in sequence. and The transaction, by extracting a partial witness from the on-chain transaction signature, allows both parties to independently calculate the complete adapter witness. Each subsequently released a fully signed version. The transaction completes the asset swap. Timeout Phase: If one party fails to release the information as agreed during the lockout phase. If the transaction is terminated, the other party, after the agreed timeout period, can force open the transaction using a verifiable discrete log-time primitive. Algorithm, recovers and broadcasts refund transactions To safely retrieve their own assets.
2. The method according to claim 1, characterized in that, The preparation phase specifically includes: and Negotiate three consistent time parameters: the final exchange completion deadline T, On-chain freeze operation deadline ,as well as On-chain freeze operation deadline Among them, satisfying ; Specifies the maximum waiting time for an exchange transaction during the exchange completion phase, while and These are specified in the blockchain ledger. and The maximum waiting time for frozen tokens; Each party generates a partial private key for the joint address. , , and The joint address is obtained through calculation by both parties. and ; Both parties exchanged their respective adapter declaration sections. The public adapter declaration is calculated. ; for In blockchain Assets on Both parties pre-signed and exchanged the transaction. ,in for The receiving address; for In blockchain Assets on Both parties pre-signed and exchanged the transaction. ,in for The address for receiving payments.
3. The method according to claim 2, characterized in that, The locking phase specifically includes: Both parties generate an intermediate joint address and and define: Step 1: Freeze the transaction. , ; The second step is to freeze the transaction in reverse: , ; Use public adapter declaration right Perform pre-signing; use for Pre-signed, where It is a by Generate and send Additional statement.
4. The method according to claim 3, characterized in that, The completion phases are performed in the following order: In time Before, release , release ; Observed After being uploaded to the blockchain, the adapter signature extraction algorithm is used. Extract witnesses from their signatures and utilize For presigned Perform adaptation to obtain the complete signature. ,exist Previous release ; Observed After being added to the blockchain, use Algorithm for extracting witnesses and utilize For presigned Perform adaptation to obtain the complete signature. ,exist Previous release The transaction also... Revealed witness ; Both sides obtained and Then, calculate independently. and utilize Exchange transactions with pre-signature Perform adaptation to obtain a complete signature. Previously released separately and The asset swap was completed.
5. The method according to any one of claims 1-4, characterized in that, The timeout phase specifically refers to: like Published and Unreleased ,but exist After a timeout, a verifiable discrete log-time primitive is invoked. Algorithm to recover refund transactions and broadcast it; like Published ,and Unreleased ,but After the corresponding timeout, call Algorithm to recover refund transactions , and broadcast it.
6. A system for implementing a universal atomic cross-chain swapping method for mitigating abort attacks as described in any one of claims 1-5, characterized in that, The system includes: The parameter negotiation and pre-signing module is used to enable... and The time parameter negotiation, joint address generation, and public adapter declaration calculation are completed off-chain, and all exchange transactions are pre-signed and verified off-chain. An off-chain locking building block is used to construct transaction structures that include a two-step freeze operation, generate and manage corresponding pre-signatures, and integrate a reverse freeze mechanism, wherein the reverse freeze mechanism freezes the transaction in the second step. The timeout deadline is set much later than the first step of freezing the transaction. The deadline for implementation; The on-chain execution and fair completion module is used to control the sequential publication of on-chain transactions by both parties, extract partial adapter witnesses from the published transactions, and ensure that after the two-step freeze is completed, both parties can independently generate the complete signature of the final exchange transaction. The timeout monitoring and asset security recovery module is used to monitor the transaction publication status of the other party. When an abortion is detected, it triggers the forced recovery function of the verifiable discrete logarithmic time primitive after the timeout, and generates and broadcasts the refund transaction.
7. The system according to claim 6, characterized in that, The parameter negotiation and pre-signature module specifically includes: The time parameter negotiation unit is used for... , , An agreement was reached; The joint address generation unit is based on a verifiable discrete logarithmic time (VTD) algorithm. and Securely generate joint addresses and ; The adapter management unit is used to generate, exchange, and calculate adapter declarations. as well as ; Pre-signature unit, calling the adapter signature algorithm Generate a pre-signature for the exchange transaction. and call Verification is required.
8. The system according to claim 6, characterized in that, The off-chain locking construction module specifically includes: Intermediate address generation unit, used to generate transitional intermediate joint addresses. and ; Two-step transaction building units, respectively building Trading and trade; Pre-signed and incentive constraint units, using different adapter declarations The transaction is pre-signed, and its timeout deadline is set to... This makes it much longer than Deadline for the transaction or This constitutes a reverse freeze incentive.
9. The system according to claim 6, characterized in that, The on-chain execution and fair completion module specifically includes: The transaction release scheduling unit, based on and Time sequence, control and The announcement of the transaction; Witness extraction and adaptation unit, integrating adapter signature algorithm and It is used to extract partial witnesses from on-chain transactions and adapt them to generate subsequent transaction signatures; Independent computation and completion units, published by both parties After the transaction, each party can calculate independently. And finally complete all Signing and publishing transactions.
10. The system according to claim 6, characterized in that, The timeout monitoring and asset safe recovery module specifically includes: The transaction status monitoring unit continuously monitors the blockchain to confirm whether the other party is present. or The agreement was released earlier. trade; The forced recovery trigger unit, upon detecting that the other party has failed to publish the transaction on time, triggers a verifiable discrete logarithmic time primitive at the local timeout point. algorithm; Secure refund execution unit, utilizing The algorithm recovers the secret, constructs and broadcasts the refund transaction. This ensures that assets can be recovered if the other party ceases its attack.
11. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein the program, when executed, controls the device where the non-volatile storage medium is located to perform the method described in any one of claims 1 to 5.
12. A terminal device, characterized in that, The terminal device includes: a processor, a memory, a communication interface, and a bus; the processor, the memory, and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to perform the method as described in any one of claims 1-5 above.