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
Solana Changelog - November 14 - Blockstore, Breakpoint, and Relaxed Transaction Constraints
Breakpoint 2023 - These are the talks we would watch - Solfate Podcast #36
Breakpoint 2023: Solana Foundation Kick-off Highlights
Solana Changelog - 2022 Recap & Looking Ahead to 2023
Solana Changelog - Optional Borsh, Precompiles, and new Web3.js
How Will Firedancer Improve Solana?
Solana Changelog June 22 - Token Metadata, Anchor 28, QUIC on Turbine
Solana Changelog July 11 - Merkle Shreds, Turbine, and a Security Series
Monad: Supercharging the EVM for Next-Gen Blockchain Performance
Solana Changelog - Optional Borsh, Precompiles, and new Web3.js
What Is Alpenglow: Solana's Largest Protocol Upgrade Ever | Brennan Watt, Anza
The State Of Firedancer, Building Thru & How To 10x Performance | Liam Heeger
Chingari: Going Web2 to Web3
Solana Changelog March 7 - Verifiable Builds, Admin RPC, and Geyser
Latest news
xStocks Opens Tokenized Access to Bending Spoons' $19B Nasdaq IPO, Listing June 30
Solmate Stock Falls 98% as CEO Exits and Board Members Resign Following $300M Solana Treasury Pivot
Jeff Park of ParaFi Capital Joins Solana Foundation as Advisor
Solflare's June 2026 Update Brings 134 xStocks, Google Pay Onramp, and Cards Borrow to Solana's Largest Self-Custody Wallet
Arcium Launches Blackthorn: Encrypted AI Inference on Any NVIDIA GPU via MPC
Forward Industries and Upexi Enter Major US Equity Indexes as Solana Treasury Companies Land in Russell Reconstitution
Colosseum Announces 26 Winners of the Solana Frontier Hackathon, the Largest Crypto Hackathon Ever
Kled AI Signs $12M Data Deal, Calls Marketplace Officially Profitable
Roundhill's $DRAM Memory Chip ETF Token Goes Live on Solana via Backpack Securities and SunriseDeFi
Solana Mobile dApp Store Surpasses 1,561 Apps as Catalog More Than Doubles in Three Months
Solana Token Markets
