Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible brainflayer not work correctly at the end of seed #118

Open
agent-0007 opened this issue Sep 4, 2020 · 4 comments
Open

Possible brainflayer not work correctly at the end of seed #118

agent-0007 opened this issue Sep 4, 2020 · 4 comments

Comments

@agent-0007
Copy link

Hi. Possible brainflayer not work correctly at the end of seed.

The first valid private key in hexadecimal is 0000000000000000000000000000000000000000000000000000000000000001 and the last valid private key in hexadecimal is fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140

brainflayer -v -I fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140 -b example.blf
secp256k1/src/field_impl.h:238: test condition failed: secp256k1_fe_normalizes_to_zero_var(&c)
Aborted

I also try fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413b, and result the same.

@ryancdotorg
Copy link
Owner

Looks like it dies when

fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141

is within the very first batch of keys brainflayer processes, but will handle a zero key fine otherwise.

@ryancdotorg
Copy link
Owner

If you set the starting key to fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0360000 it will work fine and then wrap around, but i should see if i can turn off the asserts in libsecp256k1

@agent-0007
Copy link
Author

This is minor bug, i think the reason in brainflayer start. I haven't looked closely at your code, but suppose that when brainflayer start calculating it trys to calculate 300000+ values, and when seed in the end, it can't do that. If you run bf with values (fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140 - 7A120) it will work correctly and start searchng at the start of seed 0000...001. I repot this, because don't know it's a bug or a future. May be seed have undocumented featuers.

@ryancdotorg
Copy link
Owner

Starting with fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142, values aren't valid private keys, most implementations just wrap around to 0000000000000000000000000000000000000000000000000000000000000001. Doesn't seem worth the performance hit to special case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants