Skip to content

Add Rootstock (EVM compatible bitcoin sidechain)#961

Open
ahsan-javaiid wants to merge 6 commits intogemwalletcom:mainfrom
ahsan-javaiid:feat/rootstock
Open

Add Rootstock (EVM compatible bitcoin sidechain)#961
ahsan-javaiid wants to merge 6 commits intogemwalletcom:mainfrom
ahsan-javaiid:feat/rootstock

Conversation

@ahsan-javaiid
Copy link

Description

This PR adds Rootstock chain (evm compatible bitcoin sidechain) to gem wallet core library.
Rootstock is the leading Bitcoin Layer 2 (Bitcoin sidechain) network with strong DeFi traction, fully EVM compatible with security of bitcoin (with BTC hash rate ~85%) supported by the leading developer tools; oracles, indexers, Rootstock is the most advanced and complete infrastructure for building on Bitcoin.

About Rootstock

Website: https://rootstock.io/
Defillama: https://defillama.com/chain/Rootstock
Explorer: https://explorer.rootstock.io/
Developer portal: https://dev.rootstock.io/

Need this PR to be included in core library so that support for Rootstock in gemwallet mobile apps could be added. Please review this pull request and feel free to let me know/comment if there any changes required.

@semanticdiff-com
Copy link

semanticdiff-com bot commented Feb 19, 2026

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ahsan-javaiid, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request comprehensively integrates the Rootstock (RSK) blockchain into the gem wallet core library. This foundational work establishes all necessary configurations, including RPC endpoints, block explorers, native asset definitions, and mappings for various EVM-compatible services like Uniswap and Coingecko. The integration aims to enable full support for Rootstock within gemwallet mobile applications, allowing users to interact with this Bitcoin Layer 2 network.

Highlights

  • Rootstock Chain Integration: The Rootstock (RSK) blockchain, an EVM-compatible Bitcoin sidechain, has been fully integrated into the core library, enabling support for its network and assets.
  • Configuration and Endpoints: New RPC endpoints for Rootstock have been added, along with configurations for BlockScout and EtherScan as block explorers, and specific chain settings like network ID and block time.
  • EVM and DeFi Functionality: Rootstock is now included in various EVM-related functionalities, such as token ID formatting, Multicall3 deployments, Uniswap Permit2 and V3 contract addresses, and base pair definitions (WRBTC, USDC.e, USDT).
  • Asset and Price Mapping: The native asset for Rootstock, RBTC, has been defined, and mappings for Coingecko have been established. Pyth price feed support is explicitly marked as unavailable for Rootstock.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Settings.yaml
    • Added the RPC URL for the Rootstock chain.
  • crates/chain_primitives/src/token_id.rs
    • Included Chain::Rootstock for token ID checksum formatting.
  • crates/coingecko/src/mapper.rs
    • Mapped Rootstock to its Coingecko platform and market IDs.
  • crates/gem_evm/src/multicall3.rs
    • Added EVMChain::Rootstock to the list of chains using a specific Multicall3 deployment address.
  • crates/gem_evm/src/rpc/ankr/model.rs
    • Included EVMChain::Rootstock in the Ankr chain mapping, returning None.
  • crates/gem_evm/src/uniswap/deployment/mod.rs
    • Added the Uniswap Permit2 contract address for Chain::Rootstock.
  • crates/gem_evm/src/uniswap/deployment/v3.rs
    • Defined the Uniswap V3 deployment configuration, including quoter_v2, permit2, and universal_router addresses for Chain::Rootstock.
  • crates/gem_evm/src/uniswap/path.rs
    • Configured base pair addresses (WRBTC, USDC.e, USDT) for EVMChain::Rootstock.
  • crates/prices_dex/src/providers/pyth/mapper.rs
    • Explicitly marked Pyth price feed support as unavailable for Chain::Rootstock.
  • crates/primitives/src/asset.rs
    • Defined the native asset for Chain::Rootstock as 'RBTC' with symbol 'rbtc'.
  • crates/primitives/src/block_explorer.rs
    • Added BlockScout and EtherScan as block explorers for Chain::Rootstock.
  • crates/primitives/src/chain.rs
    • Added Rootstock as a new variant to the Chain enum.
  • crates/primitives/src/chain_config.rs
    • Introduced a new ChainConfig entry for Chain::Rootstock, specifying its network ID, block time, and EVM configuration.
  • crates/primitives/src/chain_evm.rs
    • Added Rootstock as a new variant to the EVMChain enum.
  • crates/primitives/src/explorers/blockscout.rs
    • Implemented a new_rootstock function to provide BlockScout explorer metadata for Rootstock.
  • crates/primitives/src/explorers/etherscan.rs
    • Added EtherScan explorer metadata for EVMChain::Rootstock.
  • crates/primitives/src/node_config.rs
    • Added primary and secondary RPC nodes for Chain::Rootstock.
  • crates/settings/src/lib.rs
    • Added a rootstock field to the Chains struct to hold its configuration.
  • crates/settings_chain/src/lib.rs
    • Included Chain::Rootstock in the ProviderFactory and in the logic to retrieve chain-specific settings.
  • gemstone/src/gateway/mod.rs
    • Extended the EthereumClient initialization to include Chain::Rootstock.
Activity
  • The pull request was opened by ahsan-javaiid to add support for the Rootstock (RSK) chain.
  • The author requested a review from the team to incorporate this new chain into the core library.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the Rootstock chain, an EVM-compatible Bitcoin sidechain. The changes are comprehensive, touching upon configuration, chain primitives, explorers, and integrations with services like CoinGecko and Uniswap. The implementation is mostly solid, but I have identified a few areas for improvement related to code consistency, maintainability, and a potential configuration issue with swap support. My review includes suggestions to address these points, such as correcting asset naming, ensuring consistent use of checksummed addresses, and refactoring for better code reuse.

}),
Chain::Rootstock => Some(V3Deployment {
quoter_v2: "0xb51727c996c68e60f598a923a5006853cd2feb31",
permit2: "0xfcf5986450e4a014ffe7ad4ae24921b589d039b5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency and better maintainability, you should use the permit2 variable derived from get_uniswap_permit2_by_chain(chain)? at the beginning of the function, instead of hardcoding the address again. This avoids duplicating the address and ensures that if it changes, it only needs to be updated in one place.

Suggested change
permit2: "0xfcf5986450e4a014ffe7ad4ae24921b589d039b5",
permit2,

EVMChain::Plasma => "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb", // USDT0
EVMChain::Monad => "0xe7cd86e13AC4309349F30B3435a9d337750fC82D", // USDT0
EVMChain::Stable => "0x779Ded0c9e1022225f8E0630b35a9b54bE713736", // USDT0
EVMChain::Rootstock => "0x779ded0c9e1022225f8e0630b35a9b54be713736", // USDT0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other addresses in this file and to prevent potential errors, it's best to use the checksummed version of the address. The address for the Stable chain is checksummed, so the one for Rootstock should be as well.

Suggested change
EVMChain::Rootstock => "0x779ded0c9e1022225f8e0630b35a9b54be713736", // USDT0
EVMChain::Rootstock => "0x779Ded0c9e1022225f8E0630b35a9b54bE713736", // USDT0

Chain::Monad => "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
Chain::XLayer => "d6f83dfeaff95d596ddec26af2ee32f391c206a183b161b7980821860eeef2f5",
Chain::Stable => "2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
Chain::Rootstock => "", // pyth not supported yet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use BTC as pyth price provider?

gemcoder21 and others added 5 commits February 19, 2026 22:14
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments