Author

Topic: Is there something like BitcoinJS for Bitcoin Cash, or how can I modify it? (Read 359 times)

legendary
Activity: 1176
Merit: 1011
I have a bunch of bitcoins in cold storage, and I use a local copy of BitcoinJS to create and sign transactions offline. Works great.

Now, I got BCH for those cold storage bitcoins as well. And I'd prefer not to expose those private keys in some online environment just to get the BCH out.

So I'm wondering: what changes do I have to make in BitcoinJS in order to support Bitcoin Cash transactions?

I did an attempt by including the SIGHASH_FORKID (0x40) flag in the signature's hashType but that was not sufficient. The txs I generate seem OK but when broadcasting them online through e.g. blockdozer it says:
64: non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation). Code:-26


I tried to look up the exact technicalities of what distinguishes a BCH tx from BTC, but I was unable to find the exact steps.

What else do I have to change in BitcoinJS in order for it to generate valid BCH transactions? Or is there a modified version already somewhere?
Jump to: