On the Jade hardware wallet/signer how is the entropy created for generating the mnemonic? Where is the code located in Jade repo?
This was asked by samsam380.
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
This was answered by Jamie Driver in the Jade repo.
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.