Updated report
This commit is contained in:
parent
c982fb769f
commit
dd5ac9dd6f
Binary file not shown.
@ -19,8 +19,8 @@
|
||||
% please enter your group number your names and matriculation numbers here
|
||||
%TODO
|
||||
\newcommand{\groupnumber}{04}
|
||||
\newcommand{\name}{Tobias Eidelpes, Ege Mehmet Demirsoy, Nejra Komic}
|
||||
\newcommand{\matriculation}{01527193, XXXXXXXX, XXXXXXXX, same order as the
|
||||
\newcommand{\name}{Tobias Eidelpes, Mehmet Ege Demirsoy, Nejra Komic}
|
||||
\newcommand{\matriculation}{01527193, 01641187, 11719704, same order as the
|
||||
names}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
@ -137,18 +137,62 @@ Finally, the invalid blocks are written to the \texttt{invalid\_blocks} table
|
||||
and all duplicates are removed.
|
||||
|
||||
\section{UTXOs}
|
||||
% Fill here your answers for exercise B
|
||||
In this exercise we were given a smaller data set in comparison to the first exercise and we were expected to work on unspent transaction outputs which have the following constraint:
|
||||
\begin{enumerate}
|
||||
\item A transaction output is unspent if it is not used as an input to a later transaction.
|
||||
\end{enumerate}
|
||||
The exercise further has the following constraints:
|
||||
|
||||
\begin{enumerate}
|
||||
\item The table \texttt{utxos} with columns \texttt{output\_id} and \texttt{value} should contain all UTXOs as of the last block of the data set. For this constraint we need to filter out the outputs from \texttt{outputs} table, whose \texttt{output\_id}'s are not referenced in the \texttt{inputs} table. Thus we need a \texttt{WHERE NOT EXISTS} clause for the filtering.
|
||||
|
||||
\item The table \texttt{number\_of\_utxos} with column \texttt{utxo\_count} should contain as single entry the total
|
||||
number of UTXOs. For implementing the solution of this constraint, we just need to count the number of \texttt{output\_id} present in the \texttt{utxos} table from the previous constraint's implementation. \texttt{COUNT(output\_id)} clause here is sufficient.
|
||||
|
||||
\item The table \texttt{id\_of\_max\_utxo} with the column \texttt{max\_utxo} should contain as single entry the id of
|
||||
the UTXO with the highest associated value. For getting the highest valued utxo, we need to order the \texttt{utxos} table in descending manner by the values. This would ensure that we have the highest valued utxo as the first entry. Thus by adding \texttt{LIMIT 1} clause, we get the top entry from the ordered results.
|
||||
\end{enumerate}
|
||||
|
||||
With each constraint, we insert the expected results into the given tables.
|
||||
|
||||
|
||||
\section{De-anonymization}
|
||||
% Fill here your answers for exercise C
|
||||
In this exercise, a de-anonymization attempt was expected using the following two heuristics:
|
||||
|
||||
\begin{enumerate}
|
||||
\item Joint control: addresses used as inputs to a common transaction are controlled by the same
|
||||
entity.
|
||||
|
||||
\item Serial control: the output address of a transaction with only a single input and output is usually
|
||||
controlled by the same entity owning the input addresses.
|
||||
\end{enumerate}
|
||||
|
||||
First part of this exercise was to insert all pairs of addresses into the table \texttt{addressRelations} satisfying the 2 constraints above. For this we first create 2 views each representing respectively the transactions that satisfy the above constraints. After that we use these tables to find pairs of addresses by performing (multiple) joins with \texttt{inputs} table and then insert the result into a temporary table called \texttt{tempRelations}. Since result contains reflexive and symmetrical pairs, we further up define additional queries to delete these pairs from the \texttt{tempRelations} table. With reflexive and symmetrical pairs deleted, we insert the \texttt{tempRelations} pairs into \texttt{addressRelations}, which concludes the first part.
|
||||
\\
|
||||
For the second part, the function \texttt{clusterAddresses()} was provided for clustering the address pairs into entities with (artificial) ids. This function then returned a table with entity ids and the addresses belonging to these entities. First step is to save the results of the function into a temporary table. After this, following constraints have to be satisfied:
|
||||
|
||||
\begin{enumerate}
|
||||
\item The table \texttt{max\_value\_by\_entity} with column \texttt{value} should contain as single entry the
|
||||
maximum total value of (unspent) satoshis controlled by one cluster (one entity). To make our job easier, we save all the utxos with addresses, transaction ids, output\_ids and values into a temporary table. We can then use this table in a join query with the table containing clusters by addresses. We then group entries by the entity ids and perform built-in \texttt{SUM} function on values and then call another built-in \texttt{MAX} function on the query result to obtain the maximum value.
|
||||
\\
|
||||
(Note: In our solution for readability purposes, we save the \texttt{SUM} results into a temporary table and query this table when we are querying for the max value.)
|
||||
|
||||
\item The table \texttt{min\_addr\_of\_max\_entity} with column \texttt{addr} should contain as single entry the
|
||||
(numerically) lowest address of the cluster (the entity) controlling the most total (unspent)
|
||||
bitcoins. To solve this, we first create a temporary table called \texttt{temp\_max\_entity} containing entity id, address and utxo values of all the addresses of the entity with maximum utxo value from constraint 1. Then we use this table to filter out all the addresses of this entity from cluster table, saving it into yet another temporary table called \texttt{max\_entity\_all\_addresses}. As last step, we perform a \texttt{MIN} query on \texttt{max\_entity\_all\_addresses} to satisfy the constraint.
|
||||
|
||||
\item The table \texttt{max\_tx\_to\_max\_entity} with column \texttt{tx\_id} should contain as single entry the
|
||||
transaction sending the greatest number of bitcoins to the cluster (the entity) controlling
|
||||
the most total (unspent) bitcoins. We start by creating a temporary table called \texttt{max\_tx\_value\_to\_max\_entity}. The goal here is to save the value of the transaction, which sends the most amount of coins to an address of the max entry. For this query, we need to provide transaction id by joining \texttt{outputs} and \texttt{max\_entities\_all\_addresses}. We construct this join query in a \texttt{WITH..AS} clause called \texttt{max\_entity\_join\_outputs}. After that we use the same join query \texttt{max\_entity\_join\_outputs}, but we additionally filter the result by the value in \texttt{max\_tx\_value\_to\_max\_entity}, thus this leaves us with the desired transaction with the max value. The transaction id of this transaction is then inserted into the given table.
|
||||
\end{enumerate}
|
||||
|
||||
\section*{Work distribution}
|
||||
%Fill in here an overview on which group member participated in which task and to which extent
|
||||
|
||||
\begin{description}
|
||||
\item[Tobias Eidelpes] Code and report for Exercise A.
|
||||
\item[Ege Mehmet Demirsoy]
|
||||
\item[Nejra Komic]
|
||||
\item[Ege Mehmet Demirsoy] Code and report for Exercise C.
|
||||
\item[Nejra Komic] Code and report for Exercise B.
|
||||
\end{description}
|
||||
|
||||
\end{document}
|
||||
|
||||
BIN
project1/report1_tex.pdf
Normal file
BIN
project1/report1_tex.pdf
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user