This application is based upon and claims priority to Chinese Patent Application No. 202311029127.1, filed on Aug. 16, 2023, the entire contents of which are incorporated herein by reference.
This invention relates to the field of asset swap. Specifically, it allows users to securely and conveniently achieve escrow-free asset swap between blockchains.
Blockchain is a distributed ledger technology that records and verifies transactions in a decentralized manner. Each blockchain network has its own rules and protocols. With the advancement of blockchain technology, the coexisting blockchains are no longer isolated islands, and their value derives from the exchange of assets or data between blockchains. In fact, cross-chain swapping is the fundamental and crucial aspect of achieving interoperability between blockchains. Cross-chain asset swaps face certain challenges that need to be addressed. Different blockchain systems employ varying consensus mechanisms and protocol rules, making cross-chain asset swaps difficult. Additionally, due to the distributed and decentralized nature of blockchain, there is inherent mutual distrust among participating parties. Cross-chain asset swaps also involve interactions between two or more chains, which can result in a significant amount of data being processed, limiting the potential for blockchain's development and application prospects.
Cross-chain asset swap refers to the process where a user Alice transfers her holdings of assets (α units) on blockchain A to a user Bob on blockchain B, and simultaneously, Bob transfers his holdings of assets (β units) to Alice. The atomicity of cross-chain swaps ensures the integrity of the transaction, meaning that the entire exchange process either successfully completes or fails completely, with no possibility of partial success.
The approach in cross-chain asset swaps that relies on a trusted third party (TTP) is commonly referred to as ‘intermediaries’ or ‘notaries.’ Their role involves facilitating and verifying the exchange of assets. Their responsibilities include verifying and recording transactions to ensure their validity and security. Intermediaries typically require a certain level of credibility and trustworthiness to gain users' confidence in relying on them to execute transactions. A trusted central notary can ensure the security and reliability of cross-chain asset swaps, enabling fast and convenient asset transfers while supporting compatibility between multiple blockchain networks. However, the notary system also poses some challenges, including potential single points of failure and trust issues, which may increase transaction costs and reduce efficiency.
U.S. Pat. No. 10,652,019 B1 employs zero-knowledge proofs to indicate the possession of an asset and commit the asset to the peer so as to perform transactions or atomic swaps. In the invention, a message service is employed to deliver data to help atomic swap system.
Smart contracts provide a trustless solution for cross-chain asset swaps, eliminating the need for reliance on the third-party. These contracts, executed on the blockchain, automate and enforce transaction rules, facilitating cross-chain asset swaps. The process involves primarily locking, validating, releasing, and refunding cross-chain assets. Hash Time-Locked Contracts (HTLCs) are commonly employed to manage the locking, releasing, and refunding phases. However, HTLCs require participating chains to support compatible hash functions and time-locking capabilities, which may result in limited operability and scalability, along with higher execution costs. Additionally, failure to adhere to the contract rules by participants could potentially lead to asset losses.
A multi-signature address refers to an address that requires multiple private key signatures to execute a transaction. Typically, it is composed of public keys from different participants. Only when a sufficient number of private keys sign a transaction can that transaction be accepted. In cross-chain asset swaps, multi-signature addresses are primarily used for locking and releasing assets to provide enhanced security. However, managing multiple private keys and ensuring an adequate number of signatures during the exchange process increases the complexity and the probability of errors.
These methods all require escrow of exchange funds, however, interoperability issues between different blockchains may result in funds being ‘locked’ and unable to operate effectively on other networks. Furthermore, asset escrow often involves time across multiple blockchain networks, potentially leading to delays or failures in the execution of exchanges. In asset exchanges, malicious attacks on smart contracts or TTP can result in fund loss. Given these challenges, the question of how to achieve decentralized, non-custodial, secure, reliable, and user-friendly cross-chain asset swaps is of paramount importance.
Most atomic swap methods require the assets to be “locked or escrowed”, which can lead to risks of fund loss or theft, centralized risks, and inefficiencies in the speed and effectiveness of the exchange. To achieve atomic swaps of assets across different blockchains without the need for asset escrow, this paper discloses a secure and convenient cross-chain atomic swap system. First, all participants negotiate and determine specific transaction contents and sign to confirm each transaction content. Then, they use a reversible signature aggregate function to create a proof and share it with the other participants. Upon receiving the proof, the recipient verifies it. Once verified success, any participant can initiate the execution of the transaction by sending their transaction signature to the others.
In this system, assume that two users, User1 and User2, have completed their registration. User1 has α coins, stored in wallet W11 on blockchain A; also, on blockchain B, User1 has a wallet W12. User2 has β coins stored in wallet A on blockchain B; meanwhile, on blockchain A, User1 has a wallet W22. Now, User1 intends to use her a coins on blockchain A to exchange with User2's β coins on blockchain B.
In accordance with the first aspect of the invention, a method is disclosed for securely and conveniently swapping assets between different blockchains using a multi-signature scheme without asset escrow. The method includes the following steps:
According to the second aspect of the present invention, a system is disclosed for facilitating secure and convenient atomic swaps of assets between different blockchains, thereby eliminating the need for funds to be held in escrow, in which the system comprises:
Embodiments of the invention are described hereinafter in detail with reference to the drawings, in which:
The following discloses an embodiment of the invention, aiming to achieve escrow-free, secure, and convenient atomic cross-chain asset swaps.
Traditional asset exchanges between different blockchains usually require the locking of transaction assets to ensure participants exchange according to the agreement and to prevent fraudulent actions. However, this approach may lead to inefficiencies, poor liquidity, and limited scalability. The escrow-free atomic cross-chain swap method disclosed by this invention offers a faster and more convenient way of swapping assets, enhancing liquidity and reducing the influence of external factors on the swap. Moreover, by embedding the recipient's confirmation within the transaction, it effectively minimizes human errors, deters fraudulent actions, and boosts the security of the transaction.
In blockchain structures that adopt the UTXO model, such as Bitcoin, the receiving address is often based on the hash value of a public key. When a user sets up a wallet, the system generates a pair of public and private keys. This public key is processed through a specific hash function to produce a hash value. This hash value is then encoded (e.g., using Base58Check encoding) to form the user's Bitcoin receiving address. There are reasons for choosing the hash value of the public key as the address: Firstly, the public key remains undisclosed until the funds are actually used, enhancing privacy; secondly, the length of the hash value is shorter than the entire public key, which helps optimize storage and efficiency.
Assume σx and σy are signatures generated for messages x and y, respectively, using a signing scheme that possesses deterministic, homomorphic, and unforgeable properties. Function F (σx, σy) is a reversible signature aggregate function, and F (σx, σy) exhibits the following properties:
Let's assume User1 and User2 are any two users in the system. User1 has wallet W11 on blockchain A and wallet W12 on blockchain B. User2 has wallet W21 on blockchain A and wallet W22 on blockchain B. In W11, User1 holds α coins, and in W22, user2 holds β coins. To exchange assets, they construct transactions TX1 and TX2, respectively. Through TX1, User1 transfers a coins to User2's wallet W21 on blockchain A. Meanwhile, User2 sends β coins to user1's wallet W12 on blockchain B through TX2.
Our primary objective is to ensure the atomicity of cross-chain asset swaps, meaning that once an exchange is initiated, it either completes successfully or fails entirely, with no in-between states allowed. Secondly, we aim to achieve an escrow-free fund exchange. Traditional atomic exchange protocols often rely on trusted third parties, smart contracts, or shared addresses to lock, unlock, or rollback funds, but we seek to move away from these dependencies, aiming for greater decentralization. Lastly, we strive to simplify the operational process of atomic swaps and reduce the associated costs. Many current exchange mechanisms, such as hash-time-locked contracts or shared addresses, require specific script support and can be affected by time differences between blockchains. Specifically, using shared addresses might lead to complex key management issues and potential privacy breaches, posing additional challenges in technical implementation and management.
To meet all three objectives of the embodiments, the recipient's confirmation of the transaction contents into the transaction itself. This means that each transaction not only requires the sender's signature but also the recipient's confirmation signature. In this implementation, we use a reversible signature aggregation function to produce an aggregated signature for the transaction participants. Moreover, optional proof is generated for participants, evidencing the relationship between the aggregated signature and the transaction contents. Participants exchange proofs off-chain. As soon as one party discloses its signature, the other can initiate its transfer transaction and also reveal its transaction signature. With this signature in hand, the initiator can then construct and broadcast the corresponding transfer transaction.
The following embodiments will be described in detail with reference to
When a node in the blockchain network receives a transaction TX, it will verify it through the following steps:
In step 310, User1 uses his private key sky from blockchain A and sk12 from blockchain B to sign the messages m1 and m2, generating signatures σ11 and σ12. Meanwhile, User2 also signs the messages m1 and m2, generating signatures σ21 and σ22.
After signature generation, User1 employs the reversible signature aggregation function F (x, y) in step 320 to aggregate σ11 and σ12,
C
1
=F(σ11,σ12).
Moreover, User1 generates an optional proof proof1 for User2, demonstrating the relation between C1, m1, and m2. User1 sends the message (C1, proof1) to User2 through an off-chain channel. Upon receipt of the message, User2 initiates its verification with the major data shown in
Next, if either party plans to initiate a transaction, they must send the transaction signature to the other party. Taking User1 in step 330 as an example, User1 will send σ12 to User2. Upon receipt of σ12, User2 can recover σ11 based on C1 and σ12. At this juncture, User2 has the capability to construct TX1, as illustrated in σ11,σ21,m
. Next, TX1 is broadcast on blockchain A. In step 340, User1, by monitoring the network communication of blockchain A, obtains the signature σ21 and uses the reversibility of function F (⋅,⋅) to restore σ22. User1 can then construct TX2=
σ12,σ22,m2
. In step 330, if User2 decides to abort the exchange, σ21 will not be disclosed, resulting in no exchange taking place, ensuring neither party incurs any loss. However, once TX1 is broadcast, User1 is compelled to construct TX2, otherwise User1 will incur a double loss.
In step 350, the valid transactions TX1 and TX2 are respectively packaged into the corresponding blocks of blockchains A and B. Once the block is confirmed, the transfer operation will take effect, thereby completing the exchange.
Number | Date | Country | Kind |
---|---|---|---|
202311029127.1 | Aug 2023 | CN | national |