# Connect Vega wallet & select keys ## Connect wallet When looking to use Vega via a user interface e.g. Dapp (Decentralized web App), I... - If the app loads and already has a connection it can restore "eagerly" (without the user having to click connect) it **could** do so - **must** select a connection method / wallet type: (0002-WCON-002) - if Rest: - **must** have the option to input a non-default Wallet location (0002-WCON-003) - **must** submit attempt to connect to wallet (0002-WCON-005) - if the dapp DOES already have a permission with the wallet: **must** see that wallet is connected (0002-WCON-007) note: if the user want to connect to a different wallet to the one that they were previously connected with, they will have to hit logout. - if the app uses one key at a time: **should** show what key is active (re-use the last active key) (0002-WCON-008) - if the wallet does NOT have an existing permission with the wallet: **must** prompt user to check wallet app to approve the request to connect wallet: See [Connecting to Dapps](0002-WCON-connect_vega_wallet.md#connect-wallet) for what should happen in wallet app (0002-WCON-009) - if new keys are given permission: **must** show the user the keys have been approved (0002-WCON-010) - if the dapp uses one key at a time: **should** prompt me to select key. See [select/switch keys](#select-and-switch-keys). (0002-WCON-014) - if user rejects connection: **must** see a message saying that the request to connect was denied (0002-WCON-015) - if the dapp is unable to connect for technical reason (e.g. CORS): **must** see an explanation of the error, and a method of fixing the issue (0002-WCON-016) - ~~Browser wallet~~ `not available yet` - Fairground hosted wallet - **must** only be be shown this option if the dapp is connected to fairground (0002-WCON-039) - **must** input a wallet name (0002-WCON-017) - **must** input a password (0002-WCON-018) - if success: **must** see that the wallet is connected and details of connected key (0002-WCON-019) - if failure: **must** see reason for failure (0002-WCON-020) - _note: the fairground hosted wallet is configured to automatically approve connections from dapps so there is no need for key selection._ - **must** have the option to select a different method / wallet type if I change my mind (0002-WCON-021) ... so I can use the interface to read data about my key/party or request my wallet to broadcast transactions to a Vega network. ## Disconnect wallet When wishing to disconnect my wallet, I... - **must** see an option to disconnect wallet (0002-WCON-022) - **must** see confirmation that wallet has been disconnected (0002-WCON-023) ... so that I can protect my wallet from malicious use or select a different wallet to connect to ## Select and switch keys when looking to do something with a specific key (or set of keys) from my wallet, I... - **must** see what key is currently selected (if any) (0002-WCON-025) - **must** see a list of keys that are approved from the connected wallet (0002-WCON-026) - for each key: - **must** see the first and last 6 digits of the [public key](DATA-data_display.md#public-keys). (0002-WCON-027) - **must** be able to copy to clipboard the whole public key (0002-WCON-029) - **must** see the key name/alias (meta data) (0002-WCON-030) - **must** see the option to trigger a re-authenticate so I can use newly created keys (0002-WCON-035) ...so that I can select the key(s) that I want to use.