Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xdeltax authored Dec 19, 2022
1 parent f7d71ca commit ea8b3c8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,31 @@ $ openssl ecparam -genkey -name secp256k1 -text -noout -outform DER | xxd -p -c
```PRIVATE_KEY_A = private key from "Generate private key"```
```PRIVATE_KEY_B = private key from "profanity"-search result```

### Terminal:
### use Terminal

Use private keys as 64-symbol hexadecimal string WITHOUT `0x` prefix:
```bash
(echo 'ibase=16;obase=10' && (echo '(PRIVATE_KEY_A + PRIVATE_KEY_B) % FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F' | tr '[:lower:]' '[:upper:]')) | bc
```

### Python
### use Python

Use private keys as 64-symbol hexadecimal string WITH `0x` prefix:
```bash
$ python3
>>> hex((PRIVATE_KEY_A + PRIVATE_KEY_B) % 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F)
```
### handle "Leading Zero"-Bug (Example and Fix)
```bash
>>> (echo 'ibase=16;obase=10' && (echo '(0bc657b0af28b743c7f0d49c4de78efd47a5c8923dabfdef051fff5cdc7c30e7 + 0x0000f8ba428990fca1e618a252ac3614f5de19b20ff00c2ded57bfb6933830aa) % FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F' | tr '[:lower:]' '[:upper:]')) | bc
>>> BC7506AF1B2484069D6ED3EA093C5123D83E2444D9C0A1CF277BF226FB49AD0
>>> 0BC7506AF1B2484069D6ED3EA093C5123D83E2444D9C0A1CF277BF226FB49AD0 (Pad with 1 zero as length only 63)
```

Note that if **less than 64-symbol** is generated, simply **add leading zeroes** to the private key. This occurs due to the summation of `PRIVATE_KEY_A` & `PRIVATE_KEY_B` with leading 0s not being displayed in final hex generated. Example above has 1 overlapping leading 0 thus we add an additional zero.


# Usage
```
usage: ./profanity3 [OPTIONS]
Expand Down

0 comments on commit ea8b3c8

Please sign in to comment.