Hello World!

Jelly
Jelly-market
Published in
5 min readNov 12, 2019

Jelly Atomic Swap is ready to disrupt the trading

Let’s say you are trading cryptocurrencies at least from time to time or you are interested in starting doing so. You will most probably want to have in your portfolio the two best-performing assets — ETH and BTC, and you would want to trade them. But it would be better if you could avoid third parties, centralized entities, KYC & AML and all other inconveniences, which are controversial to the simple payment service that the blockchain technology aims to establish. All you want is to submit one single transaction in order to send some ETH and to simultaneously receive the respective amount of BTC.

Well, we have good news. A very handsome Jelly is here to make this possible.

Jelly on mobile

What is Jelly Swap?

Jelly is a super simple-to-use dApp that enables cross-chain Atomic Swaps without any intermediaries.

Cross-chain… Atomic Swaps… No intermediaries. Sounds a bit confusing? Let’s break this definition into smaller and easy-to-understand pieces of information which will highlight the benefits of Jelly service.

If you want to ease your trading experience and to exchange one coin for another directly from wallet to wallet, then you have a good reason to stay with us until the very end of this article.

Let’s start!

  1. Cross-chain

Pick up two chains — let’s say Ethereum and Bitcoin. Someone from one side wants to swap his ETH for BTC and someone from the other side wants to swap his BTC for ETH.

You are more than welcome to do it on centralized exchanges such as Binance. There you need to register, deposit, trade, withdraw, pay all the fees and finally add the desired BTC amount to your portfolio. Moreover, you need to trust this third party because it will take over the custody of your assets and your personal information. In fact, Binance is not going to conduct an atomic swap to exchange your ETH for BTC. What will happen is that you will buy some BTC from them by paying with ETH. It is similar to going to a traditional Change and buy one currency with another.

Then you probably think to search for a DEX that provides this service. Well, here is the thing. There is a huge interoperability problem between the different blockchains. You can swap different tokens of the same blockchain (name any ERC20 tokens working on Ethereum, for instance, BAT and REP) but you cannot swap different coins from different blockchains (Ethereum, Bitcoin, Tron, EOS). This is where cross-chain atomic swaps step in to solve the problem.

Cross-chain swap is a mechanism that triggers two transactions executed on two different blockchains (as per our example Ethereum and Bitcoin) in order to exchange different forms of value simultaneously (e.g. ETH and BTC). And the most beautiful part is that it all happens in a completely decentralized and trustless way thanks to the very nature of atomic swaps.

2. Atomic Swap

Atomic swaps enable two or more parties to swap cryptocurrencies peer-to-peer without trusting a third-party arbiter. Users can avoid paying unnecessary fees and can also eliminate counterparty, settlement, and custodial risks. But also, since the middleman is removed, users want to do it in a safe way, meaning that neither party can deceive the other party because they don’t trust and probably don’t know each other.

However, blockchain transactions are irreversible meaning that once it is confirmed on the blockchain, there is no way to go back. This leads us to the scenario where Alice sends her ETH to Bob, and then she expects Bob to send his BTC to her in order to finalize the exchange. But Bob has the option of going back on his end of the bargain once he receives the ETH and simply not following through with the protocol, ending up with both sets of coins. In this scenario, Alice is deceived and probably regrets not using a middleman.

But here is how Atomic Swaps solve this problem of trust — by simply eliminating it. When you participate in an atomic swap exchange, you don’t need to trust anyone but the correctly written smart contract. Atomic swaps ensure that no single party ever holds both cryptocurrencies at the same time, hence such frauds are impossible to happen.

To avoid fraud, atomic swaps simply lock the two transactions so that they can be unlocked only when certain requirements are met. The transactions are locked twice.

First in a manner similar to “two-factor authentication” where you need to provide a secret phrase to unlock it (“Hashlock function”). This makes the transaction extremely secure because it requires not only the signature but also the correct phrase.

And second, the transaction is time-locked, meaning that if one of the parties does not fulfill the requirements in a certain amount of time, the assets will be sent back to its original owner (“Timelock function”). In other words, a “timeout” expiration period is added to the payment. It requires the recipient to claim the funds prior to the expiry. If not, the assets will be automatically returned to the sender.

So the key advantage of the atomic swaps is that they improve the irreversible nature of the blockchain transactions by adding a way for the funds to be returned to the sender if one of the two parties steps back on his end of the bargain. The swap is atomic meaning that it will either happen or it won’t depending on whether the requirements are fulfilled.

In short:

All in all, the recipient needs to enter the correct phrase within the specific time to unlock and take the funds. At the end, the swap will be either successfully executed for both parties or the assets will be returned to their original senders. The correct name of the mechanism is Hashed Time Locked Contracts (HTLCs). If you want to learn more details about these contracts and their components — hashlock and timelock functions, secret phrase and transaction algorithm, we will publish another detailed article soon.

This is how the super handsome Jelly enables transactions between different blockchains by eliminating any third parties and minimizing the risk of losing funds. Pick up an asset — Jelly is ready to swap!

--

--

Jelly
Jelly-market

Peer-to-Peer trades across different blockchains