Unverified Commit 84a7a175 authored by Hanwen Cheng's avatar Hanwen Cheng Committed by GitHub

move wiki into repo (#679)

parent 652009a7
Pipeline #105019 failed with stages
in 3 minutes and 1 second
......@@ -6,24 +6,40 @@
# Parity Signer - Turn your smartphone into a hardware wallet
![Parity Signer](./docs/tutorials/images/logo-parity-signer.jpg)
Parity Signer is a mobile application that allows any smartphone to act as an air-gapped crypto wallet. This is also known as "cold storage".
You can create Kusama and Ethereum accounts, sign messages/transactions, and transfer funds to and from these accounts without any sort of connectivity enabled on the device.
You can create Substrate and Ethereum accounts, sign messages/transactions, and transfer funds to and from these accounts without any sort of connectivity enabled on the device.
You must turn off or even physically remove the smartphone's Wifi, Mobile Network, and Bluetooth to ensure that the mobile phone containing these accounts will not be exposed to any online threat.
**Disabling the mobile phone's networking abilities is a requirement for the app to be used as intended.**
**Disabling the mobile phone's networking abilities is a requirement for the app to be used as intended, check our [wiki](./docs/wiki/Security-And-Privacy.md) for more details.**
Have a look at the tutorial on our wiki to learn how to use [Parity Signer together with Polkadot-js app](https://wiki.parity.io/Parity-Signer-Mobile-App-Apps-Kusama-tutorial) for Kusama, or [MyCrypto app](https://wiki.parity.io/Parity-Signer-Mobile-App-MyCrypto-tutorial) and [Parity Fether](https://wiki.parity.io/Parity-Signer-Mobile-App-Fether-tutorial) for Ethereum.
Have a look at the tutorial on our wiki to learn how to use [Parity Signer together with Polkadot-js app](./docs/tutorials/Kusama-tutorial.md), or [MyCrypto app](./docs/tutorials/MyCrypto-tutorial.md) and [Parity Fether](./docs/tutorials/Fether-tutorial.md) for Ethereum.
Any data transfer from or to the app happens using QR code. By doing so, the most sensitive piece of information, the private keys, will never leave the phone. The Parity Signer mobile app can be used to store any Kusama or Ethereum account, this includes KSM, ETH, ETC as well as Ether from various testnets (Kovan, Ropsten...).
Any data transfer from or to the app happens using QR code. By doing so, the most sensitive piece of information, the private keys, will never leave the phone. The Parity Signer mobile app can be used to store any Polkadot or Ethereum account, this includes KSM, ETH, ETC as well as Ether from various testnets (Kovan, Ropsten...).
## Getting Start
- [Building](https://github.com/paritytech/parity-signer/wiki/Building)
- [Testing](https://github.com/paritytech/parity-signer/wiki/Testing)
- [Troubleshooting](https://github.com/paritytech/parity-signer/wiki/Troubleshooting)
- [Publishing](https://github.com/paritytech/parity-signer/wiki/Publishing)
### Tutorials
- [Signing with Pokadot.js Apps](./docs/tutorials/Kusama-tutorial.md)
- [Recover Account from Polkadot.js Apps](./docs/tutorials/Recover-Account-Polkadotjs.md)
- [Manage Accounts on Parity Signer](./docs/tutorials/Hierarchical-Deterministic-Key-Derivation.md)
- [Signing with MyCrypto](./docs/tutorials/MyCrypto-tutorial.md)
- [Signing with Fether](./docs/tutorials/Fether-tutorial.md)
### Wiki
- [Security and Privacy](./docs/wiki/Security-And-Privacy.md)
- [Development](./docs/wiki/Development.md)
- [Building and Publishing](./docs/wiki/Building-And-Publishing.md)
- [Testing](./docs/wiki/Test.md)
- [Troubleshooting](./docs/wiki/Troubleshooting.md)
- [QA Check List](./docs/wiki/QA.md)
- [HDKD Feature](./docs/wiki/HDKD.md)
- [Changelog](./docs/wiki/Changelog.md)
## License
......
# Parity Signer tutorial with Fether
This tutorial will walk you through setting up an account with the Parity Signer Android or iOS App and then use this account together with [Parity Fether](https://github.com/paritytech/fether) to see your balance and transfer funds or ERC-20 tokens from this account.
* Notice: The UI maybe variant for different versions, but the functionalities are the same in v4 version.
## Summary
- [1. Get Parity Signer mobile application](#1-get-parity-signer-mobile-application)
- [2. Setup or recover an account](#2-setup-or-recover-an-account)
- [Create an account](#create-an-account)
- [Recover an account with your recovery phrase](#recover-an-account-with-your-recovery-phrase)
- [3. Add Parity Signer's account to Fether](#3-add-parity-signers-account-to-fether)
- [4. Sign a transaction on Fether](#4-sign-a-transaction-using-parity-fether)
## 1. Get Parity Signer mobile application
### Device security
Parity Signer is meant to be used offline. The mobile device used to run Parity Signer will hold valuable information that needs to be kept securely stored. It is therefore advised to:
- Get a separate mobile device.
- Make a factory reset.
- Enable full-disk encryption on the device, with a reasonable password (might not be on by default, for example for older Android devices).
- Do not use any biometrics such as fingerprint or face recognition for device decryption/unlocking, as those may be less secure than regular passwords.
- Once Parity Signer has been installed, enable airplane mode and make sure to switch off Wifi, Bluetooth or any connection ability of the device.
- Only charge the phone using a power outlet that is never connected to the internet. Only charge the phone with the manufacturer's charging adapter. Do not charge the phone on public USB chargers.
Please find more info [here](Parity-Signer-Mobile-App) about the Parity Signer application.
### Install Parity Signer mobile application
Install Parity Signer making sure that it originated from **Parity Technologies**
- [Android](https://play.google.com/store/apps/details?id=io.parity.signer)
- [iOS](https://itunes.apple.com/us/app/parity-signer/id1218174838)
## 2. Setup or recover an account
When launching the app for the first time, no account has been set up yet. At this stage, you will either want to create an identity (root account) directly from your mobile device or recover an identity (root account) previously created with Parity Signer or [Parity UI / Wallet](https://wiki.parity.io/Parity-Wallet) (Desktop)
### Create an account
Tap on the `Create` button after you first entered into the app, and then you can give the identity any name you like.
In the next step, your recovery phrase will be presented to you. Think of it as a master key. If you lose it, you lose your money.
**Write this recovery phrase down and store it in a safe place**.
If your phone gets stolen/broken/forgotten this will be the only way to [recover your account](#recover-an-account-with-your-recovery-phrase).
You will then be asked to choose a pin code. This pin will be needed later on to unlock your account to manage the identity or sign a transaction.
The next screen you will allow you to select a network for generating an account.
![create account](images/Parity-Signer-apps-0.png)
### Recover an account with your recovery phrase
If you already have an account created with either Parity Signer or any other wallet, you can recover it by doing so:
- Tap on the top right side user icon, and choose ` + Add Identity`.
- Input the new identity name and tap the `Recover Identity` button.
- Type in the recovery phrase, word suggestion helps you prevent any typo. The field will turn red if the recovery phrase is not a bip39.
- Tap `Recover Identity`.
- Select a PIN number and confirm it by typing it again.
- Once your Identity is generated, you can select a network to create your first account.
## 3. Add Parity Signer's account to Fether
To be able to follow this tutorial and send Ether from a freshly created account on Parity Signer mobile app, you will need to get some Ether on this account first. Parity Fether is a simple wallet based on a light client that will allow you to manage your Signer account seamlessly.
- [Download](https://github.com/paritytech/fether/releases), install and launch Parity Fether.
- On Fether's first screen, click the + button and then `recover an account`.
- Click `Recover from Parity Signer`, it will show the image of the webcam for you to scan the Parity Signer's account QR code.
- On Parity Signer app, select the account you want to copy the address.
- Scan the QR code displayed on your phone with your computer's webcam. Make sure the QR code is fully displayed on your mobile's screen.
- You can now name this account on Fether. Parity Signer's account will be recognizable thanks to the Parity Signer's logo next to the identicon.
![Add Parity Signer account Parity Fether](images/Parity-Signer-Fether-add-account.gif)
### 4. Sign a transaction using Parity Fether
Assuming that your Parity Signer account now has funds, you will be able to send some Ether securely to anyone, without transferring your private key, and without needing any internet connection on your mobile phone.
- On Fether, select the account added previously and click on either Ether or the Token you want to send funds from.
- On Fether, enter the address of the account you want to send Ether or Tokens to as well as the amount of gas. Make sure to try with a small amount of Ether first before sending larger amounts.
- Click on `Scan` when you're done.
![Parity Signer Fether send transaction](images/Parity-Signer-Fether-tx-workflow.jpg)
You will now be presented with a QR code that represents the transaction. Since this transaction is sending funds from your Parity Signer mobile app account, only this account (sitting on your phone) can sign and authorise this transaction. This is what we'll do in the next steps:
- From the Parity Signer mobile app, tap the scan button on the top right and scan the QR code presented by Fether.
- Review the transaction addresses and the amount to send on your phone. The amount and addresses must match what you've entered in Fether. If you got phished, this is where you can realise it and reject the transaction.
- Once you're sure, scroll down and click `Sign Transaction` to enter your pin and get the QR code of the scanned transaction.
![Sign Fether transaction](images/Parity-Signer-Fether-android-1.png)
Your phone has now *signed the transaction offline* using your Parity Signer account private key. The QR code that is now displayed on your phone represents a signed transaction that can be broadcasted. We will do this in the next steps:
- On Fether, click on `Next step`, this will turn on your webcam.
- Face your phone's display to your webcam for Fether to be able to read the signed transaction.
- Verify one last time that the account addresses are correct as well as the amount to transfer on Fether.
- Click `Send` on Fether.
- Congrats you just sent Ether from an air-gapped account :)
![Send transaction Fether Signer](images/Fether-Parity-Signer-0.jpg)
# Parity Signer Accounts Management
Parity Signer v4 has introduced the Hierarchical Deterministic Key Derivation (HDKD) feature for Substrate networks. This article explains how to use this feature.
* Notice: The UI maybe variant for different versions, but the functionalities are the same in v4 version.
## Introduction
Identity is the starting point for generating accounts. Identity is bound to a seed (aka. mnemonic or seed phrase). The identity itself does not have any network affiliation. For Substrate networks, generating a new accounts means entering a derivation path and choosing a network. With this feature, you can manage as many accounts as needed with just one seed phrase safely stored.
## Key Generation
### Create an account for a Substrate based network.
Key generation also refers to accounts creation, with your created Identity:
- Choose a Substrate network, this opens the path list screen.
- Tap `Create New Derivation` Button.
- In path derivation screen, input any path and name you like, the path will be prefixed with its Network path ID, in this example it is `//kusama`.
- Tap `Derive Address` Button.
- From the path list, you will see all the paths and their names within a Substrate network, they are automatically grouped.
![screenshot Parity Signer HDKD Key Derivation](images/Parity-Signer-HDKD-0.png)
### Custom path derivation
To generate a custom path without any prefix path:
- Tap `Add Network Account` on the network list screen.
- Tap `Create Custom Path` button on the bottom.
- Input any path you like.
![screenshot Parity Signer HDKD Custom Path](images/Parity-Signer-HDKD-1.png)
### Recover Account without derivation Path
If you have created an account without derivation path from Subkey tool, Polkadot.js, or Chrome extension etc. To recover:
- Tap `Add Network Account` on the network list screen.
- Tap `Create Custom Path` button on the bottom.
- Do not input any path, but select a
### The form of path
Paths also refer to the Chaincodes which described in [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki/), though it is different from BIP-32 style:
* Soft derivation starts with a single slash, like: `/soft`
* Hard derivation starts with a double slash, like: `//hard`
Users are able to create any combination of hard derivation with `//` and/or soft derivation with `/`.
The encoded string are limited to 32 Bytes.
For technical information about the soft and hard derivations on Substrate, please refer to introduction [here](https://github.com/paritytech/parity-signer/wiki/HDKD-on-Parity-Signer#hdkd-general-on-substrate).
### Further notes
* Ethereum accounts will be generated after an Ethereum network is selected, no path is needed.
* With the same BIP32 seed users could create accounts under different networks. But if a user has a brain wallet seed, it can only create Ethereum accounts.
* The pin code is now bound to the identity instead of the account.
* Each derived account is prefixed with its network path id, which prevents it to be misused in another network.
## References:
1. [https://github.com/w3f/schnorrkel](https://github.com/w3f/schnorrkel)
2. [https://wiki.polkadot.network/docs/en/learn-keys](https://wiki.polkadot.network/docs/en/learn-keys)
# Parity Signer tutorial with Polkadot-js apps
This tutorial will walk you through setting up a Kusama account with the Parity Signer Android or iOS App and then use this account together with [Polkadot-js apps](https://polkadot.js.org/apps/) to see your balance and transfer funds or perform any extrinsic from this account.
* Notice: The UI maybe variant for different versions, but the functionalities are the same in v4 version.
## Summary
- [1. Get Parity Signer mobile application](#1-get-parity-signer-mobile-application)
- [2. Setup or recover an identity](#2-setup-or-recover-an-account)
- [Create an identity](#create-an-account)
- [Recover an identity with your recovery phrase](#recover-an-account-with-your-recovery-phrase)
- [3. Add Parity Signer's account to Polkadot-js apps](#3-add-parity-signers-account-to-polkadot-js-apps)
- [4. Sign a transaction](#4-sign-a-transaction)
## 1. Get Parity Signer mobile application
### Device security
Parity Signer is meant to be used offline. The mobile device used to run Parity Signer will hold valuable information that needs to be kept securely stored. It is therefore advised to:
- Get a Parity Signer dedicated mobile device.
- Make a factory reset.
- Enable full-disk encryption on the device, with a reasonable password (might not be on by default, for example for older Android devices).
- Do not use any biometrics such as fingerprint or face recognition for device decryption/unlocking, as those may be less secure than regular passwords.
- Once Parity Signer has been installed, enable airplane mode and make sure to switch off Wifi, Bluetooth or any connection ability of the device.
- Only charge the phone using a power outlet that is never connected to the internet. Only charge the phone with the manufacturer's charging adapter. Do not charge the phone on public USB chargers.
Please find more info [here](Parity-Signer-Mobile-App) about the Parity Signer application.
### Install Parity Signer mobile application
Install Parity Signer making sure that it originated from **Parity Technologies**
- [Android](https://play.google.com/store/apps/details?id=io.parity.signer)
- [iOS](https://itunes.apple.com/us/app/parity-signer/id1218174838)
## 2. Setup or recover an Identity
When launching the app for the first time, no identity has been set up yet. At this stage, you will either want to create an identity directly from your mobile device or recover an identity previously created.
### Create an identity
Tap on the `Create` button, and give a name to this identity.
In the next step, your recovery phrase will be presented to you. Think of it as a master key. If you lose it, you lose your money.
**Write this recovery phrase down and store it in a safe place**.
If your phone gets stolen/broken/forgotten this will be the only way to [recover your account](#recover-an-account-with-your-recovery-phrase).
You will then be asked to choose a pin code. This pin will be needed later on to unlock your account to manage the identity or sign a transaction.
The next screen will allow you to select a network to generate an account.
If you choose an Ethereum network, the related Ethereum account will be generated for the identity,
If you choose a Substrate network (like Kusama), you will first create a root account, and then you will be able to derive more accounts with specified paths and names. The name can be changed later on, but once the path is set, it can not be changed. More information about path derivation see [here](Parity-Signer-Hierarchical-Deterministic-Key-Derivation).
For each derived account, you will be able to see the address and its related QR code.
![create account](images/Parity-Signer-apps-0.png)
### Recover an identity with your recovery phrase
If you already have an account created with either Parity Signer or any other waller, you can recover it by doing so:
- Tap on the top right side user icon, and choose ` + Add Identity`.
- Input the new identity name and tap the `Recover Identity` button.
- Type in the recovery phrase, word suggestion helps you prevent any typo. The field will turn red if the recovery phrase is not a bip39.
- Tap `Recover Identity`.
- Select a PIN number and confirm it by typing it again.
- Identity generated, now you can select the network to create the first account.
NOTICE: For V3 user, after recovering the seed phrase of Kusama account, the account will appear as an identity root account aside with identity name in the network selection screen.
## 3. Add Parity Signer's account to Polkadot-js apps
To be able to follow this tutorial and interact with the Blockchain from a freshly created account on Parity Signer, you will need to get some KSMs on this account first. Polkadot-js apps allows you to manage your Signer account seamlessly.
- Visit [Polkadot-js apps](https://polkadot.js.org/apps/) website.
- Go to `Accounts` from the left sidebar.
- Click on `Add via QR` button in the top right-hand corner.
- It will ask for the webcam permission for you to scan the Parity Signer's account QR code, accept it.
- On Parity Signer, choose on the account you want to copy the address of.
- Scan the QR code displayed on your phone with your computer's webcam. Make sure the QR code is fully displayed on your mobile's screen.
- You can now name this account on Polkadot-js apps.
### 4. Sign a transaction
Assuming that your Parity Signer account now has funds, you will be able to send some funds securely to anyone, without transferring your private key, and without needing any internet connection on your mobile phone.
- On Polkadot-js apps, click on the `send` button next to your account.
- On Polkadot-js apps, enter the address of the account you want to send funds to. Make sure to try with a small amount of money first before sending larger amounts.
- Click on `Make Transfer`
- Review the transaction, you can add tip to this transaction.
- Click on `Scan via QR Code` when you're done.
![Parity Signer Polkadot send transaction](images/Parity-Signer-apps-tx-workflow.png)
You will now be presented with a QR code that represents the transaction. Since this transaction is sending funds from your Parity Signer mobile app account, only this account (sitting on your phone) can sign and authorise this transaction. This is what we'll do in the next steps:
- From the Parity Signer account overview, tap the scan button on the top right and scan the QR code presented by the Polkadot-js apps website.
- Review the transaction addresses and the amount to send on your phone. The amount and addresses must match what you've entered in apps. If you got phished, this is where you can realise it and reject the transaction.
- Once you're sure, scroll down and click `Sign Transaction` to enter your pin and get the QR code of the scanned transaction.
![Sign Polkadot apps transaction](images/Parity-Signer-apps-1.png)
Your phone has now *signed the transaction offline* using your Parity Signer account private key. The QR code that is now displayed on your phone represents a signed transaction that can be broadcasted. We will do this in the next steps:
- On Polkadot-js apps, click on `Scan Signature QR`, this will ask to turn on your webcam again.
- Face your phone's display to your webcam for the website to be able to read the signed transaction.
- Your transaction is sent automatically.
- Congrats you just sent funds from an air-gapped account :)
# Parity Signer tutorial with MyCrypto
This tutorial will walk through setting up an account with Parity Signer Android or iOs App and sign a transaction using [MyCrypto Desktop App](https://download.mycrypto.com/) to transfer Ether from one account to another.
* Notice: The UI maybe variant for different versions, but the functionalities are the same in v4 version.
## Summary
- [1. Get Parity Signer mobile application](#1-get-parity-signer-mobile-application)
- [2. Setup or recover an account](#2-setup-or-recover-an-account)
- [Create an account](#create-an-account)
- [Recover an account with your recovery phrase](#recover-an-account-with-your-recovery-phrase)
- [3. Copy Parity Signer account's address](#3-copy-parity-signer-accounts-address)
- [4. Sign a transaction on MyCrypto](#4-sign-a-transaction-using-mycrypto-desktop-app)
## 1. Get Parity Signer mobile application
### Device security
Parity Signer is meant to be used offline. The mobile device used to run Parity Signer will hold valuable information that needs to be kept securely stored. It is therefore advised to:
- Get a separate mobile device.
- Make a factory reset.
- Enable full-disk encryption on the device, with a reasonable password (might not be on by default, for example for older Android devices).
- Do not use any biometrics such as fingerprint or face recognition for device decryption/unlocking, as those may be less secure than regular passwords.
- Once Parity Signer has been installed, enable airplane mode and make sure to switch off Wifi, Bluetooth or any connection ability of the device.
- Only charge the phone using a power outlet that is never connected to the internet. Only charge the phone with the manufacturer's charging adapter. Do not charge the phone on public USB chargers.
Please find [here](Parity-Signer-Mobile-App) more info about the Parity Signer application.
### Install Parity Signer mobile application
Install Parity Signer making sure that it originated from **Parity Technologies**
- [Android](https://play.google.com/store/apps/details?id=io.parity.signer)
- [iOs](https://itunes.apple.com/us/app/parity-signer/id1218174838)
## 2. Setup or recover an account
When launching the app for the first time, no account has been set up yet. At this stage, you will either want to create an account directly from your mobile device or recover an account previously created with Parity Signer or [Parity UI / Wallet](https://wiki.parity.io/Parity-Wallet) (Desktop)
### Create an account
Tap on the `Create` button after Parity Signer's first launch, you can then name your identity.
In the next step, your recovery phrase will be presented to you. Think of it as a master key. If you lose it, you lose your money.
**Write this recovery phrase down and store it in a safe place**.
If your phone gets stolen/broken/forgotten this will be the only way to [recover your account](#recover-an-account-with-your-recovery-phrase).
You will then be asked to choose a pin code. This pin will be needed later on to unlock your account to manage the identity or sign a transaction.
The next screen you will allow you to select a network for generating an account.
![create account](images/Parity-Signer-apps-0.png)
### Recover an account with your recovery phrase
If you already have an account created with either Parity Signer or any other wallet, you can recover it by doing so:
- Tap on the top right side user icon, and choose ` + Add Identity`.
- Input the new identity name and tap the `Recover Identity` button.
- Type in the recovery phrase, word suggestion helps you prevent any typo. The field will turn red if the recovery phrase is not a bip39.
- Tap `Recover Identity`.
- Select a PIN number and confirm it by typing it again.
- Once your Identity is generated, you can select a network to create your first account.
## 3. Copy Parity Signer account's address
To be able to follow this tutorial and send Ether from a freshly created account on Parity Signer mobile app, you will need to get some Ether on this account first. A convenient way to copy the address of a new Parity Signer account is to use the `View & Send` option of MyCrypto Desktop App. Download, install and launch [MyCrypto Desktop App](https://download.mycrypto.com/).
- On MyCrypto App, click on Parity Signer.
- On Parity Signer account list, select the account you want to copy the address .
- Scan the QR code displayed on your phone with your computer's webcam. Make sure the QR code is fully displayed on your mobile's screen.
- You can now copy the address of your account in MyCrypto and send Ether to it from another account using your favourite Wallet application.
![create account](images/Parity-Signer-android-copy-address.gif)
### 4. Sign a transaction using MyCrypto Desktop App
Assuming that your Parity Signer account now has funds, you will be able to send some Ether securely to anyone, without transferring your private key, and without needing any internet connection on your mobile phone.
- To do so, click on `Parity Signer` from MyCrypto Desktop app.
![Mycrypto parity mobile signer app](images/Parity-Signer-MyCrypto-1.jpg)
- On your phone, select in the account list the account you want to send funds from of and tap `Show account QR code`.
- Scan the QR code displayed on your phone with your computer's webcam. Make sure the QR code is fully displayed on your mobile's screen.
- MyCrypto will now allow you to enter the address of the account you want to send Ether to as well as the amount of gas. Make sure to try with a small amount of Ether first before sending larger amounts.
- Click on `Send transaction` when you're done.
![Mycrypto parity mobile signer app](images/Parity-Signer-MyCrypto-2.png)
You will now be presented with a QR code that represents the transaction. Since this transaction is sending funds from your Parity Signer mobile app account, only this account (sitting on your phone) can sign and authorise this transaction. This is what we'll do in the next steps:
- From the Parity Signer mobile app, tap the scan button on the top right and scan the QR code presented by MyCrypto Desktop app.
- Review the transaction addresses and the amount to send on your phone. The amount and addresses must match what you've entered in MyCrypto. If you got phished, this is where you can realise it and reject the transaction.
- Once you're sure, scroll down and click `Sign Transaction` to enter your pin.
![create account](images/Parity-Signer-MyCrypto-3.png)
Your phone has now *signed the transaction offline* using your Parity Signer account private key. The QR code that is now displayed on your phone represents a signed transaction that can be broadcasted. We will do this in the next steps:
- On MyCrypto Desktop, click on `Scan`.
- Face your phone's display to your webcam for MyCrypto to be able to read the signed transaction.
- Verify one last time that the account addresses are correct as well as the amount to transfer on MyCrypto.
- Click `Send` on MyCrypto.
- Congrats you just sent Ether from an air-gapped account :)
![Mycrypto parity mobile signer app](images/Parity-Signer-MyCrypto-4.png)
# Recover Account from PolkadotJs
The default behaviour on Parity Signer and [PolkadotJs Apps](https://polkadot.js.org/apps/) is a little different. This tutorial will walk you through recovering an account on Parity Signer from PolkadotJs Apps.
* Notice: The UI maybe variant for different versions, but the functionalities are the same in v4 version.
## Get the mnemonic phrase and path
When creating an account on PolkadotJs, it will give you a mnemonic phrase on the beginning without any key derivation. You can change it if you click `Advanced creation options` button, here you can specify any path you like, leave it as an empty string if you do not want changes.
![Create Account on PolkadotJs Apps](./images/Polkadotjs-Create-Account.png)
## Recover identity with mnemonic phrase
On Parity Signer, each mnemonic phrase represents an identity, every account starts with an identity, and identity could derive infinite accounts from it. So firstly let's recover the identity from the mnemonic phrase.
![recover the identity](./images/Recover-Identity.png).
After tapping one network from the list, you will have the default account created for this network with a default path (as on the above image, `//polkadot`), **but this one is different with the one created from Polkadot.js Apps**, because the paths are different.
## create the account by path
On Parity Signer, accounts are grouped by different networks, and the accounts generated by the default way are always prefixed with the network name. For example, `//polkadot//fund` or `//polkadot//staking`. So to recover an account with an arbitrary path, we need tap Add Network Account -> Create Custom Path.
![Recover Account](./images/Recover-Path.png)
Here We can input the path from PokadotJs Apps, if you do not have a specific path, then just leave it empty. And then after we choose the network, we will have the same account as we created from PolkadotJs Apps.
# Building and Publishing
In this page we will list the steps to publish the app on iOS App Store / Android Play Store.
## iOS App Store
##### Build production version
1. Switch to the `master` branch and run `yarn build`
3. Build the JS bundle with `yarn build-prod:ios`
4. Start the react-native server with `yarn start`
5. Build the project in Xcode, with `Generic iOS Device` selected on the top left
##### Upload to iOS Store
1. On Xcode, Choose `Product -> Archieve`
2. In the following menu, click `Validate App`.
3. Click 'Distribute App' for uploading to Test Flight.
4. Then it should be seen on Test Flight on [Apple Connect](https://appstoreconnect.apple.com/), after it is approved, it could be used with the internal test team.
## Android Play Store
1. `yarn install` to install all the related dependencies.
3. `cd android && ./gradlew assembleRelease` for generating unsigned apk.
4. Sign the apk with keystore file
5. In Google Play Console -> Choose the App -> Release Management on Left Panel -> App Release on Left Panel -> Production track -> Manage -> Create Release -> Add the signed apk file here.
# Changelog
## Breaking Changes on Building
### Changes from 4.4.0
We extract the Rust part of Parity Signer to an independent npm library called [react-native-substrate-sign](https://github.com/paritytech/react-native-substrate-sign). The npm library includes prebuild ios static library (*.a) and android dynamic library (*.so), so that Parity Signer does not need to manually build Rust code anymore. Related to [#649](https://github.com/paritytech/parity-signer/issues/649)
### Changes from 4.3.1
From [4.3.1](https://github.com/paritytech/parity-signer/commit/ea5786c85661d9b176795b9386af640b3e73aff3) we use the latest prebuild NDK (r21) toolchains for building rust libraries for android, so that we do not need to build the standalone NDK toolchains manually. If you have built or develop Parity Signer before 4.3.1, please download the NDK r19 or newer[here](https://developer.android.com/ndk/downloads) and point the `NKD_HOME` environment variable to it with e.g. `export NDK_HOME=/path/to/latest/ndk`
# Development
### Requirements
- `node.js` ( `>=10`)
- `yarn` (tested on `1.6.0`)
#### iOS
- `cocoapods` (`$ sudo gem install cocoapods`)
- `Xcode` (only for iOS, tested on `Version 11.3.1 (9F2000)`)
#### Android
- `Android Studio` (only for Android, tested on `Version 3.3`)
- `$JAVA_HOME` envarionment variable set to java home directory (eg. `/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home`)
- `$ANDROID_HOME` environment variable set to Android SDK directory (eg. `/home/your_username/Android/Sdk`)*.
\* It's recommended to install **Android Studio** and use that to install the necessary build tools and SDKs for the Android version you want to test on. It's also the best way to test in the emulator.
### Setup
- Install Dependencies
```
yarn build
```
- Generate an Android Debug Key if it is first time.
```
./scripts/gen_key.sh
```
### Develop
- Start React Native server
```
yarn start
```
Then:
- iOS
```
yarn ios
```
- Android
```
yarn android
```
# HDKD on Parity Signer
## HDKD data schema on Parity Signer v4
In the v4 version, the data schema is significantly refactored in order to support HDKD feature.
### Highlights of the new schema
* With the same BIP32 seed users could create accounts under different networks. But if a user has a brain wallet seed, it can only create Ethereum accounts.
* Pin is now bound to the identity instead of the keypair.
* Additional derivation password could be set for identity in the future version, it will bind to identity.
* Users are able to create any combination of hard derivation with `//` or soft derivation with `/`, the path will be the index of the key pair/ account within a same seed.
* When receiving an upcoming signing request, Signer will first search in its address map `addresses` for the correct path, and then use the seed of the path for signing.
* Each derived keypair is coupled with a path ( which means it belongs to a certain network), which prevent it to be used in another network (e.g. derive a key pair under //kusama will only check the signing request with kusama's latest genesisHash, and won't sign a transaction on another Network)
* Network Schema could be updated by Scan QR code in the future version.
Furthermo