Improving MetaMask Connector for Fuel Network

Introduction

The Fuel team has recently developed a wallet connector library that integrates MetaMask, which can be found here. A demo of the current implementation is available here. While this is a significant step forward, there are some critical issues that need to be addressed for better user experience, especially for mainnet user onboarding.

Current Implementation and Issues

In the current implementation, connecting MetaMask to the Fuel network creates a new predicate used to sign transactions. This results in the user receiving a new address associated with their MetaMask address. However, this approach presents two major challenges:

  1. Funding the Predicate Address:

    • Users need to manually copy the associated Fuel address (predicate address) and send ETH to it. This additional step is cumbersome and can be a barrier for new users.
  2. Lack of Token Information:

    • It is unclear what tokens the predicate holds, as there are no names or amounts displayed. This lack of transparency can confuse users and deter them from using the platform.

Alternative Solutions from Other Non-EVM Chains

During our discussions, Luis Felipe mentioned that these issues arise because Fuel is a non-EVM chain. However, other non-EVM chains like Waves and Solana have found innovative solutions to similar problems:

  1. Waves: Network Switching within MetaMask

  2. Solana: MetaMask Snap and Additional UI

Proposal for Fuel Network

Given the successful implementations by Waves and Solana, it is crucial to explore if similar solutions can be adapted for the Fuel network. Improving the user experience is vital for wider adoption, and addressing the current UX issues should be a priority.

Potential Solutions:

  • Network Switching: Implement a feature that allows users to switch networks within MetaMask, similar to Waves.
  • Enhanced UI for Balances: Develop an additional UI within MetaMask to display token names and amounts, akin to Solana’s approach.

Conclusion

The current user experience for connecting MetaMask to the Fuel network has significant drawbacks that could hinder user adoption.

Let’s discuss the feasibility of these solutions and collaborate on finding the best approach to improve our MetaMask connector.

2 Likes

Thanks for the feedback @sway, have shared it with the team :slight_smile:

Hey Lidia

I’m Antony from project Zap building on Fuel. We are working on a bunch of the issues you’ve raised. I’ll address your points #1 and #2 below, and I encourage input from you and everyone else about the “bringing your existing wallet” experience (such as MetaMask, Coinbase, etc.) they would like to have on Fuel.

#1 Funding the Predicate: To recap your point: funding a wallet, in this case, involves funding the predicate underlying the Ethereum signer, which acts as the EVM abstracted account at a basic level. This can be done by discovering the predicate address and sending assets to it directly.

While I agree with you that it is poor UX to have the wallet owner or anyone else manually copy the predicate address associated with the EVM address to fund it, we’ve been working on and have implemented some UX improvements to address this issue. The goal is for MetaMask (or similar) users to never need to know the address of the underlying predicate wallet if they don’t want to. At Zap, we have implemented an RPC that anyone can connect to with their MetaMask or Coinbase wallet to send assets around using their Ethereum EOA, without worrying about their unique underlying address on Fuel. The mapping of the EVM address to the predicate wallet address is handled on the backend of the RPC. All predicate source code (Sway) and bytecode are completely verifiable and open for review (we even have an api call for those who want to know the fuel address).

To make this infrastructure available to apps (such as DEXs) and frontend developers (so it’s easy to incorporate MetaMask), we intend to offer a node package and example code that simplifies adding this feature.

Regarding network switching, our RPC allows wallet users to simply “add Fuel network” to MetaMask and/or “switch network” to Fuel, enabling the use of MetaMask wallet just as they would with any other EVM-based L2 or L1 chain.

Additionally, building transactions (legacy and EIP-1559 type) with ethers and submitting the raw signed transaction works as well.

#2 Lack of Token Information: At Zap, we are also actively working on the infrastructure for tokens and other assets to not only be displayed within MetaMask but also to be discoverable.

Feel free to reach out if you have any questions about how we can help. :smiley:

2 Likes