Add reason for why device is disabled in new wallet screen (#932)

* Fix #931

* Fix #930

* docs: update TOC

Co-authored-by: ben-kaufman <ben-kaufman@users.noreply.github.com>
This commit is contained in:
benk10 2021-02-12 16:25:56 +02:00 committed by GitHub
parent 2e98f96451
commit 6204df9c2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 23 deletions

View file

@ -9,8 +9,8 @@
- [GENERAL QUESTIONS](#general-questions)
- [*How safe is the app to use? Is it still considered alpha/beta or safe enough to use it with real sats in a HWW or Specter-DIY multisig setup?*](#how-safe-is-the-app-to-use-is-it-still-considered-alphabeta-or-safe-enough-to-use-it-with-real-sats-in-a-hww-or-specter-diy-multisig-setup)
- [*What does WIP mean?*](#what-does-wip-mean)
- [*What's the difference between specter-desktop and specter-DIY?*](#whats-the-difference-between-specter-desktop-and-specter-diy)
- [*Is a full node necessary for using specter-desktop?*](#is-a-full-node-necessary-for-using-specter-desktop)
- [*What's the difference between Specter-desktop and Specter-DIY?*](#whats-the-difference-between-specter-desktop-and-specter-diy)
- [*Is a full node necessary for using Specter-desktop?*](#is-a-full-node-necessary-for-using-specter-desktop)
- [*Can I use pruned mode?*](#can-i-use-pruned-mode)
- [*I'm not sure I want the Bitcoin-Core wallet functionality to be used, is that mandatory? If so, is it considered secure?*](#im-not-sure-i-want-the-bitcoin-core-wallet-functionality-to-be-used-is-that-mandatory-if-so-is-it-considered-secure)
- [How many addresses does an HD wallet have, and are they all the same?](#how-many-addresses-does-an-hd-wallet-have-and-are-they-all-the-same)
@ -19,7 +19,7 @@
- [*If the Bitcoin Core instance we are connecting to already has a wallet, is it possible to load it via the UI if we know the name, and could we import a .dat file?*](#if-the-bitcoin-core-instance-we-are-connecting-to-already-has-a-wallet-is-it-possible-to-load-it-via-the-ui-if-we-know-the-name-and-could-we-import-a-dat-file)
- [*How are Bitcoin Core mnemonic seeds created? With Core there's only the option to backup the wallet.dat file, so how does specter-desktop transform the wallet.dat file into a mnemonic seed?*](#how-are-bitcoin-core-mnemonic-seeds-created-with-core-theres-only-the-option-to-backup-the-walletdat-file-so-how-does-specter-desktop-transform-the-walletdat-file-into-a-mnemonic-seed)
- [*Why when I export a multisig wallet from specter-desktop (settings > export > copy wallet data) created from devices with only segwit ZPUBs, do I get a data structure with expected segwit derivation paths but XPUBs instead?*](#why-when-i-export-a-multisig-wallet-from-specter-desktop-settings--export--copy-wallet-data-created-from-devices-with-only-segwit-zpubs-do-i-get-a-data-structure-with-expected-segwit-derivation-paths-but-xpubs-instead)
- [*Does Specter have Coin Control?*](#does-specter-have-coin-control)
- [*Does Specter have coin control?*](#does-specter-have-coin-control)
- [USAGE](#usage)
- [*How do I run the app?*](#how-do-i-run-the-app)
- [*What types of ways can I run specter-desktop?*](#what-types-of-ways-can-i-run-specter-desktop)
@ -27,16 +27,16 @@
- [*What do I need to do in order to create a multisig wallet?*](#what-do-i-need-to-do-in-order-to-create-a-multisig-wallet)
- [*Is my understanding correct that specter-desktop does not hold any keys and you need to create a multisig wallet in order to sign transactions and send funds?*](#is-my-understanding-correct-that-specter-desktop-does-not-hold-any-keys-and-you-need-to-create-a-multisig-wallet-in-order-to-sign-transactions-and-send-funds)
- [*How would one sign with Electrum? Do I need to create multisig wallet in Electrum first or can I create it with specter-desktop?*](#how-would-one-sign-with-electrum-do-i-need-to-create-multisig-wallet-in-electrum-first-or-can-i-create-it-with-specter-desktop)
- [*Can I use Ledger and Coldcard multisig while CC remains airgapped?*](#can-i-use-ledger-and-coldcard-multisig-while-cc-remains-airgapped)
- [*Can I use Ledger and ColdCard multisig while CC remains air-gapped?*](#can-i-use-ledger-and-coldcard-multisig-while-cc-remains-air-gapped)
- [*Can I use Bluewallet with Specter DIY?*](#can-i-use-bluewallet-with-specter-diy)
- [*Which HWW's are supported?*](#which-hwws-are-supported)
- [*Which hardware wallets are supported?*](#which-hardware-wallets-are-supported)
- [*Can this also work with external nodes like Casa, MyNode, and Raspilitz?*](#can-this-also-work-with-external-nodes-like-casa-mynode-and-raspilitz)
- [*Can I use Tor?*](#can-i-use-tor)
- [*How to set the URL for the block explorer?*](#how-to-set-the-url-for-the-block-explorer)
- [I forgot my password, how can i reset it!](#i-forgot-my-password-how-can-i-reset-it)
- [I forgot my password, how can i reset it?](#i-forgot-my-password-how-can-i-reset-it)
- [BACKING UP FUNDS](#backing-up-funds)
- [*If something happens to the `~/.specter` folder, is it still possible to **restore** acccess to multisigs created there (assuming there is no backup of the `~/.specter` folder)?*](#if-something-happens-to-the-specter-folder-is-it-still-possible-to-restore-acccess-to-multisigs-created-there-assuming-there-is-no-backup-of-the-specter-folder)
- [*To recover a multisig that was built on specter (eg: 2 of 3 with Coldcard), is having the seeds of all 3 signing wallets sufficient or do we need to backup more info?*](#to-recover-a-multisig-that-was-built-on-specter-eg-2-of-3-with-coldcard-is-having-the-seeds-of-all-3-signing-wallets-sufficient-or-do-we-need-to-backup-more-info)
- [*If something happens to the `~/.specter` folder, is it still possible to **restore** access to multisigs created there (assuming there is no backup of the `~/.specter` folder)?*](#if-something-happens-to-the-specter-folder-is-it-still-possible-to-restore-access-to-multisigs-created-there-assuming-there-is-no-backup-of-the-specter-folder)
- [*To recover a multisig that was built on specter (eg: 2 of 3 with ColdCard), is having the seeds of all 3 signing wallets sufficient or do we need to backup more info?*](#to-recover-a-multisig-that-was-built-on-specter-eg-2-of-3-with-coldcard-is-having-the-seeds-of-all-3-signing-wallets-sufficient-or-do-we-need-to-backup-more-info)
- [SPECTER-DIY](#specter-diy)
- [*What does the Specter-DIY consist of?*](#what-does-the-specter-diy-consist-of)
- [*Is specter-DIY safe to use?*](#is-specter-diy-safe-to-use)
@ -45,7 +45,7 @@
- [*Do you have a physical security design?*](#do-you-have-a-physical-security-design)
- [*Is there a simulator I can try the Specter-DIY with?*](#is-there-a-simulator-i-can-try-the-specter-diy-with)
- [*Is there a goal to get Specter-DIY loading firmware updates from the SD card?*](#is-there-a-goal-to-get-specter-diy-loading-firmware-updates-from-the-sd-card)
- [*Can specter-DIY register cosigner xpubs like coldcard? I know you wipe private keys on shutdown, but do you save stuff like that?*](#can-specter-diy-register-cosigner-xpubs-like-coldcard-i-know-you-wipe-private-keys-on-shutdown-but-do-you-save-stuff-like-that)
- [*Can Specter-DIY register cosigner xpubs like ColdCard? I know you wipe private keys on shutdown, but do you save stuff like that?*](#can-specter-diy-register-cosigner-xpubs-like-coldcard-i-know-you-wipe-private-keys-on-shutdown-but-do-you-save-stuff-like-that)
- [*Once you add the javacard (secure element) you'll save the private keys, too?*](#once-you-add-the-javacard-secure-element-youll-save-the-private-keys-too)
- [SPECTER-DEVKIT](#specter-devkit)
- [*Can I buy the Specter-devkit pre-built?*](#can-i-buy-the-specter-devkit-pre-built)
@ -70,9 +70,9 @@
- [*Does specter-desktop require `txindex=1` to be set in your `bitcoin.conf`?*](#does-specter-desktop-require-txindex1-to-be-set-in-your-bitcoinconf)
- [*Does specter-desktop specify an RPC wallet in the `bitcoin.conf` or append wallet name to node url?*](#does-specter-desktop-specify-an-rpc-wallet-in-the-bitcoinconf-or-append-wallet-name-to-node-url)
- [FUTURE FEATURES](#future-features)
- [*How are you guys planning to do airgapped firmware updates via QR codes?*](#how-are-you-guys-planning-to-do-airgapped-firmware-updates-via-qr-codes)
- [*How are you guys planning to do air-gapped firmware updates via QR codes?*](#how-are-you-guys-planning-to-do-air-gapped-firmware-updates-via-qr-codes)
- [*Will this device be Shamir Secret Shares compatible?*](#will-this-device-be-shamir-secret-shares-compatible)
- [*Will there be coinjoin support in the future?*](#will-there-be-coinjoin-support-in-the-future)
- [*Will there be CoinJoin support in the future?*](#will-there-be-coinjoin-support-in-the-future)
- [VIDEOS](#videos)
- [**1** Getting started with Specter-DIY and Specter-Desktop](#1-getting-started-with-specter-diy-and-specter-desktop)
- [**2** Assembling Specter-DIY](#2-assembling-specter-diy)

View file

@ -111,6 +111,26 @@ class Device:
return True
return "" in self.key_types(network)
def no_key_found_reason(self, wallet_type, network="main"):
if wallet_type == "multisig" and self.device_type == "bitbox02":
return "BitBox02 multisig is not yet supported. Stay tuned for future versions."
if self.has_key_types(wallet_type, network=network):
return ""
reverse_network = "main" if is_testnet(network) else "test"
if wallet_type == "multisig":
for key_type in self.key_types(reverse_network):
if key_type in ["", "sh-wsh", "wsh"]:
return "Multisig compatible keys were found, but for the wrong network, make sure to add keys for the right network."
elif wallet_type == "simple":
for key_type in self.key_types(reverse_network):
if key_type in ["", "sh-wpkh", "wpkh"]:
return "Single-sig compatible keys were found, but for the wrong network, make sure to add keys for the right network.".format(
"Single key" if wallet_type == "simple" else "Multisig"
)
return "No keys found with the correct derivation type for a {} wallet.".format(
"single key" if wallet_type == "simple" else "multisig"
)
def __eq__(self, other):
if other is None:
return False

View file

@ -272,7 +272,6 @@ def new_wallet(wallet_type):
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
purposes=purposes,
cosigners=devices,
wallet_type=wallet_type,
sigs_total=len(devices),
@ -297,7 +296,6 @@ def new_wallet(wallet_type):
]
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
purposes=purposes,
cosigners=devices,
wallet_type=wallet_type,
sigs_total=len(devices),
@ -332,7 +330,6 @@ def new_wallet(wallet_type):
]
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
purposes=purposes,
cosigners=devices,
wallet_type=wallet_type,
sigs_total=len(devices),
@ -351,7 +348,6 @@ def new_wallet(wallet_type):
err = "Failed to create wallet..."
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
purposes=purposes,
cosigners=cosigners,
wallet_type=wallet_type,
sigs_total=len(devices),
@ -399,7 +395,6 @@ def new_wallet(wallet_type):
if action == "preselected_device":
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
purposes=purposes,
cosigners=[
app.specter.device_manager.get_by_alias(request.form["device"])
],

View file

@ -8,14 +8,19 @@
{% endif %}
<div class="row overflow">
{# Disable BitBox02 multisig for now... #}
{% for device_name in specter.device_manager.devices_names if wallet_type != 'multisig' or specter.device_manager.devices[device_name].device_type != 'bitbox02' %}
{% for device_name in specter.device_manager.devices_names %}
{% set device = specter.device_manager.devices[device_name] %}
<label>
<input type="{{ 'checkbox' if wallet_type == 'multisig' else 'radio' }}" {% if wallet_type == 'simple' %} onchange="document.getElementById('submit-device').click()" {% endif %} name="devices" value="{{ device.alias }}" class="hidden" chain="{{specter.chain}}" {% if not device.has_key_types(wallet_type, specter.chain) %}disabled{% endif %}>
<label style="position: relative;">
<input type="{{ 'checkbox' if wallet_type == 'multisig' else 'radio' }}" {% if wallet_type == 'simple' %} onchange="document.getElementById('submit-device').click()" {% endif %} name="devices" value="{{ device.alias }}" class="hidden" chain="{{specter.chain}}" {% if not device.has_key_types(wallet_type, specter.chain) or (wallet_type == 'multisig' and specter.device_manager.devices[device_name].device_type == 'bitbox02') %}disabled{% endif %}>
<div class="small-card radio" id="{{device.alias}}">
<img src="{{ url_for('static', filename='img/devices/' ~ device.icon) }}" width="18px">
{{ device_name }}
</div>
{% if not device.has_key_types(wallet_type, specter.chain) or (wallet_type == 'multisig' and specter.device_manager.devices[device_name].device_type == 'bitbox02') %}
<tool-tip title="Device cannot be selected" style="position: absolute; top: 30px; left: 25px;">
{{device.no_key_found_reason(wallet_type, specter.chain)}}
</tool-tip>
{% endif %}
</label>
{% endfor %}
<a href="{{ url_for('devices_endpoint.new_device') }}" style="text-decoration: none; color: #fff;">

View file

@ -166,11 +166,7 @@
{% endfor %}
<button type="submit" name="action" value="key" class="btn centered action">Create wallet</button>
</form>
<div class="spacer"></div>
<div class="note">
<center>Here we only show <b>{{ purposes[wallet_type] }}</b> and <b>General</b> keys. Follow the standards.</center>
</div>
{% endblock %}
{% block scripts %}
<script>