Skip to content

Instantly share code, notes, and snippets.

@dcts
Last active December 15, 2019 17:37
Show Gist options
  • Save dcts/ff189c86588b235aeda4fd81838fa1ff to your computer and use it in GitHub Desktop.
Save dcts/ff189c86588b235aeda4fd81838fa1ff to your computer and use it in GitHub Desktop.
find bitcoin public address that starts with a given pattern
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