Bitcoin full node and query server

May 10, 2021

View in context in the libbitcoin Slack #general mirror.

I have a newbie question related to Bitcoin Explorer. From what I understand, bx ec-new only accepts base16 entropy with at least 128 bits. I'm passing 1ffffffffffffffffffffffffffffffff hex which technically has 129 bits and yet bx ec-new complains that the argument is invalid. What am I missing? (I understand that we should be using bx seed but I'm just testing some features)
12 replies · neillm, Jay, evoskuil · last May 18, 2021
neillm11:39
It's not valid hex (for parsing). You could do something like this: bx ec-new 01ffffffffffffffffffffffffffffffff
(edited)
@neillm Thank you.
👍 1
evoskuil18:54
I suppose it could be considered valid, but libbitcoin always requires 2 hex digits per byte - no assumed padding.
👍 1
evoskuil18:55
Actually you should only use bx seed for testing, not for generating actual secrets.
Thanks @evoskuil When I meant testing, I was trying to test the entropy limits for bx ec-new and trying to understand the libbitcoin library. I haven't done any C++ coding in over 10 years. So, basically reading code and also testing things at terminal to learn about features and extend this for my application. If it's not too much, another quick question. I tried to generate pub addresses by passing two hexes, technically with same entropy but different strings. As in 00000000000000000000000000000000ffffffffffffffffffffffffffffffff and ffffffffffffffffffffffffffffffff. Their decimal values are one and the same but the resulting addresses are completely different. What might be happening in the background?
(edited)
evoskuil02:37
Zeros are part of the value, it’s not a “number” it’s a byte buffer. The zeroes get hashed in one case and not the other. The entropy is not the same, as the domain is different.
evoskuil02:40
Every bit can be one or zero, but if you reduce the domain there are fewer bits and therefore less entropy. A 132 bit buffer has 132 bits of entropy as entropy is not just the 1 bits. If you reduce the domain then it reduces the strength of the seed, even if the actual value was just 1. 1 out of 2^1 is 50%, 1 out of 2^132 is much smaller.
(edited)
evoskuil02:42
So bx is accepting from you both the numeric value and the domain.
evoskuil02:45
I won’t use any system that only accepts a numeric value, or requires it to be above a certain numeric value. That simply reduces the actual entropy, as the attacker does not need to search below that value. I’ve seen such implementations in bitcoin, such as a reduction from 132 bits to 121 bits by requiring a min value simply because the internals treat the entropy as a number instead of a byte buffer.
(edited)
Thank you for taking the time. Much appreciated
evoskuil08:42
👍
evoskuil08:43
Happy coding!