# DPtracer: Integrating Log-Driven Accountability into Data Provision Networks
## 5 DPTracer Protocol
### Nodes  
During data provisioning, a node gathers data from external data sources or other nodes and forwards an aggregated result to the next node. Before delivering the result, the node submits a request to the logger to record its output along with the information with  
Figure 6: Operations of nodes, the submitter, and the inspector interacting with the logger. input into the DPLog. Figure 5(a) illustrates these collaborative steps followed by the node and the logger, and Algorithm 1 details each operation in pseudo-code. ```
1:procedureNode.LogRequest(\(\mathbb{R},\mathbb{C}\))
2:input \(\mathbb{R}\) : List of input reports
3:input \(\mathbb{C}\) : List of input commitments (or source IDs)
4:
5:\(o\leftarrow\) Aggregate(\(\mathbb{R}\))
6: SendToLogger(\(o,\mathbb{C}\))
7:endprocedure
8:
9:procedureLogger.LocUpdate(\(R,\mathbb{C}\))
10:input \(\mathbb{R}\) : The report to be logged
11:input \(\mathbb{C}\) : List of received commitments (or source IDs)
12:
13:ifIsAggregator(\(\mathbb{C}\)) then
14:\(\mathbb{V}\leftarrow\) ExtractVersionSet(\(\mathbb{C}\))
15:for each \((C,q)\) in \((\mathbb{C},\mathbb{V})\)do
16:\(C^{\prime}\leftarrow\) RetrieveCommitment(\(q\))
17:if\(C\
eq C^{\prime}\)then
18:return\(\bot\)\(\triangleright\) Abort on verification fail
19:endif
20:endfor
21:else
22:\(\mathbb{V}\leftarrow\) ExtractSourceIDs(\(\mathbb{C}\))
23:endif
24:\(p\leftarrow\) AssignNewVersionNumber()
25:\(X_{c}\leftarrow(R,\mathbb{V})\)
26: AddToProcTree(\(X_{r}\))
27:\(C_{v}\leftarrow\) CalculateCommitment(\(v\))
28:\(\pi\leftarrow\) GenerateIntervalProof(\(\mathbb{V},v\))
29://\(\pi\leftarrow\) GenerateIntervalProof(\(v\)) for collector nodes
30:ifIsResultDistr(\(R\))then
31:\(\mathbb{L}\leftarrow\) TraceInputs(\(\mathbb{C}\))
32: SendToNode(\(C_{r}\), \(\pi\), \(\mathbb{L}\))
33:else
34: SendToNode(\(C_{r}\), \(\pi\))
35:endif
36:endprocedure
37:
38:procedureNode.RefortSend(\(\mathbb{R},\mathbb{C},R,C,\pi\))
39:input \(\mathbb{R}\) : List of input reports
40:input \(\mathbb{C}\) : List of input commitments
41:input \(\mathbb{R}\) : Current node's report
42:input \(\mathbb{C}\) : Commitment received for the report
43:input \(\pi\) : Received interval proof
44:
45:ifIsThisNodeAggregator(\(\mathbb{C}\)) then
46:for each \((w,q)\) in \((\mathbb{R}\cup\{R\},\mathbb{C}\cup\{C\})\)do
47:if notIsFound(\(w,\pi\))
48:orComputeRoot(\(\pi,\text{ExtractVersion}(q)\)) \(\
eq q\)then
49:return\(\bot\)
50:endif
51:endfor
52:if notIsFound(ExtractVersionSet(\(\mathbb{C}\)), \(\pi\))then
53:return\(\bot\)
54:endif
55:elseifIsThisNodeCollector(\(\mathbb{C}\)) then
56:if notIsFound(\(R,\pi\))
57:orComputeRoot(\(\pi,\text{ExtractVersion}(C)\)) \(\
eq C\)then
58:return\(\bot\)
59:endif
60:endif
61: SendToNextNode(\(R,C\))
62:endprocedure
```  
**Algorithm 1** Data provisioning operations  
1. (Node) LogRequest(\(\mathbb{R},\mathbb{C}\)) \(\rightarrow(R,\mathbb{C})\): A node receives multiple pairs consisting of a report and its commitment from input nodes. These reports and commitmentsare collected in the lists \(\mathbb{R}\) and \(\mathbb{C}\), respectively. The commitment list is empty for the collector nodes, as these nodes directly fetch data from external sources. After gathering the reports, the node generates its output report \(R\) based on the input reports. This output, along with \(\mathbb{C}\), is then sent to the logger as a log request. For collector nodes, identifiers from external data sources are submitted instead of the commitments. For example, in Figure 6a, step (1), node \(n_{k}\) receives two inputs: \(\left(R_{i},C_{\mathsf{v}(i)}\right)\) and \(\left(R_{j},C_{\mathsf{v}(j)}\right)\). Thus, its report \(R_{k}\) is computed as \(R_{k}=R_{i}\cap R_{j}\), where \(\cap\) is the aggregator operator, and \(\mathbb{C}=\left\{C_{\mathsf{v}(i)},C_{\mathsf{v}(j)}\right\}\). 2.