3

Is Metamask a web3 provider? I am aware it is a wallet. But is it also a web3 provider?

I have read from here that:

Web3 provider is a website running geth or parity node which talks to Ethereum network.

Then I have read here that:

Web3Modal is an easy-to-use library to help developers add support for multiple providers in their apps with a simple customizable configuration.

What do you call Metamask, Dapper, Gnosis Safe, Frame and the rest? Are they web3Providers? Or what are they?

I am asking this line of code here:

const provider = await web3Modal.connect();

const web3 = new Web3(provider)

// what is provider and why should I pass it to a new instantiation of web3?

;

2 Answers 2

2

Is Metamask a web3 provider?

Yes.

Web3 provider is a website running geth or parity node which talks to Ethereum network.

In the answer you've pointed to, when he says "website", he really means "RPC endpoint" (you'll see his path contains the string "api"), where the endpoint will likely be on a back end server running an Ethereum node.

The endpoint - i.e. path for connecting to a client node - is "provided" in one of two ways:

  • Built directly into your front end via a library (e.g. Authereum), or
  • Injected into the front end by the browser or browser add-on (e.g. Metamask).

Web3Modal allows you to handle both of these, and have the user pick the one they want to use.

4
  • When it is built directly to your front end how do users interact with your dapp? Do they still use Metamask?
    – YulePale
    Apr 16, 2021 at 17:31
  • No, there's a different interface. For example, if you use Authereum, you build the Authereum package into your front end code (npm install authereum, then include the appropriate code), when you connect the wallet you'll be presented with the Authereum pop-up instead of Metamask. Apr 16, 2021 at 17:34
  • Will the user require an Authereum browser extension like the way we use metamask?
    – YulePale
    Apr 16, 2021 at 17:38
  • 1
    No, for any providers you build into the front end code, they should generate their own pop-up interface when a user clicks "connect". Browser extensions would normally be used for providers that inject. Apr 16, 2021 at 17:52
3

As I understand it MetaMask is a Remote Client. A Remote Client offers an API and allows you to use the transaction functionalities of a wallet. Using the (injected) API, e.g. web3.js, means it translates the JS-code into JSON RPC, which is actually the language of a web3 provider (e.g. Parity or Geth). Although MetaMask includes the functionality of a wallet it does not mean that it is an actual provider. Thus, a provider can just be an actual Ethereum client connecting you to the Ethereum network.

=> MetaMask is not a provider. It just facilitates the connection.

But actually due to its default behaviour described in infura FAQ's:

MetaMask (by default) uses Infura, but has the ability to switch to another node provider, even somebody’s own node. We continue to work with MetaMask and more Web3 browser teams.

=> MetaMask makes it look like as if it is a provider.

The following image* might help you to understand better.

DApp architecture by Gardiner(2018)

*The Ethereum Client is signed as Local, but as you see by the docs of MetaMask, they may even be a Remote Service (e.g. infura).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.