fabianbormann / cardano-peer-connect

This library aims to provide simple interfaces to implement CIP-0045 for dApps and wallets
Apache License 2.0
12 stars 4 forks source link

Feature proposal - Add participants info and lifecycle callbacks #6

Closed marcuspuchalla closed 1 year ago

marcuspuchalla commented 1 year ago

It would be suitable for DApp creators and wallet providers to show the user more information about which p2p endpoint is connected. And also inform both endpoints about important lifecycle events.

I think for a great user experience when connecting wallets to DApps, these information and messages are missing:

  1. After connecting to a DApp, the wallet has no information about the endpoint besides the cryptic endpoint address. No name or URL address that he has been connected to.

  2. The connecting wallet has no information about the current status of the connection. If a wallet is closed, reopened, and connected to a DApp again, the DApp quietly logs this information that the client connection has already been established, but the client cannot know about that.

  3. Once the connection has been established, the participants need to be informed if the other side is closing the connection. So the client shall inform the server when he wants to disconnect. And the server shall notify the client when he is shutting down. So both sides can use this information to inform the user about the connection's end.

I'm open to discussing all the proposed changes of course. Those are the things I noticed when implementing the connect feature into a wallet.

fabianbormann commented 1 year ago

@marcuspuchalla I agree with you on all points and I really appreciate the lifecycle methods that you have already added πŸ’―. With regards to the displayed information I thought about something like a blockie or a generated image so that a user can quickly verify that the image on wallet-side is the same as on dapp-side.

marcuspuchalla commented 1 year ago

With regards to the displayed information I thought about something like a blockie or a generated image so that a user can quickly verify that the image on wallet-side is the same as on dapp-side.

I also thought about that πŸ˜„ Like in the TG Video Chat where there are 5 unique icons and everybody can instantly compare them. I could add something like this if you like at the end of the week probably. If you are already on it, just let me know.

fabianbormann commented 1 year ago

Nice πŸ‘ I have not started with the verification yet so it would be cool if you can look into this πŸ’― .. I would implement the dApp site (connect p2p wallet button and show up the QR code) for the CF react component: https://github.com/cardano-foundation/cardano-connect-with-wallet by end of this week

marcuspuchalla commented 1 year ago

Nice πŸ‘ I have not started with the verification yet so it would be cool if you can look into this πŸ’― .. I would implement the dApp site (connect p2p wallet button and show up the QR code) for the CF react component: https://github.com/cardano-foundation/cardano-connect-with-wallet by end of this week

I added the proposal and the pr as a new issue (https://github.com/fabianbormann/cardano-peer-connect/issues/16). So we can close this here.