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

  • US Spot Ethereum ETF Sees $5.6 Million Net Outflow

    On May 15, according to monitoring data from Farside Investors, the US spot Ethereum ETF experienced a net outflow of $5.6 million yesterday.

  • Xi Jinping Holds Restricted Meeting with Trump in Zhongnanhai

    May 15 — Chinese President Xi Jinping held a restricted meeting with US President Donald Trump at Zhongnanhai. (CCTV News)

  • US Spot Bitcoin ETF Sees Net Inflow of $131.32 Million Yesterday

    On May 15, according to monitoring by Trader T, the US spot Bitcoin ETF experienced a net inflow of $131.32 million yesterday.

  • Kechuang 50 Index Declines by 2%

    On May 15, the Kechuang 50 Index experienced a decline of 2.36% during the day. Among the constituent stocks, JinkoSolar fell by 7.60%, Tianyue Advanced dropped by 7.11%, Canadian Solar decreased by 5.54%, and Zhongke Feiyun fell by 5.64%. (Dongxin News Agency)

  • Nikkei 225 Index Falls Below 62,000 Points for the First Time Since May 7

    On May 15, the Nikkei 225 index fell below 62,000 points during trading hours, marking the first time it has done so since May 7. (Tokyo News Agency)

  • U.S. 30-Year Treasury Yield Rises to 5.056%, Reaching 10-Month High

    On May 15, the yield on U.S. 30-year Treasury bonds rose to 5.056%, marking a 10-month high, while the yield on 10-year Treasury bonds reached 4.512%. (Dongxin News Agency)

  • Japan's 10-Year Government Bond Yield Reaches Highest Level in Nearly 29 Years

    On May 15, according to CCTV, the yield on newly issued 10-year government bonds, which serves as a long-term interest rate indicator in Japan's domestic bond market, rose to 2.665%, reaching its highest level in nearly 29 years. This increase is attributed to inflationary pressures from rising oil prices and market concerns about the deterioration of fiscal policy due to Japan's domestic economic measures, leading to selling pressure on bonds. (Dongxin News Agency)

  • ETH Surpasses $2300

    Market data shows that ETH has surpassed $2300, currently priced at $2300.06, with a 24-hour increase of 1.42%. The market is experiencing significant volatility, so please ensure proper risk management.

  • ETH Surpasses $2300

    Market data shows that ETH has surpassed $2300, currently priced at $2300.02, with a 24-hour increase of 1.97%. The market is highly volatile, so please ensure proper risk management.

  • Trump's Securities Trading Records Exposed, Invests in Nvidia and Apple

    On May 15, the U.S. Office of Government Ethics released two new financial disclosure documents on Thursday, revealing that Trump disclosed large-scale financial transactions worth at least $220 million earlier this year, involving securities from several major U.S. companies. The newly disclosed documents cover the first three months of 2026, with transaction values ranging broadly from $220 million to approximately $750 million. Significant purchases valued between $1 million and $5 million include S&P 500 index funds, Nvidia, and Apple. Large sales valued between $5 million and $25 million include Microsoft, Amazon, and Meta. The documents do not consistently specify the exact types of securities involved, such as whether they are stocks or corporate bonds, nor do they indicate which accounts the transactions occurred in or who authorized the trades. Such disclosure documents are mandatory but only partially reflect officials' financial activities, as they only list transactions exceeding $1,000 and present them in broad value ranges without disclosing specific transaction prices, profit situations, or whether assets were directly purchased or held through managed accounts. Trump's assets are held in a trust controlled by his children, and some transactions in the new documents indicate the involvement of brokers as agents. (NBC)