diff --git a/tips/TIP-0045/tip-0045.md b/tips/TIP-0045/tip-0045.md index 9aaade836..590d8b45f 100644 --- a/tips/TIP-0045/tip-0045.md +++ b/tips/TIP-0045/tip-0045.md @@ -1185,9 +1185,12 @@ The following criteria defines whether a payload passes the syntactical validati - Context Inputs: - `Context Inputs Count` must be `0 ≤ x ≤ Max Inputs Count`. - `Context Input Type` must denote an allowed input type, listed in section [Context Inputs](#context-inputs). + - The Context Inputs must be lexically ordered and unique, both based on the following comparison criteria: + - `Context Input Type` as the first criteria for all Context Inputs. + - `Index` as the second criteria for _Reward Inputs_. + - `Account ID` as the second criteria for _Block Issuance Credit Inputs_. - There must be zero or one _Commitment Input_. - - All _Reward Inputs_ must reference a different `Index` and it must hold that: `Index < Inputs Count`. - - All _Block Issuance Credit Inputs_ must reference a different `Account ID`. + - For each `Index` in the _Reward Inputs_ it must hold that: `Index < Inputs Count`. - Outputs: - `Outputs Count` must be `0 < x ≤ Max Outputs Count`. - For each output the following must be true: @@ -1268,6 +1271,12 @@ used deposit address. Ed25519 addresses are not meant to be used like email addr side mismatch. While this would reduce the size of a transaction, it would make it impossible to debug the reason for having an invalid signature and transaction. With the current solution we intend to optimize for ease of development. - Uniqueness of all inputs is kept as it prevents introducing double spends in the same transaction. +- The sorting criteria for _Commitment Inputs_ is only based on their _Context Input Type_ and does not take into + account the _Commitment ID_, which allows for an optimization when determining whether there are zero or one + _Commitment Inputs_. An algorithm checking lexical order and uniqueness will detect the violation of the desired "at + most one" semantic as soon as two or more _Commitment Inputs_ are present, since those would be considered duplicates. +- Requiring lexical order in various places (such as for _Context Inputs_) is mostly an optimization in order to allow + for efficient duplicate detection. # Test Vectors