-
Notifications
You must be signed in to change notification settings - Fork 55
Jade Entropy
Replying to: https://github.com/Blockstream/Jade/issues/67#issuecomment-1572153756
may I know how the entropy is created for generating the seed phrase, where is the code located in Jade repo?
samsam380 reacted with thumbs up emoji samsam380 reacted with heart emoji
Always happy to help!
Short answer: See this web post
Long answer: If you opt for new wallet on Jade (ie for Jade to create you a new wallet on-board the hw - always the best option!), this function is called. As you can see it gets some entropy whose length depends on how many words you want in your recovery phrase (12-words/128bits is usually considered sufficient, especially if paired with a passphrase, but we also offer 24-words/256bits).
The entropy is obtained by calling get_random() which gets entropy from the internal random machine.
When Jade starts up, the random machine is seeded with initial entropy from a number of sources/sensors on the chip - temperature, battery/usb current/voltages, radio noise etc. - these environment sensors themselves include a degree of random 'noise' as well as whatever they actually sample. See here.
Also during boot the camera is activated and a number of frames of image data is fed into the random seeding - again even is jade was lying on a desk, the 'black frames' captured would contain random noise. See the boot up code here and here.
During operation, the internal random machine frequently re-fetches source entropy from the sensors on the chip - temperature, battery/usb current/voltages, radio noise etc. as above (but not the camera) to feed into the machine. See wherever refeed_entropy() is called.
Additionally at any point the connected application can send in some entropy which jade also throws into its mix of seed entropy. See here (Apps would usually feed in some entropy when they initially connect.)
NOTE: when source entropy is feed into the machine it is always cumulative/additional. We are always 'adding' some more seed randomness, not 'replacing' old data with new data.
I hope this helps.