🎉 Gate xStocks Trading is Now Live! Spot, Futures, and Alpha Zone – All Open!
📝 Share your trading experience or screenshots on Gate Square to unlock $1,000 rewards!
🎁 5 top Square creators * $100 Futures Voucher
🎉 Share your post on X – Top 10 posts by views * extra $50
How to Participate:
1️⃣ Follow Gate_Square
2️⃣ Make an original post (at least 20 words) with #Gate xStocks Trading Share#
3️⃣ If you share on Twitter, submit post link here: https://www.gate.com/questionnaire/6854
Note: You may submit the form multiple times. More posts, higher chances to win!
📅 July 3, 7:00 – July 9,
Adapter Signature: A New Tool for Cross-Chain Atomic Swaps
Adapter Signatures and Their Applications in Cross-Chain Atomic Swaps
With the rapid development of Bitcoin Layer 2 scaling solutions, the frequency of cross-chain asset transfers between Bitcoin and its Layer 2 networks has significantly increased. This trend is driven by the higher scalability, lower transaction fees, and high throughput provided by Layer 2 technology. These advancements facilitate more efficient and cost-effective transactions, thereby promoting broader adoption and integration of Bitcoin across various applications. As a result, interoperability between Bitcoin and Layer 2 networks is becoming a key component of the cryptocurrency ecosystem, driving innovation and providing users with more diverse and powerful financial tools.
There are mainly three solutions for cross-chain transactions between Bitcoin and Layer 2: centralized cross-chain transactions, BitVM cross-chain bridge, and cross-chain atomic swaps. These three technologies differ in trust assumptions, security, convenience, transaction limits, and can meet different application needs.
The advantages of centralized cross-chain trading are fast speed and a relatively easy matching process. However, its security completely relies on the reliability and reputation of the centralized institution. If there are issues with the centralized institution, user funds are at a higher risk. Additionally, centralized cross-chain trading may also expose user privacy.
The BitVM cross-chain bridge technology is relatively complex, involving multi-party signatures and optimistic challenge mechanisms. This technology is mainly suitable for ultra-large transactions and is used infrequently.
Cross-chain atomic swaps are a decentralized technology that offers advantages such as censorship resistance and good privacy protection, widely used in decentralized exchanges. Currently, cross-chain atomic swaps mainly include two solutions based on Hash Time-Lock (HTLC) and adapter signatures.
Compared to HTLC, adapter signature-based atomic swaps have the following advantages:
This article mainly introduces adapter signatures and their application in cross-chain atomic swaps, including the following aspects:
Schnorr Adapter Signatures and Atomic Swaps
The process of generating Schnorr signatures is as follows:
Where G is the base point, P is the public key, m is the message, and x is the private key. The signature is (R, s).
The verification process is: check sG ?= R + cP
The generation process of Schnorr adapter signatures is as follows:
The pre-signature is (R,s'). The complete signature is (R,s = s' + y), where y is the adaptation value, satisfying Y = y * G.
The verification process is: check sG ?= R + Y + cP
Atomic swap process:
ECDSA Adapter Signature and Atomic Swap
The process of generating an ECDSA signature is as follows:
In this, G is the base point, n is the curve order, x is the private key, and m is the message. The signature is (r, s).
The verification process is: check R'_x ?= r, where R' = s^(-1)H(m)G + s^(-1)rP
The process of generating ECDSA adapter signatures is as follows:
The pre-signature is (R,s'). The complete signature is (R,s = s' * (x + y) / x).
The verification process is: check R'_x ?= r, where R' = s^(-1)H(m)G + s^(-1)r(P + Y)
The atomic swap process is similar to Schnorr.
Random Number Problem and Solution
The pre-signatures of Schnorr/ECDSA adapter signatures commit to the random number r. If the random number is leaked or reused, it can lead to the exposure of the private key.
The solution is to use RFC 6979 to derive random numbers from the private key and message in a deterministic manner:
k = SHA256(sk, msg, counter)
This ensures that k is unique for each message, while having reproducibility for the same input, reducing the risk of private key exposure related to random number generators.
Cross-chain Scenario Issues and Solutions
UTXO and account model systems are heterogeneous: Bitcoin adopts the UTXO model, while Ethereum adopts the account model. In the account model, it is not possible to pre-sign refund transactions. The solution is to implement atomic swap logic using smart contracts on the Ethereum side.
Same curve different algorithm: If two chains use the same curve but different signature algorithms, such as one using Schnorr and the other using ECDSA, the adapter signature is still secure.
Different curves: If two chains use different curves, the adapter signature will be insecure because the order of the curves is different, and the modulus coefficients are different.
Digital Asset Custody Application
The adapter signature can be used to implement non-interactive digital asset custody:
This solution is more flexible and decentralized compared to traditional custody.
Verifiable encryption is the key technology to implement this solution, mainly including two schemes: Purify and Juggling. Purify is based on zkSNARK, while Juggling adopts methods of sharding and range proofs.
Overall, adapter signatures provide new possibilities for applications such as cross-chain atomic swaps and digital asset custody, but practical applications still need to consider issues such as random number security and system heterogeneity. In the future, with the further development of related technologies, adapter signatures are expected to play an important role in more scenarios.