What is Composability?

Composability is a software development concept describing the ability to combine components to create products and systems. Like legos stacked on top of each other to create new things from existing building blocks, software elements stack on top of each other to create new applications and uses.

Composability allows developers to use existing building blocks to create entirely new applications without having to start over every time. Like scientists build on top of each other’s work without needing to go back to basics for every study, developers use each other’s work to build new products.

“In Ethereum, every smart contract is a Lego of sorts—you can use smart contracts from other projects as building blocks for your project. This means you don't have to spend time reinventing the wheel or building from scratch.”

Smart contract composability published on ethereum.org

In this guide we'll dive into:

- Why is composability important?
- Brief history of composability on the web
- Elements that define a composable system
- Subsets of composability

Why is composability important?

Composability is important because it makes development faster, allowing engineers to focus on solving new problems rather than repeat work on old ones.

Speed of development

You can develop much faster and build new products quickly when you don’t need to start over many times. Teams can reuse each other’s code rather than having to start from scratch, so software lifecycles are significantly faster.

Solve new problems, not old ones

With private, non-composable code, developers often solve the same problems over and over again—stalling innovation and speed. With open-source, composable code, developers are free to solve new problems rather than rework old ones that have already been solved.

“Open source means every problem only needs to be solved once.”

Naval, Twitter.

Enable integrations

Integrations are easier to plug in when applications are composable with each other. The ability to integrate with other tools is often called interoperability. This creates a smooth user experience because plugging into different tools is much simpler when applications are composable.

“Like an orchestra, Web3 benefits from having disparate but composable elements combine to create new results.”

Why Composability Matters for Web3 by Emmanuel Awosika

Brief history of composability on the web

The internet is typically broken up into three stages:

  • Web1: the Read phase. This is when webpages were static and couldn’t be interacted with.
  • Web2: the Write phase. This is the web we know of today, where users can interact with websites, build vast social media networks, and have a curated experience on the web.
  • Web3: the Own phase. Web3, the era of blockchains, allows ownership of digital objects, whether they’re fungible tokens like Bitcoin, NFTs, or something else!

Web1: open-source and composable

The web1 internet was fueled by a grassroots, distributed movement with open-source at the core. Everything was public, open-source, and composable (as much as it could be in the days of the early internet).

Web2: mostly closed-source and not composable

The web2 internet saw large companies come in and lock things down. Closed-source code, closed APIs, and Intellectual Property all become common in the web2 era. Not everything became closed-source, but closed-source and non composable software became some of the moats web2 companies used as distinguishing factors to make money and beat competitors.

Web3: open-source and composable

The web3 internet has returned to values of open-source and composability. “Forking,” when a project uses code from another project and turns it into their own, is common in web3. And, because everything on the blockchain is transparent, code is open by default.

Elements that define a composable system

There are three key elements to define a composable system:

Modularity: Each piece does one thing well. You don’t bundle multiple actions into one software component: you break them down into modules.

Autonomy: Elements don’t depend on each other to function. Everything is self-contained, so if you take one thing out of the system the entire system doesn’t break.

Discoverability: The elements are published somewhere that others can easily find, like a Github repo or other website.

Subsets of composability

Let’s dive into three subsets of composability:

  • Syntactic composability
  • Atomic composability
  • Morphological composability

Syntactic Composability: all software elements are accessible

Syntactic composability is when all software elements can be forked, remixed, and used by everyone with an internet connection.

On Ethereum, every smart contract on the protocol is public and can be called by any other, which means that new problems only have to be worked out once before the software is available for reuse by the entire ecosystem.

Any Ethereum dApp can use Uniswap's contracts to manage token exchanges and any organization can use Aragon smart contracts for on-chain governance.

Reusing open-source components is the superpower that makes building in web3 extremely efficient. Teams can use huge amounts of existing, reliable code and focus only on building the components that are missing from their project.

This exponentially increases the rate of experimentation and innovation. Not having to reinvent the wheel (or worry about being sued by regulators and patent trolls) every time you build a business makes web3 magnitudes more efficient at allocating resources than web2.

Atomic Composability

Atomic Composability: multiple elements packaged as one

Atomic composability is when several operations or software elements can be bundled together into one.

For example, in DeFi transactions, several operations across multiple dApps can be bundled into a single transaction and executed together. If one of the operations fails, then the entire transaction will fail.

