aragonzkresearch / anon-voting-demo

Onchain Anonymous Voting demo app
GNU General Public License v3.0
1 stars 0 forks source link

Metamask BBJJ key derivation #1

Closed arnaucube closed 1 year ago

arnaucube commented 1 year ago

Example: https://github.com/hermeznetwork/hermezjs/blob/58cc6ccea9a4ea6ab0930a046dd79a2fc8773fed/src/hermez-wallet.js#L101 The previous link contains stuff for hermez wallet, we don't need that, but there it is the main idea & code to use.

Basically what we need is:

  1. request Eth Metamask signature over a hardcoded payload (the payload can be for example the string "I authorize my zk-key creation")
  2. hash the signature (keccak256 hash)
  3. use the output of the hash as the BabyJubJub privateKey