K7

K7Blog

须知少年凌云志 曾许人间第一流.
proton
telegram

ETH TRX wallet beautiful number generation source code

ETH: https://github.com/riba2534/rare_eth
ETH frontend generation: https://github.com/bokub/vanity-eth
ETH+TRON: https://github.com/feeeei/vanity-generator

Previously, I wrote a Nezha probe installation tutorial and solved the issue of being unable to install in China. Looking at our little chicken CPU usage rate, which is only a few percent, I feel quite uncomfortable that it is not being utilized, as it seems wasteful.

So what to do? I found a script to run eth trx vanity numbers, running a wallet vanity number in the background. Currently, I am using the ETH+TRON version, looking for AI to write a Go script that can continuously execute tasks and send them to an address for storage.

Tutorial:#

First, everyone open: https://github.com/feeeei/vanity-generator to download the source code and compile a binary file yourself.

Go one-click installation script (https://github.com/Jrohy/go-install):

source <(curl -L https://go-install.netlify.app/install.sh)
go build -o binary_file_name

After compiling, create a Go file and write the following code:

package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"os/exec"
	"time"
	"math/rand"
	"net/url"
)

func main() {
	commands := []string{
		"./trx tron --suffix=888 --concurrency=3",
		"./trx tron --suffix=777 --concurrency=3",
		// Add other commands
	}

	rand.Seed(time.Now().UnixNano())

	// Close trx process when the program exits
	defer func() {
		fmt.Println("Closing trx process...")
		cmd := exec.Command("pkill", "-f", "trx")
		err := cmd.Run()
		if err != nil {
			fmt.Println("Error closing trx process:", err)
		} else {
			fmt.Println("trx process closed successfully.")
		}
	}()

	for {
		// Randomly select a command
		cmd := commands[rand.Intn(len(commands))]
		fmt.Println("Executing command:", cmd)

		// Execute command
		_, err := exec.Command("bash", "-c", cmd).Output()
		if err != nil {
			fmt.Println("Error executing command:", err)
			continue
		}

		// Read wallet.json file
		walletJSON, err := ioutil.ReadFile("wallet.json")
		if err != nil {
			fmt.Println("Error reading wallet.json:", err)
			continue
		}

		// Convert JSON data to string and encode it as URL format
		data := url.QueryEscape(string(walletJSON))

		// Build URL with parameters
		url := fmt.Sprintf("https://k7blog.com/trx.php?trx=%s", data)

		// Send GET request
		resp, err := http.Get(url)
		if err != nil {
			fmt.Println("Error sending GET request:", err)
			continue
		}
		defer resp.Body.Close()

		// Print response status code
		fmt.Println("GET request status:", resp.Status)

		// Delete wallet.json file
		err = os.Remove("wallet.json")
		if err != nil {
			fmt.Println("Error deleting wallet.json:", err)
			continue
		}

		fmt.Println("Operation completed successfully.")

		// Sleep for a while before executing again
		time.Sleep(5 * time.Second)
	}
}

Modify the https://k7blog.com/trx.php?trx= in the code and the commands below:

"./trx tron --suffix=888 --concurrency=3",
"./trx tron --suffix=777 --concurrency=3",

./trx is the name of your compiled binary file, tron can be changed to eth and dot, then --suffix=888 is the generated suffix, --concurrency=3 is the number of threads, for example, if your CPU has 4 cores and you do not want to fully utilize the CPU, you can set the threads to 3. Here you can set multiple vanity number scans, adding the ones you want to scan yourself.

--prefix: Prefix specification, ETH needs to start with 0x, Tron needs to start with T.
--suffix: Suffix specification, ETH needs [0-9A-Fa-f], Tron needs to meet Base58.
--concurrency: Number of concurrent threads, if not passed, defaults to the number of CPU cores.

Then add a PHP file to receive data:

<?php

// Check if the "trx" parameter is received in the POST or GET request
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $trx = $_POST['trx'] ?? '';
} elseif ($_SERVER['REQUEST_METHOD'] === 'GET') {
    $trx = $_GET['trx'] ?? '';
}

// If the "trx" parameter is missing or empty, return an error response
if (empty($trx)) {
    http_response_code(400);
    die('Error: Missing "trx" parameter');
}

// Write the value of the "trx" parameter to the "qianbao.json" file
$qianbaoFile = 'qianbao.json';
file_put_contents($qianbaoFile, $trx . PHP_EOL, FILE_APPEND);

// Return success response
echo 'Data has been written to qianbao.json';

?>

The received data will be stored in the qianbao.json file, which will contain the wallet address and private key. Then compile the above Go file and add a process guardian so it can run continuously.

Alternatively, you can use the following Go script, which does not require writing commands in Go, but directly reads commands from mingling.txt and randomly selects a command to generate vanity numbers.

Write in mingling.txt:

./trx tron --suffix=9999 --concurrency=3
./trx tron --suffix=8888 --concurrency=3
./trx tron --suffix=7777 --concurrency=3
./trx tron --suffix=6666 --concurrency=3
./trx tron --suffix=5555 --concurrency=3
./trx tron --suffix=4444 --concurrency=3
./trx tron --suffix=3333 --concurrency=3
./trx tron --suffix=2222 --concurrency=3
./trx tron --suffix=1111 --concurrency=3

Go file:

package main

import (
	"bufio"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"os"
	"os/exec"
	"strings"
	"time"
	"math/rand"
)

func main() {
	rand.Seed(time.Now().UnixNano())

	// Close trx process when the program exits
	defer func() {
		fmt.Println("Closing trx process...")
		cmd := exec.Command("pkill", "-f", "trx")
		err := cmd.Run()
		if err != nil {
			fmt.Println("Error closing trx process:", err)
		} else {
			fmt.Println("trx process closed successfully.")
		}
	}()

	for {
		// Read command list
		commands, err := readCommands("mingling.txt")
		if err != nil {
			fmt.Println("Error reading commands:", err)
			continue
		}

		// Randomly select a command
		cmd := commands[rand.Intn(len(commands))]
		fmt.Println("Executing command:", cmd)

		// Execute command
		_, err = exec.Command("bash", "-c", cmd).Output()
		if err != nil {
			fmt.Println("Error executing command:", err)
			continue
		}

		// Read wallet.json file
		walletJSON, err := ioutil.ReadFile("wallet.json")
		if err != nil {
			fmt.Println("Error reading wallet.json:", err)
			continue
		}

		// Encode JSON data as URL format
		data := url.QueryEscape(string(walletJSON))

		// Build URL with parameters
		url := fmt.Sprintf("https://k7blog.com/trx.php?trx=%s", data)

		// Send GET request
		resp, err := http.Get(url)
		if err != nil {
			fmt.Println("Error sending GET request:", err)
			continue
		}
		defer resp.Body.Close()

		// Print response status code
		fmt.Println("GET request status:", resp.Status)

		// Delete wallet.json file
		err = os.Remove("wallet.json")
		if err != nil {
			fmt.Println("Error deleting wallet.json:", err)
			continue
		}

		fmt.Println("Operation completed successfully.")

		// Sleep for a while before executing again
		time.Sleep(5 * time.Second)
	}
}

// readCommands reads command list from the specified file
func readCommands(filename string) ([]string, error) {
	var commands []string

	file, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer file.Close()

	scanner := bufio.NewScanner(file)
	for scanner.Scan() {
		line := strings.TrimSpace(scanner.Text())
		if line != "" {
			commands = append(commands, line)
		}
	}

	if err := scanner.Err(); err != nil {
		return nil, err
	}

	return commands, nil
}

You can also compile the file directly, then place the previously compiled vanity number generation file together, modify the commands in the txt file, and add a process guardian to make it work.

Vanity Number Sharing#

I ran some 4a vanity numbers, and the 4-core server only used 3 threads, utilizing about 80% of CPU performance, and the speed is quite fast. If you want to use the wallets below, please refer to my previous article: How to Multi-sign TRON Vanity Number Wallet?

"private_key": "ce5a795c51bd5aacc46bdb61a7a5a014dd4cc3265d9016459122d53f00d0c8e1","address": "TR8ePorXTtTUcLQsNiX9F41mGjhEUW1111"
"private_key": "b19f9f475fe36184c3e0b140227038e0459afe59a11085893ebe9cb01d289f1d","address": "TTFRB26oj5E2ZyUokPwwrg3Vpo7ysm1111"
"private_key": "3beaf9560436e335b359b82d2b01044070f43643a4897c9c82d4565c9259f2f6","address": "TMxQE76orz9Pme3HLvTYKLCytQqFtE1111"
"private_key": "960e00dfd4863b761625877f915a339e6877a174b2dfb2c107006999db8aa602","address": "TBbj7RM6V5V2q1S68nwyr47C76Sscq5555"
"private_key": "6a01ea2f9eaffa09cdd04631f083afd137b85d34da05be2b9786707a250c9340","address": "TUNPJoLkw65XGCox54oasLY8BmMr8c4444"
"private_key": "be275bc1e4ab0d3be50004fb16d369321d8d6b3682d171e70b95619a060fc093","address": "TDQwQbFNoeKRzwa6dedzkwhQF47fQr8888"
"private_key": "d23c5bed319ad7f37cf09c3ab1df0b0972011c3b9f1c20da647556fcb76cd501","address": "TYRKfAD6Egde25sJJVBTok1FSE5Sqj9999"
"private_key": "f09a77c4a5d29540430e9ba01e7d1b4281123cf7d0f0e0b403bc7c51705b7989","address": "TWyi2RZ9rTHnGRDPSkenTRkJrmnCDS4444"
"private_key": "e95e0f34b9deaa92f7c3b91538dd890dd26032cf82b669f01b1145d16a33ea84","address": "TE3tZ1u6HUMHMyQJqnFusodJqyRL1T7777"
"private_key": "2ac5168c8eeb16164f824515233de06d0fb48b5581529d914c4a7362cbacd239","address": "THtcHYH9ivJpFETrVWFsb29cWjPw8M7777"
"private_key": "6d0629bc91b6ed046f87d2ee2e10c49bb759d6cade980895e31926a3c92a7b4a","address": "TJNuwPodQd2o2aTz8BeJ82buNP3CUP7777"
"private_key": "5e47c25f793dcf41a3804b44075c2f3d0ece253e9976b306bb80886c3b039d36","address": "TUvawNCs6Xzft25q4VxKDoDnqz19y53333"
"private_key": "26c8fd7ba83af4356a9040aabf9aaf3590c21cff25c29627f06ed64bf4b4e383","address": "TRCdbALznJYgyFV2gEecTqLufCoZiS7777"
"private_key": "286dfc2a1fc9b335da55cb025ccb8e8773fd5179ce7f79752883c7ff6296ad41","address": "TQUu7CiUBsjfzkj5zJ69vYVicVVhBp9999"
"private_key": "cbc261a7f05a224ea88818ba97f22258623709db70862853de26546d9e13a9fd","address": "TFyPdTD6DenjGjwDvMhWZpWnFGwmdb7777"
"private_key": "3a739eadb26f1b713e7f930692d4224df8374c7474fe8f11aa4ebbae60d60045","address": "TTZnRUDp8vbQ2JWv9NZuDHFEcvErtH7777"
"private_key": "2056efd8181ce6203ec358ab0b6988a4196941bcaeee6a0e67967af1b21f0384","address": "TNwc1bg1ZLTxRh8sDbxaqykR1MmsGH2222"
"private_key": "ce89f8dbedc8d00cae36db19bf700575a6c78a52fffd85055a72f88ddf607b52","address": "TMu9ofXqomoNhF4q4LHdHiv4NU8NTb3333"
"private_key": "3fc82822ba45013be4803d7f52d72f0119d30f0a74331d002fa898c6895b64c9","address": "TRx8CUinnhEMLjqs3dCWt8gdHg9Ejo2222"
"private_key": "69c3f97343ca9ceac2ad0c82730b579a54b27f82e25f857bf46fd4a38ceb637f","address": "TZ2dGsS7ugRin2KTXcZwVVrzqcxofo5555"
"private_key": "7f6321a155248b95376ba5a0db04d9cd4ca632276c3cd3b64b436f4f0e1a848b","address": "TSLCBbtqpPoDxwNfrZEuEyijv1er8a8888"
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.