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

HatsFarcasterDelegator: better onboarding with recovery address flow #341

Open
spengrah opened this issue Jun 10, 2024 · 3 comments · May be fixed by #517
Open

HatsFarcasterDelegator: better onboarding with recovery address flow #341

spengrah opened this issue Jun 10, 2024 · 3 comments · May be fixed by #517
Labels
enhancement New feature or request hats protocol https://www.hatsprotocol.xyz Improvement

Comments

@spengrah
Copy link

A significant drawback of the current onboarding flow is that migrating an existing account from Warpcast is really painful. Users need to export the seed phrase from Warpcast, find the private key of the fid custody account (derived from that seed phrase), and then import the private key into a browser wallet like metamask. This is high friction and also introduces bad op sec practices for users.

This issue describes an alternative and much improved flow that utilizes the Farcaster protocol's recovery functionality. Every fid has a recovery address, which is authorized to transfer the fid but nothing else. The key point is that Warpcast allows users to set the recovery address for their fid to any arbitrary address. For a user, this is much easier and more secure than exporting a seed phrase.

Below is what the new flow could look like. It has several key improvements:

  • The flow includes guidance for what the user needs to do in Warpcast
  • The Warpcast-related step is much simpler and more secure, as discussed above
  • No need to switch connected wallets between steps (this is a really big point of friction in the current flow)

Recommended Flow

  1. User connect wallets to herocast. This should be the wallet that wears or will wear the adminHat.
  2. Create hats using the 4-hat template from hero-50-build-scaffolding-for-hats-protocol-whitelabel #218
  3. Mint adminHat to self (and casterHat to relevant addresses, but this could also happen later), as in hero-50-build-scaffolding-for-hats-protocol-whitelabel #218
  4. Configure / deploy FD contract, as in hero-50-build-scaffolding-for-hats-protocol-whitelabel #218
  5. Guide user to set their wallet address as the fid's recovery address in Warpcast. Optionally, herocast could listen for the ChangeRecoveryAddress event before guiding the user to the next step.
  6. Back in herocast, the user signs the receive signature on behalf of FD. Alternatively, the user could call HFD.prepareToReceive(). Note that only one of these (ECDSA signature or prepareToReceive) needs to be done.
  7. User executes the transfer by calling IdRegister.recover() with the signature from (6) as payload
@hellno hellno added enhancement New feature or request hats protocol https://www.hatsprotocol.xyz Improvement labels Jun 11, 2024
@hellno
Copy link
Collaborator

hellno commented Sep 13, 2024

todo

before release

  • add space on the right side for videos to play in each step
  • create short videos for each step of the setup flow

@hellno
Copy link
Collaborator

hellno commented Sep 16, 2024

Step 5:
Which address should be set as recovery address in Warpcast? the user's wallet or the FD contract address?

@spengrah
Copy link
Author

Step 5: Which address should be set as recovery address in Warpcast? the user's wallet or the FD contract address?

it's the user's wallet. They will use that wallet in step 7 to call IdRegistry.recover().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hats protocol https://www.hatsprotocol.xyz Improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants