Protocol Wars & Forks4 min readDecred (DCR)

Atomic Swaps: The Secret You Reveal to Get Paid

A 2017 Decred–Litecoin swap addressed a simple dilemma: who sends first? Two contracts, one secret and unequal refund windows linked the trades without placing both balances in an exchange’s custody.

Atomic Swaps: The Secret You Reveal to Get Paid

3-Minute Fast Briefing

  • The ParadoxDecred’s September 20, 2017 announcement records a Decred–Litecoin atomic swap on the previous day.
  • The Turning PointRedeeming one contract reveals a secret that lets the counterparty redeem the other, while different timeouts leave room to act.
  • The LegacyThe mechanism still needs compatible chains, monitoring, transaction fees and a way to find a trading partner.

Chronological Timeline

September 19, 2017Decred and Litecoin exchange directly

The following day’s Decred post records the cross-chain swap.

March 1, 2018The tools tighten the secret-size rule

The repository documents a contract update addressing different maximum data sizes across chains.

June 5, 2018A swap still needs a market

Decred’s DEX proposal separates atomic settlement from order books, matching and measures against fraudulent orders.

Who dares to send first?

Two people can agree on a price and still have a problem. If one sends cryptocurrency first, what makes the other complete the trade? Decred’s September 20, 2017 post reported that a Decred–Litecoin atomic swap had taken place the day before. The published tools explored a way to join the two payments without handing the funds to a third-party custodian. This was an on-chain exchange, not a Lightning payment channel.[1]

The chains did not become one ledger. Each needed script conditions for signatures, compatible hash checks and time locks. Those conditions gave each deposit two possible paths: a counterparty could claim it by meeting the redemption requirements, or the depositor could recover an unspent deposit after its deadline. The scripts’ shared hash function mattered; the chains did not need identical mining algorithms.[3]

Getting paid makes the secret public

The repository’s example uses Bitcoin and Decred to explain the sequence. The initiator creates a secret, locks bitcoin in a contract, and shares the secret’s hash rather than the secret itself. The participant then locks decred under the same hash on the other chain. Recipient signatures are also required: knowing the secret alone does not authorize an unrelated observer to take the coins.[2]

The initiator claims the decred by publishing the secret in the redemption transaction. The participant can extract that value and claim the bitcoin. The documented tools use a longer refund delay for the first contract, typically 48 hours, and a shorter one for the second, typically 24 hours. That gap leaves the participant time to use the revealed secret. These are the tools’ example settings, not a universal duration for atomic swaps.[2]

Atomic does not mean instantaneous

There are separate transactions, blocks and waiting periods. A participant must check the contracts and watch for redemption while time remains. If the exchange stops before redemption, the appropriate timeout can open the refund path for funds still unspent. That is a conditional route to recover a deposit, not an automatic reversal of every transaction. The README also records a March 1, 2018 change that constrained secret sizes to prevent fraudulent swaps between chains with different data-size limits. Even a neat protocol idea needed careful implementation.[2]

The 2017 announcement was explicit about other limits. Its text-based tools required information to be relayed between users and did not supply an order book. Transactions incurred chain fees and waited for blocks. Reusing the same hash also made the two sides linkable to a blockchain observer. Removing the exchange as custodian did not make the trade instant, free or invisible.[1][3]

The exchange has more than one job

Decred returned to the missing pieces in its June 2018 DEX proposal. Users still needed somewhere to communicate prices, submit orders and find matches, along with measures against orders that could not be honored. Atomic swaps addressed how a matched pair could settle; arranging that match was another part of the system. The proposal was a design for building those services, not evidence that the 2017 command-line tools had already delivered them.[4]

The lasting achievement of the early swap is easier to see at this smaller scale. One party’s act of receiving could expose the information the other needed to receive in turn. The unequal deadlines gave that second action room to happen. The two coins stayed on their own chains, while the conditions attached to spending them linked the exchange. Trust in a custodian had been replaced by a procedure whose checks and timing still mattered.[2][3]

Connected Lore & Universe

Connected Stories in this Universe

Explore the chain reaction of historical breakthroughs, blunders, and legends.

Sources & References

  1. [1]Source 1: September 2017 announcement: on-chain swaps and their limitationsDecred / Jake Yocom-Piatt · 2017-09-20Accessed 2026-09-21
  2. [2]Source 2: Atomic-swap README: sequence, timeouts, audits and 2018 updateDecredAccessed 2026-09-21
  3. [3]Source 3: Decred documentation: script prerequisites and trade-offsDecredAccessed 2026-09-21
  4. [4]Source 4: June 2018 DEX design: the market services still neededDecred / Jake Yocom-Piatt · 2018-06-05Accessed 2026-09-21