ergoplatform / ergo-wallet-app

Ergo Wallet App
https://ergoplatform.org/en/ergo-wallet-app/
Apache License 2.0
96 stars 35 forks source link

Ergoauth requires manually entered address #179

Open esot321c opened 7 months ago

esot321c commented 7 months ago

Expected behavior:

ergoauth://${strippedUrl}/generateAddressLink/${uuid}/#P2PK_ADDRESS#/ would generate a message signing request which would ask a user to choose their wallet, then sign a message, and return an object as such:

{
  signedMessage: 'abcde'
  proof: 'xyz',
  changeAddress: 'address',
  addresses: ['array', 'of', 'addresses']
 }

Optionally you could leave out the address array for the wallet. Or change it to used and unusued like dappconnectors do. You could leave addesses out of the return object also because it can be picked up by the api via the URL if you only wish to return the chosen address and no others.

Current behavior:

Ergoauth requires the front-end to get the address before making the Ergoauth request. Two ways we have done this:

  1. Request the user adds their address to an input box manually (bad UX, what if the address is on their phone but they are using a desktop device, they have to email it to themselves or something)
  2. Allow the user to scan a QR Code for Ergopay to derive the address (This is bad UX because then we need to tell the user to choose the address, scan another QR code to initiate ergoauth, and choose the same address again. The user could choose the wrong address and we don't get the error state back to our dapp)