Documentation Index
Fetch the complete documentation index at: https://mintlify.com/1inch/cross-chain-sdk/llms.txt
Use this file to discover all available pages before exploring further.
What are Atomic Swaps?
Atomic swaps are a cryptographic protocol that enables the exchange of tokens across different blockchains in an all-or-nothing manner. In the context of 1inch Fusion+, atomic swaps guarantee that either the complete cross-chain transfer happens successfully, or no transfer occurs at all—there’s no possibility of partial execution where tokens are lost or stuck.The “atomic” property means the swap is indivisible: both the source chain and destination chain transfers must complete, or neither will happen.
How 1inch Fusion+ Implements Atomic Swaps
1inch Fusion+ uses a sophisticated escrow-based mechanism to achieve atomic cross-chain swaps:Escrow Contracts
The system deploys escrow contracts on both the source and destination chains:- Source Escrow: Holds the user’s tokens on the originating blockchain
- Destination Escrow: Holds the resolver’s tokens on the target blockchain
The Role of Resolvers
Resolvers are specialized actors in the 1inch Fusion+ network that facilitate cross-chain swaps:- Order Matching: Resolvers monitor pending swap orders and choose which ones to execute
- Escrow Deployment: They deploy both source and destination escrow contracts
- Liquidity Provision: Resolvers provide the destination tokens upfront
- Execution: After the user reveals their secret, resolvers can claim the source tokens
Resolvers are incentivized through the auction mechanism—they compete to fulfill orders at the best rates while earning the rate differential as profit.
Execution Flow
Security Guarantees
Trustless Execution
Atomic swaps in 1inch Fusion+ require no trust between parties:- No Custody: Neither the resolver nor any third party takes custody of user funds
- Smart Contract Enforcement: All swap conditions are enforced by audited smart contracts
- Hash Lock Protection: Secrets ensure that only authorized parties can claim funds
No Intermediaries
The system operates without trusted intermediaries:- Users maintain control of their secrets
- Resolvers cannot access funds without the correct secret
- Smart contracts automatically enforce timeout and cancellation rules
- Refunds are guaranteed if the swap doesn’t complete within the time window
Atomic Property Enforcement
Success Case: Both transfers complete- User receives destination tokens
- Resolver receives source tokens
- If the resolver doesn’t deploy escrows in time, the order expires
- If the user doesn’t provide secrets, resolvers can cancel and reclaim their funds
- If timeouts occur, users can reclaim their source tokens
The time lock mechanism ensures that all parties have windows to act, with fallback cancellation options if any step fails.
Benefits of Atomic Swaps
- Security: Cryptographic guarantees prevent loss of funds
- Decentralization: No centralized bridge or custodian required
- Trust Minimization: Only trust smart contract code, not third parties
- Censorship Resistance: Cannot be blocked by intermediaries
- Guaranteed Settlement: Either completes fully or refunds automatically
Related Concepts
- Hash Locks: Learn how secrets secure atomic swaps
- Secrets: Understanding secret generation and management
- Presets: Configure swap speed and cost parameters