HTLC AVM-EVM

Production ready HTLC solution for AVM, fit for purposes of 1inch

HTLC AVM-EVM

Created At

ETHGlobal Prague

Winner of

1inch - Extensions for 1inch Cross-chain Swap (Fusion+)

Prize Pool

Project Description

The AVM HTLC smart contract including setTaker configuration, memo and more features. NPM repository was created - https://www.npmjs.com/package/algorand-htlc .

Bridging is done using two HTLC smart contracts one on AVM side and one on EVM side.

HTLC contracts are deployed to Algorand Mainnet, Voi, Algorand Testnet, and Sepolia.

Bridging demo:

  • clone https://github.com/scholtz/eth-htlc repo
  • cd relayer-demo
  • in separate consoles run ./runPersonB.sh , runRelayer.sh, and after they start the executePersonA.sh

How it's Made

Algorand - Typescript smart contracts EVM - Solidity, with deployment though hardhat

The Algorand smart contract implements a secure, flexible escrow service using Hashed Time Lock Contracts (HTLC). It enables users to deposit native tokens or assets into an escrow that can be withdrawn by providing a secret password (preimage) matching a stored hash before a specified rescue deadline. If the deadline passes, the escrow creator can reclaim the funds.

Key features include:

Creation of escrow accounts secured by a keccak256 secret hash.

Optional specification of a taker (recipient) or allowing anyone with the secret to claim funds.

Management of native token deposits for minimum balance requirements (MBR).

Ability for a designated “destination setter” to assign or change the recipient address once before withdrawal.

Support for withdrawing funds upon correct secret verification and before the rescue time.

Automatic refund of escrowed funds to the creator after rescue time expires if unclaimed.

Admin functionality to withdraw any excess staking rewards or leftover tokens.

Opt-in mechanism for assets with associated deposit tracking.

On-chain key registration for participation in Algorand consensus rewards.

Overall, the contract balances secure conditional fund release with administrative oversight and resource accounting, suitable for atomic swaps, conditional payments, or token lockups on Algorand.

background image mobile

Join the mailing list

Get the latest news and updates