I know the original purpose of the nSequence
field was to hold the transaction in the mempool with the transaction being replaced when the larger value comes and so on up to 0xFFFFFFFF when the transaction becomes "finalized" and ready to be mined and included in the block. Since this is not properly implemented, it is completely disabled in Bitcoin.
Now this field has a different purpose and if you don't want any of that, you just need to set the value to 0xFFFFFFFF. However, if the value is not 0xFFFFFFFF, it is an indicator for different things.
For example, if the most significant bit (32nd, or 31 if counting from zero) is not set, it is an indicator for a relative time lock.
But what if the most significant bit is set, what are the other flags? That is, if the 32nd bit is set (1 << 31) together with, for example, the 15th or 22nd or 4th bit?
Are there other flags? If so, what are they and any related BIPs about it?
Also, how does the value of nSequence
relates to the usage of the nLockTime
field?