Skip to content

Commit

Permalink
Merge pull request selfcustody#250 from selfcustody/docs_update
Browse files Browse the repository at this point in the history
Docs update
  • Loading branch information
odudex authored Sep 19, 2023
2 parents ba0bbc8 + 61e1051 commit a63dc4a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 48 deletions.
34 changes: 12 additions & 22 deletions docs/encrypted-qr-codes.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,20 @@ There are many possible security layers one could add to protect a wallet’s pr
## QR Data and Parsing
In search of efficiency and smaller QR codes, all data is converted to bytes and organized like a Bitcoin transaction, with variable and fixed length fields. The following data is present on the QR code:

| ID length | ID | Version | Key Derivations | IV | Encrypted Mnemonic | Validation Block |
| ID length (1) | ID (2) | Version (3) | Key Derivations (4) | IV (5) | Encrypted Mnemonic (6) | Validation Block (7) |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 1 Byte | Variable | 1 Byte | 3 Bytes | 16 Bytes <br>(optional) | 16 Bytes (12 words) <br>32 Bytes (24 words) | 16 Bytes |

### Public:

(1) - Mnemonic ID length (1 Byte).

(2) - Mnemonic ID(variable lenght): Custom ID or wallet fingerprint.

(3) - Version(1 Byte): Version of encryption method, currently two are available:

0: AES-ECB-PBKDF2: Electronic Codebook with PBKDF2 key derivation.

1: AES-CBC-PBKDF2: Cypher Block Chaining with PBKDF2 key derivation.

(4) - Key derivation iterations(3 Bytes): Number of PBKDF2 key derivations times 10,000.

### Cipher:

(5) - IV(16 Bytes-optional): Initial vector for AES-CBC encryption, possibility to be nonce for future AES-CTR or other encryption methods.

(6) - Encrypted Mnemonic(16 Bytes - 12 words, 32 Bytes - 24 words): Mnemonic ciphertext.

(7) - Validation block(16 Bytes): Currently using first 16 bytes of sha256 of the mnemonic bytes as checksum, could be used in future to store AES-AEX validation tag.
* **Visible data** (1 to 4):
* **(1)** Mnemonic ID length (1 Byte).
* **(2)** Mnemonic ID (variable lenght): Custom ID or wallet fingerprint.
* **(3)** Version (1 Byte): Version of encryption method, currently two are available:
- 0: AES-ECB-PBKDF2: Electronic Codebook with PBKDF2 key derivation.
- 1: AES-CBC-PBKDF2: Cypher Block Chaining with PBKDF2 key derivation.
* **(4)** Key derivation iterations (3 Bytes): Number of PBKDF2 key derivations times 10,000.
* **Cipher data** (5 to 7):
* **(5)** IV (16 Bytes-optional): Initial vector for AES-CBC encryption, possibility to be nonce for future AES-CTR or other encryption methods.
* **(6)** Encrypted Mnemonic (16 Bytes - 12 words, 32 Bytes - 24 words): Mnemonic ciphertext.
* **(7)** Validation block (16 Bytes): Currently using first 16 bytes of sha256 of the mnemonic bytes as checksum, could be used in future to store AES-AEX validation tag.


13 changes: 5 additions & 8 deletions docs/faq.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ However, in practice not all wallet software supports this extended format, so K

For more information, check out [https://outputdescriptors.org/](https://outputdescriptors.org/).

## Why am I unable to sign a PSBT from BlueWallet?
As mentioned above, some wallet software does not support the descriptor key expression format. In this case, BlueWallet will ignore the key origin and derivation info when importing the xpub to create a single-sig wallet. This will result in the wrong derivation being used in BlueWallet and thus the inability to sign an outbound transaction in Krux.

Currently, the way to properly create a single-sig wallet in BlueWallet is to export the second QR code that Krux displays which contains the zpub. BlueWallet can then correctly infer the derivation path when creating the wallet.

## Why isn't Krux scanning my QR code?
The level of detail that you see is what Krux sees. If the QR code shown on the device's screen is blurry, the camera lens of the device may be out of focus. It can be adjusted by rotating it (with your fingertip or a tweezers) clockwise or counter-clockwise to achieve a clearer result.
The level of detail that you see is what Krux sees. If the QR code shown on the device's screen is blurry, the camera lens of the device may be out of focus. It can be adjusted by rotating it clockwise or counter-clockwise to achieve a clearer result. The lenses usually comes with a drop of glue that makes id harder to adjust for the first time. You can use your fingertip, tweezers or small precision pliers to help, being careful to don't damage the fragile lenses.

If you have adjusted the lens already, the device may be too far away or too close to the code to read it. Start by holding the device as close to the QR code as possible and pulling away slowly until all or most of the QR code is viewable within the screen. If the code on the screen looks crisp, Krux should read it quickly and give you immediate feedback.

If you are in a dark environment, you can hold down the ENTER button of the M5StickV or Maix Amigo to turn on their LED light to potentially increase visibility. M5stickV and Amigo also has an anti-glare mode to better capture images with incident light, to enable/disable the anti-glare just push the PAGE button.
If you are in a dark environment, you can hold down the ENTER button of the M5StickV or Maix Amigo to turn on their LED light to potentially increase visibility. M5stickV and Amigo also has an anti-glare mode to better capture images from high brightness screens or with incident light, to enable/disable the anti-glare just press the PAGE button.

## Why am I getting an error when I try to scan a QR code?
If Krux is recognizing that it sees a QR code but is displaying an error message after reading it, the likely reason is that the QR code is not in a format that Krux understands.
Expand All @@ -45,7 +40,9 @@ For PSBTs, Krux recognizes:
Additionally, Krux recognizes animated QR codes that use either the plaintext `pMofN` or binary [`UR`](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md) encodings.

## Why can't my computer read the QR code that Krux displays?
If you are using an M5StickV, the small screen makes it difficult for laptop webcams to capture enough detail to parse the QR codes it displays. In the future, more work will be done to support displaying lower density QR codes. For now, a workaround you can do is to take a picture or video of the QR code with a better-quality camera (such as your phone), then enlarge and display the photo or video to your webcam. Alternatively, it may be simpler to use a mobile wallet such as BlueWallet with the M5StickV since phone cameras don't seem to have issues reading the small QR codes. You can also save the PSBT on a microSD card for Krux to sign and then save the signed transaction to the microSD card to transfer the file to the computer or phone.
If you are using an M5StickV, the small screen makes it difficult for laptop webcams to capture enough detail to parse the QR codes it displays.
You can toggle brightness of QR codes from public keys and PSBTs by pressing PAGE button.
In the future, more work will be done to support displaying lower density QR codes. For now, a workaround you can do is to take a picture or video of the QR code with a better-quality camera (such as your phone), then enlarge and display the photo or video to your webcam. Alternatively, it may be simpler to use a mobile wallet such as BlueWallet with the M5StickV since phone cameras don't seem to have issues reading the small QR codes. You can also save the PSBT on a microSD card for Krux to sign and then save the signed transaction to the microSD card to transfer the file to the computer or phone.

## Why isn't my Amigo device being recognized when connected to the computer USB?
Make sure you’re using the bottom USB-C port, not the one on the left side. It is also possible that there is some incompatibility with the cable used, try a few before investigating further.
Expand Down
12 changes: 6 additions & 6 deletions docs/getting-started/generating-a-mnemonic.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ At the start screen, once you select `New Mnemonic`, you will be taken to a seco
<img src="../../img/maixpy_amigo_tft/new-mnemonic-options-150.png">
<img src="../../img/maixpy_m5stickv/new-mnemonic-options-125.png">

# Camera
## Camera
<img src="../../img/maixpy_m5stickv/new-mnemonic-via-snapshot-sha256-125.png" align="right">
<img src="../../img/maixpy_amigo_tft/new-mnemonic-via-snapshot-sha256-150.png" align="right">

(Experimental!) Choose between 12 or 24 words, then take a random picture and Krux will generate a mnemonic from the hash of the image bytes.

<div style="clear: both"></div>

# Dice Rolls
## Dice Rolls

## Via D6
### Via D6
<img src="../../img/maixpy_m5stickv/new-mnemonic-via-d6-roll-1-125.png" align="right">
<img src="../../img/maixpy_amigo_tft/new-mnemonic-via-d6-roll-1-150.png" align="right">

Expand All @@ -24,15 +24,15 @@ The entropy in a single roll of a D6 is 2.585 bits ( log<sub>2</sub>(6) ); there

<div style="clear: both"></div>

## Via D20
### Via D20
<img src="../../img/maixpy_m5stickv/new-mnemonic-via-d20-roll-1-125.png" align="right">
<img src="../../img/maixpy_amigo_tft/new-mnemonic-via-d20-roll-1-150.png" align="right">

Since a D20 has more possible outcomes, the entropy is increased per roll to 4.322 bits ( log<sub>2</sub>(20) ). This means that only 30 rolls are necessary to create a 12-word mnemonic and 60 rolls for a 24-word mnemonic.

<div style="clear: both"></div>

## How it works
### How it works
<img src="../../img/maixpy_m5stickv/new-mnemonic-via-d6-roll-string-125.png" align="right">
<img src="../../img/maixpy_amigo_tft/new-mnemonic-via-d6-roll-string-150.png" align="right">

Expand All @@ -53,7 +53,7 @@ Note: For 12-word mnemonics, only the first half of the SHA256 hash is used (128

<div style="clear: both"></div>

# Alternatives
## Alternatives
See [here](https://vault12.com/securemycrypto/cryptocurrency-security-how-to/seed-phrase-creation/) for good methods to generate a mnemonic manually, or visit [Ian Coleman's BIP-39 Tool](https://iancoleman.io/bip39/) offline or on an airgapped device to generate one automatically.

It's worth noting that Ian's tool is able to take a mnemonic and generate a QR code that Krux can read in via the QR input method mentioned on the next page.
Expand Down
4 changes: 3 additions & 1 deletion docs/getting-started/settings.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,7 @@ If your device has touchscreen you can change the touch detection threshold. If

### Encoder

If your device has a rotary encoder, you can change the debounce threshold in milliseconds. The lower the value, the faster it detects wheel rotation. Increase the value if it is difficult to get a single input from the wheel rotation.
If your device has a rotary encoder, you can change the debounce threshold in milliseconds. With lower values, faster movements and navigation will be allowed.

The caveat is low values can cause issues, such as double step and unexpected movements, especially with lower quality encoders. If this is the case increase the value to make navigation more stable.

20 changes: 10 additions & 10 deletions docs/parts.en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Krux compatible devices comparative table
**Krux compatible devices comparative table**

| Device | M5stickV | Maix Amigo | Maix Dock | Maix Bit |
| ------------- | ------------- | ------------- | ------------- | ------------- |
Expand All @@ -16,9 +16,8 @@
All devices feature Kendryte K210 chip:
28nm process, dual-core RISC-V 64bit @400MHz, 8 MB high-speed SRAM, DVP camera and MCU LCD interface, AES Accelerator, SHA256 Accelerator, FFT Accelerator

# Part List

## M5StickV
## Devices
### M5StickV
Available from many distributors, including:

- [M5Stack](https://shop.m5stack.com/products/stickv)
Expand All @@ -32,7 +31,7 @@ Available from many distributors, including:

You can expect to pay around $50 for one depending on which distributor you choose.

## Maix Amigo
### Maix Amigo
Available from many distributors, including:

- [Seeed Studio](https://www.seeedstudio.com/Sipeed-Maix-Amigo-p-4689.html)
Expand All @@ -44,24 +43,25 @@ Available from many distributors, including:

You can expect to pay around $70 for one depending on which distributor you choose.

## Maix Dock and Maix Bit
### Maix Dock and Maix Bit
For the DIYers, the Maix Dock and Bit are also supported but will require sourcing the parts individually and building the device yourself.

Below are example implementations with instructions on how to recreate them:

- [https://github.com/selfcustody/DockEncoderCase](https://github.com/selfcustody/DockEncoderCase)
- [https://github.com/selfcustody/MaixBitCase](https://github.com/selfcustody/MaixBitCase)

## USB-C Charge Cable
## Ohter parts
### USB-C Charge Cable
This will be included with the M5StickV and Maix Amigo that you purchase from one of the distributors above. It will be necessary to power and charge the device and to initially flash the firmware.

## (Optional) MicroSD Card
### (Optional) MicroSD Card
Not all microSD cards will work with the devices. Make sure to use one that has been [tested and shown to work](https://github.com/m5stack/m5-docs/blob/master/docs/en/core/m5stickv.md#tf-cardmicrosd-test) with the devices already. The size of the SD card isn't important; anything over a few megabytes will be plenty.

## (Optional) Thermal Printer
### (Optional) Thermal Printer
Krux has the ability to print all QR codes it generates, including mnemonic, xpub, wallet backup, and signed PSBT, via a locally-connected [thermal printer from Adafruit](https://www.adafruit.com/?q=thermal+printer) over its serial port.

Any of their thermal printers will work, but the [starter pack](https://www.adafruit.com/product/600) would be the easiest way to get started since it includes all the parts (except the one below) you will need to begin printing.

## (Optional) Conversion Cable for Thermal Printer
### (Optional) Conversion Cable for Thermal Printer
To connect the printer to the device, you will need a [conversion cable](https://store-usa.arduino.cc/products/grove-4-pin-male-to-grove-4-pin-cable-5-pcs) with a 4-pin female Grove connector on one end (to connect to the device) and 4-pin male jumpers on the other end (to connect to the printer). You can find them at one of the distributors above or from Amazon.
2 changes: 1 addition & 1 deletion docs/support.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
hide:
- navigation
---
# Support the Project

## Ways you can help
### Development
Audit the code, file an issue, make a pull request, or do all three. :)
Expand Down

0 comments on commit a63dc4a

Please sign in to comment.