create bitcoin address in ruby

create bitcoin address in ruby

I am trying to create a bitcoin address in ruby according to the documentation of bitcoin wiki (<a href="http://i.stack.imgur.com/VEA3u.png" target="_blank">bitcoin creation according bitcoin wiki</a>). Starting point is just some random string which emulates the output of ripmed160. Unfortunately I don't quite succeed in doing so, here is my code:

I am trying to create a bitcoin address in ruby according to the documentation of bitcoin wiki (bitcoin creation according bitcoin wiki). Starting point is just some random string which emulates the output of ripmed160. Unfortunately I don't quite succeed in doing so, here is my code:

require 'base58_gmp'
tx_hash = "a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5"

ripmed160 = tx_hash[0..39] ripmed160_with_pre = "00" + ripmed160

sha1 = Digest::SHA256.hexdigest ripmed160_with_pre sha2 = Digest::SHA256.hexdigest sha1

bin_address = Integer("0x" + ripmed160_with_pre + sha2[0..7])

bitcoin_address = "1" + Base58GMP.encode(bin_address, 'bitcoin') # => "1GPcbTYDBwJ42MfKkedxjmJ3nrgoaNd2Sf"

I get something that looks like a bitcoin address but it is not recognised by blockchain.info so I guess it is invalid. Can you please help me to make that work.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

How to Setup Development Environment for Ruby on Rails App using Docker

This Docker Compose tutorial will show you how to set up a development environment for a Ruby on Rails application using Docker. You will create multiple containers – for the application itself, the PostgreSQL database, Redis, and a Sidekiq service – with Docker Compose. Creating a development setup for your Rails application using Docker containers