selfcustody / krux

Open-source signing device firmware for Bitcoin
https://selfcustody.github.io/krux/
Other
179 stars 36 forks source link

Add option to generate mnemonic from camera feed #38

Open ghost opened 2 years ago

ghost commented 2 years ago

It looks like SeedSigner does this, and it seems like a promising way to generate a mnemonic that is random if done right.

Will need to brush up on my stats knowledge, but here's my initial rough plan:

I'm thinking you would calculate entropy from the images using Shannon's formula and display to the user a progress bar / percent until enough entropy is collected. Once you have good/enough entropy, the words (numbers, really) are generated and then a Chi-squared test is performed on the generated words as a sanity check.

May want to also use a similarity function to compare the images and reject "duplicates" so that the user is forced to move the camera around?

tadeubas commented 1 year ago

This issue could be closed, as it already was implemented by @odudex on the branch __new_features__ https://github.com/odudex/krux/

ghost commented 1 year ago

I asked @odudex to mark the feature experimental until we can add in some code to better gauge the entropy of the captured image. One image probably has more entropy than I was originally thinking, but I know it'll be less than the amount of bits in the image. I'd rather we try to estimate the entropy and display it to the user somehow, hence why I wrote this:

I'm thinking you would calculate entropy from the images using Shannon's formula and display to the user a progress bar / percent until enough entropy is collected. Once you have good/enough entropy, the words (numbers, really) are generated and then a Chi-squared test is performed on the generated words as a sanity check.

This and https://github.com/selfcustody/krux/issues/2 are on my todo list for the next release

tadeubas commented 10 months ago

Should we close this issue as the featuare is already on the latest release and marked as experimental? - https://selfcustody.github.io/krux/getting-started/usage/generating-a-mnemonic/#camera

tadeubas commented 7 months ago

Can we consider this done in release 24.03.0 ?

odudex commented 7 months ago

It's still tagged as experimental. Let's wait for more feedback, study the possibility, or necessity of adding up different entropy sources, as other signers do, and then when we remove the experimental tag we close this issue