Cointime

Download App
iOS & Android

Open sourcing op-viem and op-wagmi

TLDR: Today, we’re open sourcing op-viem and op-wagmi, extensions to the popular developer tools viem and wagmi. We’ve developed these libraries, in collaboration with the community, to empower developers to build faster and easier on OP Stack chains.

Building for OP chains with op-viem and op-wagmi

Base aims to bring the next million builders and billion users onchain, giving builders an easy-to-use, fast, and cheap development platform.

While L2s like Base offer developers cost and speed advantages, they can have their own development challenges. As we started to build on the OP Stack ourselves, we found gaps in tooling that weren't addressed by existing Ethereum development frameworks. That’s why we decided to extend popular Ethereum libraries for developers building on the OP Stack, and are open sourcing them so that anyone can review the codebase and contribute.

Why?

Today, developers building on Ethereum can use a number of libraries to simplify development, including the popular tools viem and wagmi. Viem is a low-level library compatible with any JavaScript code, abstracting the complexity of sending transactions on Ethereum. Wagmi, built on Viem, lets developers build an application’s frontend using modern React idioms.

Although viem and wagmi work out-of-the-box on the OP Stack, they don’t easily support features specific to L2s, such as bridging and cross-layer messaging. Developers looking to build these features into their applications still need to write custom code, making the process more complex and error-prone. For example, if a developer called the bridge contract code incorrectly, user assets could be lost.

With op-viem and op-wagmi, developers can add OP Stack bridging functionality into any application with dramatically less code and time spent. For example, creating a withdrawal proof can now be done via the code below, which replaces a 100+ line implementation of a React hook that would be needed without these libraries.

The full-featured React hooks in op-wagmi streamline adding cross-chain functionality to React-based dapps. For JavaScript developers using frontend frameworks other than React, op-viem provides all the building blocks needed to adopt the same functionality to their framework of choice.

Growing the onchain ecosystem, one bridge at a time

L2s enable users to use apps quickly and cheaply. But when users start onchain, they often don't have assets on an L2 right away.

As more and more users get onchain and transact on L2s, developers will need to offer their users a secure and intuitive way to bridge as a critical first step.

With op-viem and op-wagmi, you can build bridging functionality inside your apps with minimal custom code. Op-viem also provides lower-level utilities that can help with things like getting L2 hashes for deposit transactionsgetting outputs on L1 for L2 blocks, and more.

Public goods

Base is committed to building in the open, and in the spirit of empowering the entire ecosystem, we built op-viem and op-wagmi as open-source libraries. Our goal is to not only benefit builders on Base, but everyone who is building on the OP Stack and contributing towards the Superchain vision.

You can check out the code for op-viem and op-wagmi, and contribute any feedback that you might have. We're excited to hear from you and to see what you build!

Spotted a cool project built on Base? Don’t forget to nominate them for a Base Grant!

Comments

All Comments

Recommended for you

  • UBS Group increased its stake in Strategy by 3.23 million shares, bringing its total holdings to 5.76 million shares.

     according to CoinDesk, that Switzerland's largest bank UBS Group increased its holdings by 3.23 million shares in the Bitcoin reserve company Strategy, bringing its total holdings in Strategy to 5.76 million shares (valued at $805 million).

  • Wintermute: This bear market may end faster than previous ones, and the market will most likely recover in the second half of the year.

    Wintermute posted on X stating that it is clear we are already in a bear market, and in fact, it has lasted for some time—especially judging by the performance of altcoins, the extreme concentration of rebounds, and market sentiment on X. However, what makes this bear market different is that it was not triggered by structural collapses like FTX, Luna, or 3AC, but rather driven by macroeconomic conditions and cyclical trend changes, representing a relatively natural deleveraging process, with the core driving forces being changes in positions, risk appetite, and market narratives.

  • BTC breaks through $79,000

    the market shows BTC breaking through $79,000, currently at $79,014.62, with a 24-hour increase of 3.04%. The market is highly volatile, please manage your risk accordingly.

  • The US spot Bitcoin ETF saw a net inflow of $562.62 million yesterday.

    according to Trader T monitoring, the US spot Bitcoin ETF had a net inflow of $562.62 million yesterday.

  • ETH falls below $2,300

     the market shows that ETH has fallen below $2300, currently at $2299.76, with a 24-hour increase of 1.65%. The market is highly volatile, please manage your risks accordingly.

  • BTC breaks through $79,000

    market shows BTC breaking through $79,000, currently at $79,010, with a 24-hour increase of 2.66%. The market is highly volatile, please manage your risk accordingly.

  • The Chicago Board Options Exchange plans to relaunch binary options in order to enter the prediction market.

    Chicago Board Options Exchange (Cboe) is in early discussions with retail brokers and market makers to relaunch binary options contracts, aiming to compete in the rapidly growing prediction markets. Kalshi and Polymarket reached a trading volume of $17 billion in January, setting a monthly record high. Cboe had launched the product in 2008 but subsequently withdrew it, and is now seeking to reposition the product as a starting point for retail investors entering the options market through compliant design. The plan will be regulated by the SEC or CFTC.

  • BTC falls below $75,000

     the market shows BTC falling below 75,000 USD, currently at 74,991 USD, a 24-hour decline of 4.9%, with significant market fluctuations, please manage your risk accordingly.

  • BTC falls below $75,000

     the market shows BTC falling below $75,000, currently at $74,968.02, a 24-hour decline of 4.83%. The market is highly volatile, please manage your risk accordingly.

  • BTC falls below $77,000

    the market shows BTC falling below $77,000, currently at $76,980.12, a 24-hour decline of 2.28%. The market is highly volatile, please manage your risk accordingly.