✓ Verified 💻 Development ✓ Enhanced Data

Htlc

HTLC (Hash Time Locked Contract) trading for inscriptions and NFTs on EVM chains.

Rating
4.4 (57 reviews)
Downloads
2,916 downloads
Version
1.0.0

Overview

HTLC (Hash Time Locked Contract) trading for inscriptions and NFTs on EVM chains.

Complete Documentation

View Source →

HTLC Trade

Atomic swap trading using Hash Time Locked Contracts.

Quick Start

bash
# Install dependencies
npm install ethers viem

# Set environment
export PRIVATE_KEY=0x...
export BASE_ETH_RPC=https://mainnet.base.org

Commands

Generate Preimage

bash
node scripts/htlc.js preimage

Lock Funds (Buyer)

bash
node scripts/htlc.js lock <seller> <preimageHash> <timeout> <amountETH>

Reveal (Seller)

bash
node scripts/htlc.js reveal <lockHash> <preimage>

Full Trade

bash
node scripts/htlc.js trade <seller> <inscriptionTx> <amountETH>

Contract

BaseTimelock: 0xa7f9f88e753147d69baf8f2fef89a551680dbac1

Flow

  • Seller generates preimage, shares hash + inscription
  • Buyer verifies inscription, calls lock() with ETH
  • Seller calls reveal() with preimage → ETH released
  • Buyer confirms receipt → trade complete

Installation

Terminal bash

openclaw install htlc
    
Copied!

💻Code Examples

export BASE_ETH_RPC=https://mainnet.base.org

export-baseethrpchttpsmainnetbaseorg.txt
## Commands

### Generate Preimage
example.sh
# Install dependencies
npm install ethers viem

# Set environment
export PRIVATE_KEY=0x...
export BASE_ETH_RPC=https://mainnet.base.org

Tags

#git_and-github #script

Quick Info

Category Development
Model Claude 3.5
Complexity One-Click
Author web4agent
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install htlc