OpenViSTAI · Agents · Blockchain · Crypto
Menu
Smart Contracts

Hashed Timelock Contracts for Ethereum

Hashed Timelock Contracts for Ethereum is an open-source Solidity project that provides Ethereum contracts for hash-locked, time-limited transfers of native ETH, ERC-20 tokens and ERC-721 tokens. A recipient claims a transfer by revealing the matching secret preimage; after expiry, the creator can request a refund if the transfer remains unclaimed.

Independent OpenViST project profile, based on linked sources.

Hashed Timelock Contracts for Ethereum — OpenViST project profile in Smart Contracts.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when an Ethereum application needs hash-locked transfers with an expiry-based refund path, especially as the Ethereum-side contract component of an atomic-swap design.

Who it is for

  • Ethereum developers building atomic-swap applications.
  • Developers seeking reusable HTLC contracts for ETH, ERC-20 or ERC-721 transfer flows.

Documented uses

  • Create a time-limited, hash-locked asset transfer.
  • Let a recipient claim funds or tokens by revealing a matching secret preimage.
  • Allow the contract creator to request a refund after the timelock expires.
  • Explore paired contract flows for cross-chain swaps and token-for-token exchanges.
Before you choose

Requirements & limits

The repository is public and specifies a GPL-3.0 license.

  • The contracts provide transfer primitives rather than a complete end-user swap application.
  • The claim path requires the matching secret preimage; the refund path is available to the creator after the timelock expires if no withdrawal occurred.
  • ERC-20 setup requires token approval, as reflected in the documented tests.
  • The README describes separate contracts and interfaces for ETH, ERC-20 and ERC-721 assets.
  • The documented local test workflow uses Ganache with network ID 4447 and Truffle.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Run the repository’s Truffle tests

Set up the documented local test environment and run the project’s Truffle tests.

Before you start

  • Node.js/npm dependencies for the repository
  • Ganache configured with network ID 4447
  • Truffle test setup in the repository

Steps

  1. Install dependencies with npm install.

  2. Start Ganache using the repository’s npm run ganache-start script.

  3. Run the test suite with npm run test.

Expected outcome

The documented workflow runs tests for HTLC creation, claims, refunds and token-swap scenarios.

Guide limitations

  • This is a local testing workflow, not deployment guidance.
  • The README’s test output is repository documentation, not a current execution result.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
chatch/hashed-timelock-contract-ethereum · Official homepage title · retained in its source language