project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

atomicX

Trustless ETH <> STRK atomic swaps using HTLCs on Ethereum & Starknet. No middlemen, just code.

atomicX

Created At

Unite Defi

Project Description

This project enables trustless atomic swaps between Ethereum (Sepolia ETH) and Starknet (STRK) using Hash Time-Locked Contracts (HTLCs). It allows two users to securely trade tokens across these chains without relying on intermediaries or custodians.

Core Concept At the heart of the system are smart contracts deployed on both Ethereum and Starknet. These contracts lock up tokens based on a secret (a hashlock) and enforce a timeout condition (timelock). A relayer service coordinates activity across both chains and ensures atomicity — meaning either both sides of the trade complete or neither do.

Flow of the Swap User A (Maker) initiates a swap, for example offering 0.01 Sepolia ETH for 100 STRK. They lock their ETH in an Ethereum HTLC contract. A secret is generated and the hash of this secret is used to secure the contract.

User B (Taker) sees the order and agrees to the trade. They deposit 100 STRK into a Starknet HTLC using the same hashlock.

Once both deposits are confirmed, User A reveals the secret on Starknet to claim the STRK. This secret is now publicly visible.

User B reads the revealed secret and uses it to unlock the ETH on Ethereum.

The swap is atomic because revealing the secret on one chain enables the other party to claim on the other chain. If either party fails to deposit or reveal the secret within the timelock, funds are automatically refunded.

Technical Components Ethereum Smart Contract (Solidity): Handles ETH deposits, hashlock validation, and refunds.

Starknet Smart Contract (Cairo): Manages STRK side of the swap using the same logic.

Relayer Service: Watches for events on both chains, generates secrets, tracks hashlocks, and coordinates swap states.

Key Features Trustless cross-chain swaps without intermediaries

Automatic refund if a trade isn’t completed

Secured by standard HTLC mechanics

Relayer ensures synchronization across chains

Designed for testnets initially (Sepolia ETH and Starknet Testnet)

Future Possibilities Support for more token pairs (e.g., wBTC, DAI, USDC)

Production-ready version on Ethereum and Starknet mainnets

Web frontend with orderbook UI and wallet integrations

Optional privacy features using zero-knowledge proofs

Integration with messaging protocols (e.g., Starknet<>Ethereum bridges)

This project sets the foundation for secure, decentralized cross-chain trading between L1 and L2 ecosystems, without needing bridges or custodial swap platforms.

How it's Made

This project enables trustless atomic swaps between Ethereum (Sepolia ETH) and Starknet (STRK) using Hash Time-Locked Contracts (HTLCs). It allows two users to securely trade tokens across these chains without relying on intermediaries or custodians.

Core Concept At the heart of the system are smart contracts deployed on both Ethereum and Starknet. These contracts lock up tokens based on a secret (a hashlock) and enforce a timeout condition (timelock). A relayer service coordinates activity across both chains and ensures atomicity — meaning either both sides of the trade complete or neither do.

Flow of the Swap User A (Maker) initiates a swap, for example offering 0.01 Sepolia ETH for 100 STRK. They lock their ETH in an Ethereum HTLC contract. A secret is generated and the hash of this secret is used to secure the contract.

User B (Taker) sees the order and agrees to the trade. They deposit 100 STRK into a Starknet HTLC using the same hashlock.

Once both deposits are confirmed, User A reveals the secret on Starknet to claim the STRK. This secret is now publicly visible.

User B reads the revealed secret and uses it to unlock the ETH on Ethereum.

The swap is atomic because revealing the secret on one chain enables the other party to claim on the other chain. If either party fails to deposit or reveal the secret within the timelock, funds are automatically refunded.

Technical Components Ethereum Smart Contract (Solidity): Handles ETH deposits, hashlock validation, and refunds.

Starknet Smart Contract (Cairo): Manages STRK side of the swap using the same logic.

Relayer Service: Watches for events on both chains, generates secrets, tracks hashlocks, and coordinates swap states.

Key Features Trustless cross-chain swaps without intermediaries

Automatic refund if a trade isn’t completed

Secured by standard HTLC mechanics

Relayer ensures synchronization across chains

Designed for testnets initially (Sepolia ETH and Starknet Testnet)

Future Possibilities Support for more token pairs (e.g., wBTC, DAI, USDC)

Production-ready version on Ethereum and Starknet mainnets

Web frontend with orderbook UI and wallet integrations

Optional privacy features using zero-knowledge proofs

Integration with messaging protocols (e.g., Starknet<>Ethereum bridges)

This project sets the foundation for secure, decentralized cross-chain trading between L1 and L2 ecosystems, without needing bridges or custodial swap platforms.

background image mobile

Join the mailing list

Get the latest news and updates