ernestognw / ethereum_signature

A simple webpack bundled app in vanilla JS to show basic implementation of ethereum signature using web3.eth.personal.sign and web3.eth.personal.ecRecover functions. Used to demonstrate how to manage digital identity with ethereum wallets.

Home Page:https://ernestognw.github.io/ethereum_signature/dist/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ethereum sign and recover example

Live demo HERE

Web3 has its eth.personal.sign function that allows developers to use users private keys to sign messages to prove identity with its reverse function that finds the public key that signed the message.

Requires metamask or some injected Web3 Provider.

preview

How does it works?

Node.JS > 10 required

  • npm install to install dependecies
  • npm run start to run webpack dev server with hot reloading
  • Go to localhost:9000 and start testing
  • Accept the connection request from metamask
  • Write some data to sign
  • Click sign button
  • This process will return a signature, that can be reversed by web3.eth.personal.ecRecover process
  • Copy signature
  • Paste on signature textbox
  • Copy original message signed in original message textbox
  • Click on recover and see the magic

Please try to change parameters on the original message and signature to check how the results vary respect to the original signer aaccount

Licensed

MIT

About

A simple webpack bundled app in vanilla JS to show basic implementation of ethereum signature using web3.eth.personal.sign and web3.eth.personal.ecRecover functions. Used to demonstrate how to manage digital identity with ethereum wallets.

https://ernestognw.github.io/ethereum_signature/dist/index.html


Languages

Language:JavaScript 100.0%