mirror of
https://github.com/bitcoin/bips.git
synced 2024-11-19 01:40:05 +01:00
370: Describe locktime type tiebreaker
This commit is contained in:
parent
b1791c24aa
commit
1c8afe6ea4
@ -213,11 +213,15 @@ The nLockTime field of a transaction is determined by inspecting the PSBT_GLOBAL
|
||||
If none of the inputs have a PSBT_IN_REQUIRED_TIME_LOCKTIME and PSBT_IN_REQUIRED_HEIGHT_LOCKTIME, then PSBT_GLOBAL_FALLBACK_LOCKTIME must be used.
|
||||
If PSBT_GLOBAL_FALLBACK_LOCKTIME is not provided, then it is assumed to be 0.
|
||||
|
||||
If one or more inuts have a PSBT_IN_REQUIRED_TIME_LOCKTIME or PSBT_IN_REQUIRED_HEIGHT_LOCKTIME, then the field chosen is the one which is supported by all of the inputs.
|
||||
If one or more inputs have a PSBT_IN_REQUIRED_TIME_LOCKTIME or PSBT_IN_REQUIRED_HEIGHT_LOCKTIME, then the field chosen is the one which is supported by all of the inputs.
|
||||
This can be determined by looking at all of the inputs which specify a locktime in either of those fields, and choosing the field which is present in all of those inputs.
|
||||
Inputs not specifying a lock time field can take both types of lock times, as can those that specify both.
|
||||
The lock time chosen is then the maximum value of the chosen type of lock time.
|
||||
|
||||
If a PSBT has both types of locktimes possible because one or more inputs specify both PSBT_IN_REQUIRED_TIME_LOCKTIME and PSBT_IN_REQUIRED_HEIGHT_LOCKTIME, then locktime determined by looking at the PSBT_IN_REQUIRED_HEIGHT_LOCKTIME fields of the inputs must be chosen.<ref>'''Why choose the height based locktime?'''
|
||||
In the event of a tie for the locktime type, signers need to be able to know which locktime to use as their signatures will commit to the locktime in the transaction, so choosing the wrong one will result in an invalid transaction.
|
||||
Height based locktime is preferred over time based as Bitcoin's unit of time is the block height, so a height makes more sense in the context of Bitcoin.</ref>
|
||||
|
||||
===Unique Identification===
|
||||
|
||||
PSBTv2s can be uniquely identified by constructing an unsigned transaction given the information provided in the PSBT and computing the transaction ID of that transaction.
|
||||
|
Loading…
Reference in New Issue
Block a user