project screenshot 1
project screenshot 2
project screenshot 3

Chainmate

Trustless token swap bridge using HTLCs between Sepolia and Stellar via custom relayer.

Chainmate

Created At

Unite Defi

Project Description

This project implements a trustless cross-chain token bridge between Ethereum Sepolia and Stellar (Soroban) using Hashed Timelock Contracts (HTLCs). The goal is to offer users a simple onramp/offramp between chains without requiring centralized bridges, custodians, or governance.

Users initiate a swap by locking tokens in a smart contract on Sepolia or Stellar. A custom relayer monitors the blockchain events and ensures the matching escrow is created on the other chain. Once both escrows are verified, the relayer reveals the preimage secret to trigger the withdrawal on both sides.

The protocol ensures:

No middleman custody

Timeout refund logic

Replay and griefing protection

Minimal trust assumptions

This submission focuses on one clear swap direction: Sepolia → Stellar. The design is modular, enabling bi-directional flow or extension to more chains later.

How it's Made

EVM Side (Sepolia): A Solidity-based HTLC contract handles deposits, secret-based withdrawals, and time-based refunds. Test ERC-20 tokens simulate asset swaps.

Stellar Side (Soroban): A WASM smart contract written in Rust using the Soroban SDK mimics HTLC logic: locking tokens, validating the hash preimage, and enabling secure refund after timeout.

Relayer (Node.js): A custom script monitors events on both chains and reveals the shared secret once both escrows are funded. The relayer ensures the hashlock is respected and timelocks are enforced across chains with mismatched finality assumptions.

Tooling:

Solidity + Hardhat for Sepolia

Soroban CLI for deployment/testing on Stellar Futurenet

ethers.js and soroban-sdk for smart contract interaction

We used preimage-based hashlocks (sha256(secret)) and enforced timelocks using on-chain timestamps. While no Dutch auction or price discovery is implemented, the core atomicity and relayer-driven coordination mirror the 1inch Fusion+ principles. This simplified version satisfies the HTLC mechanics as required.

background image mobile

Join the mailing list

Get the latest news and updates