The Future of Web3.js

The Future of Web3.js

Authored by Phil Ngo

A Fall 2021 update from the lead maintainers of one of Ethereum's most used libraries

Web3.js could be considered one of Et[[here](https://github.com/ChainSafe/web3.js)](https://medium.com/chainsafe-systems/chainsafe-receives-grant-from-ef-for-web3js-9e4376f5f36a)um's most recognizable Javascript tools and libraries. It is a collection of modules that allow you to interact with a local or remote Ethereum node using HTTP, IPC, or WebSocket. The Ethereum Foundation awarded ChainSafe a grant in Fall 2020 to maintain and modernize Web3.js, which begins with continuing to support v1.x while rewriting the library in modern TypeScript under v4.x. You can read about our announcement of the grant here, check the Github repo here, and read the docs here.

🚨 Please fill out the Web3.js Developer Survey to help improve Web3js. More details below. 🚨

Web3.js is one of the most used libraries in the Ethereum Javascript ecosystem. With over 200,000 downloads per week, there is no doubt that we have a huge responsibility as the lead maintainer of Web3.js. Since its launch in 2015, this library has always been a vital tool allowing cohorts of developers to easily build value on top of the Ethereum ecosystem.

We strive to live up to its original purpose, but it is clear that more work needs to be done to modernize this library for Ethereum in 2021. We are committed to rewriting the Web3.js library in TypeScript and fixing outstanding frustrations identified by the community such as package build size, breaking minor upgrades, and input/return types.

Our overall goals are to refresh how Web3.js is maintained, how we interact with the community, and to make sure the next round of new Ethereum developers trust us to help them build their next project. We want to make it easier and simpler than ever before for developers to immerse themselves in Ethereum through Web3.js. We plan to keep the community well informed and open up discussion on our next steps to make this happen.

Why we will be deprecating versions 1.x

If you have ever dug into the Web3.js codebase, you may have noticed the outdated JS conventions, the poor readability of the code, and overall sophistication of the codebase. Previous to ChainSafe becoming the lead maintainer of this important library, the 1.x codebase was built by multiple external parties no longer contributing to the project. This makes it even harder for us to maintain because of the susceptibility for bugs and constant maintainability issues like inconsistent testing failures. We believe a new architecture built for maintainability and usability will resonate with the majority of Ethereum JS developers.

Simply put: it's outdated, clunky and not designed with simplicity in mind.

We simply cannot continue to repair a building with patchwork that is not structurally sound.

Long term support for versions on 1.x will still exist for an undetermined period of time to receive critical patches and support for Ethereum protocol upgrades. Our survey and roadmap will help us identify this LTS period and we will need your feedback to ensure it's done right (more information later in the post).

1.5.3-rc0 release & optional upgrade to v3.0.0 release

Version 1.5.3 is currently in release candidate status with dependency updates and bug fixes related to EIP-1559. Shortly after it has completed its testing period, these updates will be incorporated to version 3.0.0 to be released shortly after 1.5.3.

The release of version 3.0.0 deprecates unused packages web3-bzz and web3-shh. There were also breaking changes made in fields related to gas in transaction and receipt output functions now return number strings instead of numbers. Other minor changes were made to this upgrade which can be found upon its release.

The consensus between the team is to release version 3.0.0 on a separate version track which will not break usability of our current users on the 1.x branch. Users requiring this breaking change are a small subset of our main users and this release will therefore be tagged in a separate track as :binancechain. We would rather not cause undue frustration to the majority of current users on version 1.x and prepare users for a migration to the TypeScript rewrite version 4.x when it is stable. Version 3.0.0 is being released as an optional upgrade and will not be tagged as :latest or :next.

This fully concludes our support for any users still utilizing version 2.x on NPM, which will be officially deprecated upon the release of 3.0.0.

The transition plan to version 4.x

Starting with version 4.x, we will be implementing SEMVER practices to follow industry standards.

Version 4.x is a complete Typescript modernization of the Web3.js library at feature parity to what you've always used. This rewrite will commence a new era in the Web3.js ecosystem. We aim to re-architecture the library for maintainability and usability. Although this is a large change, we want to minimize breaking changes such as keeping API parity with what everyone is used to.

We aim to dedicate our time and resources to ensuring the success of version 4.x by creating and maintaining new community content such as a new landing page, tutorials, guides and documentation which supports our overall goals mentioned above. We will need your assistance to make it the best upgrade it can be for our current and future users.

We want your input to improve

As part of our ongoing efforts to be inclusive of the community as an open source project, we need to know more about your project, experiences and thoughts about Web3.js. This is an opportunity for us to collaborate and ensure Web3.js Version 4.x maximizes value for your project, for the next 20,000+ new Ethereum developers, and beyond!

To better serve you and your project needs, we launched a short block survey (link here) to gather feedback and stats on how we can best help you and your project to succeed with Web3.js. Your suggestions will help shape the outcome of our Web3.js rewrite.

For any support related inquiries, please reach out to the Web3.js team through ChainSafe on our Discord in the #web3js-general channel or Twitter.

Get involved

Want to work with ChainSafe? Come **** join us! Check out the new Careers section of our website and our open positions, and get in touch with us at careers@chainsafe.io if you are interested!

Learn more about ChainSafe by visiting our website, through our Medium, via Twitter, visiting the ChainSafe GitHub, or dropping by on Chainsafe's Discord.

Read more