Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typos and bugfix #19

Merged
merged 2 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/getting-started/using-a-single-sig-wallet.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@ Selecting `single-sig` will derive an xpub using the derivation path `m/84'/0'/0

Choose to create a *Single key wallet* when it asks which type of wallet you want on the following screen.

<img src="../../img/specter/select-wallet-type-screen-singlekey-400.png">
<img src="../../img/specter/select-wallet-type-screen-singlesig-400.png">

Select the device you just added.

<img src="../../img/specter/pick-device-screen-singlekey-400.png">
<img src="../../img/specter/pick-device-screen-singlesig-400.png">

Give your wallet a name and make sure to select *Segwit* for the wallet type, then press *Create wallet*.

<img src="../../img/specter/create-singlekey-wallet-screen-600.png">
<img src="../../img/specter/create-singlesig-wallet-screen-600.png">

Congrats, you just created a single-sig wallet with your key!

=== "Sparrow"

In Sparrow, create a new wallet by going to *File > New Wallet* and give it a name.

<img src="../../img/sparrow/new-singlekey-wallet-400.png">
<img src="../../img/sparrow/new-singlesig-wallet-400.png">

On the wallet screen, make sure to select a *Single Signature* policy type with the *Native Segwit (P2WPKH)* script type.

<img src="../../img/sparrow/singlekey-wallet-settings-400.png">
<img src="../../img/sparrow/singlesig-wallet-settings-400.png">

Now, you will need to import your public key. To do so, press the *Airgapped Hardware Wallet* button under *Keystores*. On the screen that pops up, Krux is not listed as one of the available device types, so look for the *Specter DIY* option and click its *Scan...* button.

Expand All @@ -75,7 +75,7 @@ Selecting `single-sig` will derive an xpub using the derivation path `m/84'/0'/0

It should import the xpub and show a key under *Keystores* like the following:

<img src="../../img/sparrow/keystore-singlekey-key-settings-600.png">
<img src="../../img/sparrow/keystore-singlesig-key-settings-600.png">

If everything looks right, click the blue *Apply* button to create your wallet.

Expand All @@ -102,7 +102,7 @@ Selecting `single-sig` will derive an xpub using the derivation path `m/84'/0'/0

It should import the key and create a watch-only wallet. From here, you can send or receive.

<img src="../../img/blue/singlekey-wallet-home-400.png">
<img src="../../img/blue/singlesig-wallet-home-400.png">

Congrats, you just created a single-sig wallet with your key!

Expand Down Expand Up @@ -146,11 +146,11 @@ Selecting `single-sig` will derive an xpub using the derivation path `m/84'/0'/0

Load the wallet into Krux by tapping the ellipsis in the top-right to see the wallet settings.

<img src="../../img/blue/singlekey-wallet-home-400.png">
<img src="../../img/blue/singlesig-wallet-home-400.png">

From here, tap *Export/Backup* in order to display a QR code of your wallet.

<img src="../../img/blue/export-singlekey-wallet-400.png">
<img src="../../img/blue/export-singlesig-wallet-400.png">

In Krux, select the *Wallet* menu item option and scan the QR code.

Expand All @@ -174,7 +174,7 @@ Selecting `single-sig` will derive an xpub using the derivation path `m/84'/0'/0

Navigate to the *Receive* screen where you should see a receive address that you can send funds to.

<img src="../../img/sparrow/singlekey-receive-address-600.png">
<img src="../../img/sparrow/singlesig-receive-address-600.png">

=== "BlueWallet"

Expand Down
11 changes: 7 additions & 4 deletions src/krux/qr.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ def parse_pmofn_qr_part(data):
def detect_format(data):
"""Detects the QR format of the given data"""
qr_format = FORMAT_NONE
if data.startswith("p") and data.index("of") <= 5:
qr_format = FORMAT_PMOFN
elif data.lower().startswith("ur:"):
qr_format = FORMAT_UR
try:
if data.startswith("p") and data.index("of") <= 5:
qr_format = FORMAT_PMOFN
elif data.lower().startswith("ur:"):
qr_format = FORMAT_UR
except:
pass
return qr_format
68 changes: 34 additions & 34 deletions tests/pages/test_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def test_scan_address(mocker, m5stickv, tdata):
cases = [
# Single-sig, loaded, owned address, No print prompt, search successful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"bc1qrhjqrz2d9tdym3p2r9m2vwzn2sn2yl6k5m357y",
None,
Expand All @@ -21,8 +21,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, not loaded, owned address, No print prompt, search successful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
False,
"bc1qrhjqrz2d9tdym3p2r9m2vwzn2sn2yl6k5m357y",
None,
Expand All @@ -31,8 +31,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, owned address, Print, search successful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"bc1qrhjqrz2d9tdym3p2r9m2vwzn2sn2yl6k5m357y",
MockPrinter(),
Expand All @@ -41,8 +41,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, owned address, Decline to print, search successful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"bc1qrhjqrz2d9tdym3p2r9m2vwzn2sn2yl6k5m357y",
MockPrinter(),
Expand Down Expand Up @@ -91,8 +91,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned address, No print prompt, search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"bc1q6y95p2qkcmsr7kp5zpnt04qx5l2slq73d9um62ka3s5nr83mlcfsywsn65",
None,
Expand All @@ -111,8 +111,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/44 address, No print prompt, skip search
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"14ihRbmxbgZ6JN9HdDDo6u6nGradHDy4GJ",
None,
Expand All @@ -121,8 +121,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/44 address, No print prompt, search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"14ihRbmxbgZ6JN9HdDDo6u6nGradHDy4GJ",
None,
Expand All @@ -131,8 +131,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/44 address, No print prompt, 2x search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"14ihRbmxbgZ6JN9HdDDo6u6nGradHDy4GJ",
None,
Expand All @@ -141,8 +141,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/48/0/0/2 address, No print prompt, search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"1BRwWQ3GHabCV5DP6MfnCpr6dF6GBAwQ7k",
None,
Expand All @@ -151,8 +151,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/84 address, No print prompt, search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"bc1qx2zuday8d6j4ufh4df6e9ttd06lnfmn2cuz0vn",
None,
Expand All @@ -161,8 +161,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/49 address, No print prompt, search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"32iCX1pY1iztdgM5qzurGLPMu5xhNfAUtg",
None,
Expand All @@ -171,8 +171,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/0 address, No print prompt, search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"3KLoUhwLihgC5aPQPFHakWUtJ4QoBkT7Aw",
None,
Expand All @@ -181,8 +181,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/0 address, Print, search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"3KLoUhwLihgC5aPQPFHakWUtJ4QoBkT7Aw",
MockPrinter(),
Expand All @@ -191,8 +191,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, unowned m/0 address, Decline to print, search unsuccessful
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"3KLoUhwLihgC5aPQPFHakWUtJ4QoBkT7Aw",
MockPrinter(),
Expand All @@ -201,8 +201,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, fail to capture QR of address, No print prompt, can't search
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
None,
None,
Expand All @@ -211,8 +211,8 @@ def test_scan_address(mocker, m5stickv, tdata):
),
# Single-sig, loaded, invalid address, No print prompt, can't search
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
True,
"invalidaddress",
None,
Expand Down Expand Up @@ -258,8 +258,8 @@ def test_list_receive_addresses(mocker, m5stickv, tdata):
cases = [
# Single-sig, loaded, No print prompt, show address nº1
(
tdata.SINGLEKEY_12_WORD_KEY,
tdata.SPECTER_SINGLEKEY_WALLET_DATA,
tdata.SINGLESIG_12_WORD_KEY,
tdata.SPECTER_SINGLESIG_WALLET_DATA,
False,
"bc1qrhjqrz2d9tdym3p2r9m2vwzn2sn2yl6k5m357y",
None,
Expand Down
Loading