-
Notifications
You must be signed in to change notification settings - Fork 179
Add Bitcoin Core descriptor export #32
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
Conversation
| change=1 if internal else 0 | ||
| )), | ||
| 'range': [0, 1000], | ||
| 'timestamp': 'now', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Colcard have a clock and know when the seed was generated? If so, that could be added here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly Coldcard has no idea of time nor block height.
|
This looks great and is obviously useful. I will review and get feedback to you asap. |
|
@Sjors Please review my test case ( |
|
Thanks! The test looks OK, but maybe you want to add a test that interacts with bitcoind, and checks that Another useful feature I think would be to print the first couple of addresses in the txt file, so users can more easily check that they didn't mess up the import. |
|
Yes, on both counts. |
|
Also, if you want to add support for airgapped transaction signing, you could add support for reading a plain text file with the base64 encoded PSBT. And for the signed result, you could even add the required command, I believe the GUI console lets you nest stuff: sendrawtransaction(finalizepsbt(PSBT)) |
|
Coldcard supports binary PSBT files coming from MicroSD already. If the result is a finalized transaction (as in typical single-signer case), then the hex-encoded transaction is also saved to MicroSD card. |
|
I can import the keys into bitcoind, but I don't have a good way to test they got in there.
{'address': 'tb1qxvzlcjr2djne6n60q0ytzet49mcqumpdqmluzm',
'ischange': False,
'ismine': False,
'isscript': False,
'iswatchonly': False,
'iswitness': True,
'labels': [],
'scriptPubKey': '00143305fc486a6ca79d4f4f03c8b165752ef00e6c2d',
'solvable': False,
'witness_program': '3305fc486a6ca79d4f4f03c8b165752ef00e6c2d',
'witness_version': 0}In particular:
I am using 0.18.1 |
|
You should create a fresh bitcoind wallet for this, and it needs to be watch-only (see
But Bitcoin Core doesn't. So users can only put a (unsigned) base58 encoded PSBT on the SD card.
Ok, so then the user can call |
|
|
a2329cf looks good to me. If you use #32 in the commit description, Github will automatically add a comment to this thread linking to it. You could use this to make the tests works on Windows and Linux: https://github.com/cryptoadvance/specter-desktop/blob/aa0513f5521f672bc24e6e615d07dd5bd8c6a103/src/rpc.py#L8-L16 |
This PR may have broken some tests; I can clean that up later, after initial feedback.
Bitcoin Core 0.18 a later added support for output descriptors and watch-only wallets. This makes it much easier import keys from Coldcard. In fact, it's what HWI uses internally.
This PR allows air gapped import of public keys, by adding a new menu item:

This produces a text file with a command, that can be copy-pasted to import public keys into Bitcoin Core. This is the same command HWI produces in the setup step, but doesn't require an USB connection.
This RP also adds more detailed Bitcoin Core instructions. It removes previous instructions that imo are too complicated and error prone. However I can add them back if needed, e.g. under an "older versions" heading.
Like Wasabi this only supports bech32 addresses. Mixing and matching P2SH and bech32 addresses in Bitcoin Core currently breaks compatiliity with BIP59 / BIP84. Future descriptor wallets will be able to mix and match safely, if anyone still uses P2SH wrapped SegWit by then.
To add PSBT loading and saving support to Bitcoin Core GUI, please review: bitcoin/bitcoin#17509. Until then, PSBT support is command-line only and uses the JSON instead of binary format. I added a link to HWI documentation for how to sign transactions.