Reimagining peer to peer finance with Marlowe
Marlowe decentralizes financial tools allowing anyone to create and execute peer-to-peer financial agreements
26 May 2021 6 mins read
A while ago, I logged in to my stock trading platform to buy some exchange-traded funds (ETFs). Alas, the platform was down! It turned out that the surge in the GameStop stock had forced quite a few trading platforms to shut down temporarily. We weren’t in the middle of a financial crisis, and I never expected that my bank or brokerage would block me from using my own funds without warning. I had assumed that I would always be able to access my funds, place trades, and reap profits or losses – a service for which I pay a handsome fee.
In the following days, several other stock brokers and trading platforms began blocking their users from performing trades that didn’t favour the brokers’ own agenda. Robinhood – which positions itself as the platform that democratizes finance – completely censored its users from buying GameStop stock. Are we ever truly in control of our money?
Almost all of us have given custody of our funds to some third-party, leaving us at their discretion to decide if and when those funds can be accessed, used, or even viewed. The commonality between these third-party banks and brokers is that there is a central point of control. In the case of Robinhood and GameStop, we have seen how this centralization can lead to failure. The central point of control can be influenced, attacked, or manipulated by an external self-interested actor, making it the antithesis of democratized finance.
This is the core motivator of decentralized finance, commonly known as DeFi. DeFi offers a similar set of financial tools offered by Wall Street such as lending, escrows, derivatives, swaps, and securities. What makes DeFi platforms stand out is their ability to offer these financial instruments without the need for central market makers, banks, or brokers. Each financial agreement is represented as a smart contract on the blockchain, and is settled algorithmically. Their decentralized nature makes them far more resilient to market manipulation or the failure of a centralized system.
We are currently developing a suite of Marlowe products to democratize finance and enable easy access to financial agreements. This includes Marlowe Run, a new product that will allow users to seamlessly execute off-the-shelf financial agreements with friends or clients in a secure fashion, and on their own. With added automation features and no need for third-parties, this peer-to-peer solution will be cost-effective, and more importantly, democratizing.
What is the Marlowe suite?
With Marlowe, we aim to democratize finance by facilitating peer-to-peer agreements that run on a blockchain. We seek to empower people to create their own financial instruments and set up agreements with anyone with whom they want to interact. Marlowe will offer a suite of products, each product serving a different function and set of users. Marlowe’s overarching product strategy comprises three streams – Marlowe for developers, Marlowe for end users, and Marlowe for enterprise.
Marlowe for developers
Marlowe for developers includes Marlowe Build and Marlowe Play (also called the Marlowe Playground) as well as the input to the Marlowe Library. Marlowe Build and Marlowe Play together enable end-to-end financial smart contract development.
Developers can compose smart contract code on Marlowe Build. Then, they can perform preliminary iterative design using simulations, and formally verify and test smart contracts on Marlowe Play. These capabilities – paired with a purpose-built domain-specific language (DSL) for finance – ensure that the contracts are easy and straightforward to build, as well as being secure, verifiable, and rigorously tested. Once built and tested, developers may contribute them to our open-source smart contract template library, the Marlowe Library.
Marlowe for end users
Marlowe for end users will bring an intuitive, straightforward, and seamless interface for users to execute financial agreements with their friends, colleagues, or clients on the blockchain. This includes Marlowe Run and gives access to a variety of templates for financial instruments from the Marlowe Library. We’re designing these products with the user in mind. To make financial agreements on the Marlowe Run, the user does not need to know the ins and outs of blockchain, or how to write smart contracts. Every step of the contract is explained in non-technical language, and each action is performed only with the user’s explicit authorization. Our team has built a suite of rigorously tested and verified financial tools including escrows, debt securities, and swaps that can be used on the Marlowe Run. These – and many more verified open-source contracts – are made available through the Marlowe Library.
Marlowe for enterprise
Marlowe for enterprise aims to expand DeFi beyond individual users, helping enterprises to access the tangible benefits of smart contracts. This will include a bespoke, customizable suite of capabilities and financial agreements that are tailored to a commercial use case, with the provision of smart contract templates that adopt Algorithmic Contract Types Unified Standards (Actus) for financial contracts.
Implementing Marlowe on Cardano
In 2020, we rolled out the Marlowe Playground Alpha. This provided the ability to write contracts in JavaScript, in addition to Haskell, or directly in Marlowe itself. This also included proof-of-concept oracles, with the ability to access external data such as price, directly from a stock market ‘ticker’ or, in the future, data feeds such as Coinbase. To support the rollout, we published tutorials to guide developers. We have since been building on this work, continuing to improve the user experience, and building, testing, and validating more smart contract templates.
As a part of the Goguen rollout, we are now in the process of completing the implementation of Marlowe on Cardano, giving users and organizations the opportunity to execute DeFi contracts they have written themselves or downloaded from a contract repository. Marlowe will run first of all on the Cardano blockchain, but it is blockchain-agnostic so could run on other blockchains to reach an even broader audience in the future.
What comes next?
Marlowe for end users will come online in stages throughout 2021. First, is the prototype of Marlowe Run, where users can demo and try out their own financial agreements. This will include a suite of financial smart contract templates that users can customize to their needs. This prototype will allow users to explore the experience of making financial agreements in a decentralized fashion, all in a peer-to-peer manner without requiring a value-extracting third party. To use the Marlowe Run prototype, users don’t need to own any real tokens, so they may try the demo before they onboard. This rollout will include a suite of template financial instruments, built by our in-house developers. These templates can be used to execute test agreements on Marlowe Run. We’ll share a demo of Marlowe Run on this month’s Cardano360 show (airs May 27) so join us for that.
We are committed to delivering this suite of products for the Marlowe ecosystem that empower people across the globe to build, control, and execute their own financial instruments on their terms.
We are planning a series of webinars on decentralized finance with Marlowe (starting June 3rd), you can register on our website for these webinars now!
Bringing ERC20 to Cardano
Our new ERC20 converter will allow Ethereum tokens like AGI to run on our proof-of-stake blockchain – coming soon to testnet
17 May 2021 7 mins read
Connecting blockchain protocols and collaborating on applications are essential to achieving the promise of decentralized finance (DeFi) and provide an alternative to the traditional banking system.
According to DeFi Pulse, a tracking website, cryptocurrency to a total value of over ‘$75 billion is now locked up’ in DeFi. A year ago, the total was just $700 million. Most of this value is in the form of crypto-assets based on the ERC20 token standard.
But Ethereum’s proof-of-work infrastructure is challenged with ever-rising costs. We foresaw this issue and providing an alternative was one of the founding principles we set for Cardano. This is about to come into fruition.
To expand the variety of use cases for application developers and businesses, Cardano will support the ERC20 token migration to its platform. The Alonzo hard fork and Plutus smart contracts are on the way. Once deployed, users of supported Ethereum tokens will be able to bring them over from Ethereum's congested network and take advantage of Cardano's transaction capacity and lower fees, while enjoying enhanced security, reduced cost, and interoperability.
Why ERC20?
Let’s take a closer look at the nature of ERC20 to understand why this standard fits the market trends in terms of business needs. First, of course, Ethereum brought the concept of smart contracts and ‘programmable money’ to the blockchain in 2015. Since then, tokenization and the ERC20 token have gained popularity because of utility in everyday business transactions. Applications built on a blockchain can provide tokens that can serve as:
- a payment unit
- a transaction unit
- access to digital services
- a reward or incentive
- a right to vote
- an investment mechanism
Well-designed ERC20 tokens address many needs, and the more useful they become, the more demand grows and so their value grows accordingly. That is why these tokens are widely used and are so well supported by wallets and exchanges.
Ethereum v Cardano
The ERC20 standard was invented for Ethereum, and as of today, there are over 400,000 contracts based on this token standard with examples including Binance coin (BNB), Tether (USDT), Uniswap (UNI), and Dai (DAI) to name a few.
Ethereum is a popular and functional blockchain platform, but it is slowing down and becoming more expensive. As more network participants interact with decentralized applications, the ‘gas’ fees paid for validating transactions are rising sharply (Figure 1).
Figure 1. Ethereum gas fees are increasing
The problems being experienced by Ethereum users have also been identified by a Cointelegraph survey cited in ‘DeFi Adoption 2020’:
45% of platforms built on Ethereum name scalability and high gas costs among the top three problems constraining mass DeFi adoption.
Ethereum has not yet resolved these challenges and is unlikely to do so in the short term. So many businesses will want to consider other options.
By enabling the migration of ERC20 tokens to Cardano, we focus on delivering a value proposition that leverages Cardano’s advantages over Ethereum. In particular, Cardano's higher capacity for transaction processing and lower fees when compared with Ethereum's high cost and often congested traffic.
Enabled by Ouroboros
The key to addressing the problem of network congestion and high fees is Cardano’s Ouroboros proof-of-stake consensus mechanism. Compared with Ethereum’s proof-of-work protocol, Ouroboros needs far less energy to process network transactions; it runs using amounts of electricity on the scale of a large house, rather than a small country. Because of this, Ouroboros is not only eco-friendly but also needs far lower fees to process transactions.
Additionally, Cardano does not require smart contract execution costs as the ledger supports native token functionality with its built-in accounting model. This means that the tracking, transfer, and ownership of different types of assets are handled by the ledger instead of smart contracts. Whereas the creation and transfer of ERC20 tokens on Ethereum require the manual modification of the standard contract type, the logic for this is built into Cardano, which also eliminates the risk of errors and vulnerabilities.
How the ERC20 converter works
Cardano currently supports ada and native tokens, which have proven successful with over 160,000 tokens minted. We are now launching an ERC20 converter to ensure better interoperability in the future as well as lay a solid background for extended business opportunities.
Our ERC20 converter is a tool that will allow issuing organizations and their users to handle ERC20 token migration to Cardano. It is designed for token issuers (organizations that wish to enable the migration of their tokens to Cardano), and their users (token holders) to use the tool to move their ERC20 tokens to the Cardano network.
Users can convert their Ethereum tokens in just a few clicks, and when moved across, these tokens will be ‘translated’ into a special native token on Cardano that has the same value and works just like an ERC20. Additionally, if the user wishes to do so at a later stage, they can move their tokens back to the source network by burning them on Cardano. Two-way convertibility is baked in.
We’ll soon spin up a version of the ERC20 converter tool on a dedicated testnet. IO Global is currently working with partners for migration to Cardano, and SingularityNET will be the first of these. The ERC20 converter will introduce a new SingularityNET AGIX token, the deployment of which marks the first milestone in the SingularityNET to Cardano migration plan. The initial testnet will allow users to assess the process of migration while working with AGIX tokens both in Cardano and Ethereum Kovan testnets.
It will be possible to authenticate an account using Metamask (an extension for the Chrome browser) with more options to come later. Users will also need to add their Daedalus testnet address so they can migrate their tokens to Cardano and easily track balances and transactions.
When users log into their ERC20 converter account, they will see SingularityNET tokens listed and available for migration, and, by clicking on a token ‒ details such as token balance. They will just need to select the token, indicate the amount they would like to convert, and then migrate them by specifying a Cardano address. When tokens migrate to the address, it will be possible to use them for payments and transactions from the Daedalus wallet. All the activities will be visible both within Etherscan and the Cardano Explorer.
Figure 2. ERC20 converter dashboard
At later stages, users will see different types of tokens within the dashboard. Tokens available for migration will be listed first, and if not yet eligible – it will be possible to subscribe for updates about any changes.
A glance ahead
As the number of ERC20 converter partnerships increases, the range of token types supported will grow. Currently, our partners need to be custodians of their tokens, however, we will achieve greater interoperability while onboarding organizations when Plutus smart contracts operate on mainnet.
Our goal is to support many tokens to create possibilities for business deals. So, further down the road, with a variety of tokens, the ERC20 converter will act as a bridge between blockchains, and this will promote effective cross-chain communication.
The ERC20 converter testnet is now in the final stages of quality assurance testing before the public launch. This stage will allow us to test the user journey and improve their experience along with fixing any occurring issues. We will also soon provide the dedicated testnet environment with relevant documentation and instructions on how users can test the converter capabilities.
We’ll share an update on May’s Cardano360 show. Meanwhile, stay tuned and follow our Twitter announcements to find out more in due course!
Announcing new stake pools chosen for our delegation strategy
Committing to the health and diversity of the Cardano network, we are now announcing the new round of winners for delegation
14 May 2021 9 mins read
Cardano continues to grow, powered by a stake pool operator (SPO) community working toward a vision of an independent, globally decentralized ecosystem. Stake pools have always been the driving force of the Cardano network and we launched our delegation strategy to recognize and bootstrap the promising pools.
To support our long-term vision for Cardano’s growth and network decentralization, we have already delegated the stake from retired IO Global pools to a number of promising stake pools in the ecosystem – to bootstrap their business and support community development goals, technical contributions, and geographical distribution. Our analysis has shown that our contribution helped them to become more stable in the network and attract delegators and community members who share their ideas and development objectives.
Diversity & distribution
Any community ecosystem needs its engineers and entrepreneurs, its technocrats, and its diplomats – globally. Equally, the pool ecosystem needs a balance of larger established players, a strong core, and an inflow of new entrants primed to build further success upon strong fundamentals.
The problem that many stake pools currently face is their recognition within the ecosystem or rather visibility that allows the attraction of community support to ensure stable and consistent pool operation. Running a stake pool is not an easy process; unlike mining, it does not presume straightforward funds earning from just setting up a pool on the machine. You cannot buy your way to success through a better and better kit – indeed, Cardano is designed to be relatively light on computing resources. Stake pool operation is a complex business that has the hallmarks of both a commodity and a distributed market, and requires a blend of skills, persistence, and luck.
There are many factors that influence the pool’s success and differentiate it from the others. First of all, these are technical factors such as:
- Parameters: this includes pledge influence factor, relative pool saturation size, stake delegated to the pool, and stake pledged by the owners.
- Fiscal: variable fee, fixed fee, and pledge should be all taken into account to ensure that the pool functions effectively, produces blocks, and earns rewards for its delegators.
- Performance: calculated according to the pool’s expected activity as the ratio of the number of blocks a stake pool produces in a given epoch versus the number it was capable of producing.
- Overall mission: even if the pool meets all of the above requirements, this does not mean that it becomes totally recognized or drives straightforward attention. With over 2000 active pools in the ecosystem, it is essential to reveal to the community the mission that a certain pool is trying to achieve and explain why this exact choice is beneficial for others.
The ability to differentiate is key, and that is where the marketing factor steps in. Just like any business seeking ‘customers’ in a competitive market, no pool will get recognized unless it announces itself, tells a story, builds trust. So, commitment to raising awareness sits alongside vigilance towards node maintenance. Like any small business – and that's what this is – it requires clear objectives, and of course, goals that add value to the community while meeting the bottom line.
Opportunities
We announced a new stage of application submission earlier in April, and are now committing to redelegate our funds to a new cohort of stake pools and – we hope – help them grow to their potential.
Even though we may want every pool to be successful, not every pool will be. With our delegation, we are committing to help those stake pools that ultimately, have not yet reached the desired level of awareness. One of the critical issues a stake pool operator comes across is uncertainty and the inability to rely on consistent rewards. This is like with venture capital investments – stakeholders invest in those projects where they see returns on investment. But what if the mission is highly important and promising, but there is no capital to kick it off? In such cases, many companies receive initial support (investment) in order to boost their development and reach desired goals.
In the same way, we are willing to support promising stake pools, and help them get established within the ecosystem by evening out more predictable rewards and, thus, attracting a higher number of delegators to support their mission.
Differentiation is key to success, and we hope that we can provide the chosen stake pools with opportunities to establish themselves and keep sustainable and stable operations without relying on the luckiness factor. We can now share details of the fresh cohort of stake pools chosen to take part in our new delegation round. But first, a closer look into objectives and the process.
The process
Choosing the pools for delegation is always a complex process. Every active pool is making a contribution to the globally decentralized network. Last time, when assessing the pools and their contributions, we have been guided by such factors as their goals and purpose, geographical location, technical contribution, stake & pledge ratio, and community/social media engagement.
With 700 pools to assess, we were always going to disappoint many pools and some may feel they have been unfairly overlooked. Even after some initial filtering, we had a field of some 300 pools that met many of the criteria we identified. Thanks again to pooltool.io and adapools.org for providing additional data sources during the process.
Purpose and mission remain an important part of Cardano so this was again part of the mix. Greater weight this time was also given towards other key aspects such as geographic distribution, social/community activity, and support for the lower-middle sized part of the network. Pragmatically, sustainable support needs to focus on pools that are neither strongest nor weakest. The following delegation distribution was defined:
- 50% of our dedicated stake to the geographically distributed pools
- 25% to socially active pools with solid technical potential
- 25% to the lower-middle sized pools to even out the network balance
Let’s take a closer look at the factors that influenced our choice to understand the reasoning behind it.
Geographical distribution
Cardano is a decentralized, distributed network of nodes that work together to verify block production and transaction validity in the network. Decentralization is key to this process as only independence from governing entities establishes trust and confidence in handling financial activities. To ensure that the network is resilient to connectivity failures, it is essential that stake pool operation nodes are distributed across the globe without significant concentration in one location. This is beneficial for setting up connections between different regions and eliminates a single point of failure. A minimum of two relays was another factor in play as part of this.
Social/community activity
Our survey earlier in the year helped us understand that a critical issue SPOs face is the inability to differentiate. For this reason, we used a social impact score from Pulsar to help us understand which stake pools were gaining traction across potential delegators.
As well as ‘ambassadors’ for the network, we have evaluated socially active stake pools that operate to support business goals in their countries or for the betterment of various community activities. We have chosen those pools that have great social presence and community engagement but face difficulties in gaining a stronger position in terms of reward predictability. To be clear, technical performance is still the most important factor – no amount of tweets or Reddit posts is going to make up for missed blocks.
Network balance
With such a variety of stake pools all functioning for different purposes, we are also distinguishing potentially strong pools that have been working hard to keep the network activities and support block production and transaction validation. Delegating to these pools, we support smaller-middle size businesses and help their delegators earn stable rewards.
Due to the security properties of the Ouroboros protocol, the selection process for block production is ultimately randomized, and the probability of creating a block is proportional to the amount of delegated stake.
Such a condition is well-applicable for long-term reward behavior, however, in terms of shorter timespans (one or several epochs), this randomness can yield an unpredictable amount of rewards. This effect increases the smaller amount of delegation the pool has, which in turn might have an undesired side effect disconcerting delegators who expect a predictable amount of return on their stake.
Meeting the winners
Here’s a list of 100 stake pools chosen for our new round of delegation. If you’re interested to find out more about these pools and their mission, you can easily do so at adafolio.com or adapools.org.
We are aiming to delegate to these pools at the end of May/early June, so SPOs can expect to receive ada from then for a period of three months.
Looking ahead
As much as we are happy to recognize 100 stake pools that we believe have solid potential in reaching business objectives and supporting ecosystem sustainability, we still understand that there are many more contributors that we are not able to delegate to this time. We would like to thank you for all you do and if you were not selected this time, please note that we’ll have a new delegation round three months from now.
So, we encourage all pools that missed out to apply again for the fresh cohort during Q3, and we’ll make a new call for applications in June to rotate delegations in July. While technical analysis is the primary way that pools are identified for delegation, we always welcome community feedback on how we can continue to improve the process. We are committed to seeing the Cardano ecosystem go from strength to strength. Together we have created the world’s leading proof-of-stake ecosystem and we want to do what we can to maintain and improve it as it matures.
Thanks to Ben O’Hanlon, Colin Edwards, Francisco Landino, Sam Leathers, Olga Hryniuk & Tim Harrison for support and additional contributions.
Strategic partners pave way for Plutus smart contracts
Metalamp and Runtime Verification among developers priming Cardano for the age of DeFi
12 May 2021 6 mins read
The technical infrastructure is being laid for Plutus smart contracts on Cardano. But such infrastructure for decentralized finance (DeFi) is like a road with no cars if there aren’t the developers to write the contracts that will drive platform adoption and usage.
The Plutus pioneer program was kicked off in April, as part of an evolving scheme for developer education that began over two years ago. The goal? To provide structured training for anyone who wants to learn about functional programming, so they can begin using Haskell and Plutus, and start building their first apps. Alongside this keen and committed group of about 1,500 ‘trainee’ Plutus developers, we’ve also formed partnerships with experienced software development houses to build a number of decentralized applications (DApps) to stress-test the network, provide some early proof-of-concept applications, and assess our processes and support for the army of developers that follow.
The plan for Plutus is to have ‘professional developers complement the work of the pioneer program and help fast-track our quality assurance and testing process towards the Alonzo hard fork,’ says Silviu Petricescu, director of product strategy.
‘The Cardano community has been integral to us testing, improving and rolling out the network since the days of the incentivized testnet,’ he adds. Professional developers add another element to the process – in terms of expertise, sitting somewhere between the core internal team and the pioneers – ‘to scrutinize everything’, he adds. ‘Starting with documentation, tools and all the support elements that we are going to provide, they are going to be the first to test it all and give us feedback. We will include that in our internal testing and quality assurance processes.’
It’s a two-pronged approach: the pioneer scheme will be training up an army of developers, while the partner scheme will bring in heavyweight expertise to make sure everything works – that way, everyone is ready when Plutus is deployed to the mainnet as the final component of Goguen on the Cardano roadmap. ‘Having these developers as part of this is a way for us to ensure that our quality of build towards the next hard fork will be at the level that we want,’ says Petricescu.
Gerard Moroney, director of operations, has been bringing these software houses into the scheme. ‘We've been talking to companies that have experience with blockchain, and blockchain consultancies, and others that are not necessarily crypto but know distributed computing. We've also looked at consultancies that have solid Haskell experience.’ Enthusiasm and passion are also part of the equation: ‘We're working with companies that really want to try something new, something innovative and interesting. Fundamentally, we're backing people who want to be brave and be ahead of the curve.’
Of course, the blockchain never sleeps and the search has taken him far and wide, holding talks with consultancy companies across Europe, Asia Pacific, and the Americas. ‘Some of them were entirely new to us,’ he says, ‘but they already knew about Cardano and Plutus – and that's been really interesting.’
These are companies that have experience in the finance sector and business so ‘they've all got great ideas’ he adds. ‘We're giving them guidance about what we want them to work against at the beginning, but they're also coming up with new ideas – and that’s a lot of fun.’
March’s Cardano360 show ran interviews with some of the partner companies. When it comes to software engineering, their expertise soon becomes clear. Obsidian Systems, for example, provided many of the tools and the technical support for the block validators who maintain the Tezos proof-of-stake blockchain.
On a visit to the Metalamp offices, you’d find yourself in the city of Omsk in Siberia among a team that thrives on ‘complex and time-consuming projects’, often built on the Haskell programming language. ‘The company had heard about Cardano and knew that ‘it is one of the most fascinating projects written in Haskell’. Some of their teams had already played with Plutus before the companies came into contact. Metalamp has experience with financial technology and has built applications involving lenders, loans, and ledgers.
Other companies supporting the rollout include:
- Eleks: custom software engineering and consulting services since 1991. Based in Ukraine.
- Node Factory: blockchain research and development specialist in Zagreb.
- MLabs: develops compilers, artificial intelligence, and DevOps applications, mostly in Haskell, Python, and Typescript.
- BinarApps: based in Poland, this developer specializes in projects for the retail and loyalty sectors.
Developers are looking forward to exploring applications involving digital exchanges and online sources called ‘oracles’ that bring information – whether it be commodity prices, exchange rates, airline timetables, or logistics schedules – into blockchains. The Essential Cardano page on GitHub maps the Cardano ecosystem and links to a library of resources.
A long time in the making
Of course, Plutus will be used for complex financial smart contracts. There is a lot of money at stake with these contracts – it is reckoned that $43 billion is already locked into contracts using the Ethereum system. Yet DeFi is still at a very early stage and, as we showed in our recent #CardanoAfrica event, there is a whole new market out there for real world use cases (or RealFi as we call it).
Implementing secure smart contracts for the long term is hard, and software schedules are notoriously difficult! But the progress made by our blockchain engineers and the acceleration in the way the pieces of the Goguen jigsaw are falling into place are clear to see in the Plutus timeline below. The Plutus Playground is up and running. We have about 1,500 developers building their skills within the Pioneer program, writing scripts and building prototype apps. A series of Alonzo development testnets will soon begin rolling out – with core functionality at first, followed by a process of fast iteration with new capability and new user groups added in the weeks ahead. All the while, we are advancing steadily towards deployment of Alonzo on the mainnet and the start of smart contracts on Cardano.
It’s going to be an exciting summer as everyone in the Cardano community – partners, pioneers and developers of every stripe – works tirelessly to ensure that the Plutus smart contract platform hits the ground running. The secure, energy-efficient system that decentralized finance has been waiting for.
We’re in the final stages of preparing the first Alonzo testnet, aiming for the end of the month. Keep an eye on our social channels this week for an update. You can try out the Plutus Playground for yourself, and join Plutus discussions at the Cardano Forum. There is also a Plutus GitHub repository. You can register your interest and join our Slack community.
Cardano decentralization continues: insights into our P2P deployment
Stake pools will soon be able to test automated peer-to-peer connections
11 May 2021 5 mins read
Decentralization of the Cardano network is key to ensuring its long-term sustainability, resilience, and independence from centralized governing entities. Now that block production is fully decentralized, our next focus is on developing our decentralized stake pool operator (SPO) ecosystem to build reliable and effective connections between distributed nodes.
Giving the power to validate blocks and transactions to stake pool operators requires enhancements to the network software. The activation of the peer-to-peer (P2P) governor, along with the deployment of the connection manager, enabled the release of a private P2P testnet in late April. We are now assessing this engineering testnet before deploying a semi-public P2P testnet for a group of invited SPOs to help us test and tune.
In the P2P governor post, we discussed the network’s architecture and the interaction between mini protocols and the components that enable direct and automated communication between nodes. Here, we assess how the connectivity model has matured to enable automated peer connectivity and reflect on the results of the private testnet launch.
Evolution of network connectivity
When Cardano was launched, the Byron network connectivity model operated in a federated state. In that setting, IOHK maintained core and relay nodes that connected to about 200 other relays (Figure 1).
Figure 1. Byron federated network structure
With the launch of Shelley last year, Cardano started functioning in a hybrid setting. This allowed stake pools to construct their P2P network manually by connecting to core and relay nodes and also to the seven federated relays that helped maintain the network during this transitional phase (Figure 2).
Figure 2. Shelley’s initial hybrid network structure
Since March, block production has been entirely decentralized, with stake pools following manual topologies for P2P connections. This means that SPOs have been using a list of relay nodes registered across the globe to generate their configuration for connections with other peers. To provide better efficiency, it is essential to enable automated node communication without reliance on IO-run relay nodes. Thus, the networking team is now deploying the automated P2P code, which will allow pool operators to create and run a more decentralized network.
In this way, once the P2P mainnet is deployed, Cardano will be maintained solely by community-run nodes (Figure 3).
Figure 3. Final network structure with automated node communication
P2P testnet and node communication
The first stage in the P2P rollout was the launch of the private P2P testnet last month. This has been used to test the basic capabilities of the components:
- P2P governor: manages hot, warm, and cold sets of peers and ensures that the node meets the target number of each type of peer.
- Connection manager: creates outbound connections or registers inbound connections, tracks their state, and allows full-duplex TCP connections to be reused.
- Server: accepts connections and performs dynamic rate limiting.
- Inbound protocol governor: responsible for running and tracking the state of the inbound connection side. This includes tracking the state of each remote peer (cold, warm, or hot) and the state of each inbound mini-protocol.
The P2P system was deployed in a private environment and tested between eight nodes that connected to the mainnet and established communication with active SPO relay nodes; these further connected to other relays and block-producing nodes. The system enabled nodes to discover stake pool relays using the on-chain stake pool registry, which includes the DNS name or IP address of each relay.
Test results show that the nodes could arbitrarily select peers for communication, including those from the mainnet. The use of an ‘upstream’ metric enabled the discarding of the worst-performing peers and random selection of new peers for connection. This policy has been demonstrated in large-scale simulations (10,000 nodes), providing close-to-optimal results. In the live testing, the team saw many iterations of the optimization procedure. The team also observed that a range of peer connections occurred – with both nearby and far-away peers from different locations, which was inherent to all the eight nodes run in different parts of the world.
The networking and DevOps teams are now working together to improve the testnet environment, so all SPOs invited to the semi-public testnet can establish direct peer connections. This includes work on feature enhancements and testing processes to deliver the most efficient results. Thus, to introduce new targets for local root peers, the team is finalizing the tests for such related features as targets for known, established, and active peers.
We will be soon launching the semi-public P2P testnet, with the support of a small group of SPO partners to help with initial testing, before broadening this out to the wider SPO community. As ever, early feedback and ideas from our community are central to test, iterate, and improve processes as we progress towards a fully automated and decentralized P2P architecture for the Cardano mainnet.
Additional contributions from Karl Knutsson, Duncan Coutts, Neil Davies, Prashanti Naik, and Olga Hryniuk.
Recent posts
2021: the year robots, and graffiti came to a decentralized, smarter Cardano by Anthony Quinn
27 December 2021
Cardano education in 2021: the year of the pioneers by Niamh Ahern
23 December 2021
Cardano at Christmas (and what to say if anyone asks…) by Fernando Sanchez
21 December 2021