3 ms·
Was the code seeding by seconds since epoch, or nanoseconds since epoch truncated to 32 bits? Broken either way. https://github.com/libbitcoin/libbitcoin-syste
by mkj 3y ago
Was the code seeding by seconds since epoch, or nanoseconds since epoch truncated to 32 bits? Broken either way.
https://github.com/libbitcoin/libbitcoin-system/blob/a1b777fc51d9c04e0c7a1dec5cc746b82a6afe64/src/crypto/pseudo_random.cpp#L70 https://github.com/libbitcoin/libbitcoin-system/blob/a1b777f...
const auto now = high_resolution_clock::now();
return static_cast<uint32_t>(now.time_since_epoch().count());
- ryanatdistrust 3y agoNanoseconds since epoch, which means eventually it does loop around, so at the very least it's not possible to generate a specific wallet by knowing when it was first used.
- infofarmer 3y agoA quick search says it's actually ticks, which is OS and machine dependent (kernel tunable). Nanosecond resolution is not enough for a seed if it's a real datetime, so the 32-bit truncation is a separate problem.