A bitcoin full node does not use a random number generator or encryption.

Reply to this note

Please Login to reply.

Discussion

v2 P2P transport (bip324) can choose to use encryption to communicate with other peers

Correct!

It just blows my mind that bitcoin even works without it.

Yeah it's pretty magical how Bitcoin functions and transforms. I always like to point people to the article "Mycelium of Money" for a fun persepective

"it's like a magic mushroom that feeds off energy that a time-traveling space wizard brought into existence because there needed to be a way to tell time in cyberspace" 🍄

Actually the code probably does use secure random number generators for certain data structures like hashmaps where you need DoS resistance. I haven't checked myself. But this is now standard practice.

IIRC for DoS stuff it uses a not cryptographically secure (but fast) RNG.

Interesting, thanks!

Do you know when a RNG was first introduced?

Well for the wallet at day 1. Bucketing peers was introduced a few years later I think to deal with eclipse attacks. With the removal of openssl a few years ago a more clear distinction was made between cryptographically secure vs fast random data.

Here's some current stuff: https://github.com/bitcoin/bitcoin/blob/master/src/random.h

Yes, that's why I used the term “secure” rather than “cryptographic”. RNG requirements for DoS resistance are somewhere in between. Many otherwise perfectly acceptable RNGs are too easily predicted for this application, as their internal state is too small. OTOH you don't need quite as high requirements as a cryptographic RNG