5

CLTV (OP_CHECKLOCKTIMEVERIFY - absolute locktime) and CSV (OP_CHECKSEQUENCEVERIFY - relative locktime) utilize BIP 68. Is the locktime for those two operations implicitly encoded in little-endian format?

Byte swapping associated with endianess has a very serious impact on the semantics for lock types (i.e., absolute, relative) and locktime value units (i.e., block number, seconds). Would it be prudent/responsible for the BIP 68 Standard to make it clear whether the bit-encoding is natively little-endian or big-endian?

skaht
  • 3,057
  • 1
  • 13
  • 23

1 Answers1

2

All fields in a Bitcoin transaction are little-endian encoded except for the signature fields and the public key fields which are both DER and big-endian encoded since they were originally produced by an external library that uses these encodings.

Would it be prudent/responsible for the BIP 68 Standard to make it clear whether the bit-encoding is natively little-endian or big-endian?

I think this information belongs in the protocol documentation, not necessarily in the BIP.

Thorkil Værge
  • 1,047
  • 8
  • 25