LoginSignup
1
0

More than 5 years have passed since last update.

Bitcoin::Utilの備忘録

Posted at

(順次追加していきます。)

HASH160から、アドレスを得る

module Bitcoin
  module Util
    def hash160_to_address(hex)
      encode_address hex, address_version
    end
>>  tx.out[2].to_hash
=> {"value"=>"0.00000600", "scriptPubKey"=>"OP_DUP OP_HASH160 59c92518eb81c82e864ffda2caf0b2b5f14624ee OP_EQUALVERIFY OP_CHECKSIG"}

>> hash160_to_address('59c92518eb81c82e864ffda2caf0b2b5f14624ee')
=> "mohhPvLT4n97qaugzM7pR3QMzXqYB6sEaa"
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0