(順次追加していきます。)
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"