Skip to content

TrainProtocol/contracts

Repository files navigation

Train: Permissionless, Trustless Cross-Chain Bridging Protocol

Read the protocol description and spec - Train Documentation

TL;DR

  • Introduces Train, an improved version of HTLC for practical atomic swaps
  • Permissionless and trustless protocol without reliance on 3rd parties
  • Supports multi-hop transactions for bridging between indirectly connected chains
  • Alpha version available for testing on multiple testnets

Networks and Repository Layout

This repository is organized so that audited, stable implementations live on the main branch, while networks that are still under active development or audit live on dedicated branches.

Audited networks (in main)

The following networks are considered stable enough to live directly in main:

-- EVM (Solidity)chains/evm/solidity
-- Solanachains/solana
-- Starknetchains/starknet
-- Fuelchains/fuel

In-progress / unaudited networks (per-branch)

The following networks are still under active development, testing, or audit.
Each one lives in its own long-lived branch:


Introduction

Train is a revolutionary bridging protocol designed to address the challenges of seamless asset movement across the rapidly expanding cryptocurrency ecosystem. As the number of blockchain networks grows, including L1s, L2s, side-chains, and app-chains, the need for efficient and secure cross-chain asset transfer becomes critical.

Key Features

  • Trustless: No reliance on oracle-based systems or 3rd parties
  • Permissionless: Open for any participant to join without compromising security
  • Multi-hop Transactions: Enables bridging between chains without direct Solver connections
  • Censorship Resistant: Decentralized design resistant to censorship attempts

Architecture

Diagram 1

How It Works

Train introduces an improved version of HTLC that addresses key limitations:

  1. User creates a PreHTLC, committing funds for the selected Solver
  2. Solver detects the transaction, generates a Secret, and creates an HTLC on the destination chain
  3. User observes the destination transaction and converts their PreHTLC to an HTLC on the source chain
  4. Solver reveals the Secret on both chains to complete the transfer

This approach resolves issues with secret management, claim transactions on the destination chain, and liveness requirements.

Disclaimer: Development in Progress

Please note that this project is actively under development. It is not ready for deployment on any mainnet environments, unless mentioned as audited. As we continue to experiment and test new ideas, expect significant changes to the interface. Please be prepared for ongoing modifications.

Acknowledgements

  • The initial HTLC implementation was based on the work done in the atomic-port project by Yuki Uichiro

About

Protocol contracts for PreHTLC Atomic Swaps and Discovery

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •