-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
45 lines (40 loc) · 1.11 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"fmt"
"strings"
"time"
"github.com/gagliardetto/solana-go"
)
var generatedCount = 0
var numThreads = 16
var startTime = time.Now()
var searchTerm = ""
var shouldStopThreads = false
func generateWallet() {
for {
if shouldStopThreads {
return
}
newWallet := solana.NewWallet()
if strings.HasPrefix(newWallet.PublicKey().String(), searchTerm) && !shouldStopThreads {
firstCharAfterSearchTerm := strings.Split(newWallet.PublicKey().String(), searchTerm)[1][0:1]
if firstCharAfterSearchTerm == strings.ToUpper(firstCharAfterSearchTerm) {
fmt.Printf("Success! Wallet found: %s\n", newWallet.PublicKey())
fmt.Printf("Secret Key: %v\n", newWallet.PrivateKey)
fmt.Printf("Attempts required: %d, Time elapsed: %s\n", generatedCount+1, time.Since(startTime))
shouldStopThreads = true
}
}
generatedCount++
if generatedCount%1000000 == 0 {
fmt.Printf("Status: %d wallets generated in %s\n", generatedCount, time.Since(startTime))
}
}
}
func main() {
fmt.Printf("Target prefix: %s\n", searchTerm)
for i := 0; i < numThreads; i++ {
go generateWallet()
}
fmt.Scanln()
}