Skip to content

ethers.js vs viem in 2026: what changes when choosing or migrating

Versions, dependencies and a migration case: ethers throws on a reverted transaction, while viem returns the receipt without throwing.

IIsaac González7 min
Share

Larger ethers.js and viem logos on a dark background with a subtle violet gradient
viem fits with wagmi and Hardhat 3; migrating from ethers first requires reviewing how each library handles a reverted transaction.
Sources
  1. ethers.js v6.17.0 release (GitHub)
  2. ethers.js v6 source: TransactionResponse.wait (provider.ts)
  3. ethers.js v6 documentation
  4. viem 2.57.17 release (GitHub)
  5. viem source: waitForTransactionReceipt
  6. viem source: transaction receipt formatter
  7. viem: TypeScript
  8. viem: writeContract
  9. wagmi 3.7.11 on npm
  10. @nomicfoundation/hardhat-toolbox-viem 5.0.7 on npm

Frequently asked questions

Yes. They are independent packages and can coexist during a gradual migration, for example with viem in the frontend through wagmi and ethers in backend scripts that already work. The cost is maintaining two representations of transactions, receipts and errors. To keep error handling consistent, each flow should use a single library from start to finish.

Got a blockchain project in mind?

From idea to product, strategy and technology must move forward together.

Tell us your idea

As featured in

CointelegraphInvesting.comEl EspañolEmprendedoresEl ObservadorCriptoNoticias