Last active
December 15, 2019 17:37
-
-
Save dcts/ff189c86588b235aeda4fd81838fa1ff to your computer and use it in GitHub Desktop.
find bitcoin public address that starts with a given pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bitcoin' | |
key = nil | |
addr = "" | |
iteration = 0 | |
pattern = "Thomas" | |
until addr.start_with?("1#{pattern}") | |
key = Bitcoin::Key.generate | |
addr = key.addr | |
iteration += 1 | |
print "." | |
print "Mining for BitcoinKey starting with '#{pattern}' (iteration: #{iteration})\n" if iteration % 100 == 0 | |
end | |
puts "FOUND A KEY!" | |
puts "address : #{key.addr}" | |
puts "public_key : #{key.pub}" | |
puts "private_key: #{key.priv}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment