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.
Name: Psychedelic Bart a.k.a. Psycho Bart
Click here, free ruby on rails course videos for you. It shows you best way to complete Ruby certification. OnlineITGuru guides you towards easy Web script
Few people ask me about the social, political, and economic impact of cryptographically-secure, time-stamped distributed ledgers. Most people ask “should I buy bitcoin?” They seem interested in whether they can make money from its price going up.
Our Ruby on Rails Training will provide you to learn about Rails and web applications development with realty. Our Ruby on Rails Course also includes live sessions.
Can I write on a Bitcoin Blockchain? Can I drop down a message? Yes, Luca of course you can! You can leave a message on a Bitcoin blockchain using a particular op code, called OP_RETURN.