UniteDeFi ICP

Unite Escrow – fully on-chain 1inch Fusion+ swaps between Ethereum/Bitcoin and ICP

UniteDeFi ICP

Created At

Unite Defi

Winner of

1inch

1inch - Extend Fusion+ to ICP 2nd place

Project Description

Unite Escrow brings the entire 1inch Fusion+ stack on-chain by rewriting it as Internet-Computer canisters.

Instead of off-chain relayers & scripts, every role now lives on ICP:

  • Orderbook canister – Dutch-auction engine that stores all intents.
  • Relayer canister – imports orders, ticks the price curve, elects a winner, and guards the secret.
  • Factory canister – deploys hash-time-lock escrows in ICP (CREATE2-like via canister WASM).
  • Universal Escrow canister – holds ICP/ICRC assets, auto-pulls via ICRC-2, supports lock/withdraw/cancel windows and safety-deposit logic identical to 1inch Solidity.
  • Resolver canisters (bots) – permission-less actors that race to accept the best price, deploy both escrows, verify them, reveal the secret, and withdraw on both chains.
  • Chain-Fusion HTTPS out-calls let the relayer & resolvers read EVM events and even broadcast Bitcoin HTLC spends – no off-chain servers.

Focus this weekend: Ethereum ↔ ICP MVP with a mocked EVM leg so judges watch the entire happy path live; Bitcoin code scaffolded.

Once merged, the infra lets anyone spin up a resolver with custom risk parameters (slippage, profit floor, asset allow/deny lists) and earn yield by arbitraging Dutch auctions.

How it's Made

  • Rust + Candid for all canisters.
  • ic-cdk and icrc-ledger-types for ICRC-1/2 transfers.
  • StableBTreeMap for on-chain order & escrow registries (upgrade-safe).
  • Chain-fusion HTTPS out-calls for EVM JSON-RPC; CREATE2 address verification coded in Rust (encode_src|dst_immutables).
  • Timers: relayer ticks every 5 s; resolver polling configurable via automatic_tick flag.
  • Secret flow: maker includes 32-byte secret with order → relayer holds it → after both escrows verify, secret revealed on-chain → withdraw functions unlocked.
  • Hacky but fun:
    • Factory transfers ICP to the brand-new escrow before installing WASM, side-stepping allowance-routing.
    • Resolver demo mode mocks the EVM escrow and logs a realistic withdraw line with token T1INCH and calculated amount.
    • Sed-one-liner grabs the escaped secret blob from verify_and_reveal_secret and pipes it straight into withdraw – no manual hex edits on video.

Technologies glued together:

| Piece | Tech | | --- | --- | | Canisters | Rust, ic-cdk | | Dutch curve | piece-wise linear interpolation in stable map | | ICP ledger | local ICRC-1/2 canister for tests | | EVM side | 1inch Fusion Solidity ABI re-encoded in Rust, verified via eth_call | | Front-end | Vite + React (UI not shown in demo to save time) |

With everything on ICP, wallets need only one call (submit_order); validators & withdrawals are self-custodied, censorship-resistant, and composable with the broader IC DeFi ecosystem.

background image mobile

Join the mailing list

Get the latest news and updates