Hi everyone,
We wanted to share a new cross-chain atomic swap construction called Zwap, and get feedback from the Zcash community. This work is motivated by a fairly fundamental limitation in how cross-chain swaps are implemented today, and why that limitation becomes especially problematic for privacy-preserving systems like Zcash.
The Problem with HTLC-Based Swaps
Most existing cross-chain swaps rely on hashed timelock contracts (HTLCs). While HTLCs give us the atomicity guarantee that either both sides of the swap execute or neither does, they introduce a deterministic linkage between chains.
The same hash preimage condition H(s) is embedded on both chains, and once the preimage is revealed on one chain, it becomes trivial for any observer to correlate the corresponding transaction on the other chain. In effect, HTLCs create a public bridge between two otherwise independent transaction graphs.
For ecosystems where transparency is already the default, this tradeoff is often accepted. But in the context of Zcash, where minimizing linkability and metadata leakage is a core design goal, this becomes a much more serious issue. Even if one leg of the swap is shielded or privacy-enhanced, the shared hash across chains can reintroduce correlation at the cross-chain level.
Zwap’s Core Idea (Zcash ↔ Ethereum Example)
Phase 0 (Off-Chain Order Matching):
-
Alice generates secret
s, computesPS = s · GandH(s) -
Alice proves (in zero-knowledge) that
sis the preimage of bothH(s)and the discrete log ofPS -
Bob verifies the proof, generates
b, sendsPB = b · G -
Both compute shared point
PSB = s · PB = b · PS
Phase 1 (Locking):
-
Alice locks on Ethereum: funds redeemable by ECDSA signature under
PSB(requires keys · b) -
Bob locks on Zcash: transparent UTXO with script requiring
OP_SHA256preimage ofH(s)
Phase 2 (Redemption):
-
Alice reveals
son Zcash, claims Bob’s BTC -
Bob reads
sfrom Zcash blockchain, computess · b, signs underPSB, claims Alice’s ETH
This works today with Zcash transparent addresses and the funding transaction could be an unsheilding transaction (z->t). For our future work we are actively exploring trustlessly swapping with shielded (z->z) transactions.
Compatibility and Practical Use
In terms of compatibility, the construction works directly with Zcash’s transparent layer, since it only requires standard UTXO scripting primitives : signature verification, hash preimage checks, and timelocks. This makes it immediately applicable to swaps like Zcash–Bitcoin or Zcash–EVM chains without requiring changes to consensus or signature schemes.
More generally, the protocol is chain-agnostic. It only assumes that one chain can enforce a signature-based lock and the other can enforce a hash-based lock. The exact encoding differs per chain, but the core construction remains the same.
As client-side proving performance continues to improve, the computational overhead of Phase 0 becomes negligible from a user experience perspective.
Implementation Status
We’re are on a road map to ship soon targeting:
-
Ethereum mainnet + L2s
-
Zcash transparent (standard P2SH scripts)
-
ZK proving stack (UltraHonk/Provekit for off-chain proofs)
The protocol is designed for a solver model (professional market makers) rather than peer-to-peer matching. Solvers provide liquidity, manage watchtowers, and handle cross-chain complexity. End users just lock → reveal → claim.
Relation to PTLCs
An important comparison for cross-chain atomic swap protocols is how ECDH-Swap relates to PTLC-based approaches.
When both chains support Schnorr signatures and adaptor signature primitives, PTLCs offer a cleaner and more cryptographically native path to unlinkable atomic swaps. In homogeneous environments with these capabilities, PTLCs are arguably the ideal construction.
ECDH-Swap is not intended to replace that direction. Instead, it addresses the practical gap in heterogeneous cross-chain environments where at least one chain lacks native Schnorr support , most notably EVM-based chains, which rely on Schnorr verification through ecrecover workarounds, which remains non-native and gas-inefficient compared to ECDSA operations.
Open Questions for the Community
- How much does a trustless atomic bridge matter to a ZEC holder?
- How much does statistical unlinkability matter vs. cryptographic unlinkability in practice?
Read the Full Paper
PDF: Zwap: A Cross-Chain Atomic Swap Protocol Using Multiplicative Key Aggregation