Web3.js - Past, Present & Future

This ad is not shown to multipass and full ticket holders
JSNation US
JSNation US 2025
November 17 - 20, 2025
New York, US & Online
See JS stars in the US biggest planetarium
Learn More
In partnership with Focus Reactive
Upcoming event
JSNation US 2025
JSNation US 2025
November 17 - 20, 2025. New York, US & Online
Learn more
Bookmark
Rate this content

Will discuss the challenges faced in Web3.js project.

Some opensource contribution statistics.

Current refactoring objectives we are working on to make web3.js better.

Release timeline.

Overview of future plans.

This talk has been presented at JSNation 2022, check out the latest edition of this JavaScript Conference.

FAQ

Web3.js is a widely used JavaScript library in the Ethereum community, providing tools to interact with the Ethereum blockchain.

Web3.js was originally started in 2014 by a solo contributor, Jeffrey Bickle.

As of now, the company ChainSev is responsible for maintaining the Web3.js library.

Web3.js has had over 100 contributors overall.

Web3.js version 4 includes native TypeScript support, reduced size, improved code readability, extensibility for future features, and a new declarative validator for data validation.

Web3.js version 1 faced challenges such as an obscure code base, tightly coupled modules, numerous TypeScript issues, and a large build size.

No, Web3.js version 4 maintains a v1 Parity API, meaning existing projects will not break. There could be slight changes, which will be documented in the change log or migration guide.

The main focus is to mature Web3.js version 4 and release a production-ready version this year, along with introducing more flexible modularization, improving tree shaking, and supporting out-of-the-box integrations for different front-end tools.

You can explore Web3.js version 4 by checking out the 4.x branch on GitHub and installing it directly from there.

Web3.js version 4 introduces features like native TypeScript support for contracts, a new declarative validator for data validation, and dynamic data formatting, which are unique in the Ethereum ecosystem.

Nazar Hussain
Nazar Hussain
21 min
20 Jun, 2022

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Today we will discuss the Web3JS library, its history, maintenance, and community involvement. The upcoming version 4 aims to address challenges faced in version 1 by introducing native TypeScript support, reduced size, improved code readability, and increased test coverage. Version 4 also introduces a new validator for easier Ethereum data validation and allows developers to customize how they handle numbers and bytes. It brings a dynamic data format for custom formatting and introduces TypeScript for contracts without transpiling. The API in version 4 is easy to extend and has future improvements and refactoring.

1. Introduction to Web3JS Library

Short description:

Today we will discuss the Web3JS library, its history, maintenance, and community involvement. Started in 2014 by Jeffrey Bickle, the library has been maintained by various contributors and organizations. With over 100 contributors and 17,000 pull requests, the library has undergone extensive testing. Fun facts include the library's two-year beta period and failed rewrite attempts. Despite this, version one remains the most widely used.

Hi everyone, it's Nazar here. And today we are going to discuss the Web3JS, one of the most famous and widely used libraries in the Ethereum community. So we will be discussing some past aspects of the library and some future aspects as well as some present milestones that we have achieved currently. So let's get started.

So first of all, we're going to explore the past about the library. Most of you had been using this library a lot, but may be not aware of how this library was actually started. So this Web3js library was started in 2014 by a solo contributor, Jeffrey Bickle, and in 2016 it was moved to another solo maintainer, Samuel Furter. And from 2018, Ethereum JS from the Ethereum Foundation was maintaining it. And since two years, our company ChainSev has been responsible to maintain this library. And if you look on the facts that this library has been maintained for over eight years, it has over 100 contributors overall and have 17,000 more than 1700 pull requests.

And so far 172 versions were released and out of which 90 were the pre-release version. That means this library had very thorough investigation and debugging and testing from the community during the pre-release versions. 90 pre-release versions is a large number. And this library has 600,000 weekly downloads as well. And it's all because of the community who is using and trusting this library.

And there are some fun facts about the library. I have asked so version one of the library web3.js has been living in beta for two years and people have been using v1 beta in the production environment for many years. Because this v1 was in extensive testing and thorough debugging process. And we started to have a v2 rewrite in past and it was a fail and abandoned rewrite attempt because of some aspects I will discuss in further slides. We started v3 rewrite with some extensive features, which never lasted a lot. And since then, v1 is the only version which the whole community has been using so far.

2. Web3 JS Version 4 and Achieving Goals

Short description:

The Web3 JS library has faced challenges in version 1, including an obscure code base, tightly coupled modules, TypeScript issues, and build size problems. Despite failed attempts at rewriting, the upcoming version 4 aims to address these challenges. It will feature native TypeScript support, reduced size, improved code readability, and increased test coverage. The goals for version 4 have been achieved while maintaining the v1 Parity API, ensuring minimal project breakage.

This is quite an interesting aspect as well, and considering that like two rewrite attempts or two version attempts has been failed so far, but it doesn't mean that the library v1 version has been unstable. So v1 has been maintained and supported so far and had been doing it. And if you look at the aspect that v1 lived for the two years in the beta, I think this is the most longest time after another project expressjs version 5, it will last for more than two years.

And there were some challenges we were facing in the web3js version 1. Most of you can understand it because you may have already reported some of the issues or have been also encountered or facing those issues. It was very obscure code base. The code base was being maintained by over 100 contributors I explained earlier. The code base was not using some standard process or standard patterns. The modules inside the code were very tightly coupled. There were a lot of technical challenges to maintain this code and there was a lot of difficulties to introduce new features particularly in the library v1.

And most of the you guys have already been using the typescript. So there were a lot of decoupled types. Decoupled types were in the web3.js v1. And because of that, there were a lot of typescript issues being reported by the community. And if I look on the logs, I can see around 60 over 60 issues been reported of the mismatch or inaccurate types, which was one of the biggest challenge for us. And from the community perspective, the build size became around the bottleneck. And for the dev development, because this library was bundled in a huge single package file and that package file was being bundled in every dev. And this was causing a lot of problem during the dev development by a lot of community as well. And on a larger spectrum, JS community and the toolchain has been advanced a lot. A lot of new frameworks, new patterns and new tools have been introduced in the community in the ecosystem, but Web3 JS could not get way forward because of those challenges I discussed earlier.

So are we going to stick with the version one, or are we going to do something about it? Despite the two attempts or failed attempts, we are still hopeful that we are going to present the current improvements in the library and with that said, this is the new era for the Web3 JS, the version four, and this is not some speculation. It's been under development for over a year now. And we are almost ready to release, hopefully it's been released this month, but you can already explore directly from the GitHub. So version four is going to be a huge, huge, huge milestone for the Web3 JS lifespan and it's going to address a lot of stuff that we've been discussing in the community and all those people have been addressing those things. So version four will come with a native TypeScript support and it will have a reduce size. We have decoupled a lot of code and the complexity has been reduced since we are doing this rewrite completely from scratch, so the code readability has been improved a lot, and we try to make it extensible so that in the future we can add more features very easily and even the community can extend the library for their own use, and we focus on the test coverage for the version four and hopefully once, right now we are working on writing the system test for the library, and within a month when we will release the first alpha for the v4, it will be having a lot higher test coverage compared to the version one, and compared any other competitive library in the ecosystem. So the question is, does all these goals that we defined, rewrite for the version four, are these good enough, or have we achieved it or not? Yes we have achieved all these goals, and the most important thing is that we achieved all these goals with a v1 Parity API. So you don't need to be worried about that your projects are going to break. There could be slight changes that we will be documenting and sharing with the community in the change log or the migration guide, but those changes will not be a lot. Overall, the API of version one remains the same.

3. New Validator and Custom Data Handling

Short description:

We have introduced a new validator in the version 4 rewrite of the Web3.js library. This validator provides declarative validation using JSON schema, making it easier to validate Ethereum data. It is compatible with Ethereum ABI schema and eliminates the need for complex imperative validation. Additionally, version 4 introduces a feature that allows developers to customize how they handle numbers and bytes in their dApps.

We explicitly decided this architecture change, or this pattern, so that a lot of community does not break their projects, and they can easily migrate to the version four, which is more recent.

And the question is like, does it just rewrite of the v1 with the same API or does it include some new features as well or not? Yes, it is. It contains a lot of new features. It's not just the rewrite. Rewrite was the first objective, but during the rewrite, we focused on creating more features within the library so that we can be future safe and we can extend the library very easily in the future.

And some of the features which I'm going to present here, which is very unique for the version one, version four for the Web3.js library is unique in the Ethereum ecosystem. No other package or the utility as of now, which I remember may have introduced such features and hopefully you guys will like them.

So the first thing, the most important feature within our rewrite is this new introduction of the new validator. Because data is so important for any dev particularly and data validation has been an extensive job for the maintainers of the different devs and we decided to create a brand new layer of the declarative validation for the community. And we use this validator within our library as well and it is also available for you to use in your devs.

And so what is a declarative validator? So most of you know that JSON schema or JSON data is kind of a defacto data format for the JS community. JSON schema is also a defacto data standard for validation and communities already adopted it. So we use both of these schemes as a JSON data and the JSON schema and merge them together for the Ethereum community. And you don't need to have no if-else anymore and all of the validation that you're going to do using the JSON schema will be tightly coupled with the Ethereum types. So you don't need to remember the Ethereum native types or compare to the JavaScript native types. It will work seamlessly. And this validator is also compatible with Ethereum ABI schema. So if you have such an ABI, it will also validate the data based on the ABI as well.

Let's jump to some examples. So here you can see some examples. So we have some data and which contains some addresses in an array and some balance, and, if I go with the imperative validation, which we had been doing in previous library versions, you can see that, we have, some loops going on and then we are validating by using function calls and then throwing some errors and same for the balance field that we have, we are particularly validating by using some function call. But if we go with a declarative approach, you can see that we have schema defined for the data and this schema is going to present the whole anatomy of the data and if you notice that the data that we are going to present is very particular for the Ethereum. So we have an address array, we have UN256. These are Ethereum types and we can validate this data based on this schema and there are different formats of the schema and hope you can explore further.

So there is another feature that we introduced in version 4 rewrite and this is going to change the way you look into your data. So the question is that every dApp that you develop is not the same. So the need for every dApp is also different. For example, someone developing an app or using a library where he needs numbers in the beginning. Someone wants numbers in a number or someone wants number to be a number string. Similarly for the bytes.

4. Dynamic Data Format and Custom Formatting

Short description:

The previous version of the library was restrictive to one data format, which was counterintuitive for dApps using different formats. To address this, we are introducing a dynamic data format that allows custom formatting. You can define your own format for numbers and bytes and use it in function calls. Our library has been extensively using this feature.

So there can be different formats of the same data that you can use but the previous version was very strict and very restrictive to the one data format. Which was not counter which was counterintuitive for the different dApps which were using different data formats.

So we tried to cover this as well and we are creating a dynamic data format, which is quite easy. All of the Ethereum web 3js library interfaces are going to return are going to support this custom data formatting. And let's say we have this get balance and by default, this get balance will return you a balance in the hex string format.

But if you want that the balance function should return the balance into different formats, you can define your own data format, specifying the format for the numbers and specifying the format for the bytes and passing these formats to the every function call is the last parameter and you will be get the data in that particular format that you define. And you can use this formatting logic in your own project as well. Our library has been extensively using it.

5. Typescript for Contracts

Short description:

Web 3.js version 4 introduces Typescript for contracts without transpiling. Simply declare your API in a Typescript project as a constant, and you'll have a typesafe contract instance. No transpiling is required, and changes to the API will automatically update the types. Share your feedback on this unique feature.

So one more important feature. Maybe everyone should be relying on it, and I think this is one of the unique features which Web 3.js version 4 is going to introduce, is Typescript for the contracts without any transpiling. So you don't need to transpile anything. All you need is your API declaration in the Typescript project. So there is no need for the transpiling of the APIs or creating or doing some command line execution of any other third-party tools. You just need to copy your API, declare them into the Typescript project, and you will be ready to have a complete typesafe contract instance. Let's say we have this API and all you need is to have this API declared, and the trick is here that you have to declare them as a const, so the Typescript does not infer them as generic types rather have strong types for each declaration. And once you have declared this API as a constant, you can create your contract instance and this contract instance will be completely typesafe and there is no transpiling required. And if you ever change the API or update your API, your types will automatically reflect those change and Typescript can detect the validations on the compile time. This is a unique feature and I would love that we'll be sharing some feedback on it.

6. Easy Extensibility and Future Improvements

Short description:

We are introducing easy extensibility for our API, providing a consistent API for all Web3 modules. You can also create your own modules by extending the Web3 context. Version 4 has many future improvements and refactoring. It is currently in alpha and can be installed from the GitHub repository.

And there is another feature that we're going to introduce is easy extensibility for our API. So the Web3 modules have introduced a different or consistent API to support all modules. So when I'm referring to the modules, you may be aware that Web3 has different modules like contracts, Ethereum, SSH, ABI, ENS. So these are different modules. So we introduced a consistent API for all of the modules so that you don't have a different compatibility issues using them.

And you can also create your own modules if you want. And the feature is very simple and like straightforward to introduce, you just need to, we have consistent object or Web3 context and all you need is to declare your component or the module which is extended from the Web3 context and then you have a library instance Web3. You just call them a use and you will get an instance of the component which will have all of the main component of the library link. For example, a provider will be linked a request manager, a subscription manager and a lot more will be linked to your component. And that will easily, so you can use your component easily with the same consistent API which we had been using in the Ethereum or contract or ABI or ENS packages. So this is all from the version four, so the question is like, this is all the features that we're gonna introduce. I think not. There are a lot of future improvements, a lot of refactoring, a lot of things going on in the version four and I will left all those to you that you can explore in the version four and the version four is in the alpha hopefully this month but you don't need to wait it. You can go to the GitHub and check out 4.x branch and it will be all up for you to install directly from the GitHub and use it.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Web 3 Gaming: What it is and Why it Matters
JS GameDev Summit 2022JS GameDev Summit 2022
36 min
Web 3 Gaming: What it is and Why it Matters
Web3 gaming enables decentralized identity and finance, allowing game developers to bypass centralized platforms. It is driven by wallets, ERC20 tokens, and NFTs. Web3 games focus on collaborative world-building, ownership, and open-source collaboration. The challenge is achieving decentralization while addressing economic and technological limitations. Web3 aims to redefine the gaming industry by using economic tools and exploring new genres like RPG and RTS games.
E2E Tests for Web3 Applications
TestJS Summit 2022TestJS Summit 2022
21 min
E2E Tests for Web3 Applications
Top Content
In this Talk, Rafaela discusses Web3, its decentralized and token-based model, and the architecture based on smart contracts. Testing Web3 poses challenges due to the need for third-party providers like MetaMask. Approaches such as mocking the Web3 flow and using end-to-end testing tools like Taskafar are suggested. The trade-offs in Web3 testing include test speed and dependency on third-party apps. Balancing unit, integration, and end-to-end tasks is crucial for a robust testing strategy.
A Frontend Developer’s Guide to Web3
React Summit 2022React Summit 2022
22 min
A Frontend Developer’s Guide to Web3
This talk covers an introduction to Web 3 and smart contracts, including deployment and bytecode compilation. It also discusses interacting with blockchain wallets, using RPC endpoints and block explorers, and accessing smart contract data. The talk emphasizes the use of ABIs and JavaScript libraries like ethers for interacting with smart contracts. It mentions the shift in mindset from HTTP requests to using ABI code and libraries for front-end development in Web 3. The talk concludes by mentioning Web3UI and tools like PolygonScan and Etherscan for building on the blockchain.
Building Dapps with React
React Advanced 2021React Advanced 2021
30 min
Building Dapps with React
The Talk discusses building decentralized applications (DApps) with React and explores the benefits of smart contract technology. It highlights the characteristics and infrastructure of Web 3 applications, including decentralized indexing, off-chain data storage, and decentralized file storage. The Talk also covers identity in Web 3, with a focus on self-sovereign identity and the use of blockchain for identity verification. The process of building a DApp with React and Hard Hat is explained, along with deploying contracts and interacting with them. Overall, the Talk provides insights into the world of DApps and the technologies involved.
Reacting to Web3
React Summit 2022React Summit 2022
6 min
Reacting to Web3
Decentology provides developer tools for building React component-based blockchain applications without writing blockchain code. Web3 development is beneficial for applications with game engines, microtransactions, mobile payments, mediator contracts, business logic applications, simple authentication, and payments. They advocate for open source and allow developers to add a small royalty fee to paid transactions.
Build Blockchain dApps using JavaScript
JSNation 2022JSNation 2022
21 min
Build Blockchain dApps using JavaScript
Hello, my name is Russ Fustino, and welcome to Build Blockchain DApps Using JavaScript. We'll cover Algorand blockchain, layer one, setup your development environment, creating a simple DApp, verification, and UI controls from pipeline. Blockchain tools are now accessible to anyone for creating liquidity pooling, staking, and more. The Italian Society of Authors and Publishers is using NFTs on the Algorand blockchain to identify copyrights. Algorand accounts, ASAs, Atomic Transactions, Algorand Smart Contracts, and reporting with Indexer are part of the solution. Creating NFTs can be done using visual tools like Algodesk.io and wallets like Algosigner and MyAlgoWallet. Algorand atomic transfers guarantee the exchange of goods and facilitate decentralized applications. Smart signatures approve spending transactions and smart contracts facilitate global and local storage. DApp architecture includes a UI front end, payment transactions between accounts, asset transactions for NFTs and Fungible Tokens, and application calls for smart contracts. Various SDKs and tools are available, such as AlgoDesk.io, Algorand Studio, and Algodia. Reach is a high-level language and compiler for deploying DApps to the blockchain. Verification and audits play a crucial role in preventing locked away tokens. The Pipeline UI offers controls and components for easy integration into solutions.

Workshops on related topic

Web3 Workshop - Building Your First Dapp
React Advanced 2021React Advanced 2021
145 min
Web3 Workshop - Building Your First Dapp
Top Content
Featured Workshop
Nader Dabit
Nader Dabit
In this workshop, you'll learn how to build your first full stack dapp on the Ethereum blockchain, reading and writing data to the network, and connecting a front end application to the contract you've deployed. By the end of the workshop, you'll understand how to set up a full stack development environment, run a local node, and interact with any smart contract using React, HardHat, and Ethers.js.
Querying Blockchain Data with GraphQL
JSNation 2023JSNation 2023
64 min
Querying Blockchain Data with GraphQL
WorkshopFree
Simon Emanuel Schmid
Simon Emanuel Schmid
Curious about how data works in the world of blockchain? Join Simon in an engaging session about The Graph, the decentralized indexing protocol that makes it easy for blockchain developers to search and query blockchain data. 
Table of the contents:- Understanding blockchain data- Anatomy of a smart contract- Indexing blockchain data with The Graph- Accessing data on The Graph- Recommended subgraphs- Writing subgraphs overview
How to Convert Crypto Currencies With GRPC Microservices in Node.js
JSNation 2023JSNation 2023
117 min
How to Convert Crypto Currencies With GRPC Microservices in Node.js
Workshop
Alex Korzhikov
Andrew Reddikh
2 authors
The workshop overviews key architecture principles, design patterns, and technologies used to build microservices in the Node.js stack. It covers the theory of the GRPC framework and protocol buffers mechanism, as well as techniques and specifics of building isolated services using the monorepo approach with lerna and yarn workspaces, TypeScript. The workshop includes a live practical assignment to create a currency converter application that follows microservices paradigms. It fits the best developers who want to learn and practice GRPC microservices pattern with the Node.js platform.
Prerequistes:- Good understanding of JavaScript or TypeScript- Experience with Node.js and writing Backend applications- Preinstall Node.js, npm- Preinstall Protocol Buffer Compiler- We prefer to use VSCode for a better experience with JavaScript and TypeScript (other IDEs are also ok)
How to Build UI's for Smart Contracts
React Summit 2022React Summit 2022
134 min
How to Build UI's for Smart Contracts
Workshop
Rahat Chowdhury
Rahat Chowdhury
There are many journeys we can take into becoming a web3 developer. Not all journeys require learning a completely new language and becoming a smart contract developer. In this workshop we will learn how to build our own React UI on top of any existing smart contracts on the Polygon Proof of Stake Blockchain. We will explore a basic overview of blockchains and learn about the advantages of building on Polygon. We will also gain an understanding of what Smart Contracts are, learn how to find existing ones, and learn tools that help us interact with them from a React application.
Learn to Build on WEB3 Like It’s WEB2
React Summit 2024React Summit 2024
83 min
Learn to Build on WEB3 Like It’s WEB2
Workshop
David Dal Busco
David Dal Busco
In this session, we will build and deploy a decentralized application from scratch and delve into its additional features, all while minimizing the complexity typically associated with learning blockchain technology.By the end of this session, I hope attendees will not only have a clearer understanding of blockchain development, but also realize that building in this space can be surprisingly straightforward and enjoyable.My goal is to share my enthusiasm for open-source development and the potential of Web3.
Build Web3 apps with React
React Summit 2022React Summit 2022
51 min
Build Web3 apps with React
Workshop
Shain Dholakiya
Shain Dholakiya
The workshop is designed to help Web2 developers start building for Web3 using the Hyperverse. The Hyperverse is an open marketplace of community-built, audited, easy to discover smart modules. Our goal - to make it easy for React developers to build Web3 apps without writing a single line of smart contract code. Think “npm for smart contracts.”
Learn more about the Hyperverse here.
We will go over all the blockchain/crypto basics you need to know to start building on the Hyperverse, so you do not need to have any previous knowledge about the Web3 space. You just need to have React experience.