# HBTBD: A Heterogeneous Bitcoin Transaction Behavior Dataset for Anti-Money Laundering
## 2 Related Work
### Bitcoin Wallet Address Node-Type Division  
In the heterogeneous information network of Bitcoin transactions, Bitcoin transaction entities and Bitcoin wallet addresses are represented by nodes in the graph structure. In the anti-money laundering detection of Bitcoin, we aim to detect the legitimacy of the transaction node, so we mark the transaction node as \(Tx\). In addition, we further divide the wallet address node into three categories by analyzing the characteristics of the wallet address participating in the transaction, as shown in Figure 3.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Notations** & **Explanations** \\ \hline \(N\) & Number of Bitcoin transaction entity nodes \\ \(M\) & Number of wallet address nodes \\ \(D\) & Number of node features \\ \(Tx_{i}\) & Bitcoin transaction entity node \(i\) \\ \(Add_{i}\) & Bitcoin wallet address node \(i\) \\ \(\mathcal{V}_{Tx}\) & The set of Bitcoin transaction entity nodes in a graph \\ \(\mathcal{V}_{Add}\) & The set of wallet address nodes in a graph \\ \(\mathcal{E}\) & The set of edges in a graph \\ \(\mathcal{G}\) & A graph \(\mathcal{G}=(\mathcal{V}_{Tx},\mathcal{V}_{Add},\mathcal{E},\mathcal{C})\) \\ \(p\) & Metapath \\ \(p(Tx_{v},Add,Tx_{u})\) & Metapath between node \(Tx_{v}\) and \(Tx_{u}\) connected by \(Add\) \\ \(\mathrm{h}_{i}\) & Attributes or embeddings of node \\ \(\mathcal{M}_{r}\) & Relation-specific matrix of relation \\ \(\sigma\) & Sigmoid function \\ \(\odot\) & Hadamard product \\ \(\oplus\) & Concatenation operator \\ \hline \hline \end{tabular}
\end{table}
Table 1: Notations and Explanations.  
It is worth noting that the premise of dividing the Bitcoin wallet address types involves the situation under an independent timestep; so for the wallet, there are three states: input only, output only, and input and output coexisting.  
Algorithm1 describes the node-type division method, the pseudocode is shown below.  
Given the Bitcoin transaction heterogeneous information network \(\mathcal{G}\), the wallet address node is divided into three categories: For the wallet address node with only input and no output, which is when \(Add^{in}>0\) and \(Add^{out}=0\), marked as \(Add\_A\) (line 2, 3); for the wallet address node with only output and no input, which is when \(Add^{out}>0\) and \(Add^{in}=0\), marked as \(Add\_B\) (lines 5, 6); for the wallet address node with both input and output records, which is when \(Add^{in}>0\) and \(Add^{out}>0\), marked as \(Add\_C\) (lines 8, 9).  
```
1:The Bitcoin address node data \(Add\_List\)
2:Address node of various types: \(Add\_A\), \(Add\_B\), \(Add\_C\)
3:for each \(addnode\) in \(Add\_List\)do
4:if\(addnode\_outdegree==0\) and \(addnode\_indegree!=0\)then
5:\(Add\_A.append(addnode)\)
6:endif
7:if\(addnode\_outdegree!=0\) and \(addnode\_indegree==0\)then
8:\(Add\_B.append(addnode)\)
9:endif
10:endif
11:endfor
```  
**Algorithm 1** Bitcoin Wallet Address Node-Type Division  
To summarize, in this Bitcoin transaction framework, we designed four node types: \(Tx\), \(Add\_A\), \(Add\_B\), and \(Add\_C\) to participate in constructing a heterogeneous graph.