This makes it possible to split a transaction across multiple exchanges, or vote on several DAO proposals at once without the risk of a partial failure.

Atomic composability is vital to decentralized finance (DeFi) because it allows for innovations like flash loans where an asset is borrowed, invested, and paid back within a single transaction.

Web3 Composability: Vote on Snapshot → Zodiac Reality → Borrow $DAI @ MakerDAO → Pool $DAI @ Curve → Deposit Curve LP tokens @ Convex → Earn trading fees + $CRV + $CRX

Morphological Composability: speaking the same language

Morphological composability is when you use the same standard, such as the ERC20 token standard, to port elements into other contracts. It’s when contracts speak the same language. This type of composability enables a token to travel to tons of different apps, whether it’s from a DAO treasury to a DeFi app, or from one web3 game to another.

DAOs and DeFi

A sequence like this is made possible by morphological composability, or all contracts respecting the same token standard:

DAO token holders to vote on Snapshot and use Zodiac Reality to trigger a transaction from the DAO's treasury to take a $DAI loan from MakerDAO, pool the $DAI on Curve, then deposit the resulting LP tokens into Convex to earn trading fees plus $CRV and $CVX tokens.

NFT gaming

The same morphological composability concept can be applied to NFTs in web3 games, in which the same NFT can be ported to other games.

Think of games like Axie Infinity or Guild of Guardians using NFTs, or unique digital property, standardized in ERC721. Because they are actually owned by users, they can be transferred freely between different games, sold on secondary markets, or even used as collateral for loans.

To achieve the equivalent in web2 would mean somehow convincing Nintendo to share a database with Sony and Microsoft or, back in the finance world, for eTrade to execute transactions on Robinhood. The likelihood of this happening is basically zero: even if web2 companies weren't all in competition with each other, they are built on incompatible tech stacks that would prevent them from reusing each others' software.

Identity

Another element of morphological composability is identity. Web3 also allows users to port their identity and reputation between dApps. You can sign in with your wallet and port your web3 identity to that new application rather than starting over every time. Your wallet acts as a unique identifier and reputation metric.

On-chain identity is a space that’s still being explored. Morphological identity in web3 gives you the ability to hold your own data, and your own identity, in a wallet without relying on centralized groups like governments or corporations.

What are the drawbacks of composability?

Value capture

When all code is open-source and readily accessible by everyone, you’ll need to come up with unique ways to make profit. Your code’s unique functions can no longer be the moat that distinguishes your product from another one. Finding new moats, like DAO community, can be a way to distinguish your project.

Scaling

Composability works in theory, but in the multichain world we live in today, composability is much harder to execute. As scaling occurs—via layer two blockchains, alternative layer ones, and sharding—atomic and morphological composability gets much more difficult. Just try bridging assets to another chain and seeing the “wrapped” version that comes out the other end. To dive into scaling, read our article on how blockchains scale.

Security

Composability between chains and layers can become a serious security risk, because when bridging assets, you’re just locking those assets in a smart contract. Those smart contracts have become huge attack vectors. This also creates fragmented liquidity across chains and applications, which can again be an attack surface or at least an inconvenience for token swaps.

DAO Tooling

How the new Aragon protocol is composable

The new Aragon protocol is composable because:

  • Syntactic composability: any developer can tap into our existing smart contracts and use, fork, or remix any part of the contracts that they find useful for their project.
  • Atomic composability: Through plugins and other types of integrations like our smart contract composer, the new Aragon stack serves as a homebase gluing the ecosystem together. We are building a lean base layer to enable any type of additional logic to extend the framework’s powers.
  • Morphological composability: In our DAO creation, we are following the metadata standards set by the DAO Star team as well as integrating ERC-20s and other token standards into our framework so Aragon DAOs can easily be integrated into any ecosystem player.

Composability shaped the internet

Without the advances in composability, the internet would not have become what it is today! Composability allows the building blocks of every application you interact with to be built in an open-source, modular way.

Next time you plug one tool into another, think about how composability made that possible!

--

Aragon is building the future of decentralized governance for Web3 communities & organizations. See the latest at aragon.org, subscribe to our monthly newsletter, join the conversation on Discord, or follow us on Twitter.

Docs | YouTube | Telegram | Github | Reddit | Linkedin | Forum