One of the concepts you can often hear about DeFi is Atomic Settlement. The essential element in the atomic contract is the simultaneous (instantaneous) exchange of two assets, if one of the assets does not fall into the hands of the other party, this contract will not be realized. This is made possible by a specifically created “hash timelock contract” smart contract.
​
It is always better understood with an example. Below is a scene from the Indiana Jones movie.
​
[Indiana Jones and the Raiders of the Ark \(1981\)](
In this scene, our hero wishes to acquire a valuable idol. This is the asset he wants. But here is the problem: the “special stone” on which the idol is placed reacts according to the weight of the object on it, if the stone is left empty, booby traps will be activated and our hero will die. Thinking of this, Jones plans to put a small bag that he carries with him on the special stone when he *immediately* takes the idol, and *only by doing this* he gets the idol.
Now let’s write down the analogy of atomic contracts with this scene.
* **There are two sides:** Indiana Jones and the special stone
* **The demands are clear:** Jones wants the idol; special stone wants an object that has the same weight as the particular stone idol.
* **There is a smart contract that is executed only when the desired conditions are met:** Here the special stone has to be weighted as much as it is taken from it, otherwise the deal will not happen – booby traps 🙁
* **The deal is instantaneous, it’s atomic:** Jones immediately changes the weight without noticing the particular stone.
* **There is no third party:** the deal is between Jones and the special stone.
Usefulness of Atomic Settlement:
* **Security:** Since the contract is peer to peer, no third party is needed. This prevents the deal from being hacked in any way.
* **Speed:** Removing the third party speeds up the process. And because it’s instant, it’s actually the fastest operation, hence the name atomic.
* **Cheap:** You pay no transaction fees.
​
PS: It is an original post. Since it is the first thing I write about these subjects, I welcome your criticisms and suggestions (such as good/bad example, too long, incomprehensible, beautiful style, etc.)
Algorand has this functionality built into there layer 1 protocol.
I share new Binance Smart Chaine brilliant – CryptoEnergy, looks good, site is made just amazing, experienced public devs, product inspires confidence. In addition, the company is selling a real product, which is rare in crypto! I joined – t.me/CETCryptoEnergy