(Link to Jean-Luc PONS GitHub https://github.com/JeanLucPons)
VanitySearch is a bitcoin address prefix finder. If you want to generate safe private keys, use the -s option to enter your passphrase which will be used for generating a base key as for BIP38 standard (VanitySearch.exe -s “My PassPhrase” 1MyPrefix). You can also use VanitySearch.exe -ps “My PassPhrase” which will add a crypto secure seed to your passphrase.
- Fixed size arithmetic
- Fast Modular Inversion (Delayed Right Shift 62 bits)
- SecpK1 Fast modular multiplication (2 steps folding 512bits to 256bits using 64 bits digits)
- Use some properties of elliptic curve to generate more keys
- SSE Secure Hash Algorithm SHA256 and RIPEMD160 (CPU)
- Multi-GPU support
- CUDA optimisation via inline PTX assembly
- Seed protected by pbkdf2_hmac_sha512 (BIP38)
- Support P2PKH, P2SH and BECH32 addresses
- Support split-key vanity address
VanitySearch [-check] [-v] [-u] [-b] [-c] [-gpu] [-stop] [-i inputfile]
[-gpuId gpuId1[,gpuId2,...]] [-g g1x,g1y,[,g2x,g2y,...]]
[-o outputfile] [-m maxFound] [-ps seed] [-s seed] [-t nbThread]
[-nosse] [-r rekey] [-check] [-kp] [-sp startPubKey]
[-rp privkey partialkeyfile] [prefix]
prefix: prefix to search (Can contains wildcard '?' or '*')
-v: Print version
-u: Search uncompressed addresses
-b: Search both uncompressed or compressed addresses
-c: Case unsensitive search
-gpu: Enable gpu calculation
-stop: Stop when all prefixes are found
-i inputfile: Get list of prefixes to search from specified file
-o outputfile: Output results to the specified file
-gpu gpuId1,gpuId2,...: List of GPU(s) to use, default is 0
-g g1x,g1y,g2x,g2y, ...: Specify GPU(s) kernel gridsize, default is 8*(MP number),128
-m: Specify maximun number of prefixes found by each kernel call
-s seed: Specify a seed for the base key, default is random
-ps seed: Specify a seed concatened with a crypto secure random seed
-t threadNumber: Specify number of CPU thread, default is number of core
-nosse: Disable SSE hash function
-l: List cuda enabled devices
-check: Check CPU and GPU kernel vs CPU
-cp privKey: Compute public key (privKey in hex hormat)
-kp: Generate key pair
-rp privkey partialkeyfile: Reconstruct final private key(s) from partial key(s) info.
-sp startPubKey: Start the search with a pubKey (for private key splitting)
-r rekey: Rekey interval in MegaKey, default is disabled
The bitcoin address (P2PKH) consists of a hash160 (displayed in Base58 format) which means that there are 2160 possible addresses. A secure hash function can be seen as a pseudo number generator, it transforms a given message in a random number. In this case, a number (uniformaly distributed) in the range [0,2160]. So, the probability to hit a particular number after n tries is 1-(1-1/2160)n. We perform n Bernoulli trials statistically independent.
If we have a list of m distinct addresses (m<=2160), the search space is then reduced to 2160/m, the probability to find a collision after 1 try becomes m/2160 and the probability to find a collision after n tries becomes 1-(1-m/2160)n.
An example:
We have a hardware capable of generating 1GKey/s and we have an input list of 106 addresses, the following table shows the probability of finding a collision after a certain amount of time:
Time | Probability |
---|---|
1 second | 6.8e-34 |
1 minute | 4e-32 |
1 hour | 2.4e-30 |
1 day | 5.9e-29 |
1 year | 2.1e-26 |
10 years | 2.1e-25 |
1000 years | 2.1e-23 |
Age of earth | 8.64e-17 |
Age of universe | 2.8e-16 (much less than winning at the lottery) |
Calculation has been done using this online high precision calculator