Web3j, an LF Decentralized Trust project, is a lightweight, highly modular Java library for integrating Ethereum-based applications. It allows developers to interact with Ethereum smart contracts, transactions, and accounts seamlessly. With growing adoption of Layer 2 solutions, Web3j has expanded its support for Layer 2 EVM-compatible chains like Linea, enabling developers to leverage cost-efficient and scalable blockchain interactions.
Linea is a Layer 2 solution built on Ethereum that leverages zero-knowledge rollups (ZK-rollups) to provide fast, cost-efficient transactions. As part of its infrastructure, Linea offers a set of RPC APIs that developers can use to interact with the network, retrieve blockchain data, estimate transaction fees, and verify proofs.
With the latest updates in Web3j, we now support full integration of Linea RPC APIs, enabling developers to seamlessly interact with the Linea network using Java and Kotlin.
Web3j now supports the following Linea-specific RPC methods:
This API estimates the gas required for a transaction to be successfully executed on the Linea network.
This API retrieves the account and storage values, including Merkle proof verification, for a given account at a specific block.
3. linea_getTransactionExclusionStatusV1
This API checks whether a transaction was rejected by the Linea sequencer or RPC nodes.
Testing and Feedback
Developers can now test these APIs using Web3j by connecting to a Linea RPC endpoint. We encourage users to test and provide feedback on this integration to improve usability and reliability.
The PR - https://github.com/hyperledger-web3j/web3j/pull/2150 - has been merged into the main branch and will be available in Web3j v4.13.0, the next major release.
Conclusion
With full support for Linea’s RPC APIs, Web3j provides developers with a seamless experience for interacting with the Linea network. By leveraging these features, developers can efficiently estimate gas costs, verify transaction proofs, and handle transaction exclusion scenarios.
We look forward to your feedback on this integration and any suggestions for additional features!
If you are interested in contributing to Web3j’s ongoing development, feel free to check out our GitHub repository and join the discussions! You can also find us here on the LF Decentralized Trust Discord.