Announcing ethers.js — a web3 alternative

Oct 24, 2017 · 3 min read

L4 Ventures and Richard Moore are proud to announce the most recent version of ethers.js, a feature-complete library for ethereum applications. Ethers.js has every feature available in web3 (and more!), has been in active development for +2 years, includes extensive test-cases, and is entirely MIT licensed.

In short, ethers.js is an alternative to web3, the most commonly used library for ethereum applications. We are committed to ensuring the continued development of this library and its related suite of open-source development tools, and will be hosting each stable release of these code-bases on our L4 github account.

What makes ethers.js great:

  1. ENS names are first-class citizens

In ethers.js, you can use an ENS name in place of a contract address — a feature not currently available in web3.

This can be useful in many situations. For instance, a developer writing an application that needs to call the ENS resolver can simply use “resolver.eth” rather than enter the actual contract address (“0x5FfC014343cd971B7eb70732021E26C35B744cc4”). If the actual contract address of the resolver were ever updated, an application whose code reads “resolver.eth” would not need to be updated, as the owner of that ENS name would redirect it (assuming you trust them!). An application using raw contract addresses would have to update that address.

2. It’s tiny.

Ethers.js is only 77kb compressed.

3. Separation of concerns — key management and state

One major difference between ethers.js and web3 is how they handle key management and interaction with the ethereum blockchain. Web3 assumes that there is a local node connected to the application. That node is assumed to store keys, sign transactions, and interact with and read the ethereum blockchain. In reality, this is not often the case — most users are not running geth locally. Metamask effectively emulates that environment through a browser application, and so most web3 apps require Metamask to hold keys, sign transactions, and interact with the ethereum mainnet.

Ethers.js takes a different approach that we believe gives developers more flexibility. Ethers.js separates the “node” into two separate roles:

  • A “wallet” that holds keys and signs transaction, and
  • A “provider” that serves as an anonymous connection to the ethereum network, checking state and sending transactions

This allows developers to manage these two roles discretely — perhaps using Infura as the provider, and a hardware device for the wallet.

4. Extensive documentation

Really, there’s a lot.

5. A large number of test cases (9,513 and counting)

Richard has written an extraordinary number of test cases for ethers.js. Ethers.js passes all of them. Ethers.js uses Travis-ci, meaning that every time new code is added to the repo, all tests are automatically and publicly run.

6. Ethers.js is entirely MIT licensed, including all dependencies

We want developers to use ethers.js to build products and to adapt it to their own ends. That’s why it was released under the most permissive open-source license available. Under the MIT license, you are free to do pretty much anything you want with ethers.js, so long as you include the copyright notice.

Why make an alternative to web3?

It’s been more than two years since Ethereum launched, and we’ve come a long way in our understanding of the protocol, availability of development tools, and diversity of client software.

Web3 is an awesome library that has facilitated an entire generation of ethereum applications so far. But we believe open-source ecosystems are strongest when there are a variety of different tools available to developers which offer different features, make different trade-offs and even, to some extent, compete with one another.

We’re proud to offer ethers.js to the ethereum community under the MIT license, and hope that it’s useful to developers building the next generation of decentralized applications.

In the coming weeks, we’ll also be releasing a suite of command line tools built around ethers.js — more announcements to come!

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store