bitcoinjs / bitcoinjs-lib

A javascript Bitcoin library for node.js and browsers.
MIT License
5.68k stars 2.1k forks source link

Create Tx BTG ((Signature hash type missing or not understood) (code 64)) #1621

Closed Droppix closed 4 years ago

Droppix commented 4 years ago

Hi,

I try use bitcoinjs-lib for create transaction BTG (BIP44 -> BIP44, BIP49 -> BIP44, ...), I can create a rawTx but I try to send, I have this error: -26: non-mandatory-script-verify-flag (Signature hash type missing or not understood) (code 64)'

02000000000101dd93350c0d814fc258b113e1bdc9cadffe866490ff72b258ff1abb84455edeaa00000000171600145723ed64f46e5a6f07d9929623113958498ba6b4fdffffff0200e1f5050000000017a9148518303631d59de4252e223c569d861d23b6449f87b2d4a4350000000017a914a44bb6bc3228487f4a120fd187b13c23a4886cfc8702483045022100b3030931ef26330359e266a2e6d002af76ce58700edbdcc8ab19c77dfdf9c93f022063467e22b808b829477cc7bd879b9adfdcc07dd8be846ae37d6090857f5589a3012102c5239bb1ec5fbc70e0bcd28fe04b4dcb7ef82605b6da70ed768cb0e4e08bf62e00000000

An idea ?

Thanks

junderw commented 4 years ago

We do not support BTG.

It uses sighash forkid, so all the signatures will fail verification unless you use the sighash_forkid method for creating the sighash during signing.

junderw commented 4 years ago

I do have an unsupported fork that supports it.

You will have to figure out how to use it / whether it is safe on your own.

https://github.com/junderw/bitcoinjs-lib/tree/cashv5

Here's a test that shows how you use it.

https://github.com/junderw/bitcoinjs-lib/blob/fb2c364d15b17c382d3a58f9586b963fdf84a5e7/test/bitcoingold.test.js#L41-L60

Droppix commented 4 years ago

ah great! I'm going to watch... Thanks

Le mer. 16 sept. 2020 à 12:28, Jonathan Underwood notifications@github.com a écrit :

I do have an unsupported fork that supports it.

You will have to figure out how to use it / whether it is safe on your own.

https://github.com/junderw/bitcoinjs-lib/tree/cashv5

Here's a test that shows how you use it.

https://github.com/junderw/bitcoinjs-lib/blob/fb2c364d15b17c382d3a58f9586b963fdf84a5e7/test/bitcoingold.test.js#L41-L60

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitcoinjs/bitcoinjs-lib/issues/1621#issuecomment-693317831, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEKL45MLXWWQAD2LWOQYB3SGCHNFANCNFSM4RORI2MQ .