Search code examples
htmlethereumweb3jsmetamask

How can I set my site so users can sign in with metamask?


Currently, my site uses Passport.js so users can sign in with facebook & google, etc. but I want users to be able to sign in to my site with Metamask and be able to send ETH (and other cryptos) to each other. I've seen some crypto-based sites enable users to sign in with Metamask to interact with their Dapp but I only want users to be able to send direct transactions to each other when their username is shown in the chat.

Is there a simple way for users to sign in to my site with Metamask and be able to send each other crypto?


Solution

  • What I think you want to achieve is implemented on CryptoKitties.

    What you need to do is to prove the ownership of an account by signing a piece of data using a private key.

    I've found this tutorial which you can follow for its complete implementation.