0

These days I'm asking myself why can't you inject web3 with dependency libraries or CDNs? Why yo need a browser plugin? I cannot understand it.

Thanks

1 Answer 1

3

The user needs to have a familiar environment to confirm transactions. This environment needs to be 100% shielded from the JavaScript on the website they are using. Otherwise, any website could perform Ethereum transactions without their consent, which would obviously be a disaster.

You don't necessarily need a browser plugin to have this. You can also just include the web3.js library yourself and connect to an Ethereum node running locally on the user's device:

var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

When performing a transaction, the user will then be asked to confirm it inside their Ethereum client program.

3
  • But in that case, Metamask plugin should be accepted/configured for every webdapp? Commented Nov 7, 2017 at 20:09
  • @AlexAcc MetaMask is one of the most commonly used ways to use DApps. If you're writing a DApp it's a very good idea to support it.
    – Jesbus
    Commented Nov 7, 2017 at 21:38
  • Could you go deeper into how a hacker can perform a transaction without their consent? What do you mean include web3.js? in the front end? how does the user know to start up an Ethereum node?
    – Strawberry
    Commented Apr 12, 2018 at 7:53

Your Answer

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

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