By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
FrizzTechFrizzTech
  • Business
    • Automotive
    • Crypto
    • Education
    • Finance
    • Healthcare
    • Industries
    • Investment
    • Legal
    • Market
    • Money
    • Moving
    • Real Estate
    • Retail
    • Startup
  • Lifestyle
    • Beauty
    • Culture
    • Drink & Food
    • Fashion
    • Hair
    • Health
    • Jewelry
    • LGBTQ
    • Parenting
    • Women
    • Sex & Relationship
    • Society
  • Entertainment
    • Awareness
    • Celebrity
    • Funny
    • Gaming
    • Movies
    • Music
    • Sports
    • Shopping
    • Science
    • Television
    • Travel
  • Tech
    • Digital Marketing
    • Gadgets
    • Mobile
    • Smart Home
    • Reviews
    • Windows
  • How To
    • Android
    • Apps
    • Email & Messaging
    • Game
    • IOS
    • Mac
    • Office
    • Software and Tools
  • Decor
    • Construction
    • Design Ideas
    • Events
    • Furniture
    • Gardening
    • Home Repair
    • House Keeping
    • HVAC
    • Kitchen
    • Painting
    • Paste Control
    • Plumbing
© COPYRIGHT 2022 | ALL RIGHTS RESERVED
Reading: How to implement Atomic Swaps?
Share
Notification Show More
Latest News
Why Snapt is Suitable For Small Business Corporations
Five Reasons Why Snapt is Suitable For Small Business Corporations
September 13, 2023
Tips To Keep Your Devices Safe
Tips To Keep Your Devices Safe in 2023
September 13, 2023
cyber Security Company
Cybersecurity Trends And Predictions For 2023
September 13, 2023
cybersecurity consulting
5 Cybersecurity Trends Every Small Business Should Know
September 13, 2023
Cyber security Challenges
How Evolving Businesses Must Handle Cybersecurity Challenges?
September 13, 2023
Aa
FrizzTechFrizzTech
Aa
  • Business
  • Culture
  • Entertainment
  • Society
  • Tech
  • How To
  • Business
    • Automotive
    • Crypto
    • Education
    • Finance
    • Healthcare
    • Industries
    • Investment
    • Legal
    • Lifestyle
    • Market
    • Money
    • Real Estate
    • Retail
    • Startup
    • Science
  • Culture
    • Celebrity
    • Sex & Relationship
    • Digital Marketing
    • Funny
    • Parenting
    • Drink & Food
  • Entertainment
    • Movies
    • Television
    • Gaming
    • Travel
  • Society
    • Awareness
    • LGBTQ
    • Women
    • Activism
  • Tech
    • Mobile
    • Gadgets
    • Smart Home
    • Reviews
  • How To
    • IOS
    • Mac
    • Android
    • Apps
    • Game
    • Office
    • Windows
    • Email & Messaging
Have an existing account? Sign In
Follow US
© COPYRIGHT 2022 | ALL RIGHTS RESERVED
FrizzTech > Blog > Business > Crypto > How to implement Atomic Swaps?
Crypto

How to implement Atomic Swaps?

Lal Pratap Singh
Last updated: 2022/06/14 at 3:47 PM
Lal Pratap Singh
Share
How to implement Atomic Swaps
SHARE

Atomic swap (ACCS) lets two parties trade bitcoins without middlemen.

Contents
ACCS paymentsBlockchain-based ACCS

In development: Supported blockchains are limited. Classic smart contracts aren’t needed for the exchange.

It overcomes the issue of performing connected transactions in unrelated blockchains, where both parties must fulfill their contract acts or the transaction would fail. Implementation possibilities:

Some blockchains support on-chain.  Lightning Network and Raiden are developing off-chain payment channels. Even test networks lack ready-made implementations.

The content was written by the blockchain development business AXIOMA GROUP, thus it’s appropriate for readers with a basic understanding.

Hashed Time-Locked Contract is the underlying tool (HTLC). This is a method for cryptographically confirming the legality of time-separated participant activities. This tool combines two ways to stop a transaction’s exit: time (time lock) and a secret number whose hash is published on the blockchain (hash lock). Such a system provides transaction reversibility if one party “disappears,” or doesn’t complete the needed activity. HTLC is utilized in the Lightning network. HTLC support and the same hash function are required for an atomic exchange between two blockchains.

Blockchain shouldn’t enable transaction flexibility to prevent fraud. The transaction ID can’t change randomly since it might confuse the exchange partner. Segwit on the blockchain addresses this possible weakness and is a need for ACCS.

