As decentralized application (dApps) developers gain more experience working with blockchains, some are running into limitations created by the parameters of blockchain architecture. Ethereum, for instance, allows for applications to be created via smart contracts, but does not allow for automatic execution of code. It also maintains fairly strict control over the way consensus and networking functions are exposed to those applications. To overcome these limitations, some developers are turning to application-specific blockchains — purpose-built and tuned for their specific application needs, and colloquially called “appchains.”
One of the more popular options for building appchains is the Cosmos SDK, due to built-in composability, interconnected blockchains, and the ability for developers to maintain sovereignty over their blockchain. We’ve covered Cosmos in the past, including a developer academy for learning to build in the Cosmos Network and the addition of Interchain Security, which allows multiple Cosmos blockchains to align around common security protocols while maintaining sovereignty.
Cosmos SDK and Application Modularity
In an interview with The New Stack, Sunny Aggarwal, co-founder of Osmosis, said, “The Cosmos SDK makes it easy to build your custom blockchain and modify the core code. We can change very core pieces of the blockchain to create new features or create new user experiences that other DEXs don’t have; for example, most blockchains require you to use a native token for fees, which always felt like really bad UX. So what we did with our chain, to get mass adoption, we realized we needed to allow users to pay transaction fees with any token they want.”
This notion of creating flexibility of payment might sound as simple as allowing users to pay with both Euros and U.S. dollars, but it’s far more complicated with blockchain implementations like Ethereum, where the blockchain has no direct knowledge of other chains. Because the Cosmos ecosystem is designed for Cosmos blockchains to be aware of each other, it becomes easier to customize features like payment, while also maintaining awareness of other Cosmos-compatible blockchains.
One advantage Cosmos has for building appchains is the modular nature of the Cosmos SDK. Aggarwal said, “There’s a set of core modules that all Cosmos-based blockchains reuse, though people do modify them. For instance, we modified the staking module, but we try to keep it in line with the upstream module.” The real power of the modular approach is being able to adopt modules written by other developers to expand beyond the core SDK. “Developers write additional modules and other appchains may copy those modules and fork them into a repro,” Aggarwal said. “For instance, we’ve written on-chain timer modules that allow for self-executing code and a number of chains have forked that module.”
CosmWasm: the Cosmos Way of Using WebAssembly
One of the key strengths of Cosmos blockchains is the smart contracting module CosmWasm, which allows developers to write cross-chain smart contracts. It is primarily adapted for your specific applications using Rust and is further customizable in combination with the Cosmos SDK. “CosmWasm is the Cosmos smart contracting system that is built as a module of the SDK,” Aggarwal said. “It’s become a kind of secondary standard for how to build stuff in Cosmos. More of the development of application code is going to move into CosmWasm and treat the Cosmos SDK almost the way you would kernel code that you only modify when there’s no other option.”
CosmWasm is also seeing interest from parties looking to adapt it for other blockchains, because of its flexibility. Composable has already implemented CosmWasm into the Substrate and DotSama blockchains, which allows them to do cross-chain smart contracting in combination with the Composable Cross-chain Virtual Machine.
Economics of Decentralized Application Development
According to Aggarwal, one particular argument in favor of appchains is the elimination of maximal extractable value (MEV) leakage. In blockchains generally, there’s a strong incentive to identify the most valuable transactions and submit them ahead of other transactions at a higher price, in part because that’s how consensus solutions are compensated. “More app developers are going to realize that having your own appchain makes sense,” Aggarwal said. “The value of layer 1 blockchains is the MEV you can capture. App developers are going to start questioning why they are leaking value to the L1, when instead they can capture that value in their own chain and distribute it as revenue to token holders.”
In July, HOPR highlighted some potential risks around the upcoming Ethereum merge and how it may create new incentives for attacking validator vulnerabilities (see the Twitter thread below). Running your own blockchain removes this type of issue from the underlying infrastructure your application relies on.
ETH2 validators have a major attack vulnerability that is worse than what is currently known
And with the Merge coming closer, this problem should be talked about – but it needs some background:
A thread ?
— HOPR ? (@hoprnet) July 11, 2022
Another way to look at the economic aspects of running your own blockchain is the potential to create cost efficiencies, in much the same way that traditional application models evaluate developing features in house instead of paying for API calls to third parties. An application-specific blockchain also eliminates competition for resources away from everyone else using the chain, which means all transactions on the chain are directly associated with the activity of the applications users. In theory, this translates to better application performance, which in turn translates to a better user experience.
Longer term we may see a greater commoditization of blockchains themselves, with greater focus on applications and how those applications support users’ needs. Aggarwal put it this way: “My thesis is that L1s get commoditized over time and what has value is the apps, because the apps are what have relationships with users. If you look at the early internet, the way to bet on the rise of the Internet wasn’t to bet on the rise of AOL and Compuserve, it was to bet on Amazon and Google, which were the early apps of the Internet. Ethereum apps are slowly going to start to realize that.”
Feature image via Shutterstock.