How to convert a bitcoin address (starts with 1
) to the right format acceptable by script
(I'm using this Ruby library)? I'm doing this:
tx.output do |o|
o.value(50000)
o.script { |s| s.recipient('1GzqkR2zNQUzHLpE7PLPjVNJ51FHC3bpDH') }
end
I'm getting:
RuntimeError: Script type must be hash160, pubkey, p2wpkh or multisig
I suspect there is something wrong with the format of the destination address. I cross-posted to GitHub too.