Skip to main content
Experimental TechnologyNon-interactive swaps on Arkade are experimental technology in active development. All code and examples presented here are for exploration and proof of concept purposes only. Do not use in production environments.
Non-interactive swaps allow users to exchange assets without requiring both parties to be online simultaneously. This pattern leverages Arkade Script’s advanced capabilities to create secure, trustless swap mechanisms. Routes with both sides settling through Arkade fund swaps against this contract, which acts as their settlement primitive. Cross-corridor routes establish terms through RFQ and settle with a profile-specific HTLC.

Overview

Unlike traditional atomic swaps that require coordination between parties, non-interactive swaps allow:
  • One party to fund a swap offer that anyone can fill
  • A solver to complete the swap without the user who funded it being online
  • Automatic verification of swap conditions without trusted third parties
In the contract code below, maker and taker are script parameters — the funding side and the filling side. See Asset Swaps for the participant terminology used by Arkade Intents.

Contract Architecture

The non-interactive swap contract uses a combination of:
  1. Hash Preimage Verification - To ensure the correct asset is being swapped
  2. Transaction Introspection - To verify output amounts and destinations
  3. Timelock Mechanisms - Expiry-based reclaim

Example Implementation

This example illustrates an expiry-based contract variant. The current reference Intents swap has no automatic expiry; it stays open until a solver fills it or the user cancels it.

Advanced Features

Partial Fills

Non-interactive swaps can be extended to support partial fills, allowing multiple takers to each fulfill a portion of the swap:

Price Oracles

For swaps that need to execute at market price rather than a fixed rate, oracle integration can be added:

Using it

The contract described here settles the arkade:<asset> → arkade:<asset> route. Exchange Assets documents the working integration against it — discovering a market, funding the derived contract, tracking the fill, and cancelling an unfilled swap.

Security Considerations

When implementing non-interactive swaps, consider these security aspects:
  1. Frontrunning Protection - Consider mechanisms to prevent frontrunning of attractive swap offers
  2. Fee Management - Ensure the contract accounts for transaction fees to avoid dust outputs
  3. Replay Protection - Implement nonces or other mechanisms to prevent replay attacks
  4. Timelock Selection - Choose appropriate timelocks that balance security with capital efficiency

Future Directions

The Arkade ecosystem is exploring several enhancements to non-interactive swaps:
  • Multi-asset Swaps - Supporting swaps involving more than two assets
  • Conditional Swaps - Swaps that execute only when certain external conditions are met
  • Privacy Enhancements - Techniques to improve the privacy of swap participants