This repo will be used to facilitate a Discord bot but can be helpful for anyone wanting to use the Keplr wallet to sign arbitrary messages and verify the signed document and public key.
There is a standard called ADR36 for signed typed messages, and we'll get as close as we can to using this standard, except when the Keplr wallet limitation exist.
There is a server (ExpressJS) and a React frontend that communicate. This document is for the frontend.
Good idea to have NodeJS version >= v14.17.0
Let's also get yarn
with:
npm i -g yarn
First we install with:
yarn
npm run start
This will give you instructions in your Terminal or Command Prompt app.
We are using the Keplr to sign a message using the private key stored in the wallet. This message will then be passed to the backend where it can be verified, and the backend can interact with a database / server / whatever and process as it pleases.
If you're running a local server, you can specify a custom Starry backend with:
env REACT_APP_STARRY_BACKEND=http://localhost:8080 npm run start
- Keplr development
- Ethereum concepts about signed typed message from the "Sign-in with Ethereum" initiative.
- A draft implementation from Simon Warta that may be helpful
- A test in CosmJS that elucidates signing and verifying using Amino