About
TwinLock: Cross-Chain Atomic Swap Protocol TwinLock is a smart contract-based atomic swap system that enables secure, trustless exchange of tokens between two incompatible blockchain networks: Ethereum (Sepolia) and Tron (Nile). The protocol is built using Hashed Timelock Contracts (HTLCs), which enforce cryptographic guarantees to ensure both users receive what they expect—or both walk away with their original assets.
Why This Project? Most cross-chain token transfers today rely on centralized bridges, oracles, or liquidity networks, which introduce risks such as hacks, slashing, and counterparty trust. TwinLock removes all intermediaries and replaces them with a purely cryptographic protocol.
It demonstrates a fully trustless way for two people to swap tokens across incompatible chains by agreeing on:
A shared secret hash (hashlock)
A timeout period (timelock)
The amount to swap on each side
This is especially relevant as the multi-chain ecosystem grows, and there's a need for safer alternatives to risky bridges.
What Does TwinLock Include? Two fully deployed HTLC smart contracts:
One on Ethereum Sepolia (Solidity)
One on Tron Nile (Tron Solidity / TVM)
Swap logic for:
lock (initiate swap)
claim (redeem with secret)
autoRefund (reclaim funds after timeout)
CLI scripts using Node.js to:
Deploy contracts
Lock tokens on both chains
Claim tokens using the shared secret
Refund if no claim is made in time
Clear logging and events for each action
How a Swap Happens:
Initiator (e.g., Alice) generates a random secret and locks tokens on Ethereum using the hash of that secret.
Counterparty (e.g., Bob) uses the same hash to lock tokens on Tron.
Alice claims Bob's tokens on Tron, revealing the secret.
Bob uses that revealed secret to claim Alice’s tokens on Ethereum.
This atomic flow ensures that either both sides complete or nothing happens at all.
Key Features:
Bi-directional atomic swap between Ethereum and Tron
No bridge, no oracle, no validator — only smart contracts and hashlocks
Automatic refunds after timelock expiry
All swap data visible on-chain (transparent)
Testnet-safe — deployable and runnable on Sepolia and Nile
Educational and extensible — ideal for devs learning about HTLCs
Use Cases:
Developers learning cross-chain swap mechanics
Research prototypes for decentralized exchange infrastructure
Safe peer-to-peer trading of assets on different chains
Foundation for future cross-chain dApps or multi-chain protocols
Status:
TwinLock is a working proof-of-concept. All smart contracts are deployed, and CLI tools are functional. The design is simple and lightweight, with emphasis on security and extensibility for future upgrades.
This is not meant for production usage or mainnet deployment. It is an educational and research-focused implementation for testnets only
From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.






