Blog > 2021 > June

Stablefees and the Decentralized Reserve System

Exploring a new mechanism to help make fees fair, stable, and more predictable over time

10 June 2021 Prof Aggelos Kiayias 7 mins read

Stablefees and the Decentralized Reserve System

Facilitating transactions in cryptocurrency platforms stumbles on the dual utility of the platform’s underlying asset. On the one hand, users can hold and trade it as part of their investment portfolios. On the other hand, it supplies the necessary “fuel” for processing transactions.

This duality suggests that the system should have a mechanism for adjusting transaction costs, so they remain competitive and reasonable. Also, the bounded throughput of decentralized platforms per unit of time introduces another hurdle: the system should also allow the users to discover the correct price for timely transaction processing, depending on their individual needs.

Why not drop transaction fees altogether? Three reasons: One, transaction processing incurs costs on the system’s side (in terms of computation and storage). It is reasonable to allow transaction processors (stake pool operators, in the case of Cardano) to offset their costs. Two, even with a theoretically infinite capacity, it is important to prevent transaction issuers from saturating the network with worthless transactions. Three, it is appropriate to incentivize transaction processors to provide quality of service. A surge in demand should influence their payoffs accordingly.

Adding a fee to each transaction can address the above considerations.

Bitcoin and beyond

Bitcoin set out the first mechanism for pricing transactions in distributed ledger platforms. This mechanism resembles a first-price auction: transactions bid for a place in a block naming a specific reward, and block producers select the transactions that they prefer to include. Block producers also get rewarded with the right to mint new coins, i.e., their operation is subsidized by the whole community via inflation of the total coin supply. Inflation drops geometrically over time, and transaction fees become increasingly dominant in the rewards. This mechanism, while enabling Bitcoin to run for well over a decade, has been criticized for its inefficiency. Transaction costs have also risen over time.

In this blog post, we explore a new mechanism that builds on Cardano's approach to ledger rules and system assets, and complements the Babel fees concept. The objective is making fees fair, stable, and predictable over time. We describe the mechanism in the context of Cardano. However, it can be adapted to any other cryptocurrency with similar characteristics.

Introducing 'Stablefees'

The core idea behind Stablefees is to have a base price for transactions through pegging to a basket of commodities or currencies. Stablefees includes a native "decentralized reserve" contract that issues and manages a stablecoin pegged to the basket. A comparison in the fiat world might be the International Monetary Fund’s SDR, (established in 1969) and valued based on a basket of five currencies—the U.S. dollar, the euro, the Chinese renminbi, the Japanese yen, and the British pound sterling. The stablecoin --- let’s call it "Basket Equivalent Coin" (BEC) --- is the currency used for paying transaction fees (and all other real world pricing needs of the platform, e.g., SPO costs).

In this system, ada will play a dual role: Reserve asset of the decentralized reserve, and reward currency for staking. It will also be the fall-back currency in extreme scenarios where the reserve contract is in a liquidity crunch. Before a transaction, the issuer will have to obtain BECs, either via other third parties or directly by sending ada to the decentralized reserve contract. On what basis will the reserve issue BECs? The reserve contract will also issue equity shares -we will call them decentralized equity coins (DECs)-, in exchange of ada. Leveraging the value of DECs, the decentralized reserve will often adjust the value of BEC so it is pegged on the underlying basket of commodities. In other words, DECs will absorb the fluctuations of ada vs. the basket to ensure that the real-world value of BECs remains stable (cf. the AgeUSD stablecoin design that has been already deployed and used on Ergo).

This trinity of coinage, issued natively by the system, will attract different cohorts. BECs' stability and liquidity might be attractive to risk-averse, transaction-intensive holders. DECs will offer the highest rewards if ada goes up, but also take the most significant hit when ada goes down. Long-term holders may find DECs more attractive. Also, since decentralized reserve prices these coins in ada, both BECs and DECs can facilitate participation in staking and governance. Returns can be issued at different rates, reflecting the different nature of each coin. Ultimately, rewards will always be denominated and payable in ada, which will remain the most versatile of all three coins.

Oracles

The centerpiece of this mechanism is an on-chain oracle that determines the price of the basket in ada. SPOs can implement this oracle in a decentralized manner. The reserve can offer extra rewards to all oracle contributors from the fees collected during BEC/DEC issuances. This will ensure two things: thousands of geographically-diverse contributors, and ledger rules calculating a synthesized exchange rate in some canonical way (through a weighted median across all price submissions in an epoch, for example). If oracle contributors manipulate their contributions, they can be held accountable by tracking their reputation and performance on-chain.

The pricing mechanism

How would one price transactions and reward block producers? Using the current approach in Cardano, each transaction will be deterministically mapped to a precise value denominated in BECs, using a formula determined by the ledger rules. The formula will take into account both transaction size and its computational requirements, and may also incorporate runtime metrics (such as the average system load). The resulting value will be the base fee guaranteeing that the transaction will be processed by the system. Given the base fee, end users will be able to apply a multiplier if they wish (which will be a value at least 1, e.g., 1.5x, 3x, etc.) to increase the fee and accelerate processing. This will become relevant at times of surging demand.

This approach has one advantage when compared with the first-price auction model: the pricing mechanism is continuously stabilized to a reasonable default value. Users perform price discovery in one direction only to accelerate processing, if required. Also, transaction issuers can store BECs to secure their future transaction-issuing ability without being affected by ada price volatility.

Stablefees and Babel fees

The Stablefees mechanism can be considered a natural extension of Babel fees ---spot conversion of BECs into ada by the decentralized reserve. Both mechanisms complement (and are compatible with) each other. Babel fees can be deployed together with Stablefees with just one change: Using BECs to cover Babel fee liabilities, instead of ada. This also means that fees will always be payable in ada (via a Babel fee liability convertible in ada on the spot). Hence, the whole mechanism is backwards compatible: it won’t affect occasional users who just hold ada and do not wish to obtain BECs.

A final point about diversity. While the above narrative identifies a unique and global BEC, the same mechanism can be used to issue regional BECs pegged to different baskets of commodities, which could possibly be weighted differently. Such “regional” BECs will be able to increase system inclusivity, while enabling SPOs to have more fine-grained policies in terms of transaction inclusion.

Stablefees 'lite'

The above mechanism requires a decentralized reserve contract and the issuance of BECs and DECs by the contract to buyers. A “lite” version avoids the reserve contract and directly adjusts the fee formula by pegging it onto the agreed basket of commodities through the price oracle. The resulting system denominates transaction fees nominally in BECs and immediately converts them into ada. The payable amount fluctuates, depending on the value of BEC. The mechanism is otherwise identical, also facilitating unidirectional price discovery through the multiplier. The only disadvantage is that a prospective transaction issuer has no access to a native token that enables transaction processing predictably; transaction issuers must pay fees in ada. Still, the fees will continuously adjust and remain stable via the pegging mechanism with respect to the basket. As a result, a transaction issuer will be able to organize their off-chain asset portfolio to meet their transaction needs effectively.

The road ahead

Our team is currently researching the granular details of the Stablefees mechanism. Once this research is complete, Stablefees can be integrated into Cardano to offer fair and predictable transaction pricing. Moreover, the price oracle and the global BEC (and regional variants, if included) will undoubtedly find uses beyond paying transaction fees, expanding the capabilities of decentralized applications in the Cardano ecosystem.

A close look at the software running Cardano

Learn about the ‘stack’ of components that interact to run the blockchain platform

8 June 2021 Niamh Ahern 5 mins read

A close look at the software running Cardano

Cardano has been designed in modules, with linked components that can be used in various ways. These components form the Cardano ‘platform stack’. They work together under the hood to support the construction and use of the live Cardano blockchain.

We are currently in the early testnet phase on the way to the Alonzo hard fork, which will bring full smart contract capability to Cardano. This process is highly complex, requiring the steady upgrade of the different elements which make up the Cardano platform, and their careful integration and testing. So, it is a good time to revisit these components, explain some of the terminology, and discover how they interact within the ‘platform stack’.

Elements of the Cardano platform stack

Figure 1. Components that communicate with the Cardano node

The platform stack for Cardano includes these core components:

  • Cardano node (and associated processes)
  • Cardano wallet
  • Wallet command line interface (CLI)
  • DB Sync (synchronizes blockchain data with a relational database)
  • PostgreSQL database (which interacts with GraphQL, REST API, and Smash)
  • Smash server
  • Rosetta API (blockchain communication protocol)

Note that the Daedalus wallet is not part of the core stack, but does communicate with the components (Figure 1).

The node and the networking layer

First, let's take a look at the Cardano node. This software runs on your computer and underpins the network, enabling everyone to participate in the decentralized blockchain. The node integrates the consensus, ledger, and networking sub-components, providing top-level configuration, API, CLI, logging, memory management, and monitoring capabilities that can be used by other Cardano components or by skilled users. Daedalus is a full-node wallet, so if you are running that on your local machine, you are effectively helping to run the network.

The networking layer

Next, we have the networking layer. This links each Cardano node into a distributed system that manages the blockchain and associated services. The network consists of a collection of nodes that communicate with each other to maintain the distributed ledger, support transaction submission, and interact with user wallets and other services. The core of the network is built around the decentralized nodes – the stake pools – that collectively validate blocks, and add new blocks to the chain. They are supported by dedicated relay nodes that manage network connections and establish the structure of the network as a whole. The dedicated consumer nodes that are run by the Daedalus wallet and other services connect to this network to track and submit transactions on-chain.

Cardano nodes maintain connections with their peers. A set of mini-protocols enable communication between the nodes. Each mini-protocol implements a basic information exchange requirement, such as informing peers of the latest block, sharing blocks as needed, or sharing new transactions around the Cardano network. For connection purposes, mini-protocols are determined by the version of the network protocol.

Cardano wallet backend

The Cardano wallet backend component supports the graphical user interface of the Daedalus wallet. It is used to send and receive ada. Behind the scenes, the wallet runs a full Cardano node. Unlike a light client wallet, it loads the entire shared ledger and validates all transactions, thus bolstering the security of the blockchain for everyone.

Wallet command line interface (CLI)

The wallet command line interface (CLI) supports interactions with the actual blockchain. More technically advanced users can use the CLI to work with a collection of tools for generating keys, constructing transactions, creating certificates, and performing other tasks. It is organized in a hierarchy of subcommands, and each level comes with its own built-in documentation of command syntax and options.

DB Sync

DB Sync is a component that follows the activities on the Cardano chain and stores blocks and transactions in PostgreSQL. As a ‘middleware’ component, it powers cardano-graphql. DB Sync stores blockchain data fetched from cardano-node in an intermediate database to enable higher-level interfaces for blockchain exploration. It also provides a number of queries to fetch Cardano blockchain data from the PostgreSQL, and supports services such as the Cardano Explorer, a graphical user interface that reflects the blockchain data in a straightforward way. Cardano GraphQL is a cross-platform API for the GraphQL data query language.

Rosetta API

The Rosetta application programming interface provides a high-level interface that aims to make the integration process easier, faster, and more reliable so that you can build once and integrate your blockchain everywhere. We have created a unique cardano-rosetta implementation to simplify the process of integration with Cardano. This interface is particularly useful for exchanges, since they can interact with the Cardano chain using the same interface that they use with other blockchains.

Looking forward

With smart contracts coming to Cardano soon, this means that Plutus, the native smart contract language, and other smart contract development languages like Marlowe for finance and Glow for DApps will be integrated into the Cardano stack. IO Global’s engineers will provide new and extended components to compile Plutus, Marlowe, and Glow scripts, submit them on-chain, and interact with them (Figure 2).

Figure 2. Plutus, Marlowe, Glow, Solidity, and IELE can all be used to write Cardano smart contracts

The Alonzo protocol upgrade will build on recent token upgrades and is being deployed to the mainnet via several testnets. Our Plutus partners and Plutus Pioneers will help us to test Plutus Core and will be part of the user acceptance phase before mainnet deployment. At this point we will officially add the Plutus and Marlowe components, such as both interpreters, to Cardano’s platform stack.

To keep up to date with the Alonzo rollout, please check our social channels and blog page.

Nervos partnership to build the first cross-chain bridge with Cardano

Our new collab lets Cardano and Nervos token holders transmit their value across both platforms while building interoperability across the crypto space

2 June 2021 Eric Czuleger 3 mins read

Nervos partnership to build the first cross-chain bridge with Cardano

IOHK and Nervos are teaming up to build a bridge of interoperability between Cardano and the Nervos Network. Once completed, this pioneering cross-chain bridge will enable users to transact assets between the two blockchains. The end goal is to foster greater interoperability while expanding the global reach and utility of both Nervos and Cardano.

The Nervos ‘Common Knowledge Base’ (CKB) is a permissionless, layer 1, open-source, proof-of-work blockchain protocol focused on creating the foundations for an interoperable universal public network. It allows any crypto asset to be kept in a secure, immutable, and permissionless environment with the added benefit of smart contracts and layer 2 scaling. 

Nervos is developing this robust network through three key components. Together, these make up the Universal Passport, Nervos’ approach to next generation interoperability. 

  • PW Core – enables developers to build applications on all chains
  • Nervos’ Polyjuice – an Ethereum-compatible layer that allows developers to port a smart contract from Ethereum to Nervos
  • Force Bridge – a trustless bridge that enables cross-chain transactions between Nervos and a spectrum of blockchains. Nervos will use Force Bridge to connect directly to Cardano, which means that users will be able to transact using their existing Cardano wallets.

Bridging blockchains with transportable tokens

So what does this mean in practice? Holders of Nervos CKByte (CKB) and ada will be able to transact both currencies interchangeably. Nervos users will also be able to take advantage of Cardano's native asset standard to create tokens that can be ported and used across both networks. On top of this, the bridge enables developers on both chains gain access to services and features to expand their DApp ecosystem and user bases. 

Mousebelt, a full-service blockchain accelerator, will build the bridge with financial support from Nervos. The Cardano team will contribute expertise and resources to connect Cardano to the bridge. Development work is already underway and it is expected to be completed in the next six weeks. 

'Using the Force Bridge to link the Nervos Network and Cardano is especially exciting given the relationship we have already built with IOHK,' said Kevin Wang, co-founder of Nervos. 'We have been growing our research and development partnership, but we will soon have a tangible bridge that will also showcase the power of the Force Bridge and push us further along the road to a functional and interoperable network.'

This bridge is just part of our collaboration with Nervos. 'We share a vision of a world that works on a ‘constellation’ of interoperating blockchains,' says Romain Pellerin, CTO at Input Output. 'We believe that academic research is also fundamental to advancing the entire crypto space. Together we will also be co-authoring academic papers to pioneer improvements to the UTXO model, explore universal accounting standards, and contribute to the future development of decentralized technology through open-source research.'

Blockchain technology will only achieve mainstream acceptance when end users are not locked into one blockchain or standard, but can seamlessly access value and utility, regardless of which blockchain they are using. 'Bridges like this are an absolute necessity in order to ensure that users have a seamless experience,' continued Pellerin. ‘By connecting our communities and finding innovative new ways to work together, as we have been doing with Nervos, we can ensure that blockchain lives up to its promises of creating a fairer and more efficient global financial operating system.'

Check out the Nervos website for more information on upcoming partnerships and research initiatives.