Thank you!
How would I implement this in my current script?
I am not necessarily trying to vanity gen I am trying to create new addresses as quickly as possible and have them be as random as possible.
The reason I want to use Go is because I have seen a considerable difference in the speed.
C# is pretty slow, 2-3 keys a second, same with Python.
Go seems to be considerably faster, C would probably be the best.
Uh
// Generate keypairs.
aKeypair, err := ecdsa.GenerateKey(btcec.S256(), crand.Reader)
if err != nil {
return err
}
pubkeyBtcec := btcec.PublicKey{aKeypair.PublicKey.Curve,
aKeypair.PublicKey.X,
aKeypair.PublicKey.Y}
keypairBtcec := btcec.PrivateKey{aKeypair.PublicKey, aKeypair.D}
// Create a map to json marshal
keypairMap := make(map[string]string)
keypairMap["pubkey"] = hex.EncodeToString(pubkeyBtcec.SerializeCompressed())
keypairMap["privkey"] = hex.EncodeToString(keypairBtcec.Serialize())
// Store the address in case anyone wants to use it for BTC
pkh, err := btcutil.NewAddressPubKey(pubkeyBtcec.SerializeCompressed(),
&btcnet.MainNetParams)
if err != nil {
return err
}
keypairMap["address"] = pkh.EncodeAddress()
b, err := json.Marshal(keypairMap)
if err != nil {
return err
}
fmt.Printf("%v\n", b)
}
Hey, thank you!
I actually figured it out.
I just generated a 64 char random string using hex characters and then used hex.decode string to get the private key from bytes.
Here is the output after my changes, a lot more random, the 6 digits at the end are a loop counter:
18PrXNBbxrg2KWNvnbfLzSwpxR4ynyoH3S 1B7UGMtbNgX8PbavqsNNJQdAw7FPSaViPr
22d5620d8a500ba446f0322d1607469e390f2f03d4c901cb1f09999448c64e8d 676652
1DXpuk7BWz6EK9PScUpCBwn9ksGnyrAwqn 15n21bF8JhEytL4nkHSvuPJkEpogkfZ3tN
0b645864934c1639e2731ca911a81d7329b0c47a0e6ee6f0cfbcb1e5781c00d4 676653
13qF3EAno4gc7Hqswq8oC2kGHfShVHTwEp 1C8ZEB1huzjqhPcrWrFA3F6yi9imn28ST2
bcf5aaf9cb77265e716d09a66972d260340aa250e8777c5ff894453591d1245b 676654
1BuGZmB8WBVeYAm42Aa6jJgqZq9QVHJvpY 128SK4muV5FjmAiiS92p5GndxstnxBXkA7
d0f346b06fbb93a42e7279a76c075df6f7e9b1e6a04afb0e0fc8f8a61818aeff 676655
19Vu5xPZYQAy2e5houeLL57FRgqAGRYxWA 17qHRE3RDiTuZEc471nAG4Qa5tmCAFQG78
15c1d5345cfc0fa64a6facc6af108460a13d8119469099aaf44ed8dc2ad86983 676656
1PwHUPUdBLkn4BMvcVGcbTE2FLjGCUxSkc 13YYjBVFJNnaRzxzTiJ29exDbMCP4JNz2N
0bc524534c51273cd5849c30bcca59e46d679eb9eda4bdeae874f27e513126c4 676657
1JTXZcZTAnN5MZFe7SJeF1SmTWxUKSntZm 19nWRU971Nq46iHJYFdZA82LXaVJ2YEFKa
7b3f70bcf37faf29227e863f028f1cf13021052967028e5d33fb9ad5e94751ff 676658
12sk7CVxCLNwU5tuAh8DzW9nBJgJXSjcpT 1EEt7ubWnWZqUcCmpfBcUQ2Xznv87Hc3XW
ee0e7e097dba72484edc80bf4d9efd33f1bd3f65e950b105cdf9a02783bc3531 676659
16pg6BBYRnPL34LPbAenkBRgCk7urG7AZZ 1DMJkLkDdrR2gXFrkaxtk6iqpjaRwqs1Qs
4acb6803f4707a8f0a4e12cbe5d422b5f84f1c36e2615c6efc926444d5e1f4cc 676660
126SjxtjNMdGr3FGUtJAa67GsYWj9D59dr 1Hk3krWGxiviPyLNyBAM9MdWXLJT2nKJ6q
a381da6f8679b7e0b41d5c08221e807f3078bf52cb379cbb5a2b2ef791b47c2a 676661
19yuDgVSxWr8uGT1r2j6CNhTijoY22QEAL 13mzLF8SqEpsup2fUN7WMv366AK4NCktL7
9eb0bfe95e16347627e0d76d3a494a746fb12738d1131bee756c12064ff3c7ba 676662
1Gwr2Yr4tmYE2d4c2VHoZZomMMUYArmBRw 1MBbt7yKWoqLnsXu6C62UcCAoEW6vg4hJD