Breakpoint 2023: Introducing the New Web3.js
Steven Luscher presents the new Web3.js with enhanced features and performance improvements.
Summary
During the 2023 Breakpoint conference, Steven Luscher from Solana Labs introduced the revamped Web3.js, a crucial JavaScript library for blockchain development on the Solana network. He emphasized the evolution of Web3.js to become more efficient, customizable, and user-friendly, drawing an analogy to how consuming vegetables provides long-term health benefits compared to the fleeting satisfaction of sugary treats. The new Web3.js promises not just a tech-rich experience but also intends to lead developers towards a "pit of success" by its very design. The talk covered the ins and outs of the updated library, highlighting the ways it can significantly benefit developers and ultimately, the end-users of blockchain applications.
Key Points:
The New Web3.js: A Healthier Option for Developers
Comparing the new API to vegetables, Steven highlighted the importance of creating an API that is robust and sustainable in the long run. The aim for the new Web3.js is to deliver a library that promotes best practices, leading to more stable and successful applications without the common pitfalls of overly sugary APIs that can lead to technical debt and performance issues.
The Demand for a Better Web3.js
Feedback from the Solana community indicated a clear desire for a more customizable and less opinionated version of Web3.js. This includes the need for improved transaction confirmation strategies, support for multiple RPC connections, and the ability to batch requests. Developers have been asking for tree shaking capabilities, modern JavaScript support, and generally a more modular and slimmed-down library.
Performance Improvements and Reductions in Library Size
There have been significant improvements in the performance and size of the new Web3.js. The library has been reduced in size by as much as 14 times in typical applications, making it efficient for web environments and mobile users who may experience poor connectivity. Performance metrics also showed notable speed improvements in transaction signing and block hash operations.
Technical Deep Dive: Subscription APIs, Keys, Transaction Builders, and TypeScript
Steven went into detail about several technical aspects of the new library, including a simpler and more efficient transport interface, a dynamic and slim RPC API, modern subscription APIs for better error handling and gap recovery, improvements to cryptographic key management, unified transaction building, and enhanced TypeScript support.
Facts + Figures
- The new Web3.js was described by Steven Luscher as being more like vegetables rather than candy; it aims for long-term developer success rather than short-term ease of use.
- Web3.js is a JavaScript library pivotal for developers interacting with the Solana blockchain, including actions like minting NFTs and playing blockchain-based games.
- Despite being downloaded 400,000 times a week, feedback indicated developers wanted more from the library.
- Size reductions in the new Web3.js have been substantial, with a full browser bundle dropping from 90 kilobytes in the old version to 33 kilobytes in the new, a 2.7 times improvement—and potentially down to 17 kilobytes for environments supporting ED25519 natively.
- An AWS service bundle for transaction handling was reduced in size from 5.4 megabytes in the old version to 1.7 megabytes with the new Web3.js.
- Solana's official explorer saw a 26% reduction in first-page load size after replacing the old Web3.js with the new.
- The RPC API of a new Web3.js is now TypeScript-based and can easily extend to support additional RPC methods.
- The new subscriptions API leverages modern JavaScript features like async iterators, promising a more reliable and maintainable way to handle real-time data.
- Keys now use native JavaScript crypto keys with polyfills for environments lacking native ED25519 support.
- Transaction builders unify legacy and version transactions into a single, more efficient class.
- TypeScript integration ensures developers catch errors early in the development process, reducing runtime errors.
Top quotes
- "I like to think of the new Web3JS API as more like vegetables. You eat them, you chew on them, they sharpen your teeth."
- "Folks from Mango told us, Steve, your transaction confirmation strategy just doesn't work for us. We need something different."
- "For the past six months or so, me and this crack team of developers... have been working on a new version of Web3JS."
- "Old Web 3JS was able to crank out 700 of those operations per second, 10 times more if you use the native ED25159 stuff in new browsers and new JavaScript environments."
- "Just migrating to the new Web3JS let you throw out a quarter of the code."
- "The subscriptions API is now based on modern JavaScript async iterators."
- "Keys now are based on native JS crypto keys."
- "We want to offer you APIs that are closer to your customers' desires."
- "Tell us if you find something broken. Tell us if we missed including something."
- "Solana FM, get at me. And let's get this done."
Questions Answered
What is Web3.js?
Web3.js is a JavaScript library used for interacting with the Solana blockchain. It allows developers to read and write data, and execute programs, essentially facilitating a direct line of communication with blockchain-based applications like games, services, or NFT platforms.
Why was a new version of Web3.js necessary?
The new version of Web3.js was created in response to community feedback that highlighted the need for a more customizable, efficient, and less opinionated API. Developers wanted better performance, a reduced library size, and features ripe for modern JavaScript practices.
How does the new Web3.js improve performance and size?
The new Web3.js improves performance by facilitating faster transactions, reduced latency, and a higher rate of operations per second. It reduces size by implementing tree shaking, which means projects only include the code they actually use, significantly slimming down the library footprint.
What are some of the technical improvements in the new Web3.js?
Technical improvements include a new RPC transport interface that's easier to work with, an RPC API that uses TypeScript for error reduction, a more robust and efficient subscription API that utilizes modern JavaScript async iterators, and native JavaScript crypto keys for better security and performance.
How does the new Web3.js leverage TypeScript to benefit developers?
The new Web3.js leverages TypeScript to help developers catch errors during the coding phase rather than in production, reducing runtime errors and ensuring a smoother development process and more reliable end-user experience.
Comments
Please login to leave a comment.
On this page
Related Content
Solana Changelog - November 14 - Blockstore, Breakpoint, and Relaxed Transaction Constraints
Explore Solana Breakpoint highlights, Web3.js improvements, and upcoming changes to transaction constraints in this comprehensive Solana Changelog episode.
Solana Changelog - November 14 - Blockstore, Breakpoint, and Relaxed Transaction Constraints
Explore key takeaways from Solana Breakpoint, including Runtime V2 and Web3JS updates, along with upcoming changes to transaction constraints and blockstore functionality.
Breakpoint 2023 - These are the talks we would watch - Solfate Podcast #36
Dive into the highlights of Solana Breakpoint 2023 with the Solfate Podcast. Discover the most anticipated talks, exciting announcements, and groundbreaking developments in the Solana ecosystem.
Breakpoint 2023: Solana Foundation Kick-off Highlights
An overview of notable announcements and sessions during the Solana Foundation event, Breakpoint 2023.
Solana Changelog - Optional Borsh, Precompiles, and new Web3.js
Explore Solana's latest developments including optional Borsh, precompiles standardization, core BPF migration progress, and exciting Web3.js updates in this comprehensive changelog.
Solana Changelog - Optional Borsh, Precompiles, and new Web3.js
Discover Solana's latest developments including optional Borsh in SDK, precompile standardization, core BPF migration progress, and exciting Web3.js updates for enhanced developer experience.
Solana Changelog - 2022 Recap & Looking Ahead to 2023
Explore Solana's major achievements in 2022, including improved developer tools, network upgrades, and mobile initiatives. Learn about exciting developments planned for 2023 and beyond.
Solana Changelog May 2 - Account Interfaces, Web3.js Experimental, and Tea
Discover the latest Solana updates including account interfaces, Web3.js experimental changes, and the new Tea package manager for easier Solana installations.
Solana Changelog June 22 - Token Metadata, Anchor 28, QUIC on Turbine
Discover the latest Solana updates including the Token Metadata Interface proposal, Anchor 0.28.0 release, and QUIC implementation for Turbine in this comprehensive changelog.
Chingari: Going Web2 to Web3
Learn how Chingari, India's leading short video app, is transforming the creator economy by pivoting to Web3 on Solana. Discover innovative features like social staking and NFT marketplaces.
Solana Changelog July 11 - Merkle Shreds, Turbine, and a Security Series
Discover the latest Solana updates including QUIC Turbine implementation, Merkle Shreds rollout, and a new security series for developers. Learn how these changes improve network efficiency and program security.
Solving Crypto's Scaling Trilemma | Arbitrum
Explore how Arbitrum is tackling Ethereum's scaling challenges, the intricacies of optimistic rollups, and the future of decentralized Layer 2 solutions in this in-depth discussion with Arbitrum's founders.
How Will Firedancer Improve Solana?
Explore how Firedancer could revolutionize Solana's performance, pushing transaction speeds to new heights and potentially reaching millions of TPS.
Solana Changelog March 7 - Verifiable Builds, Admin RPC, and Geyser
Explore the latest Solana developments including verifiable builds, admin RPC improvements, and Geyser interface updates for enhanced performance and security.
Solana Changelog March 21 - Priced Compute Units and the Solana Developer Forum
Explore Solana's latest developments, including the Priced Compute Units proposal, validator improvements, and the launch of the Solana Developer Forum.
Solana Token Markets
