Metamask – Why Use Metamask Instead of Web3.js in the Browser?

dapp-developmentdappsmetamaskweb3js

It is my understanding that Metamask brings a convenient way for the user to interact with DApps by storing their wallets and by providing an interface that gives the user control of what the DApp is doing. Is this correct?

If the user does not mind at all inserting the wallet address and password, and they fully trust the app, is there any reason to use Metamask? Web3.js allows doing everything that Metamask does in the browser as well, right?

Best Answer

For your first question, you are absolutely right. There are more other features of metamask please dig it.
Ok now from the side of web3js we can do alot of wallet related work.

web3.eth.accounts

The web3.eth.accounts contains functions to generate Ethereum accounts and sign transactions and data. please see other function related to account.

You can create in memory wallet from web3js

web3.eth.accounts.wallet - Contains an in memory wallet with multiple accounts. These accounts can be used when using web3.eth.sendTransaction().

Now the point is, You can create your own wallet using web3js library. You don't need metamask to

Generate account
deploy contract
Call contract
Encryption
Decryption
sign Transaction

Related Topic