# Decentralized Documentation of Maritime Traffic Incidents to Support Conflict Resolution
## 4 Concept
### TSA Negotiator
If after the last iteration (i.e., \(j=\max\limits_{1<i<n}(j_{max}(P_{i}))\)) still no common TSA can be found, it is not possible to identify a TSA that all participants trust. Therefore, the second stage of the protocol is entered and is aimed at finding the largest possible subsets of participants who can agree on a set of TSAs in such a way that:  
\[\exists K\in K_{q,k}:\mathop{\cap}\limits_{i\in K}\pi_{j}(P_{i})\
eq\varnothing\]  
Here, we define \(K_{q,k}:=\{M\subseteq P(q)||M|=k\}\) with \(q\) being an index set for the considered participants in a single round of the second stage of the protocol. Hence, \(K_{q,k}\) is the set of all subsets of \(q\) with size \(k\). We introduce \(c\) as a pruning factor for the participant sets, such that the number of currently considered participants for finding a common TSA is \((n-c)\). Initially, we set \(c=1\) and \(q=\{1,\ldots,n\}\), so that all subsets are considered that are missing only a single participant. For each set \(K\) in \(K_{q,\,(n-c)}\) it is then checked whether a common set of TSAs exists for which \(\cap_{i\in K}\pi_{j}(P_{i})\
eq\varnothing\) is true (similar to the first stage of the protocol). Generally, the search for a common TSA set proceeds identically to the search with all participants so that for each pruning factor, the trust lists are also successively extended in \(j\) iterations. If a set is found, then an arbitrary TSA from the set \(\cap_{i\in K}\pi_{j}(P_{i})\) is selected as \( TSA_{selected}\) for signing the data for the participants from \(K\). Since the trusted TSAs of the individual participants do not change during the negotiation, the trust lists do not need to be transmitted again over the P2P network. If a common TSA cannot be found for any \(K\) after \(j\) iterations, \(c\) is increased by \(1\) so that in the next iteration, all \(K\subseteq q\) with one participant less are taken into account. However, since a valid \(K\) is a proper subset of the index set of participants \(q\), even after finding a TSA there will be a set of participants \(q\setminus K\) for which no TSA has been found yet. Given that the set \(q\setminus K\) refers to at least \(2\) participants if \(c>1\), it should still be aimed to create a common trust basis between these participants. This is done in the same way as for the first subset with \(j:=1\); \(q\ :=q\ \setminus K\); \(c\ :=n-c\). This process is repeated until \(n-c=1\), so that no more subsets with at least \(2\) participants can be formed. If this case occurs, a common TSA cannot be found based on the trust lists of the respective participants under any circumstances. Here, each of these participants \(P_{i}\) should use self-selected TSA (\(fallback_{p}\)) as \( TSA_{selected}\) to sign the records and to establish at least a minimum of trust and security in the documentation. Note that the search for \(\cap_{i\in K}\pi_{j}(P_{i})\) for a subset \(K\) of \(q\) assumes that it is better to find a common TSA at least among the largest possible subset of participants, instead of finding no TSA at all. In this way, at least the largest possible trust is established between the participants. Also, if at any step there are multiple subsets of \(q\) of equal size for which \(\mathop{\cap}\limits_{i\in K}\pi_{j}(P_{i})\
eq\varnothing\) holds, a choice must be made for one subset \(K\) deterministically since the participants in the two sets might overlap. To deterministically select one of the sets, they are hashed and then sorted alphabetically. The alphabetically first set is then defined as the selected set \(K\).