0

I know Meta Mask is a frontend Google Chrome extension. I want to know how my DApp can find the client's current wallet. Should I check if web3.js is enabled and check the availability of Meta Mask and then pass it to the server via AJAX for later use?

I wanted to stick on web3.py but not sure how to do this.

1 Answer 1

1

In order to use metamask, with any daap, you need to connect metamask to your provider and connect your provider to your daap code (all done in Js). The metamask user is the one that chooses which wallet they want to use.

doing that would let metamask intercept your requests going from the js client (browser) to your provider.

this has nothign to do with web3.py, if you are creating a browser Daap,you will have to use web3.js

Any simple tutorial will show you how to completely do this.

6
  • I do know that Meta Mask is for JS. My point is, does it make sense I use web web3.js to pass info so that it can be used later in web3.py to interact with Smart Contract? I do not want to interact with Contract at client side at all and I am not using NODEJS
    – Volatil3
    Jun 6, 2021 at 17:53
  • No it doesn't make sense, you wante to handle the contract interactions in your backend, but for that you will need to sign transactions which would require private keys. so you will have to store the private keys in your backend and that would completely negate the usage of metamask. Jun 6, 2021 at 18:08
  • So you are saying I use NodeJS for the backend? I do not want to use it!
    – Volatil3
    Jun 6, 2021 at 18:17
  • no, you don't have to use nodeJs, you can interact with the smart contract in any language you want. You can use python and web3py but what i meant is : if you don't want to your users to interact directly with teh smart contract (forces the to not use metamask) you will have to host the wallets on your backend (save private keys in your backend filesystem or database) Jun 6, 2021 at 18:22
  • Saving a private key at my end is not a suitable idea neither I'd prefer it. But, even if I use backend language/framework for other sections of the site and web3.js for blockchain related only, I will have to use smart contract interaction code with the frontend js file and it'd be visible to everyone who sees the source. Is there any security concern?
    – Volatil3
    Jun 6, 2021 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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