# dApp dev

Everyone is talking about DeFi. Few people are asking what DeFi should look like. Ergo has a vision for what the sector can become.

2020 is shaping up to be the year in which Decentralised Finance rose to mainstream attention, in the same way, that Bitcoin and blockchain did in 2016 and 2017. In July alone, Total Value Locked – the number of funds committed to DeFi app's smart contracts – doubled from $2 billion to$4 billion, largely driven by Compound's distribution of its COMP governance tokens.

DeFi is all the rage, with several well-known projects pioneering the space before our eyes. But while the crypto world is gripped with the short-term opportunities of DeFi, fewer are talking about what it actually is – and fewer still about what it should be. In building a DeFi platform like Ergo, though, that's exactly the kind of question we have to ask.

## DeFi dislikes limits#

In talking about what DeFi 'should' be, it's easy to fall into the trap of being prescriptive, of introducing arbitrary conditions and limits. But that's not what blockchain is about. As we've seen with Bitcoin and blockchain more generally, there's a free market of ideas, and nothing is off the table. It's reasonable (though not particularly helpful) to say that DeFi should be 'anything and everything.

Just like blockchain, DeFi brings advantages of transparency, immutability and efficiency (often including speed and/or cost) to financial processes. But in terms of what we believe this new set of technologies should offer, and what decentralised finance can bring to the conventional financial system, it's worth focusing the conversation on a few other key areas that have been overlooked or under-represented to date: Privacy, Scalability, Interoperability, and Decentralisation.

## 1. Privacy#

As Eric Hughes wrote in A Cypherpunk's Manifesto back in 1993, 'Privacy is necessary for an open society in the electronic age.' That is never more true than for financial privacy. Privacy must be a built-in feature of DeFi – not a bolt-on extra or a desirable feature. It must be integral.

But, as Hughes continues, 'Privacy is the power to selectively reveal oneself to the world.' There is always a balance to be struck between privacy and compliance, transparency and anonymity. Large scale adoption of DeFi requires audibility and the regulatory approval that enables it.

Thanks to the latest advances in zero-knowledge proofs, Ergo can offer both privacy and transparency, where required. The platform's Sigma Protocols offer robust, customisable cryptography – and, at the same time, the ability to selectively reveal information where necessary.

## 2. Scalability#

The ability to process thousands of transactions per second is also a non-negotiable feature for a thriving DeFi sector. How this is achieved is less important than that it is achieved; in practice, there will be many different approaches, with different users and protocols selecting the ones they prefer.

For example, while we have seen the rise of sidechains and child chains, the reality is that exchanges remain a gateway to the blockchain world for a large proportion of users. Popular exchanges are increasingly integrating DeFi functionality, allowing their vast user bases to access it from their individual accounts without interacting directly with the protocol.

While this may be less than ideal from a security perspective, it's a simple reality that centralised services are not going out of fashion but are integrating decentralised technologies thanks to the advantages they offer. Ergo has its own approach to scalability, but we can't and won't ignore the importance of businesses in driving forward user adoption.

## 3. Interoperability#

One of DeFi's key strengths is composability: the ability to build new applications from existing components, leveraging the network effect of established dApps and tokens. This is one of the main factors that has enabled TVL to explode over the past month.

But composability currently has its limits. Cross-platform composability currently isn't possible. Even atomic swaps – the first stage of interoperability – are in their infancy, though Ergo is working on an atomic swap-powered DEX.

Full interoperability means the ability for a user to execute a smart contract on one platform and have it seamlessly interact with another blockchain. This would allow truly frictionless cross-protocol interaction and is what is needed to enable the flow of liquidity fully throughout the DeFi world. At that point, applications become blockchain agnostic, and the platforms are really more like the programming languages for accessing dApps' functionality.

## 4. Decentralisation#

Lastly, and specifically in the context of scalability and interoperability, we cannot forget the importance of decentralisation – something Ergo has always taken seriously.

Of course, DeFi is decentralised – but there are different types of decentralisation. Ethereum, the home of almost every major DeFi dApp, is just one platform.

Ethereum's developers are working on a plan for scaling, but even if this is successful, it is still one blockchain. Should we entrust all our funds to one network? What if a critical bug or exploit is found?

Interoperability does more than enable cross-chain liquidity. It decentralises the decentralised infrastructure for DeFi, adding layers of redundancy and security. In the process, it strengthens every blockchain that is a part of that ecosystem, creating a whole that is more than the sum of its parts. At a time when relatively large blockchains still suffer double-spend attacks and serious reorgs, and catastrophic vulnerabilities are found in smart contracts holding tens of millions of dollars of value, we cannot assume that one single blockchain will or should rule them all.

As blockchain technology gains traction, central bank digital currencies are among the most significant applications being developed. But these will inevitably fall far short of the ideal for one simple reason: control. In particular, that has implications for composability and privacy, and much else besides.

Central bank digital currencies are no longer a theoretical application of blockchain technology. The list of countries developing CBDCs is growing rapidly, with several now trialling state-backed digital cash.

CDBCs are not built on classic, open blockchain technology. While there are various approaches, they are all based on permissioned ledgers that restrict the role of securing the network and processing transactions to a group of approved entities. They also include a control layer that gives administrators the ability to intervene in transactions, blocking or reversing those they deem invalid.

It's a far cry from the ideals of Bitcoin and the Ergo platform that aims to build on these. But it's only to be expected. The state has a role and a remit, and it's unlikely to give up the control it exercises. Unfortunately, though, there are two ways that holding onto control will mean that CBDCs fall far short of what they could be, meaning they may ultimately cede ground to open platforms like Ergo.

## Composability#

As we wrote in a recent blog, composability is a core feature of DeFi. It's what gives applications network effect, instantly adding value by plugging into existing dapps' user bases and functionality.

Programmable money is a huge development. The current system is clunky and complicated to use, at best. It's not possible to attach detailed conditions to transactions, and have them interact seamlessly with software, as can be done with blockchain and smart contracts.

Imagine the value that could be unlocked if CBDCs were programmable, and smart cash could be integrated frictionlessly into new applications – banking interfaces, investment services, stores, social networks, games. The list is endless. But this is hardly likely. The freedom to program money will exist, for many years at least, in the open blockchain space alone.

## Privacy#

Secondly, we consider privacy to be a core requirement of DeFi. Money is too important to be used as a tool of surveillance, but there is no question that this is what it will become as soon as the first CBDCs are rolled out to a large user base.

China is one of the furthest ahead in its creation of state-backed digital cash. This is a state that is notorious for its internet censorship and online surveillance of its population. Its human rights record is dire, and in recent days we have learned more about its oppression of the Uighur minority. Moreover, China already uses a social credit system, which grants or denies citizens access to certain services and amenities depending on their social score, with model citizens enjoying greater privileges.

There is, again, no question that a state-backed, traceable CBDC will be used as a tool of surveillance on a scale that is unprecedented in human history. And it will be the same across any nation that implements money within the same framework.

That giant eye on the dollar bill? You ain't seen nothing yet.

## Private, programmable financial services#

Ergo has a very different vision for blockchain-based cash and financial services. In the new paradigm of blockchain, value is not retained by constraining it. It is only maximised through open systems that make it as accessible as people want it to be. Money without borders, in both senses: cash that can be programmed, sent and received freely but privately, between any two individuals or organisations – and even blockchains – anywhere in the world.

This is what money needs to be and what Ergo is building.

This is the first in a series of articles speculating on how the fast-emerging DeFi sector might evolve in the coming years.

The DeFi movement, as it currently exists in only a few months old, and blockchain itself has barely existed for a decade. Already, though, we are beginning to see themes crystallising and the first popular use cases becoming established.

As a DeFi platform that takes positioning for the future seriously, it's important that Ergo has a vision – not only a sense of where things might be heading, but the role that it should itself be playing as these new decentralised financial services consolidate and grow in popularity.

While no one can know the future, least of all in this space, a number of trends, technologies, products and use cases are emerging, and it seems that these are starting to plot a certain trajectory. Allowing for necessary course correction as time goes on, where might we see DeFi end up in ten years?

## Tokens will be the fuel for DeFi, and everything will be tokenised#

One of the major themes that were becoming apparent, long before the yield farming craze brought DeFi to global attention is tokenisation. We already have blockchain tokens representing cryptocurrencies and digital assets, and the first shares and other securities have been issued on the blockchain. The benefits are such that the direction of travel is clear. Sooner or later, everything will end up as tokens.

For regular, fungible (interchangeable) assets, a regular token will work. Fiat and cryptocurrencies, shares, bonds, precious metals, ETFs, CBDCs – these will all be freely available on the blockchain.

For other assets, NFTs will proliferate. When you buy a car, house, painting or other unique items of value, whether digital or physical, there's a good chance that transaction will also include a blockchain token.

These tokenised assets will place on the blockchain trillions of dollars of value that are currently 'stuck' offline, illiquid or impossible to buy or sell outside of certain limited circles and circumstances. This pool of tokenised value will represent the fuel of the Defi economy: assets that can be traded frictionlessly, borrowed against and leveraged using decentralised protocols that probably won't look so very different to the ones we use today.

## Digital identity will become non-negotiable#

Since these assets will be tradeable on centralised and decentralised exchanges, digital identity will also become an increasingly important theme. This will link blockchain addresses with offline identities, enabling individuals and corporations to operate in a way that is compliant with relevant regulations. It will also allow the automation of tax and accounting processes. To date, digital identity has been an overlooked element of the DeFi ecosystem – likely due to the use of centralised platforms that can conduct KYC as a condition of use. We're fast approaching a point where that is no longer a given, with the growth of new forms of a decentralised exchange and the increase in volumes moving to these platforms.

## Stablecoins will become embedded elements of the blockchain#

One of the biggest use cases for DeFi – and again one that is often overlooked – is stablecoins. These exist in many forms and rely on a range of approaches: centralised and decentralised, collateralised and algorithmic, fiat-backed, and so on.

Whatever your preferred approach or view of stablecoins, they are here to stay. They have found use cases as a store of value, especially for traders, and as a popular form of collateral for yield farming.

What they haven't been widely adopted for yet, is as an integral part of blockchain infrastructure. Transaction fees are almost always paid for with the native blockchain token. Not only does this fluctuate in value, but so does the amount required per transaction, depending on both the complexity of the transaction itself and competition for space in the next block. Clearly, this complexity is not conducive to mainstream adoption. End users are best served by simplicity, with minimal burdens for managing multiple tokens. They will want to pay transaction fees in a stable unit of account and not have to worry about handling the native blockchain token.

The solution? An integrated stablecoin that, to most end-users, is the most important token on the platform.

## Two-tier system#

As a result of this need, it seems likely that we may start to see a two-tier system evolve more clearly. A blockchain such as Ergo will have a native token, which will serve as the underlying currency of payment, just as it occurs now. For the most part, though, these will only be handled by more experienced users. These expert users will maintain the technical and financial infrastructure of the DeFi space. For example, they will mine and use the native token as collateral to create a stablecoin, which can be sold into the market for general use in return for tokenised assets of all kinds.

Regular users will then use the 'native stablecoin' in all their businesses as a kind of standard reserve currency. It will be used to buy other assets; it will be lent to users against other tokenised assets as collateral (houses, cars, real estate and much more); and it will be used to pay transaction fees.

The miners who receive this native stablecoin can hold it as it is to pay for electricity and hardware costs, or they can convert it back to the platform token or other assets – that is up to them.

These are just some of the themes we are starting to see emerging in the DeFi world and how they might develop over time. In the coming weeks, we'll explore various other ideas as the space continues to evolve and Ergo launches new technology.