Author

Topic: .JSON file vs zpub in Electrum (Read 117 times)

legendary
Activity: 2254
Merit: 4260
🔐BitcoinMessage.Tools🔑
January 18, 2023, 04:37:41 AM
#10
In case you missed it, here is an official guide on how to make air-gapped transactions with Coldcard and Electrum: https://www.youtube.com/watch?v=fNZgVHq0FGM

The process doesn't seem too complicated:

1) you open your Electrum wallet and construct transaction as if it is "normal" transaction
2) then click "Finalize"
3) click "Export" -> "For hardware device; include xpubs" -> "Export to file"
4) select a name for your new file: "file.psbt" for example and put it on MicroSD card.
5) import to your Coldcard and select "Ready to sign" from the options
6) confirm all details and transfer signed transaction back to Electrum
7) select "Tools" -> "Load transaction" -> "From file" and select the file you transfered
Cool click "Broadcast"

Hope this information will help you to recover funds.


hero member
Activity: 1050
Merit: 681
January 18, 2023, 02:12:26 AM
#9
Oh cool. Is there any specification for this particular wallet format?
I have not tried it personally but in this video[1] they have successfully shown how to import a .json file into electrum. Its pretty old one but maybe still valid with the current (newer) versions?!

[1] How to setup COLDCARD with electrum: https://youtu.be/u5jRJ8L1Vwo
legendary
Activity: 2338
Merit: 5297
Self-proclaimed Genius
legendary
Activity: 1526
Merit: 6442
bitcoincleanup.com / bitmixlist.org
January 18, 2023, 01:45:58 AM
#7
I'm an Electrum user, and AFAIK, there is no option to import JSON into Electrum. So do you have any idea what kind of data is inside the .json file you are trying to import?
Since he's talking about Coldcard, it's the exported .json file with simple data like keystore, script type, path, etc. which can be loaded in Electrum as a new wallet.
Using "File->Open" will import it and Electrum will then format it into a proper Electrum wallet.

Oh cool. Is there any specification for this particular wallet format? There could also be some description in the Electrum source code for it, right? But I would assume that ColdCard has some page about it, no?
legendary
Activity: 2338
Merit: 5297
Self-proclaimed Genius
January 18, 2023, 01:40:17 AM
#6
I'm an Electrum user, and AFAIK, there is no option to import JSON into Electrum. So do you have any idea what kind of data is inside the .json file you are trying to import?
Since he's talking about Coldcard, it's the exported .json file with simple data like keystore, script type, path, etc. which can be loaded in Electrum as a new wallet.
Using "File->Open" will import it and Electrum will then format it into a proper Electrum wallet.
legendary
Activity: 1526
Merit: 6442
bitcoincleanup.com / bitmixlist.org
January 17, 2023, 08:56:37 AM
#5
I'm an Electrum user, and AFAIK, there is no option to import JSON into Electrum. So do you have any idea what kind of data is inside the .json file you are trying to import?

You can import x/y/zpubs, addresses, privkeys, BIP39/Electrum seedphrases, and the corresponding formats for multisig. And of course there is the integration with hardware wallets that might let you put in additional data.

Conversely when you export the JSON file from ColdCard, it already contains the correct fingerprint so the PSBT created that way is not rejected.

You mean the output descriptor?
legendary
Activity: 3402
Merit: 10424
January 15, 2023, 12:38:18 AM
#4
It is not possible to find the problem without seeing the PSBT contents but usually problems like this are caused by the wallet creating the wrong "fingerprint" for the transaction the wallet sends to the other device/tool to sign. This is why your Electrum wallet created using the master public key is showing correct derivation path and correct addresses but the PSBT is rejected.
Conversely when you export the JSON file from ColdCard, it already contains the correct fingerprint so the PSBT created that way is not rejected.
hero member
Activity: 1050
Merit: 681
January 14, 2023, 11:08:03 PM
#3
So, what is PTSB?, I just heard today from you.
It should be PSBT (not PTSB), should've been a typo error made by OP. Btw, PSBT means Partially Signed Bitcoin Transaction

Using PSBTs, a transaction can be crafted with a watch-only wallet, which does not have access to the private keys needed to sign the transaction. The watch-only wallet can then export a PSBT file, which can be imported to a wallet which does contain the required private keys.
 
hero member
Activity: 798
Merit: 736
January 14, 2023, 10:49:00 PM
#2
However, when I extract zpub master public key and add it to watch only wallet in Electrum, I get exactly the same addresses and balances as with .json file. But when I try to sign a transaction by extracting PTSB file, it doesn't work, Coldcard gives error message that wallet signatures don't match.
as you mentioned as watch only wallet that is impossible to sign a transaction because there isn't key to open it. so that possible PTSB is also doesn't have key to sign. So, what is PTSB?, I just heard today from you.

Can someone explain the difference between .json file and zpub master key. Do they contain exactly the same data in different format or there is a real difference. Also, is there an increased risk by exposing .json file to the public/hackers vs xpub/zpub?
Yes, they do NOT Exactly the same data .json file you can not use for wallet where aren't support it, while zpub master key you can extract it first from a tool that you can get the key to importing to another wallet.

Someone from Coinkite suggested that the issue is probably different paths, but if the paths are different, wouldn't you get different addresses? In my case, I get 2 identical Electrum wallets with exactly same addresses (native segwit). Except when using zpub in Electrum, I can't sign a transaction (different master key fingerprint).
Maybe Coinkite support means not as derivation path, but a other path like .json file. or code.
Like electrum, we can't import private key without code front [p2pkh:, p2wpkh-p2sh:, p2wpkh]
newbie
Activity: 1
Merit: 0
January 14, 2023, 02:18:25 PM
#1
Hello,

I posted this in Coldcard reddit but didn't really get a proper explanation so I hope someone can explain what is really the issue.

As per the Coldcard guide, you would need to export .json file and open it with Electrum where you would see all your addresses but you need Coldcard to sign a transaction to send coins (either via cable or PTSB signed file). This works with no issues.

However, when I extract zpub master public key and add it to watch only wallet in Electrum, I get exactly the same addresses and balances as with .json file. But when I try to sign a transaction by extracting PTSB file, it doesn't work, Coldcard gives error message that wallet signatures don't match.

Can someone explain the difference between .json file and zpub master key. Do they contain exactly the same data in different format or there is a real difference. Also, is there an increased risk by exposing .json file to the public/hackers vs xpub/zpub?
Someone from Coinkite suggested that the issue is probably different paths, but if the paths are different, wouldn't you get different addresses? In my case, I get 2 identical Electrum wallets with exactly same addresses (native segwit). Except when using zpub in Electrum, I can't sign a transaction (different master key fingerprint).

Thanks in advance.
Jump to: