Standards, Composability, Interoperability - the key points of DeFi
DeFi, or Decentralized Finance, comprises the financial applications built on the public blockchains. If you wonder yourself why the term comes up more and more lately, this article might be useful to you. We will explain the most interesting and promising advantages that DeFI has and where Elrond Network stands out in this relatively new environment.
Before diving into DeFI, we should remind you of the problems we meet daily in the present. Nowadays most people are limited in terms of financial services access and that is why they don’t go further than paying taxes, spending and saving, without the possibility of generating extra income. Globally this issue is even harsher as there are still countries in which citizens can’t open a bank account which leads to employment impossibility, not being able to have a stable income to reward their work and without the access to a store of value option.
The majority of the available financial services, including the banking services, come with various problems, the most important being custody and the limited access to our own funds. We must trust diverse companies in managing our funds in a responsible manner, but without having access to their traceability history. If you decide to access your own funds or loans, there are many chances to go through long hours of discussions and several waiting weeks until your papers get approved. All these, taking into consideration the working hours of the working people of that company/institution.
The biggest problem is not the banks and the companies/institutions we have to get in contact with as they must be fully legal and respect regulations, but the whole financial system that has been here for many years and which is built to be against change and offers access to financial tools to the ones that need them the least. Considering the impossibility of adaptation and the fact that these can’t keep up with the technological developments, the need for a change gets bigger and bigger, and DeFi and its fundamental changes start to become an obvious choice and opportunity for the most.
Suddenly, through the public blockchains’ permissionless nature, anybody with internet access has the possibility to hold and transfer any kind of value respecting just the rules of the network consensus that are open source and can be verified by anybody. The power that until this moment was in the hands of few persons became dispersed among all the network’s users and in the new environment there is no central authority, no subjectively forced restrictions, no need to trust intermediaries and everything works transparently.
The power of the permissionless can be observed in the innovation wave and the creativity that abound in the blockchain environment nowadays. Permissionless systems allow anybody to build and integrate the technology, no matter how crazy or useful might look in at first glance the proposed ideas. Most might fail, but there will be enough successful ones. Maybe the one that will change the world in the following years will be born right in the bedroom of a teenager that is into technology and its applications in the multitude of domains available out there.
The hinge point for blockchain applications came up once Smart Contracts (SCs) were integrated, these being programs using blockchain to store their code data and they get executed once the code conditions are met. In contrast to the conventional contracts, Smart Contracts are executed automatically without the need of an intermediary or a central authority and especially papers. These differences bring an improvement in terms of execution speed, costs but also transparency - anybody can check and track 24/24 the code and the requests of a Smart Contract.
Having this technology available, the next step towards adoption is to offer developers the possibility to go from idea to execution immediately. This can be done by allowing developers to use popular coding languages when writing SCs.
The Virtual Machine Elrond uses, Arwen VM, allows developers to write SCs using well known programming languages as Rust, C/C++, C#, Typescript and compile the code in WASM. Basically switching to developing on Elrond blockchain is very smooth as it has the same programming paradigm (functional programming).
Furthermore, as most of the people that got in contact with blockchain already know, in order to call a Smart Contract one has to pay a fee towards the network but in order to incentivize developers Elrond protocol gives 30% of the fees paid on the calls of a SC to the author. This is a WIN-WIN situation both for developers and users. The developer does not require accessing a developer fund, waiting for approbation and going through the whole tough and expensive process, and the user will pay lower fee on his end, as the developer won’t need to add extra fees.
Now that we have seen how easy it can be to switch as a developer to developing applications on blockchain, let’s switch to what normal user experience looks like. In order to accelerate adoption the users should not even know they are using blockchain. The problem in this case is that as we previously mentioned, every blockchain action requires a fee to be paid towards the network. How could users interact with blockchain if at start they are forced to own an amount of coins (even if that means a small amount) to use the network? Should they buy or get from somebody the required amount? It would not be nor user-friendly nor easy to manage.
Through Meta Transactions Elrond allowed a relayer to pay these fees for the users improving in this way the the experience of the users and the use-cases addressing a large number of users have finally found their place on blockchain.
An example that most of us have been wishing for is the possibility to vote on blockchain in such a manner that our unique identities are associated anonymously, immutably and transparently in order to meet our interest in the best way. The user taps a few buttons, without knowing he is interacting with the blockchain and the request is turned into a transaction with the fee being paid by the state.
After establishing what DeFi is and making you curious, let’s see the greatest improvements they could bring in the actual systems and why in spite of so many advantages, adoption is slow. We should see what pieces of the puzzle miss in the present and what features a platform should have to host a DeFi ecosystem for millions of users or even billions. Beside the well known discussion about scalability, security and decentralization, there are other 3 critical components less discussed: Standards, Composability and Interoperability.
A very important aspect that lays against the interaction and composability between applications is using the standards since the early design phase, the most well known being tokens standard specific to any blockchain.
During the early days of token creations and interactions on Ethereum there was chaos. Every token contract was written differently, there was no composability and the interaction between the SCs was impossible. The need for a standard to define the requirements and clear functions were obvious so ERC-20 for fungible tokens and ERC-721 for non-fungible tokens were created. A token created on Ethereum isn’t actually a token truly speaking, but a Smart Contract that has some functions and keeps the holders’ balance evidence. For example Address A = 11, Address B = 21 and so on.
The problem of the tokens issued and managed by a Smart Contract is that every time people want to transfer a token they have to call the Smart Contract, which means those token transactions will be processed slower than the native token ETH and require a higher fee.
There was a need for independent from SCs tokens and Elrond came up with the solution by creating ESDT standard that allows tokens to be built in protocol and that can be transferred at same speed and with the same fees as the native coin EGLD.
Beside the processing and the fees of the transactions, having the tokens stored directly at account level, the ownership of a token, whether we speak about fungible tokens (FTs) or non-fungible tokens (NFTs), ESDT is more suitable for real use-cases from the legal point of view. Instead of having a SC to say I am the owner of an asset, I actually have the ownership rights for that asset.
As every new participant adds value to the whole network every new application built on a composability system represents a new tool in the developers’ libraries. Composability allows the developers to use the existing products or their components avoiding building from scratch. In other words, composability means innovation.
DeFi applications are often called Lego pieces due to their composability. Having the possibility to combine multiple products in a permissionless manner is maybe one of the biggest innovations since the internet invention. This turned waiting weeks or months to access a loan into accessing the loan, using the funds and taking advantage of opportunities and paying the debt, all in a few seconds going through multiple applications. In an environment where just creativity and execution matters is possible due to DeFi applications composability.
Because we got into lending and various opportunities we can easily access, we must also consider the cases less desired when one of the transactions we want to do fails due to various reasons with the possibility of being exposed with assets we don’t necessarily want to hold. That is why, to extend their possibilities and the use-cases, DeFi applications must be able to connect instantly in one transaction whose result we must know beforehand and which can be reverted if it is not the desired one. This instantaneous interaction between applications is called Atomic Composability.
Atomic Composability is the combination of atomicity and composability. It is the characteristic that makes possible the combination of any number of applications, in any form with all the parts being combined atomically in one transaction in which either all succeed or all fail.
Such an example is “flash loans” implementation done by Elrond, which fully disruptive and extremely secure due to Elrond blockchain’s design (the owner of an ESDT token is directly the wallet, not a Smart Contract, all being done inside the same shard, and the transaction is actually divided into micro transactions that are part of the same transaction).
Flash Loans are either granted and reimbursed with interest or not granted. These are called “flash” because the entire granting and reimbursement process execution takes the required amount of time to produce a block. The most well known use-cases of flash loans are the arbitrage, bonds exchange, liquidation and portfolio rebalancing.
Imagine now how it will be to do arbitrage with the “flash loans” implemented by Elrond in Maiar Exchange. You can not simply lose money, either the arbitrage will work and the call will end up just with the desired arbitrage or it will simply not get executed ( a flash loan call can revert all the sub-transactions in order to preserve the initial state due to the atomicity).
There are many discussions on atomic composability for the communication between the shards. By atomic the most softwares engineers understand “synchronous communication”, but for obvious reasons, synchronous communication between different shards is not possible, that would mean locking the shards until an API call is finished (no matter how small this is).
For better communication efficiency between the shards, Elrond uses asynchronous calls using Async calls with locked state. It is up to the developer if he wants to lock state for the whole contract or just a data set. This is the most efficient method to avoid blocking a shard (or more) and instead protecting certain data you need to be split between the shards. It is the same design and logic used in any parallel and distributed application.
Blockchain networks’ Interoperability allows value and information transfer between different networks. No matter if we speak about Digital Identity, Supply Chains, Healthcare or simply value transfers, interoperability plays a key role in what we call “decentralized Internet Web 3.0”.
At this point in the crypto market, being a relatively new one currently under development, we see how every project, in order to win more from the market shares, participates in a constant battle of numbers with the others as in the case of classic networks. A good example to help you understand this phenomenon better would be the competition between social networks, these being closed networks both for developers and in many cases for users. If Twitter would introduce a new useful functionality a Facebook user would not be able to benefit from it because there is no communication between these platforms. You can’t import the followers you have on Facebook into Twitter or the other way around, and your posts on one platform are not available on the other. Every platform is a closed circuit in which the efforts don’t aim to create a borderless ecosystem. All these platforms fight to get new users, and once they are in, they would do anything to keep them on their platforms by integrating all the features other platforms have. This whole development and adoption process is slow and a creativity and productivity killer. Unfortunately we are observing more and more this issue among blockchain networks, where every network is actually an island that does not communicate with the other networks.
Over time, in the crypto industry, “the being the best” mentality was built in such a manner that we can see most of the projects starting from the idea that if they bring an improvement, no matter how small, the whole industry will switch to their network. Considering the multitude of use-cases, problems and the required improvements of the actual technology, there neither is any solution capable of solving all of them nor will ever be. A multitude of networks with different characteristics as transaction types, hashing algorithms or consensus models, will find their place in this industry on a certain segment, and the potential of the blockchain technology will be fully reached when these segments will be able to communicate without borders, no matter what network they run on.
An interoperability solving method is bridges building between different networks in order to allow assets and data transfer between them. Currently there are various solutions, some centralized and some having various decentralization levels. In spite of the fact that by the bridge term we might get transfer, in most cases the bridges use a locking mechanism completed by a mint & burn mechanism. For example, if I would like to send BUSD from Binance Smart Chain(BEP-20) to Elrond network through a bridge, I have to lock the amount of BUSD in a Smart Contract on BSC, and another Smart Contract on Elrond Network would mint the same amount of BUSD I previously locked and send it to the erd1 address I filled in.
If after some time I want to get back on BSC I just have to take the process the other way around by sending the BUSD in ESDT format to the Elrond SC, where the BUSD amount is burned, and the locked amount on BSC will be sent back to the address I used to call the Smart Contract from.
So, moving forward from the case in which a user has access to the opportunities and functionalities available just on one network to the possibility of accessing all the applications in the crypto environment is what will unlock the DeFi progress, solving at the same time one of the biggest challenges of our time: liquidity.