ACCS payments

ACCS and payment channels have similar principles, yet they’re different. A couple may make several transactions by creating a payment channel. To trade across blockchains, create a payment channel in each. Participants then terminate the payment channel, fixing the trade on the blockchain.

Exchanging via the payment channel is quicker than waiting for the partner to act.

First-ever Lightning network Bitcoin-Litecoin trade.

Blockchain-based ACCS

Alice and Bob swap items. Bob gives Alice 1 BTC and 10 LTC. Parties agreed to pay blockchain commissions themselves.

Alice and Bob trade new addresses. Bob gives Alice the LTC blockchain address AA and the BTC address AB.

Alice produces a secret key K and its hash KX. Alice makes a 1 BTC TA contract. TA is added at Wta.

Alice provides Bob the TA information, and he learns the KX hash and validates the contract.

If everything is in order, Bob creates a 10 LTC TB contract. VTB adds TB to the blockchain. Bob explains TB to Alice.

Alice reviews the TB contract. She must enter her LTC address, which she supplied to Bob in the first stage. The contract must cost 10 LTC, matching the original agreement. “Secret hash” must match the hash of Alice’s secret key KX from step 2. The contract must also be valid; the specified Locktime must enable the transaction.

Alice sends 10 LTC from transaction TB to another wallet address. Alice reveals the K to Bob. Bob may now access transaction TA.

Bob transfers 1 BTC from TA to another wallet address. It’s over now.

Bob may use TA monies if he learns key K within (Wta, Wta + 48 hours). Alice may use unused cash after BTA+48 hours.

Alice may spend TB money with key K within (Wtb, Ttb + 24 hours). Bob may return unused payments after Wtb+24 hours.

Alice had 10 LTC less the LTC transaction cost and spent 1 BTC plus its fee. Bob spent 10 LTC and 1 BTC after transaction fees.

Due to contract delays, each party has time to obtain its due. Alice can obtain her BTC after 48 hours if Bob doesn’t make a TB contract. Bob will get LTC in 24 hours if Alice doesn’t get TB money. Alice will reclaim Bob’s BTC after 48 hours.

This two-contract transaction is atomic. Each gets his due, or both keep their own, less commission.

Also Read: What Are The Benefits You Can Reap Using Mobile Bitcoin Wallets

You Might Also Like

3 Earning Big-Time Profits on the Bitcoin Trading

How to buy and sell Bitcoin

What Are The Benefits Of Buying Crypto On A Specific Platform Or Exchange?

5 Best Crypto Wallets For Beginner’s Users

Cardano Powered By The ADA Coin: Everything You Need To Know

TAGGED: Atomic Swaps

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.

   

By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Lal Pratap Singh June 14, 2022
Share this Article
Facebook Twitter Pinterest Reddit Copy Link Print
Share
Posted by Lal Pratap Singh
I am an accomplished coder and programmer, Quality Engineer and I enjoy using my skills to contribute to the exciting technological advances that happen every day at Multi-National Tech. Organization. I am pouring my experience into writing Technical blogging. I graduated from the Vellore Institute of Technology in 2012 with a Bachelor's Degree.
Previous Article Cybersecurity Mesh Platform What is A Cybersecurity Mesh Platform?
Next Article How to Develop a Food Delivery App How to Develop a Food Delivery App That Customers Will Love

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Why Snapt is Suitable For Small Business Corporations
Five Reasons Why Snapt is Suitable For Small Business Corporations
Business
Tips To Keep Your Devices Safe
Tips To Keep Your Devices Safe in 2023
Android Apps Tech
cyber Security Company
Cybersecurity Trends And Predictions For 2023
Tech
cybersecurity consulting
5 Cybersecurity Trends Every Small Business Should Know
Business
//
The stories that we cover specialize in a wide niche which includes News, Lifestyle, Fashion, Entertainment, Technology, and Women. The purpose of the blogs and articles is to keep you updated and significant information stays in your mind.

Quick Link

  • How To
  • Tech
  • Business
  • Entertainment
  • Culture

Quick Links

  • Home
  • About Us
  • Advertise
  • Contact
  • Privacy Policy
Subscribe to Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

   

FrizzTechFrizzTech
Follow US

© COPYRIGHT 2023 | ALL RIGHTS RESERVED

Removed from reading list

Undo
Welcome Back!

Sign in to Editor's Account

Lost your password?