add summary of mnemonics and passwords (#214)

This commit is contained in:
joe petrowski 2020-01-06 12:46:18 +01:00 committed by Jaco Greeff
parent 563559286a
commit 48d83d9cf6

View File

@ -19,13 +19,13 @@ As it stands, it does one thing: it _only_ manages accounts and allows the signi
## FAQ
### Why can't I import an account with a seed
### Why can't I import an account with a seed?
This is a deliberate choice since mnemonic phrases are easier to write down, to memorize or type in a field. They have a checksum (not every 12/24 words list is a valid mnemonic) and constitute a much better means of holding un-encrypted information. Therefore, this extension does not and will not have the functionality to recover an account from a hex seed phrase.
### I want to send funds directly from the extension
### I want to send funds directly from the extension.
The extension is not meant to be a full wallet replacement. It tries to focus on account management and making it as smooth as possible - and then makes these accounts to any dapp that can perform transfers, allow you to vote on democracy proposals and/or participate in any feature available on Polkadot and Substrate. We really aim to keep this singular account-only focus, leaving the hard-work of understanding chains and their intricacies over to over to wallets such as [polkadot-js/apps](https://polkadot.js.org/apps/).
### My addresses display differently on the extension vs a dapp
### My addresses display differently on the extension vs a dapp.
Unlike a dapp, the extension itself does not connect to a network. The addresses are formatted with a network-specific prefix, which on a dapp, is retrieved upon connection from the chain properties. Underlying the public keys can be the same, but based on the address formatting the display could be different. This does not affect operation at all. You can choose which format to display the addresses in your extension via the "Options" screen.
## Development version
@ -113,7 +113,7 @@ interface Signer extends SignerInterface {
The information contained in this section may change and evolve. It is therefore recommended that all access is done via the [@polkadot/extension-dapp](packages/extension-dapp/) (for dapps) and [extension-inject](packages/extension-inject/) (for extensions) packages, which removes the need to work with the lower-level targets.
The extension injects `injectedWeb3` into the global `window` object, exposing the following: (This is meant to be generic across extensions, allowing any dapp to utilize multiple signers, and pull accounts from multiples, as they are available)
The extension injects `injectedWeb3` into the global `window` object, exposing the following: (This is meant to be generic across extensions, allowing any dapp to utilize multiple signers, and pull accounts from multiples, as they are available.)
```js
window.injectedWeb3 = {
@ -130,3 +130,23 @@ window.injectedWeb3 = {
}
}
```
## Mnemonics, Passwords, and Imports/Exports
### Using the mnemonic and password from the extension
When you create a keypair via the extension, it supplies a 12-word mnemonic seed and asks you to create a password. This password only encrypts the private key on disk so that the password is required to spend funds in `polkadot-js/apps` or to import the account from backup. The password does not protect the mnemonic phrase. That is, if an attacker were to acquire the mnemonic phrase, they would be able to use it to spend funds without the password.
### Importing mnemonics from other key generation utilities
Some key-generation tools, e.g. [Subkey](https://substrate.dev/docs/en/next/development/tools/subkey), support hard and soft key derivation as well as passwords that encrypt the mnemonic phrase such that the mnemonic phrase itself is insufficient to spend funds.
The extension supports these advanced features. When you import an account from a seed, you can add these derivation paths or password to the end of the mnemonic in the following format:
```
<mnemonic phrase>//<hard>/<soft>///<password>
```
That is, hard-derivation paths are prefixed with `//`, soft paths with `/`, and the password with `///`.
The extension will still ask you to enter a password for this account. As before, this password only encrypts the private key on disk. It is not required to be the same password as the one that encrypts the mnemonic phrase.