← Back to home

UniteDeFi ICP

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

Problem Statement

Unite Escrow brings the entire1inch 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-callslet the relayer & resolvers read EVM events and even broadcast Bitcoin HTLC spends – no off-chain servers.Focus this weekend:Ethereum ↔ ICPMVP 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.

Solution

Rust + Candidfor all canisters.ic-cdkandicrc-ledger-typesfor ICRC-1/2 transfers.StableBTreeMapfor on-chain order & escrow registries (upgrade-safe).Chain-fusionHTTPS 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 viaautomatic_tickflag.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 escrowbeforeinstalling WASM, side-stepping allowance-routing.Resolver demo mode mocks the EVM escrow and logs a realistic withdraw line with tokenT1INCHand calculated amount.Sed-one-liner grabs the escaped secret blob fromverify_and_reveal_secretand pipes it straight intowithdraw– 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.

Hackathon

ETHGlobal Unite

2025

Prizes

  • 🏆

    Extend Fusion+ to ICP2nd place

    1inch

Contributors