Closed deflexor closed 2 years ago
dsa_sign_asn1
is a method of OpenSSL::PKey::EC
. The error seems to be calling dsa_sign_asn1
for Bitcoin::Key
.
In the sample, the
key = Bitcoin.open_key("9b2f08ebc186d435ffc1d10f3627f05ce4b983b72c76b0aee4fcce99e57b0342")
with Bitcoin.sign_data
as the argument. This key
is OpenSSL::PKey::EC
. Are you accidentally passing Bitcoin::Key
?
I passing key this way:
key = Bitcoin::Key.generate
// save key to file
save_string_to_file(key.to_base58)
recovered_key = Bitcoin::Key.from_base58(read_string_from_file)
So this recovered_key
is what i'm passing.
Bitcoin::Key.from_base58
returns Bitcoin::Key
itself, so you need to use recovered_key.sing(data)
instead of Bitcoin.sign_data(recovered_key, data)
.
Oh, thank you, that worked.
Hi, geeting this error when try to create transaction as in examples/generate_tx.rb
``Undefined method
dsa_sign_asn1' for #.../versions/2.6.3/lib/ruby/gems/2.6.0/bundler/gems/bitcoin-ruby-f9b817c946b3/lib/bitcoin.rb:379:in `block in sign_data'