Bitcoin Forum
December 13, 2024, 12:09:08 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there something like BitcoinJS for Bitcoin Cash, or how can I modify it?  (Read 356 times)
Kazimir (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1011



View Profile
August 08, 2017, 03:07:02 PM
 #1

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?

In theory, there's no difference between theory and practice. In practice, there is.
Insert coin(s): 1KazimirL9MNcnFnoosGrEkmMsbYLxPPob
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!