Skip to content

sansil/web3-auth-back

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web3 auth frontend example

Complete example of web3 authentication example

🤖 Demo

Live demo Front deployed on Vercel Back deployed on Heroku

Frontend

Checkout the frontend code here

Why signing message to authenticate users?

You want to verify that the user owns certain address, so the backend will provide a message and the user sign it. The user use their private key to sign the message. To validate the signature you use some maths along with the message, and you should get the public key which in turns give you the address, cryptographically you can't get the validation from the message to be equal to the public key without the private key thus proving ownership.

You can understand more here

How is the working flow?

  1. User connect account
  2. Server send a message with a token to the user
  3. User sign the message, and send back the to the server the signing message with the token
  4. Server first validate if the message it's legit using the token, and then validate the signature of the message.
  5. if the signature it's valid, server send back to the user a session token
  6. User navigates in private routes using session token

Libraries used

  • ethers
  • JWT
  • Tailwindcss

About

backend for web3 auth end to end example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published