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

  • Tether CEO posts job openings, sparking speculation that a mobile encrypted wallet is on the horizon.

    Tether CEO Paolo Ardoino posted on the X platform stating that Tether has started recruiting a senior software engineer who will be responsible for Tether's mobile crypto wallet-related products, which will be supported by artificial intelligence, Wallet Development Kit (WDK), and QVAC technology. Later, Paolo Ardoino also posted a suspected wallet product screenshot in another tweet, which shows "Own your Money".

  • Bloomberg analysts: Among the top 25 US equity ETFs with the highest annual inflows, BlackRock IBIT is the only ETF with negative returns.

    Eric Balchunas, a senior ETF analyst at Bloomberg, posted the annual top 25 U.S. stock ETFs by fund inflows on the X platform. Among them, BlackRock's Bitcoin exchange-traded fund IBIT is the only ETF with a negative return, with an annual return rate of -9.59%. It is worth noting that despite the negative return, IBIT's annual fund inflow still ranks sixth, even surpassing the GLD ETF with a 64% return. In the long run, this is a very good sign, as it received over $25 billion in fund inflows during the bear market phase, indicating greater potential once the market turns bullish.

  • Hassett's chances of becoming the next Federal Reserve Chairman have once again surged significantly.

    Golden Finance reports that the increased, rising to 54% on Polymarket and 51% on Kalshi, with the probabilities of Walsh and Waller being nominated by Trump ranking second and third respectively.

  • China Merchants Bank: The yen carry trade may undergo a sustained reversal, exerting long-term downward pressure on global asset liquidity.

    China Merchants Bank released a research report stating that on December 19, the Bank of Japan raised interest rates by 25 basis points, raising the policy rate to 0.75%. Although the Bank of Japan is highly likely to remain very cautious in its pace of rate hikes, the reversal of yen liquidity and the Japanese bond market will continue to suppress global financial conditions.

  • A new address withdrew $2.5 million worth of LINK from Binance.

    according to on-chain analyst Ai Yi's monitoring, the new address "0xf44…b1CC43" withdrew 199,517 LINK from Binance hours ago, worth 2.5 million USD.

  • ETH breaks $3,000

     the market shows ETH breaking through $3000, currently at $3002.51, with a 24-hour increase of 2.19%. The market is highly volatile, please manage your risk accordingly.

  • BTC breaks through $89,000

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

  • BTC breaks through $88,500

     the market shows BTC breaking through $88,500, currently at $88,549.08, with a 24-hour increase of 0.69%. The market is highly volatile, please manage your risks accordingly.

  • Nasdaq-listed Mangoceuticals plans to launch a $100 million SOL digital asset treasury.

     Nasdaq-listed company Mangoceuticals announced it will cooperate with Cube Group to establish a subsidiary, Mango DAT, to advance the strategy of building a $100 million SOL digital asset treasury (DAT). The related funds will be raised through an ATM financing plan and the sale of common stock. It is reported that the company has also submitted a "MULTI-DAT" trademark application to the United States Patent and Trademark Office to promote a series of strategic digital asset and DeFi plans.

  • BTC breaks through $88,000

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