43

Bitcoin Cash says that they are providing replay protection for their fork. How does this replay protection work?

41

Bitcoin Cash (aka Bitcoin ABC aka UAHF) provides two methods of replay protection, both of which are opt in. If you do not create transactions which use these features, then your transactions are vulnerable to replay.

The first method is a redefined sighashing algorithm which is basically the same as the one specified by BIP 143. This sighash algorithm is only used when the sighash flag has bit 6 set. These transactions would be invalid on the non-UAHF chain as the different sighashing algorithm will result in invalid transactions. This means that in order to use this, you will need to transact on the UAHF chain first and then on the non-UAHF chain second.

The second method uses an OP_RETURN output which has the exact string:

Bitcoin: A Peer-to-Peer Electronic Cash System

as the data of the OP_RETURN. Any transaction which contains this string will be considered invalid by UAHF nodes until block 530,000. This means that prior to block 530,000, you can split your coins by transacting on the non-UAHF chain first with the OP_RETURN output, and then transacting on the UAHF chain second.

Update: They Bitcoin Cash specification now requires that all transaction use the redefined sighashing algorithm as explained for the first method. This means that there is now two way transaction replay protection; transactions made on the Bitcoin ABC chain will be invalid on the non-ABC chain and vice versa.

  • 2
    1. Replay protection is mandatory now and will be enforced by BCC wallets and nodes. 2. BCC wallets have probably implemented all of this now since they have forked off of the Bitcoin network. At the time this was written, many BCC wallets were not complete nor was their spec complete. – Andrew Chow Aug 2 '17 at 5:07
  • 2
    in other words, replay protection is not opt-in anymore, right? – knocte Aug 2 '17 at 5:14
  • 5
    Yes, replay protection is not opt-in. Although they have still kept the OP_RETURN thing in for some reason. – Andrew Chow Aug 2 '17 at 5:15
  • 2
    No, it is not opt out either. The replay protection with the sighash thing is mandatory. The 530,000 block wait is unrelated to this mandatory replay protection. That only applied to the opt in one with OP_RETURN – Andrew Chow Aug 2 '17 at 5:32
  • 3
    It is mandatory in that any transaction that does not use the redefined sighashing algorithm will be considered invalid and rejected. All transactions must use that sighashing algorithm. – Andrew Chow Aug 2 '17 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.