You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeError: Script type must be hash160, pubkey, p2wpkh or multisig
/Users/yegor/.rvm/gems/ruby-2.6.0/gems/bitcoin-ruby-0.0.19/lib/bitcoin/builder.rb:239:in `sig_hash_and_all_keys_exist?'
/Users/yegor/.rvm/gems/ruby-2.6.0/gems/bitcoin-ruby-0.0.19/lib/bitcoin/builder.rb:308:in `sign_input'
/Users/yegor/.rvm/gems/ruby-2.6.0/gems/bitcoin-ruby-0.0.19/lib/bitcoin/builder.rb:208:in `block in tx'
/Users/yegor/.rvm/gems/ruby-2.6.0/gems/bitcoin-ruby-0.0.19/lib/bitcoin/builder.rb:207:in `each'
/Users/yegor/.rvm/gems/ruby-2.6.0/gems/bitcoin-ruby-0.0.19/lib/bitcoin/builder.rb:207:in `each_with_index'
/Users/yegor/.rvm/gems/ruby-2.6.0/gems/bitcoin-ruby-0.0.19/lib/bitcoin/builder.rb:207:in `tx'
/Users/yegor/.rvm/gems/ruby-2.6.0/gems/bitcoin-ruby-0.0.19/lib/bitcoin/builder.rb:21:in `build_tx'
I suspect there is something wrong with the format of the signature key but would be great to get a more meaningful message or at least fail sometime earlier when I'm building the transaction.
I guess I know what's wrong. The tx['script'] is not a text, but a hash. That's why it can't be parsed. How do I convert hash160 script into its text format?
Sorry for necroposting but your prev_out in the tx.input block cannot be the new tx instance: it must be the tx id of the utxo being spent, in hex format.
What is wrong with my code?
I'm getting:
I suspect there is something wrong with the format of the signature key but would be great to get a more meaningful message or at least fail sometime earlier when I'm building the transaction.
Cross-posted to SO: https://stackoverflow.com/questions/55595070/why-i-cant-sign-a-bitcoin-transaction-in-ruby
The text was updated successfully, but these errors were encountered: