Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Metamask signature while setting withdrawal address #17

Open
4 tasks
sponnet opened this issue May 31, 2022 · 2 comments
Open
4 tasks

Integrate Metamask signature while setting withdrawal address #17

sponnet opened this issue May 31, 2022 · 2 comments

Comments

@sponnet
Copy link
Contributor

sponnet commented May 31, 2022

Context

Currently when you configure a minipool - you have to provide a withdrawal address for when you decide to stop your minipool.
This is currently a form field - that has some sanity checking in place.
People could however fill out a wrong address here. If the user does not have access to this wallet he will not be able to withdraw his stake - potentially losing funds.
Rocketpool solves this with a metamask + signature implementation on their website.

Proposed solution

Make the form field of the withdrawal address disabled by default and put a "connect wallet" button next to it.
When the user connects to his wallet - the button changes to "Sign" with a subtitle saying "to fill in withdrawal address - sign a message using metamask"

When the user hits the "Sign button" he gets a metamask popup asking him to sign a message "Sign to confirm withdrawal address 0x....." - after the signature was created - the client verifies the validity of the signature & fills out the address.

Underneath the field is a link "fill out address manually" - when clicked this enables editing the field (for those who don't have metamask - or are uncapable of signing the message , for example if the withdrawal wallet is not imported in your MetaMask)

TODO

  • make the field read-only / disabled by default + a link that forces it to be enabled.
  • Implement a Metamask connect button (using an existing React library) in the form - with a connect button next to the field
  • a "sign" button going through the flow as described above (send eth_sign to metamask) + verify signature
  • when signature correct - fill out the address and change the button to "clear" - hitting clear clears the field & starts over.
@sponnet
Copy link
Contributor Author

sponnet commented May 31, 2022

@sponnet
Copy link
Contributor Author

sponnet commented Jun 1, 2022

https://wagmi.sh/ can be used possibly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant