You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a two part issue requiring knowledge of message signing with Metamask using personal_sign on the CLIENTSIDE, and how to recover addresses from signed messages using ether.js Cryptographic Utilities on the SERVER SIDE.
This feature is in support of crypto-native authentication for off-chain data for OpenQ. We have a MongoDB which will be home to non-critical off-chain data like bounty watchlists
Updates to user's info will be keyed on their Eth address, and authenticated as such using message signatures.
Authentication Flow
User attempts a write operation to the OpenQ-API (not needed for this task, just use a mock button)
User is prompted in Metamask to sign a message (simply the string 'OpenQ', message data itself is irrelevant)
The message signature is verified, the address is recovered, and validation confirms that the recovered address is equal to the address on the query string. This can be done in a new utility function called ecdsaRecover in the OpenQ-Github-OAuth-Server. Put it in a new folder called utils/ecdsaRecover.js.
Just to note that this issue cuts across two repos - Frontend signs the message, a backend route on OpenQ-Github-OAuth-Server (soon to simply be renamed OpenQ-Auth since it does both OAuth and Web3 auth) will then recover address and compare against the desired resource ID to authorize.
Description
This is a two part issue requiring knowledge of message signing with Metamask using
personal_sign
on the CLIENTSIDE, and how to recover addresses from signed messages using ether.js Cryptographic Utilities on the SERVER SIDE.This feature is in support of crypto-native authentication for off-chain data for OpenQ. We have a MongoDB which will be home to non-critical off-chain data like bounty watchlists
Updates to user's info will be keyed on their Eth address, and authenticated as such using message signatures.
Authentication Flow
utils/ecdsaRecover.js
.Out of Scope
Notes and Resources
We just need
personal_sign
for this, not EIP-712. More info on the various signing methods here: https://docs.metamask.io/guide/signing-data.html#a-brief-historyethereum/go-ethereum#2940
The text was updated successfully, but these errors were encountered: