-
Notifications
You must be signed in to change notification settings - Fork 145
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
Xor seedsave #94
base: master
Are you sure you want to change the base?
Xor seedsave #94
Conversation
I have no idea why there are these other commits in this PR, I have run |
|
nvm, I wasn't looking properly, my commits were off another branch, not master. That has been resolved now. |
Let me know if this is valuable, I plan to write something along the lines of these tests:
Not sure if all of the use cases will be testable though, for example, I don't know if I can make a test assuming that there is no SD card since the tests don't control the emulator's startup. |
It is useful. We were planning to do something similar, except with just XOR of 1.. so you might call it "ephemeral seeds" |
I deleted and re-init the repo now that I've rebased, I'm trying to get the thing to build. I am getting the following errors when I run
Any idea why/what I need to install to get this to build now? Thanks @doc-hex I am running Arch Linux by the way, but if there is a specific piece of debian software that I need, I can usually find it's equivalent in the Arch package repository. |
NVM, new dependency required from linux repository: |
I'm struggling to get tests passing. I've tried the following commands: pytest --sim
pytest --sim -m "not bitcoind and not qrcode and not unfinalized"
pytest --sim -m qrcode I had to make a change to
This was because after running the tests in Now I am struggling with tests that assume NFC is enabled. I can of course run tests by file, however, I\d like to understand how should I be ensuring that my tests are well written and will not break other tests? Also, is there a way to write a test that can force the simulator to think it has no SD card without requiring manual intervention? Thanks. |
with regards to SD card - what you're looking for is Recently we've also added |
Thanks for contributing to COLDCARD source code, please be as descriptive as possible.
By submitting this work you agree to the Individual Contributor License Agreement (CLA)
I hope this is useful and not controversial, I am building on the seed xor work (love it btw).
TODO list:
[x] Implement loading from file
[x] Implement saving to file
[x] Manually test edge cases
[x] Make existing tests pass
[ ] Create new tests to cover new functionality
This PR will introduce saving and restoring XOR from sd cards.
The idea here, is that similar to passphrases, you can store one seed on the device, and another on an SD card.
When you wish to sign, you must log in using your pin, then you must restore the seed xor from file and you may then sign a transaction, bringing a more secure alternative to the passphrase.
Of course, this is not a replacement for backing up the XOR seed words.
When creating an XOR file, you are told to have your seed words ready, this is a hint to have an already valid seed word. As the ColdCard is not creating the words, there is no need for a quiz.
Loading from SD Card is not enabled if you have no existing seed words (eg. first time use). This makes no sense anyway as the file is encrypted using an existing xpriv, so if you don't have an existing xpriv, we can't decrypt the file anyway.
When you are restoring seed XOR words, you will be asked whether you wish to "enter manually" or load from sd card.
The code is defensive, and if reading, decrypting or parsing the file fails, then the user will see a message, no action was taken, and they will be able to continue where they left off.
One thing that is novel here, is that once the XOR has been applied, you cannot decrypt the file anymore as we will always use the currently in use private key to decrypt and parse any xor files.
A user can store multiple xor files on multiple sd cards and restore them, or they can put them all on one sd card.
You are NOT offered to save your XOR to file after creating one, that feels complicated. Instead, you are able to create XOR files at any time through a separate menu.