Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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/a1b777f...

        const auto now = high_resolution_clock::now();
        return static_cast<uint32_t>(now.time_since_epoch().count());


Nanoseconds 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.


A 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: