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
I am trying to impelement and test CHECKLOCTIMEVERIFY(BIP 65) wit bitcoin-ruby.
# https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki#two-factor-walletsredeem_script="OP_IF 0246aa2141994cb42d55ac7273b0d7e9e2c7d54b9d1c1214264e18e916009fe12e OP_CHECKSIGVERIFY OP_ELSE 1867923 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_ENDIF 038279d8920c630baad74032aeeef5701687be55a38fb91d9962ec51bdea6702d3 OP_CHECKSIG"sig_hash=unsigned_tx.signature_hash_for_input(0,redeem_script.to_payload)service_key=Bitcoin::Key.new(OpenSSL::Digest::SHA256.digest('service-bob2').hth)user_key=Bitcoin::Key.new(OpenSSL::Digest::SHA256.digest('user-alice2').hth)sigs=[service_key,user_key].map{ |k| k.sign(sig_hash)}# Constructs a scriptSig for the locked contract. It has the following form:# [sig] [sig..] [0|1] [serialized redeemScript]# https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki#two-factor-walletsclvt_script_sig=Bitcoin::Script.from_string("#{s1.hth}#{s2.hth} 1 #{@redeem_script.to_payload.hth}")tx.in[0].script_sig=clvt_script_sig.to_payload
If I try to broadcast this tx, I am getting Non-canonical DER signature. I recreate same tx in bitcoinj and I saw only diffrences in key signatures.
I am getting Non-canonical DER signature error when I try to send this transaction
I am trying to impelement and test CHECKLOCTIMEVERIFY(BIP 65) wit bitcoin-ruby.
If I try to broadcast this tx, I am getting Non-canonical DER signature. I recreate same tx in bitcoinj and I saw only diffrences in key signatures.
If I sign keys with https://github.com/oleganza/btcruby/blob/master/lib/btcruby/openssl.rb#L270 ecdsa_signature method I can broadcast this tx and generated key signs are slightly diffrent.
The text was updated successfully, but these errors were encountered: