How we’re scaling Cardano in 2022
With core smart contract capability now deployed, the next phase for Cardano focuses on performance optimization and scaling. And it starts right here…
14 January 2022 5 mins read
The Cardano project has always been committed to addressing the classic blockchain trilemma; scalability, security, and (importantly) decentralization. As the organization tasked with creating the core platform, we have always pursued a defined, clearly staged roadmap to deliver on Cardano’s capability and fulfill its long-term potential.
Utilising formal development methods and Haskell code – with deep roots into a peer-reviewed academic approach – we have delivered a robust, secure platform fit for the future. Built for correctness. We named this phase Byron.
An incredible community has grown up around our endeavors and, through a network of some 3,000 stake pool operators, we now have one of the most decentralized proof-of-stake networks in the world. This era of decentralization and stake pools we named Shelley, after poet and political radical, Percy Bysshe Shelley.
Goguen (which included the Alonzo HFC event) brought with it core smart contract capability, paving the way for DeFi and DApps. With initial Plutus capability now deployed, we continue to evolve the expressiveness of the Plutus language and the overall proposition, in collaboration with a growing community of developers.
Now, as we enter the Basho stage, we’re investing further energy into optimization and scaling. Building on these foundations, and steadily increasing capacity and throughput to deal with the growth in the DApp ecosystem and onboard first hundreds of thousands, then millions of new users. From DeFi degens to citizens of developing nations.
During the course of this year, starting right now, we’ll be pursuing this next phase of our mission. Parameter adjustments, improvements, enhancements and other innovations will all play their part in steadily increasing Cardano’s capacity & throughput during 2022. While maintaining the considered, safe approach that has served us to date. Yes, we anticipate periods of high demand, network congestion at times. We’re on an exciting journey and usage will be high. While we may at times feel impatient, this is the way. Here’s how we will optimize and scale as we grow.
Block size increase
The bigger the block, the more transactions it can carry. Block size was recently increased by 8KB to 72KB (a 12.5% increase); further increases will be applied over time based on ongoing system monitoring and overall network health.
Improves block propagation times by coalescing validation and propagation. The goal is for blocks to be propagated to at least 95% of peers within five seconds by reducing the ‘dead time’ between blocks (the block propagation overhead). This provides the headroom to make more aggressive scaling changes, such as increasing block size/increasing Plutus parameter limits.
Input endorsers improve block propagation times and throughput by allowing transactions to be separated into pre-constructed blocks. This improves the consistency of block propagation times and allows higher transaction rates.
Memory /CPU parameters for Plutus
Memory usage is more efficient across the chain. Specifically, there are memory improvements in Unspent Transaction Output (UTXO) handling, stake distribution, live stake distribution and pools, and hash representation.
Plutus script enhancements
Even more effective usage of the powerful EUTXO model through smart contract optimization, including:
- Reference inputs (CIP-0031) – Plutus scripts can inspect transaction inputs without needing to spend them. This means that it is not necessary to create UTXOs simply to inspect the information held by an input.
- Plutus Datums (CIP-0032) – Datums can be attached directly to outputs instead of datum hashes. This simplifies how datums are used, as a user can see the actual datum rather than having to supply the datum that matches the given hash.
- Script sharing (CIP-0033) – Plutus script references can be associated with transaction outputs, meaning that they can be recorded on-chain for subsequent reuse. It will not be necessary to supply a copy of the script with each transaction, hugely reducing friction for developers. Reusing scripts in multiple transactions significantly reduces transaction sizes, improving throughput and reducing script execution costs.
Improvements will help even distribution of stake and reward computations across the epochs, thus providing greater headroom for block size increases. Also, memory usage is now more efficient. Memory compaction reduces RSS footprint, and memory sharing means we need less data instantiated. Node version 1.33.0, from January 2022, reduces peak load at critical points, including the epoch boundary.
By storing portions of the protocol state on disk, nodes will need to hold less in memory, meaning that RAM-constrained systems will be able to run nodes provided they have sufficient storage, and memory will no longer be a bottleneck on scalability. This will enable significant growth in the blockchain state.
A sidechain is a separate blockchain connected to a main blockchain (the 'main' chain, also known as parent chain), through a two-way mechanism (the 'bridge') that enables tokens and other digital assets from one chain to be used in another and results returned to the original chain. Assets can be moved between chains as needed. One single parent chain can have multiple interoperable sidechains connected to it, which may operate in completely different ways. EVM sidechains coming to Cardano include dcSpark’s Milkomeda and IOG’s Mamba.
Introduces isomorphic state channels to maximize throughput, minimize latency, incur low to no costs, and greatly reduce storage requirements. Hydra provides a more efficient means to process transactions off-chain while using the main-chain ledger as the secure settlement layer.
Offloading some of the computation, for example with Asynchronous Contract Execution (ACE) can drive greater core network efficiency. Transactions occur outside of the blockchain itself, yet can offer fast, cheap transactions via a trust model.
To achieve greater scalability, you need to address the complexity of critical operations that depend logarithmically on the number of participants. Mithril will improve chain synchronization while maintaining trust. The result? Multi-signature aggregation that is fast and efficient without compromising security features.
Infographic credit: Mikki Pham/Fernando Sanchez
A new internal IOG Developer Experience department will improve development agility
Starting with our internal processes, we are committed to building better solutions and the optimization of the Cardano development experience
13 January 2022 4 mins read
Designed for global reach and enhanced functionality, Cardano is now moving from its core capabilities to a living and breathing smart contract platform. Gradual optimization and scientifically verified system improvements lead the way for Cardano's growth and maturity.
‘Move fast and break things’ isn’t the way Cardano is built. Working at the forefront of technology, and with our research agenda at the core, we use formal methods, such as mathematical specifications, property-based tests, and proofs to deliver high assurance software systems and give confidence to users for the management of digital funds.
While we chose the Haskell programming language as the basis to achieve strong guarantees on the functional correctness of core system components, there is no single language or tool that helps us deliver a rock-solid blockchain platform.
With so many possibilities of different programming scenarios, our goal is to ensure that both internal developers and the wider developer ecosystem have a coherent and consistent experience while building on Cardano. So, while working with different programming languages and development tools in the infrastructure, we’re also pushing this development to the limits. This means enhancing coding principles and expanding the capabilities of various systems and methodologies.
Any effort to grant wider functionality and use needs to start with internal processes. So, to provide a flexible and consistent environment for everyone building and deploying on Cardano, we have now created a new internal structure that improves the agility of development.
Developer experience department
To establish an environment, where developers at IOG are not hindered by the tools they use in their day-to-day work, we have created a new Developer Experience department (DevX), led by Moritz Angermann.
Moritz Angermann explains:
Think of DevX as an internal technical support center for IO developers. It primarily focuses on providing assistance and tooling to different teams assisting with their Continuous Integration (CI) and ‘Build’ needs and ensuring that setup procedures don’t affect timely deliveries.
The department involves cooperation with all engineering teams and is also responsible for amplifying synergies between teams and streamlining development processes. Another focus of DevX is improving the Haskell tooling as a natural continuation of the ‘tools’ team that is now part of DevX.
While Cardano is a multi-functional smart contract development platform, it is still early days and the ledger and network is being gradually upgraded as we go. Cardano is designed to serve millions of users everywhere and thus we’re adapting it to be flexible upon increasing demand. This means that along with the network growth, we are tuning protocol parameters to adjust to extending scalability and throughput properties.
The DevX department is creating tooling that will enable continuous ledger upgrades and optimizations. This tooling addresses developers’ needs and allows for better utilization of various building libraries. Streamlining the Haskell development experience includes:
- substantial improvement of cross-compilation capabilities
- enhanced plugin support
- work on interoperability with the Rust programming language and other languages
As Cardano continues to evolve as a fully open infrastructure model during 2022, we hope in due course these improvements will provide the broader developer community with better tooling for working on different projects and deploying them on Cardano.
DevX contributions are included across multiple Input Output repositories, and you can check out Haskell Nix development progress in this repository or learn more about the Glasgow Haskell Compiler development by going to gitlab.haskell.org.
With the Cardano ecosystem set to grow exponentially in 2022, now is the time to get to grips with some of the prime principles – and jargon – behind DeFi
10 January 2022 11 mins read
The number of ada users and software developers building on the Cardano blockchain continues to grow. With projects now in final testing and starting to deploy, sites like Cardano Cube, Built on Cardano, Building On Cardano, and Essential Cardano are busy mapping an exciting ecosystem. Cardano has been created as a secure, robust platform to build blockchain-based products, services, and systems. With a clear roadmap to steadily develop, we now see it scaling to serve on a global scale.
DeFi – decentralized finance – has exploded in recent years, opening up a host of new financial instruments – from the useful to the crazily speculative. Ultimately as this market matures, the goal of DeFi is to help individuals and companies engage in financial activity without going through a central, expensive middleman such as a bank, or to attain higher returns on their assets in an era of inflation and negative interest rates.
Cardano has expanded on this idea. The aim is to bring inexpensive banking and insurance services to the millions of people worldwide who cannot access such products. This would help break down the barriers between developed and developing nations. We call this vision ‘RealFi’.
Despite this surge for Cardano, overall blockchain understanding and adoption levels are still low. Not least, because of the mountain of jargon every crypto-curious person needs to grapple with. So, in anticipation of the next wave of fresh interest in Cardano – and particularly to welcome new readers to this blog – we thought the beginning could be a great place to start!
So we’ll try to unpack the complexity of some notions that we so often read about with blockchain. Terms like DeFi, RealFi, DApp, DEX, liquidity, and so on go hand-in-hand with the latest blockchain products. Let’s take a look at what these terms mean, and let’s start with the basic building blocks.
Where does DeFi start?
It all starts with a blockchain. So, simply put, a blockchain is a digital ‘book’ of records – what accountants would call a ledger – about transactions. What’s unusual about this book is that it is not controlled by a single person, company, or government official. Instead, entries are made in a decentralized way. By decentralized, we mean that thousands of people’s computers communicate with each other to agree on whether a transaction is valid. They reach this consensus based on the rules built into the blockchain software they are running. Blockchain records cannot be altered and can be examined by everyone – making it impossible to delete the record about a transaction, forge its amount, or hide any details. This feature guarantees transparency and trust between the users. Interestingly, although the blockchain shows such information, users are ‘presented’ as addresses. So, although anyone can see what transactions were made to and from an address since the blockchain started, no one can identify the person at the blockchain address.
The advantages of decentralized systems are summarized in Figure 1.
But how do we use blockchain in daily life, and why does it matter? The answer is that blockchain is about trading or exchanging funds under specified conditions, for a potentially infinite number of applications. Companies in healthcare, art, retail, collecting, beverage, sportswear and gaming already use blockchain technology.
Figure 1. Decentralized v traditional finance
What is decentralized finance?
Decentralized finance or DeFi is a blockchain-based form of finance that addresses the same needs as traditional finance. You can send and receive payments, pay for products or services, or invest in cryptocurrency projects instead of bonds or stocks. However, DeFi does not depend on any intermediary and uses smart contracts to settle deals fairly. By adding an identity component such as Atala Prism – and thus a ‘bridge’ to the real world – you have what we call RealFi.
In a traditional setting, we use money to pay for products and services. This medium of exchange is usually represented as coins or banknotes issued by central banks. Crypto users have popularized the use of the term fiat to describe real-world money. The US dollar, British pound, and Japanese yen are all fiat money. The word has been used since governments stopped having to back their currency with gold. Instead, they issue a formal decree – a fiat – that their currency is legal tender.
On the blockchain, people use crypto assets instead of fiat. Let’s take a look at the different types (Figure 2).
Figure 2. Types of cryptocurrency assets
How it works
Before we dive into the peculiarities of DeFi terminology, let’s first see what makes it all work. So, the driving force of security and fair agreements lies in smart contracts. Let’s say you download a DeFi app and you’d like to lend Alice 10 ada. We need to be assured that Alice will pay it back, and we’d also like to earn some interest if she pays back later than agreed. Traditionally, users sign agreements and specify such conditions. That’s also done on the blockchain, but in the form of smart contracts.
- Smart contract: an automated digital agreement, written in code, that tracks, verifies, and executes the binding parts of a deal between various parties. The contract stages are automatically executed by the smart contract code when predetermined conditions are met.
An interesting fact is that smart contracts don’t find specific data themselves. For example, we agree with Alice that she pays back by say, January 20. For a smart contract to execute, it needs to know the date, whether Alice processed a transaction and whether the sent amount matches the indicated amount. For this, smart contracts use oracles.
- Oracle: a way to communicate with real-world data. Oracles connect with trusted external data sources that enable smart contracts to execute by referencing datasets such as exact timing, the weather, election results, sports statistics, and cryptocurrency prices. Oracles ensure confidence in timely, accurate, and untampered data.
With Cardano, users can work with Plutus or Marlowe contracts:
- Plutus: a set of programming tools for writing smart contracts on Cardano. Deployed since September on Cardano, it includes Plutus Core – the software that runs Plutus transactions and contracts – and the Plutus programming language, which is based on Haskell, a language designed for writing extremely reliable programs. There is also the Plutus Playground – a place where developers can test their code before using it on the main chain.
- Marlowe: Marlowe is a language designed specially for writing financial smart contracts. It is limited to financial applications and is for experts in finance rather than in programming. There is also the Marlowe Playground, where users can create, edit, simulate, and analyze Marlowe contracts in a web browser. Marlowe will be deployed to Cardano later this year.
Users access various DeFi platforms and applications for different purposes. For instance, asset management products (or simply, wallets) store, send and receive cryptocurrencies between users. There are many decentralized applications (DApps):
- DApp: a digital application that runs on the blockchain. There are various types of DApps, such as DeFi products, NFT markets, wallets, exchanges, games and more.
Now that the Cardano ecosystem is growing fast, more and more DeFi products are coming to Cardano. Users will soon be able to use new DApps and platforms for their financial needs. Thus, to ensure that users and the developer community can offer and consume products of the best quality, we are working on:
- The dAppStore: a user-friendly marketplace for all Cardano DApps. It is also a place where users with limited blockchain knowledge will be able to explore ways that the technology can be useful to them.
- DApp certification: certification and assurance help ensure that products meet certain quality checks. While voluntary (Cardano is, after all, open and decentralized) Certification benefits both developers and users because it includes security checks that help with auditing smart contracts. There are three levels of certification, each of which complementary to the others.
DeFi platforms and DApps mainly deal with financial activities. Besides sending and receiving funds, these can be used for investing, lending, and borrowing.
As a matter of fact, users can borrow cryptocurrency on the blockchain without paying interest:
- Flash loan: works as an instant loan that doesn't require collateral (funds needed to secure a loan of other cryptocurrencies or tokens) or know-your-customer (KYC) verification. However, the flash loan requires repayment within the same block it is lent to the borrower. If the loan isn’t paid back, the initial transaction is rejected, and the issuer retains their funds.
Let’s take a look at a few more of the most common terms you’ll come across in DeFi:
- Exchange: a cryptocurrency marketplace where users can buy or sell cryptocurrencies. There are two types of exchanges. A CEX (centralized exchange) is maintained by a specific entity or structure, which is subject to regulations or rules. A DEX (decentralized exchange) is a type of crypto exchange with no intermediary, and users can buy and sell their assets in a secure, peer-to-peer way.
Liquidity is another term that you’ll commonly hear. It measures the circulating supply and trading activity in a certain DEX, CEX, or another network. Circulating supply is essential to meet the trading needs of users. For example, Alice wants to sell some bitcoins she owns and instead buy some ada, and let’s say, some tokens needed for her new shopping app. While bitcoin trading is very popular, she won’t have any difficulties. She’ll probably buy ada as well if the chosen exchange supports it. But what if there are none of the tokens she’s looking for? Or, say, she wants to get 100 tokens for her app, and there are only 30? This is what liquidity is about – having enough supply of coins or tokens to satisfy users’ requirements.
Liquidity includes relevant activities and notions that go hand in hand with them:
- Liquidity mining: the process of creating or adding new coins or tokens to support the demand for transactions. Liquidity miners (providers) usually get rewards that incentivize them to support the user base and grow liquidity pools. Liquidity mining is also known as yield farming.
- Liquidity pools: a pool of deposited cryptocurrencies that provides liquidity to the network, where the currencies are in demand.
- AMM (automated market maker): a pool of cryptocurrencies that provides liquidity between ‘trading pairs’. A trading pair is a match between Alice, who wants to sell her bitcoin, and Bob, who wants to buy it, for example. AMMs are decentralized and depend on the liquidity provided by their users.
Decentralized exchanges aren’t only convenient marketplaces for cryptocurrency trading. They also serve as tools for earning profit. So let’s discuss some relevant terms:
- ROI (return on investment): the profit or loss on an investment, often expressed as a percentage.
- Yield farming: as mentioned above, this is also known as liquidity mining. Because rewards are gained for providing funds, such a process is called farming.
- Yield: rewards earned for cryptocurrency staking or liquidity mining.
- Leverage: the act of using borrowed capital, expecting profits to be greater than the paid interest.
Please note that we’re not giving any financial advice. This post explains some of the DeFi terms for informative purposes only.
And while we’re discussing some ‘earning profit’ terms, let’s also recall how ada holders can securely benefit and get rewards from their ada:
- Staking and delegating on Cardano: every ada holder owns a stake that is based on the amount of ada they have. A developer or a tech-savvy person can set up a stake pool and run it to help verify Cardano transactions, getting rewards for this. Everyone can delegate their funds to a stake pool to earn a share of these rewards. There is no risk to this and no ada leaves your wallet. Ada can be delegated from your wallet or spent at any time.
While these are exciting times, we continue to stress the importance of doing your own research and approaching new products with caution. Follow our blog and Twitter for new announcements not to miss a thing. And throughout this year, we’ll have plenty more content coming your way to help you navigate this growing ecosystem.