Default Accounts for dApps


#1

I think it would be great if the wallet-connect protocol (or perhaps the web3 provider) could support users with correlating a dApp to accounts. I think it is good digital hygiene to use different dApps with different keys - especially as there is still a lot of privacy infrastructure missing on ethereum or it is just still to expensive to use.
But UX wise this can be hard - 2 ideas to help here:

  • when the dApp is querying for the account - add ability give a hint what account was used last
  • save what account was used last with a certain dApp on the wallet side. I think for this we would need something like a dApp-id as the name might not be stable enough over time

#2

With walletconnect there is this code for dapp integration:

const webConnector = new WalletConnect(
  {
    bridgeUrl: 'https://bridge.walletconnect.org',  // Required
    dappName: 'INSERT_DAPP_NAME',                   // Required
    canvasElement: 'INSERT_QRCODE_CANVAS_ELEMENT',  // Optional
    sessionId: 'INSERT_EXISTING_SESSION_ID',        // Optional
    sharedKey: 'INSERT_EXISTING_SHARED_KEY',        // Optional
  }
)

At Tenzorum we’re using a data standard that when a user signs in with a certain key that “dappName” is associated with the key on the mobile. The idea is to have different dapp profiles on the phone associated with different keys. Digital hygiene :ok_hand:. What you could do is get the metadata from the above configuration and associate it with your keys in the app’s local storage.


#3

what do you mean?

keys in local storage sounds wrong - can you elaborate?


#4

When configuring the dapp with new WalletConnect({…
You are required to input the dappName. On the mobile side it could possibly grab the dappName from this configuration and associate the dappName with a key on the device. If you look into Parity Signer’s React Native app they have the ability to securely store multiple keys. What could be built into WalletConnect is when signing into a new dapp then a new securely stored key can be created alongside the dappName which could be displayed in the UI of the app. e.g. Aragon account - 0x21a2b12e23ab…, Cryptokitties account - 0x2132a23d321e23f…


#5

Hm - I do not like to take the dappName for this as it is a human readable string an I am not sure how stable this is - would prefer some ID rather than using the name.
And I still think keys do not belong into local storage - especially in a browser. Might be OK with app-isolation like parity signer is doing - but IMHO not in the browser like wallet connect would use it.


#6

Fair enough, I was wondering if there would be an unique id for each dapp as well. For UI purposes it would make sense to have dapp name somewhere in there. I wasn’t implying the browser’s local storage, was implying the mobile’s local storage. As in using the devices native storage.