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

Convert2cc #7700

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Convert2cc #7700

wants to merge 25 commits into from

Conversation

scgbckbone
Copy link
Contributor

@scgbckbone scgbckbone commented Mar 7, 2022

  • add new plugin convert2cc

Testing:

  1. create multisig/singlesig wallet with non coldcard hardware device/s (in my case trezor, ledger)
  2. click on 'Wallet' tab and choose 'Information' - wallet information dialog will open and you should see 'convert2cc' button Screenshot from 2022-03-07 09-04-40
  3. if 2. does not hold - go to plugins, activate 'convert2cc' and go back to 2. (needs ckcc-protocol as dependency)
  4. if wallet created in 1. is singlesig disconnect hww and load same seed + passphrase (if used) to coldcard and connect it to PC, if multisig, do the same for just one cosigner
    (can be done even without Coldcard connected, it won't give you a hint based on master fingerprint match)
  5. click 'convert2cc' button in wallet information modal - convert2cc modal will pop up
    Screenshot from 2022-03-07 09-05-07
  6. one of the keystores/cosigner should match with your connected coldcard (icon_paired + [matches connected Coldcard])
    if your coldcard is not connected there will be no match Screenshot from 2022-03-07 09-40-07
  7. choose correct keystore and hit 'convert button'
  8. select how to name a where to store newly created converted wallet
  9. hit yes - confirming that you want to open newly created wallet
  10. old wallet is closed, converted wallet is opened and one of your devices is converted to Coldcard (should show paired icon)
  11. try that wallet is working as expected

@scgbckbone
Copy link
Contributor Author

  1. This only works for standard and multisig wallets - if tried with different one (i.e. imported) convert2cc modal:
    Screenshot from 2022-03-07 09-41-01
  2. at least one of keystore cosigners must not be coldcard (so there is something to convert):
    Screenshot from 2022-03-07 09-41-38

@@ -593,15 +594,16 @@ def on_cb(x):
if cb_checked:
self.config.set_key('dont_show_testnet_warning', True)

def open_wallet(self):
def open_wallet(self, filename=None):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add ability to skip getOpenFileName dialog if filename is provided

btn_close = CloseButton(dialog)
btns = Buttons(btn_export_info, btn_close)
vbox.addLayout(btns)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to https://github.com/spesmilo/electrum/pull/7682/files where we need an ability to add multiple buttons to wallet information dialog

vbox.addLayout(btns)
if wallet_info_btns:
# now more than one wallet_info_butons hook, needs concat
wallet_info_btns = reduce(operator.concat, wallet_info_btns)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now we also expect more than one hook to provide data

@@ -232,6 +232,8 @@ def run_hook(name, *args):
results.append(r)

if results:
if name == "wallet_info_buttons":
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure If I understand this constraint - why can only one result from hook be accepted? Here I expect more than one hook to provide data

if selected_index is not None:
target_keystore = keystores[selected_index]
with self.coldcards_connected() as connected_cc_clients:
# dev = self.match_candidate_keystore_to_connected_cc_device(connected_cc_clients, target_keystore)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now - not sending device to convert2cc - it is not needed and in current ckcc-protocol version it causes huge slowdown, see Coldcard/ckcc-protocol#17

avirgovi added 2 commits March 7, 2022 12:04
…plugged in coldcards that canont be open; change dialog closing logic
@scgbckbone
Copy link
Contributor Author

scgbckbone commented Mar 7, 2022

added msg of coldcard device which we cannot connect to but is plugged in (other application using it) if coldcard is opened in electrum a we can find it in device_manager.clients that connection to device will be used... also check #7701)

Screenshot from 2022-03-07 15-02-29

@scgbckbone
Copy link
Contributor Author

instead of warning for encrypted wallets - I found and easy way to preserve encryption settings. User can choose to preserve them or not (checkbox)

hardware device encryption:
Screenshot from 2022-03-10 09-21-25

password encryption:
Screenshot from 2022-03-10 09-25-38

If one chooses to preserve encryption settings, same pwd (pubkey) will be used for encryption. If one chooses NOT to preserve, newly generated wallet is plaintext and can be encrypted later via standard path (wallet -> password ...)

where one chooses which hardware device gets converted to Coldcard.<br>
All wallet data like contacts, labels, payment requests etc. are preserved.<br>
If you've chosen to change your hardware wallet to Coldcard, convert2cc<br>
will save you the hustle.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you meant hassle.

@SomberNight
Copy link
Member

Do I understand it correctly that the whole purpose of this plugin is to help users who have non-coldcard hw devices and want to migrate to coldcard? -- and this plugin creates a new wallet file which is sort of a copy of the existing one, except one of the keystores is replaced with Coldcard_KeyStore?

@scgbckbone
Copy link
Contributor Author

yes and yes, yet it's more of the implementation what you've described, purpose is to preserve all wallet "metadata" like labels, payment requests, contacts etc. and only change hww device

@Kamranwew70 Kamranwew70 linked an issue Apr 19, 2022 that may be closed by this pull request
Closed
@SomberNight SomberNight removed a link to an issue Aug 6, 2022
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants