Bitcoin Forum
May 02, 2024, 08:57:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Vanity Address Generator in Java  (Read 194 times)
apogio (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 960



View Profile WWW
September 18, 2023, 05:00:38 PM
Last edit: January 31, 2024, 07:15:37 PM by apogio
Merited by DaveF (3), albert0bsd (2), ABCbits (1)
 #1

I have developed a vanity address generator in Java. The purpose is solely academic.

You can find the code here: the code is obsolete and shouldn't be used, therefore I removed it. If anyone wants to see it for some reason, send me a PM

There is a README file, but I will give the instructions here also.

Instructions:
1. Modify `Main.java` and change the variable `desiredAddressPrefix` to whatever prefix you wish for your bitcoin address.
2. Run `Main.java`
3. Once the address is found, the program will generate a `wallet` directory:
  • keys.txt file, which includes the address and the private key in WIF and HEX format.
  • legacyAddress.png QR code for the address.
  • privateKey.png QR code for the private key.

I would appreciate it if you could:
1. Suggest any code alteration - modification.
2. Suggest a better (if any) entropy source than Java's SecureRandom.
3. Suggest benchmarking tools.

If there are any updates in the future, I will post them on this post, in the section below:

Updates:
Place for future updates





1714640252
Hero Member
*
Offline Offline

Posts: 1714640252

View Profile Personal Message (Offline)

Ignore
1714640252
Reply with quote  #2

1714640252
Report to moderator
1714640252
Hero Member
*
Offline Offline

Posts: 1714640252

View Profile Personal Message (Offline)

Ignore
1714640252
Reply with quote  #2

1714640252
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714640252
Hero Member
*
Offline Offline

Posts: 1714640252

View Profile Personal Message (Offline)

Ignore
1714640252
Reply with quote  #2

1714640252
Report to moderator
1714640252
Hero Member
*
Offline Offline

Posts: 1714640252

View Profile Personal Message (Offline)

Ignore
1714640252
Reply with quote  #2

1714640252
Report to moderator
digaran
Copper Member
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 899

🖤😏


View Profile
September 18, 2023, 05:36:28 PM
 #2

Can we run it on android phones? I have tried to run  jar files on my android before but I couldn't find a compatible runtime for my phone.
Nowadays everyone should develop apps/tools for both desktop and phone devices. So I wonder if you have any benchmark to share with us, though I think java is very slow when it comes to key generation process.
I will try it later on my laptop and will report back, if I can manage to successfully run it, I have no experience with java.

🖤😏
apogio (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 960



View Profile WWW
September 18, 2023, 06:14:42 PM
 #3

Can we run it on android phones? I have tried to run  jar files on my android before but I couldn't find a compatible runtime for my phone.
Nowadays everyone should develop apps/tools for both desktop and phone devices. So I wonder if you have any benchmark to share with us, though I think java is very slow when it comes to key generation process.
I will try it later on my laptop and will report back, if I can manage to successfully run it, I have no experience with java.

Unfortunately you can't run it on Android. I will try to create an executable file for ease of use. Looking forward to hearing from you.

BitMaxz
Legendary
*
Offline Offline

Activity: 3248
Merit: 2955


Block halving is coming.


View Profile WWW
September 18, 2023, 06:20:12 PM
 #4

Can we run it on android phones?
I don't think this would work on Android devices because .java extension only works if your PC have installed Oracle JDK. I don't find any Android apps that can able to run .java.

You are free to try but Playstore only show one app that could run java app called J2ME loader or try Java compiler.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Online Online

Activity: 1596
Merit: 6719


bitcoincleanup.com / bitmixlist.org


View Profile WWW
September 19, 2023, 11:34:05 AM
 #5

Can we run it on android phones?
I don't think this would work on Android devices because .java extension only works if your PC have installed Oracle JDK. I don't find any Android apps that can able to run .java.

You are free to try but Playstore only show one app that could run java app called J2ME loader or try Java compiler.

Android apps are written in Kotlin, which is like Java but it is not Java. It has its own compiler and everything.

But if you use some stock app interface generated by any Kotlin IDE, and then plug this java code inside it, you will get a workable Android app to use, because pretty much everything in Android has to run via a GUI unless you already have a terminal open. That's cumbersome to do.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
DaveF
Legendary
*
Offline Offline

Activity: 3458
Merit: 6258


Crypto Swap Exchange


View Profile WWW
September 20, 2023, 07:16:34 PM
 #6

tl;dc (to lazy didn't check)
How is the performance? I see that
Quote
3. Suggest benchmarking tools.
but did you do any performance tests?
I'm guessing that since it's Java not great but verification is good. And I actually do not have anything with Java installed at the moment so unless it's decent not even going to try.
But, good concept.

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
apogio (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 960



View Profile WWW
September 20, 2023, 08:00:33 PM
 #7

tl;dc (to lazy didn't check)
How is the performance? I see that
Quote
3. Suggest benchmarking tools.
but did you do any performance tests?
I'm guessing that since it's Java not great but verification is good. And I actually do not have anything with Java installed at the moment so unless it's decent not even going to try.
But, good concept.

-Dave


Hi Dave, thanks for answering. As I said, the purpose was purely academic. I don't suggest you use it. I will find benchmarking tools when I find the time. In fact, the performance must be mediocre. I know that. But I wanted to try it. And indeed I managed to create my own address Smiley

albert0bsd
Hero Member
*****
Offline Offline

Activity: 850
Merit: 660



View Profile WWW
September 20, 2023, 08:14:49 PM
Merited by apogio (1)
 #8

2. Suggest a better (if any) entropy source than Java's SecureRandom.

Well i think that actually SecureRandom must be enough validated by the community, some of us may remember some nasty bug in  SecureRandom that lead in some multiple bitcoin wallet hacks

Weaknesses in Java SecureRandom (e.g. Android bitcoin wallets)
Some SecureRandom Thoughts

If you aren't sure of using SecureRandom, I may suggest o try to use the RNG of the Guests OS, but that may complicate the code a little and also make it OS depend, that break the the Java Parading: Write once Run Anywhere

I like the OS Random Number Generators, but for Java I recomend stick on the Standar Class.

SecureRandom
Quote
This class provides a cryptographically strong random number generator (RNG).

if you want to do some benchmarking try to compare it againts the:

VanitySearch
Keyhunt vanity-search



apogio (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 960



View Profile WWW
September 20, 2023, 08:31:31 PM
 #9

Quote from: albert0bsd
....

Thanks, I didn't know about this hack.

I am definitely gonna try to benchmark my code against those but I think I have no luck. The question is, what is the benchmarking process? How will I compare them?

Finally, as I said, I will make it executable once I have some free time.

albert0bsd
Hero Member
*****
Offline Offline

Activity: 850
Merit: 660



View Profile WWW
September 20, 2023, 08:37:21 PM
 #10

what is the benchmarking process? How will I compare them?

In the case of my keyhunt tool you can select a specific range, so, if in you code you can do the same the idea should select the same range and check how many coincidences it found and how much time it takes.

Another way to make these benchmarks is just put them at random ranges and stop them after some 15 minutes or half an hour and compare how many addresses they found, this may not be fair or may be biased because Address prefixes are random and it's not predictable how often they may appear.

Timelord2067
Legendary
*
Offline Offline

Activity: 3668
Merit: 2216


💲🏎️💨🚓


View Profile
October 18, 2023, 11:16:01 PM
 #11

You are free to try but Playstore only show one app that could run java app called J2ME loader or try Java compiler.

APKpure.com is a better alternative for sourcing APK files and has it's own installer you can install on your android device to install new and update existing APPs on your android device.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!