Skip to content

Commit 24814b0

Browse files
authored
Merge pull request #731 from PROWLERx15/update-docs
[Documentation] Improved Docs
2 parents f818f92 + 662693b commit 24814b0

13 files changed

+176
-172
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This pull request is categorized as a:
1414

1515
## Checklist
1616

17-
- [ ] I’ve run `pytest` and made sure all unit tests pass before sumbitting the PR
17+
- [ ] I’ve run `pytest` and made sure all unit tests pass before submitting the PR
1818

1919
If you modified or added functionality/workflow, did you add new unit tests?
2020

README.md

Lines changed: 24 additions & 23 deletions
Large diffs are not rendered by default.

docs/code_structure.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
# Code Structure
22

3-
SeedSigner roughly follows a Model-View-Controller approach. Like in a typical web app (e.g. Flask) the `View`s can be called as needed like individual web urls. After completing display and interaction with the user, the `View` then decides where to route the user next, analogous to a web app returning a `response.redirect(url)`.
4-
5-
The `Controller` then ends up being quite stripped down. For example, there's no need for a web app's `urls.py` since there are no mappings from url to `View` to maintain since we're not actually using a url/http routing approach.
6-
7-
`View`s have to handle user interaction so there are `while True` loops that cycle between waiting for user input, gathering data, and then updating the UI components accordingly. You wouldn't find this kind of cycle in a web app because this sort of interactive user input is handled in the browser at the html/css/js level.
3+
SeedSigner roughly follows a Model-View-Controller approach. Like in a typical web app (e.g. Flask), the `View`s can be called as needed like individual web URLs. After completing display and interaction with the user, the `View` then decides where to route the user next, analogous to a web app returning a `response.redirect(URL)`.
84

5+
The `Controller` then ends up being quite stripped down. For example, there's no need for a web app's `urls.py` since there are no mappings from URL to `View` to maintain since we're not actually using a URL/HTTP routing approach.
96

7+
`View`s have to handle user interaction, so there are `while True` loops that cycle between waiting for user input, gathering data, and then updating the UI components accordingly. You wouldn't find this kind of cycle in a web app because this sort of interactive user input is handled in the browser at the HTML/CSS/JS level.
108

119
* `Model`s: Store the persistent settings, the in-memory seeds, current wallet information, etc.
1210
* `Controller`: Manages the state of the world and controls access to global resources.
1311
* `View`s: Implementation of each screen. Prepares relevant data for display. Must also instantiate the display objects that will actually render the UI.
14-
* `gui.screens`: Re-usable formatted UI renderers.
12+
* `gui.screens`: Reusable formatted UI renderers.
1513
* `gui.components`: Basic individual UI elements that are used by the `templates` such as the top nav, buttons, button lists, text displays.
1614

17-
In an typical webserver context the `View` would send data to an html template (e.g. Jinja) which would then dynamically populate the page with html elements like `<input>`, `<button>`, `<img>`, etc. This is analgous to our `gui.screens` constructing a UI renderer by piecing together various `gui.components` as needed.
18-
19-
15+
In a typical web server context, the `View` would send data to an HTML template (e.g. Jinja) which would then dynamically populate the page with HTML elements like `<input>`, `<button>`, `<img>`, etc. This is analogous to our `gui.screens` constructing a UI renderer by piecing together various `gui.components` as needed.
2016

2117
`Controller` is a global singleton that any `View` can access and update as needed.

docs/debug_crash.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,45 @@
1-
## Debugging a Crash for advanced (technical) users
1+
## Debugging a Crash for Advanced (Technical) Users
22

33
These instructions are intended to help users of SeedSigner provide crash exception and traceback logs to developers to aid in troubleshooting and resolving bugs.
44

55
### Testnet vs Mainnet
66

7-
Whenever possible recreate a crash in testnet. This will help avoid accidently revealing private information about yourself, your bitcoin transactions, or lose any funds.
7+
Whenever possible, recreate a crash in testnet. This will help avoid accidentally revealing private information about yourself, your Bitcoin transactions, or losing any funds.
88

9-
### Network connected SeedSigner
9+
### Network-Connected SeedSigner
1010

11-
If you are using SeedSigner for development and testing, then I recommend network access via ssh to view crash logs. Follow [these](https://github.com/SeedSigner/seedsigner/blob/main/docs/usb_relay.md) instructions to setup a USB relay for internet access. You can also connect your SeedSigner to Wifi if you have a rasp pi zero w/ wifi.
11+
If you are using SeedSigner for development and testing, then we recommend network access via SSH to view crash logs. Follow [these](https://github.com/SeedSigner/seedsigner/blob/main/docs/usb_relay.md) instructions to set up a USB relay for internet access. You can also connect your SeedSigner to WiFi if you have a Raspberry Pi Zero W with WiFi.
1212

13-
### Airgapped debugging setup
13+
### Airgapped Debugging Setup
1414

15-
If you are using SeedSigner for mainnet transactions, then do not connect your device to a network or the internet. Instead connect your SeedSigner to a HDMI display (without internet) and a USB keyboard. This will require an HDMI adapter and micro USB to USB A adapter. Plug in the HDMI display and keyboard before powering on SeedSigner. The password for the SeedSigner pi user is `raspberry`.
15+
If you are using SeedSigner for mainnet transactions, then do not connect your device to a network or the internet. Instead, connect your SeedSigner to an HDMI display (without internet) and a USB keyboard. This will require an HDMI adapter and a micro USB to USB A adapter. Plug in the HDMI display and keyboard before powering on SeedSigner. The password for the SeedSigner pi user is `raspberry`.
1616

17-
### Debugging steps
17+
### Debugging Steps
1818

19-
At this point you should be signed into the pi user either on a HDMI display (via command line) or a ssh connection.
19+
At this point, you should be signed into the pi user either on an HDMI display (via command line) or an SSH connection.
2020

21-
Follow these steps to setup a debug session.
21+
Follow these steps to set up a debug session:
2222

23-
`cd seedsigner/src`
23+
1. Navigate to the source directory:
24+
```bash
25+
cd seedsigner/src
26+
```
2427

25-
`nano settings.ini`
28+
2. Edit the settings file:
29+
```bash
30+
nano settings.ini
31+
```
2632

27-
in nano editor change `debug = False` to `debug = True` (case sensitive). Save and exit settings.ini.
33+
3. In the nano editor, change `debug = False` to `debug = True` (case sensitive). Save and exit settings.ini.
2834

29-
stop the seedsigner systemd process by running
35+
4. Stop the SeedSigner systemd process:
36+
```bash
37+
sudo systemctl stop seedsigner.service
38+
```
3039

31-
`sudo systemctl stop seedsigner.service`
32-
33-
now start the python app manually by running
34-
35-
`python3 main.py`
40+
5. Start the Python app manually:
41+
```bash
42+
python3 main.py
43+
```
3644

3745
SeedSigner should now be up and running. Keep it connected to the display and keyboard. Recreate the steps to cause the crash. The traceback log and exception will be displayed on the HDMI display.

docs/developer_tips.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
### Quickly generate a new seed to test with
44
Generate a new 12- or 24-word seed via [https://iancoleman.io/bip39/](https://iancoleman.io/bip39/).
55

6-
Access a `python3` environment that has the `embit` library installed (e.g. your own local machine, ssh into the SeedSigner, etc)
6+
Access a `python3` environment that has the `embit` library installed (e.g., your own local machine, SSH into the SeedSigner, etc.).
77

8-
Start a python REPL session by just typing: `python3`
9-
10-
Paste in the following but insert your newly generated mnemonic:
8+
Start a `python3` REPL session by typing:
9+
```bash
10+
python3
1111
```
12+
13+
Paste in the following code (replace the seed phrase with your newly generated mnemonic):
14+
15+
```python
1216
from embit import bip39
1317
seed_phrase = "smoke chimney announce candy glory tongue refuse fatigue cricket once consider beef treat urge wing deny gym robot tobacco adult problem priority wheat diagram"
1418
data = ""
@@ -19,7 +23,7 @@ for word in seed_phrase.split(" "):
1923
print(data)
2024
```
2125

22-
For the seed in the snippet, you should see:
26+
For the example seed phrase above, you should see:
2327
```
2428
163803200074026607961827144306700411123603780160185419152013046908321497181700301371136719990487
2529
```
@@ -28,35 +32,36 @@ Take the output and paste it into a [QR code generator](https://www.the-qrcode-g
2832

2933
Start up SeedSigner's UI to import a seed from a QR code. Scan the new QR code and you're good to go!
3034

31-
3235
# Advanced developer notes
3336

3437
## Backup an SD card
3538

36-
You can back up and restore any size SD card but the process is a little inefficient so the bigger the source SD card, the bigger the backup will be and the longer it'll take to create (and even longer to image back to a new SD card), even if most of the card is blank.
39+
You can back up and restore any size SD card, but the process is a little inefficient. The bigger the source SD card, the bigger the backup will be and the longer it'll take to create (and even longer to image back to a new SD card), even if most of the card is blank.
3740

38-
You can restore a backup image to an SD card of the same or larger size. So it's strongly recommended to do repetitive development work on a smaller card that's easier to backup and restore. Once the image is stabilized, then write it to a bigger card, if necessary (that being said, there's really no reason to use a large SD card for SeedSigner. An 8GB SD card is more than big enough).
41+
You can restore a backup image to an SD card of the same or larger size. It's strongly recommended to do repetitive development work on a smaller card that's easier to backup and restore. Once the image is stabilized, then write it to a bigger card, if necessary (that being said, there's really no reason to use a large SD card for SeedSigner. An 8GB SD card is more than big enough).
3942

40-
Insert the SD card into a Mac/Linux machine and create a compressed img file.
43+
### Steps to create a backup:
4144

42-
First verify the name of your SD card:
45+
1. Insert the SD card into a Mac/Linux machine
46+
2. Verify the name of your SD card:
4347

44-
```
48+
```bash
4549
# Mac:
4650
diskutil list
4751

4852
# Linux:
4953
sudo fdisk -l
5054
```
5155

52-
It will most likely be `/dev/disk1` on most systems.
56+
The device will most likely be `/dev/disk1` on most systems.
5357

54-
Now we use `dd` to clone and `gzip` to compress it. Note that we reference the SD card by adding an `r` in front of the disk name. This speeds up the cloning considerably.
58+
3. Create a compressed backup using `dd` and `gzip`. Note that we reference the SD card by adding an `r` in front of the disk name to speed up the cloning process:
5559

56-
```
60+
```bash
5761
sudo dd if=/dev/rdisk1 conv=sparse bs=4m | gzip -9 > seedsigner.img.gz
5862
```
5963

6064
The process should take about 15 minutes and will typically generate a roughly 1.1GB image.
6165

62-
To restore from your backup image, just use the Raspberry Pi Imager. Remember that you can only write it to an SD card of equal or greater size than the original SD card.
66+
### Restoring from backup
67+
To restore from your backup image, use the Raspberry Pi Imager. Remember that you can only write it to an SD card of equal or greater size than the original SD card.

docs/dice_verification.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,19 @@ As usual: Don't Trust, Verify!<br>
77
<br><br>
88
**Note:**<br>
99
**Do NOT use this with any seed you want to use later with real funds. This exercise is only for checking that the independent codebases get to the same end result!**<br>
10-
**However, if you do want to check your real seedphrases you should download the Iancoleman and/or Bitcoiner.Guide tools onto an airgapped, ephemeral computer (e.g. using tails-OS) and perform these tests on there. Destroy/abandon the TailsOS afterwards.**<br>
10+
**However, if you do want to check your real seed phrases you should download the Ian Coleman and/or Bitcoiner.Guide tools onto an airgapped, ephemeral computer (e.g. using Tails-OS) and perform these tests on there. Destroy/abandon the Tails-OS afterwards.**<br>
1111
**Never input seed phrases that you intend to use to store real funds onto an internet-connected computer!!!**
1212
<br><br><br>
1313

1414
## 99 Dice Rolls / 24 Seed Words Example
1515

16-
The following 99 dice roll results are used in the verification steps as an example for a 24 words seed:<br>
16+
The following 99 dice roll results are used in the verification steps as an example for a 24-word seed:<br>
1717
> 655152231316521321611331544441236164664431121534415633526456254462245546236542364246312613322234612
1818
1919
The corresponding 24 seed words are:<br>
2020
> eyebrow obvious such suggest poet seven breeze blame virtual frown dynamic donor harsh pigeon express broccoli easy apology scatter force recipe shadow claim radio
2121
2222
(Scroll down near the end to see result values for a 50 dice rolls / 12 seed words example)
23-
<br><br><br>
2423

2524
## Creating seed via Dice rolls in SeedSigner (here v0.6.0)
2625

@@ -56,7 +55,7 @@ Keep the SeedSigner open and the newly created seed still loaded as we will need
5655
## Create new wallet from seed in Sparrow Wallet to see xpub/zpub and addresses
5756

5857
Go to https://www.sparrowwallet.com/download/ and download the release version supported by your operating system.<br><br>
59-
Open Sparrow Wallet, go to 'File' menu and select 'New Wallet'. Enter a name (e.g. test), and click 'Create Wallet'.<br><br>
58+
Open Sparrow Wallet, go to the 'File' menu and select 'New Wallet'. Enter a name (e.g. test), and click 'Create Wallet'.<br><br>
6059
Click 'Airgapped Hardware Wallet' (1) and click on the 'Scan' button in the SeedSigner entry (2) which will open the camera scan screen:<br>
6160
<kbd><img src="img/dicedoc/sparrow_wallet_1.png"></kbd>
6261

@@ -84,7 +83,7 @@ Go to https://iancoleman.io/bip39 and check 'Show entropy details' (1):<br>
8483
<br>
8584
Make sure to check (1) 'Hex' and (2) '24 Words' as 'Mnemonic Length'.<br>
8685
(Do not use 'dice' format because dice 6 will be replaced by 0).<br>
87-
Then enter the 99 dices numbers in (3). The corresponding seed words are shown in (4):<br>
86+
Then enter the 99 dice numbers in (3). The corresponding seed words are shown in (4):<br>
8887
<kbd><img src="img/dicedoc/coleman_verify.png"></kbd>
8988
<br><br>
9089
The 24 seed words are the same in SeedSigner and the Ian Coleman tool.
@@ -144,7 +143,7 @@ Compare to zpub in Sparrow:<br>
144143
<kbd><img src="img/dicedoc/sparrow_zpub.png"></kbd>
145144
<br>
146145

147-
Zpub is the same as shown in SeedSigner, Sparrow and Ian Colemand tool.
146+
Zpub is the same as shown in SeedSigner, Sparrow and Ian Coleman tool.
148147
<br><br>
149148
**Addresses:**<br>
150149
Scroll down a little bit where the receive addresses are shown and compare to the ones generated in Sparrow ('Addresses' tab of the wallet):<br>
@@ -163,10 +162,10 @@ Check that the change addresses all match.
163162

164163
## 50 Dice Rolls / 12 Seed Words Example
165164

166-
SeedSigner supports the creation of mnenomic seeds both with 12 or 24 seed words corresponding to 50 or 99 dice rolls. Below are some example result values for using 50 dice rolls only.<br><br>
167-
All the steps shown can be executed the same way, just select the '12 words (50 rolls)' option in SeedSigner and change the 'Mnenomic Length' dropdown boxes in both web tools to '12 Words'.<br><br>
165+
SeedSigner supports the creation of mnemonic seeds both with 12 or 24 seed words corresponding to 50 or 99 dice rolls. Below are some example result values for using 50 dice rolls only.<br><br>
166+
All the steps shown can be executed the same way, just select the '12 words (50 rolls)' option in SeedSigner and change the 'Mnemonic Length' dropdown boxes in both web tools to '12 Words'.<br><br>
168167

169-
50 dice roll results as an example for a 12 words seed:<br>
168+
50 dice roll results as an example for a 12-word seed:<br>
170169
> 65515223131652132161133154444123616466443112153441
171170
172171
The corresponding 12 seed words are:<br>
@@ -246,7 +245,7 @@ python3 mnemonic.py -h
246245
python3 mnemonic.py coins 1111100111...
247246
248247
# 256 coin flips / 24-word mnemonic
249-
python mnemonic.py coins 0010111010...
248+
python3 mnemonic.py coins 0010111010...
250249
251250
# GENERATE 50 random dice rolls / 12-word mnemonic
252251
python3 mnemonic.py dice rand12

docs/electrum.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# SeedSigner Electrum seed phrase support
1+
# SeedSigner Electrum Seed Phrase Support
22

3-
SeedSigner supports loading of [Electrum's Segwit seed phrases](https://electrum.readthedocs.io/en/latest/seedphrase.html#electrum-seed-version-system). This is considered an Advanced feature that is disabled by default.
3+
SeedSigner supports loading of [Electrum's SegWit seed phrases](https://electrum.readthedocs.io/en/latest/seedphrase.html#electrum-seed-version-system). This is considered an Advanced feature that is disabled by default.
44

5-
To load an Electrum Segwit seed phrase, first enable Electrum seed support in Settings -> Advanced -> Electrum seed support. After this option is enabled, the user will now be able to enter an Electrum seed phrase by selecting "Enter Electrum seed" in the Load Seed screen.
5+
To load an Electrum SegWit seed phrase, first enable Electrum seed support in Settings -> Advanced -> Electrum seed support. After this option is enabled, the user will now be able to enter an Electrum seed phrase by selecting "Enter Electrum seed" in the Load Seed screen.
66

77
Some SeedSigner functionality is deliberately disabled when using an Electrum mnemonic:
88

@@ -11,5 +11,5 @@ Some SeedSigner functionality is deliberately disabled when using an Electrum mn
1111
- SeedQR backups
1212
- Since Electrum seeds are not supported by other SeedQR implementations, it would be dangerous to use SeedQR as a backup tool for Electrum seeds and is thus disabled
1313
- Custom derivations
14-
- Hard coded derivation path and script types in SeedSigner to match Electrum wallet software. These are m/0h for single sig and m/1h for multisig
14+
- Hard-coded derivation path and script types in SeedSigner to match Electrum wallet software. These are m/0h for single sig and m/1h for multisig
1515
- User-chosen custom derivations are thus not supported for Electrum seeds

0 commit comments

Comments
 (0)