Stake with Nodeist

Navigating the Multi-Chain Developer Experience

    Öne çıkan konu
657213479341c3ee215cdf58_Difficulties%20with%20the%20Multi-Chain%20Developer%20Experience.jpg

In this blog post we will explore some of the key challenges developers face when building multi-chain applications, primarily stemming from fragmentation and lack of native, standardized solutions.

tl;dr
1. Multi-chain dApps are inherently hard to build with
2. Existing solutions are primarily one-size-fits-all and many are tailored toward Ethereum/ Eth L2s.
3. Native multi-chain development is possible with LavaSDK.

Building in a multi-chain world


Developers in Web3 who build multi-chain face an unequivocal terror: the tyranny of choice.

Unless you're using a one-size fits all solution in the development of your application, you've likely tried to build a multi-chain app that incorporated several different libraries and plugins. It's a messy affair and the one-size-fits-all solutions are pretty elegant. Unfortunately, most of these solutions are locked into a specific chain architecture (whether Ethereum-bound or particular to another chain).

The irony of the times is that interoperability, cross-chain communication, and transcendental web3 are the future, yet the dev tools for making apps that natively perform these functions are limited or experimental.

A great example of a one-size-fits-all working with Ethereum is Metamask:

Code:
import { MetaMaskSDK } from '@metamask/sdk';
const MMSDK = new MetaMaskSDK(options);

const ethereum = MMSDK.getProvider(); // You can also access via window.ethereum
ethereum.request({ method: 'eth_requestAccounts', params: [] });

Expanding beyond Ethereum is tough


Many developers who thrive in Ethereum can attest to the utility of such simple interfaces - and the extensibility of being able to continuously develop applications with plug-n-play components (📣 Metamask has even developed a React-UI integration so frontend development is even easier!). The convenience of these types of libraries and SDKs is undeniable… With only a few lines, you can assemble a working app which successfully interacts meaningfully with the blockchain.

But what if you want to live beyond the bounds Ethereum? In most cases, building a multi-chain dApp that has different chain architectures at play is exhausting. The developer experience in web3 involves roping together these different one-size-fits-all solutions to make a unique solution tailor made to the use-case you're attempting to serve. In other words, much of web3 developer experience involves inventing and reinventing the wheel:
6571e3d138a1ac998b80ddf6_Untitled%20(36).png

He's not wrong…

No unified standard for web3


Let's imagine you want to build a simple cross-chain application for checking balances. You can, of course, as highlighted above, use Metamask for Ethereum, which is standard fare for developers. Unfortunately, other chains, especially those which are Cosmos-based, will not play nice with Ethereum libraries & tools. It is likely that you will need multiple libraries. Each library has its own set of APIs, documentation, and quirks, which means additional development overhead, technical debt, and time away from your favorite Discord channel.

In the end, developers will need some sort of library/framework/common standard which is native to all of web3, but also chain-agnostic, cross-platform, and interoperable. Web3.js , Ethers.js, and other libraries are impressive in their flexibility, but do not and can not presently meet the aforementioned qualifications.

Native multi-chain RPC & indexing with Lava SDK


Enter LavaSDK!

Code:
const { LavaSDK } = require('@lavanet/lava-sdk')

async function initializeWeb3() {
    const web3Handler = await LavaSDK.create({
        badge: {
            badgeServerAddress: "https://badges.lavanet.xyz",
            projectId: "f7c19450ae62f68022713016a4c4ddb6"
          },
        chainIds: ["AXELAR", "AXELART","ETH1","COSHUB","STARKNET","CELO"]
    });
    return web3Handler
}

(async () => {
    initializeWeb3()
})()

Lava SDK solves this issue with surety:​
  1. 🌐🔗 Multi-Chain - Natively multichain with support for 25+ chains and counting. Switching between chains incurs no additional development cost and multiple chains can be initialized and called upon at the same time.
    ‍​
  2. 🔄🔗Chain Agnostic - Supported chains span various ecosystems, FVM, EVM, COSMOSDK, COSMWASM, NEAR, etc. are all supported. RPC relays can be conducted with a single sendRelay function independent of the target chain or API.
    ‍​
  3. 🔄📡Protocol Agnostic - Access to archival and debug nodes on JSONRPC, fully supported method sets on Tendermint, and nominally rarer protocols like gRPC and Websockets are also fully supported.
    ‍​
  4. 🧩🔗Extensible & Modular - Changes to the network are introduced incrementally through Specification files (a.k.a. "Specs" for short). Specs allow for Web3 APIs, rich APIs, indexing functions all accessible directly from LavaSDK's sendRelay. Anyone can implement support for a new chain/API. Learn more here
  5. 🚫🕵️No MITM - Connections between dApps and Providers is completely peer-to-peer (P2P) with no Man-in-the-Middle. Requests are routed through a decentralized, fault-tolerant network of top-performing providers based upon geolocation, latency, and uptime.
    ‍​
  6. 🛠️🔌Integrations - Popular libraries such as Viem/Web3.js/Ethers.js/CosmJS are supported. You don't need to rebuild your app on LavaSDK to use LavaSDK! See examples on our docs.​

The SDK is live now


👉🏿 If you've heard enough and want to give it a try - Getting started with LavaSDK is relatively easy- follow our Getting Started Guide.
Nevertheless, the problems of Web3 Developer Experience are daunting to even seasoned developers; in a multi-chain world, there's absolutely no shame in looking for better DX than is conventionally available. Collectively, with more tools which transcend the bounds of siloed ecosystems, we can hope for a more interconnected, more interoperable, and more sensibly Web3 world.

🗒️ On another note, Lava Phase 2 brings even more improvements including to our continously improving SDK Beta! Feedback is welcome. Check us out now.

About Lava


Lava is the first modular data access layer for blockchains. It introduces "specs": a primitive that lets contributors permissionlessly add support for new chains and data services to the base protocol. RPC is the first service supported by the protocol.

Developers get fast, reliable and accurate service, with each provider competing to offer the best service across 30+ chains including Ethereum and StarkNet. The protocol always pairs developers with the best available node and developers benefit from Lava's innovative SDK, offering low latency, peer-to-peer RPC from the browser.

By leveraging modular architecture and a peer-to-peer network of node operators, Lava creates a unified and performant platform for accessing the multi-chain world.​
 
Up