+ part of dataset
Browse files- README.md +174 -1
- addr_labels_balanced.csv.zst +3 -0
- addr_labels_big.csv.zst +3 -0
- lstm_dataset/README.md +41 -0
- lstm_dataset/daily_filtered.parquet +3 -0
- lstm_dataset/monthly.parquet +3 -0
- lstm_dataset/weekly.parquet +3 -0
README.md
CHANGED
|
@@ -1,3 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
| 1 |
+
# πΈ Ethereum Address Behavior Dataset β GNN + LSTM (Fraud Detection)
|
| 2 |
+
|
| 3 |
+
This dataset is designed for **fraud detection on Ethereum addresses** using a **dual-modality approach**:
|
| 4 |
+
- **Graph Neural Networks (GNN):** transaction graph structure.
|
| 5 |
+
- **Recurrent Models (LSTM/Transformers):** time-series of address features.
|
| 6 |
+
|
| 7 |
+
The dataset is built from:
|
| 8 |
+
- **Ethereum public BigQuery dataset** (`bigquery-public-data.crypto_ethereum.transactions`).
|
| 9 |
+
- **Etherscan labels + custom scam labels**.
|
| 10 |
+
- **Balanced address list** of ~115k addresses (scam vs non-scam, contracts vs EOAs).
|
| 11 |
+
|
| 12 |
+
## π¦ Dataset Collection Pipeline
|
| 13 |
+
|
| 14 |
+
To reproduce or customize the dataset, use the instructions and code in the [eth-fraud-dataset-pipeline repository](https://github.com/fesevu/eth-fraud-dataset-pipeline).
|
| 15 |
+
That repository provides:
|
| 16 |
+
- Scripts for downloading raw data from public sources (BigQuery, Etherscan, curated scam lists).
|
| 17 |
+
- Code for merging, deduplicating, and balancing address labels.
|
| 18 |
+
- Tools for building the GNN and LSTM datasets (parquet files, mappings, targets).
|
| 19 |
+
- Utilities for generating checksums and manifests for data integrity.
|
| 20 |
+
|
| 21 |
+
**You must run the provided scripts to generate the dataset locally; the data files are not stored in the GitHub repository.**
|
| 22 |
+
|
| 23 |
---
|
| 24 |
+
|
| 25 |
+
## π Repository Structure
|
| 26 |
+
|
| 27 |
+
final/
|
| 28 |
+
ββ gnn_dataset/ # GNN dataset (edges, meta, labels, mapping, targets)
|
| 29 |
+
β ββ edges_all/edges.parquet
|
| 30 |
+
β ββ edges_by_week/week=YYYY-Www/edges.parquet
|
| 31 |
+
β ββ edges_by_month/month=YYYY-MM/edges.parquet
|
| 32 |
+
β ββ meta/{week,month}_window_meta.parquet
|
| 33 |
+
β ββ labels/targets_global.parquet
|
| 34 |
+
β ββ mapping/address_id_map_labels.parquet
|
| 35 |
+
β ββ targets/{week,month}_targets.parquet
|
| 36 |
+
β ββ README.md
|
| 37 |
+
ββ lstm_dataset/ # LSTM dataset (daily β weekly β monthly aggregations)
|
| 38 |
+
ββ daily_filtered.parquet
|
| 39 |
+
ββ weekly.parquet
|
| 40 |
+
ββ monthly.parquet
|
| 41 |
+
ββ README.md
|
| 42 |
+
|
| 43 |
+
- `gnn_dataset/` β GNN dataset (graph edges, slices, labels, mapping).
|
| 44 |
+
- `lstm_dataset/` β LSTM dataset (tabular features, time-series).
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## π Synchronization Between GNN and LSTM
|
| 49 |
+
|
| 50 |
+
- Both use the same **address universe** (`node_id` mapping).
|
| 51 |
+
- Both use the same **time windows**:
|
| 52 |
+
- ISO weeks (`YYYY-Www`) from `gnn_dataset/meta/week_window_meta.parquet`.
|
| 53 |
+
- Months (`YYYY-MM`) from `gnn_dataset/meta/month_window_meta.parquet`.
|
| 54 |
+
|
| 55 |
+
---
|
| 56 |
+
|
| 57 |
+
## π Raw Data
|
| 58 |
+
|
| 59 |
+
Alongside the processed datasets, we also provide the **raw parquet exports** (all parquet files are compressed with **Zstandard (zstd)**):
|
| 60 |
+
|
| 61 |
+
final/
|
| 62 |
+
ββ GNN/parquet/ # raw transaction parquet chunks for GNN
|
| 63 |
+
β ββ transactions_daily_part-00000.parquet
|
| 64 |
+
β ββ transactions_daily_part-00001.parquet
|
| 65 |
+
β ββ ...
|
| 66 |
+
ββ LSTM/parquet/ # raw daily features parquet for LSTM
|
| 67 |
+
β ββ daily_final_part-00000.parquet
|
| 68 |
+
β ββ daily_final_part-00001.parquet
|
| 69 |
+
β ββ ...
|
| 70 |
+
ββ addr_labels_balanced.csv # balanced address list with labels
|
| 71 |
+
ββ addr_labels_balanced.csv # balanced subset with labels (used in GNN + LSTM)
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
### Contents
|
| 76 |
+
- **`GNN/parquet/`** β raw transaction-level parquet files, containing:
|
| 77 |
+
- `from_address`, `to_address` (STRING, lowercase hex)
|
| 78 |
+
- `block_number` (INT64)
|
| 79 |
+
- `timestamp` (TIMESTAMP, UTC)
|
| 80 |
+
- `value_wei`, `tx_fee_wei` (NUMERIC in source, stored as string later)
|
| 81 |
+
- `nonce`, `input_data_size`, `contract_creation`, `tx_hash`, `day`
|
| 82 |
+
- **`LSTM/parquet/`** β raw daily activity parquet files (address-day features before filtering).
|
| 83 |
+
- **`addr_labels_big.csv`** β initial large list of Ethereum addresses (>1M), with scam/contract metadata, **not used directly** (later downsampled & balanced).
|
| 84 |
+
- **`addr_labels_balanced.csv`** β final balanced list of ~115k addresses (scam vs non-scam, contract vs EOA), used for both **GNN** and **LSTM** datasets.
|
| 85 |
+
|
| 86 |
+
All parquet files in this dataset are compressed using **Zstandard (zstd)** for efficient storage and fast access.
|
| 87 |
+
|
| 88 |
+
These files are the **starting point** for the preparation scripts:
|
| 89 |
+
- `build_unified_dataset.py` β creates `gnn_dataset/` (GNN).
|
| 90 |
+
- `build_lstm_dataset_lowmem.py` β creates `lstm_dataset/` (LSTM).
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## βοΈ Labels
|
| 95 |
+
|
| 96 |
+
- Source: Etherscan tags + curated scam lists.
|
| 97 |
+
- Balanced across:
|
| 98 |
+
- **Scam vs Non-Scam**
|
| 99 |
+
- **Contract vs EOA**
|
| 100 |
+
- Provided in:
|
| 101 |
+
- `gnn_dataset/labels/targets_global.parquet`
|
| 102 |
+
- `gnn_dataset/mapping/address_id_map_labels.parquet`
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
### Address Label Files
|
| 107 |
+
|
| 108 |
+
Both `addr_labels_big.csv` (full set) and `addr_labels_balanced.csv` (balanced subset) share the same schema:
|
| 109 |
+
|
| 110 |
+
| Field | Type | Units | Description |
|
| 111 |
+
|--------------------|----------|-------|-------------|
|
| 112 |
+
| address | STRING | hex | Ethereum address (0x..., lowercase). |
|
| 113 |
+
| is_scam | INT64 | 0/1 | Scam label: 1 = scam, 0 = non-scam. |
|
| 114 |
+
| description | STRING | β | Free-text description (e.g. "Verified", "Phishing"). |
|
| 115 |
+
| activity_start_ts | TIMESTAMP| UTC | First observed activity timestamp. |
|
| 116 |
+
| activity_end_ts | TIMESTAMP| UTC | Last observed activity timestamp. |
|
| 117 |
+
| is_contract | INT64 | 0/1 | Address type: 1 = smart contract, 0 = EOA. |
|
| 118 |
+
|
| 119 |
+
- **`addr_labels_big.csv`** β ~1M+ raw addresses with scam/contract metadata, **not used directly** (later downsampled and balanced).
|
| 120 |
+
- **`addr_labels_balanced.csv`** β final balanced subset (~115k addresses, scam vs non-scam, contract vs EOA), used in both **GNN** and **LSTM** datasets.
|
| 121 |
+
|
| 122 |
+
---
|
| 123 |
+
|
| 124 |
+
## π¦ Use Cases
|
| 125 |
+
|
| 126 |
+
- **Graph ML:** Train static embeddings (GraphSAGE, Node2Vec) or temporal GNNs.
|
| 127 |
+
- **Sequence ML:** Train LSTM/Transformer on address time-series features.
|
| 128 |
+
- **Fusion:** Combine GNN embeddings and LSTM features via `node_id`.
|
| 129 |
+
- **Fraud detection:** Predict scam addresses, contracts vs EOAs.
|
| 130 |
+
|
| 131 |
+
---
|
| 132 |
+
|
| 133 |
+
## π Collection Details
|
| 134 |
+
|
| 135 |
+
- Source: Ethereum mainnet via BigQuery.
|
| 136 |
+
- Labels: from Etherscan + custom curated lists.
|
| 137 |
+
- Timezone: UTC.
|
| 138 |
+
- ETH amounts stored as Decimal(38,9), exported as strings for precision.
|
| 139 |
+
- Data preparation optimized for BigQuery + Polars, fits in 12β24 GB RAM.
|
| 140 |
+
|
| 141 |
+
## π Integrity
|
| 142 |
+
- All files are checksummed (SHA256, optional MD5).
|
| 143 |
+
- See `CHECKSUMS.md` for a human-readable table.
|
| 144 |
+
- See `manifest.jsonl` for a machine-readable log (size, mtime, checksums).
|
| 145 |
+
- To verify after download:
|
| 146 |
+
```bash
|
| 147 |
+
python3 make_checksums.py --verify --base /path/to/final
|
| 148 |
+
|
| 149 |
+
## π Source Datasets
|
| 150 |
+
|
| 151 |
+
The address list and labels (scam/non-scam, description) were compiled from the following public datasets:
|
| 152 |
+
|
| 153 |
+
- **Primary sources:**
|
| 154 |
+
- [xblock.pro Dataset #13](https://xblock.pro/#/dataset/13)
|
| 155 |
+
- [xblock.pro Dataset #25](https://xblock.pro/#/dataset/25)
|
| 156 |
+
- [xblock.pro Dataset #50](https://xblock.pro/#/dataset/50)
|
| 157 |
+
- [PTXPhish](https://github.com/blocksecteam/PTXPhish/tree/main?tab=readme-ov-file)
|
| 158 |
+
- [Phishing Contract Sigmetrics](https://github.com/blocksecteam/phishing_contract_sigmetrics25/tree/main)
|
| 159 |
+
- [Etherscan Open Source Contract Codes](https://etherscan.io/exportData?type=open-source-contract-codes)
|
| 160 |
+
- [MyEtherWallet Ethereum Lists](https://github.com/MyEtherWallet/ethereum-lists)
|
| 161 |
+
- [EtherScamDB](https://github.com/MrLuit/EtherScamDB/tree/master)
|
| 162 |
+
- [CryptoScamDB Blacklist](https://github.com/CryptoScamDB/blacklist)
|
| 163 |
+
- [ScamSniffer Scam Database](https://github.com/scamsniffer/scam-database)
|
| 164 |
+
- [Forta Network Labelled Datasets](https://github.com/forta-network/labelled-datasets)
|
| 165 |
+
- [Kaggle: Labelled Ethereum Addresses](https://www.kaggle.com/datasets/hamishhall/labelled-ethereum-addresses?select=eth_addresses.csv)
|
| 166 |
+
- [Etherscan Labels](https://github.com/brianleect/etherscan-labels/tree/main/data/etherscan/combined)
|
| 167 |
+
- [Kaggle: Ethereum Fraud Detection Dataset](https://www.kaggle.com/datasets/vagifa/ethereum-frauddetection-dataset/data)
|
| 168 |
+
- [Ethereum Fraud Datasets](https://github.com/surajsjain/ethereum-fraud-datasets/tree/main)
|
| 169 |
+
- [Kaggle: Ponzi Scheme Contracts](https://www.kaggle.com/datasets/polarwolf/ponzi-scheme-contracts-on-ethereum)
|
| 170 |
+
- [Ethereum Fraud Detection](https://github.com/eltontay/Ethereum-Fraud-Detection)
|
| 171 |
+
|
| 172 |
+
- **Integration:**
|
| 173 |
+
- Addresses and labels from these sources were merged and deduplicated.
|
| 174 |
+
- The final balanced address list (~115k addresses) was constructed based on these datasets.
|
| 175 |
+
|
| 176 |
---
|
addr_labels_balanced.csv.zst
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:52941005bd44d2597037e2e1c932e4d25fcf9c855980f442896cb497d1827b39
|
| 3 |
+
size 3851967
|
addr_labels_big.csv.zst
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15637e4bcfc73856c8f9e0f5c2e35ac63bae33347651f99641fdc22d881a2c5f
|
| 3 |
+
size 100475757
|
lstm_dataset/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# πΈ Ethereum Transaction Graph Dataset (GNN)
|
| 2 |
+
|
| 3 |
+
This dataset represents **Ethereum transactions as edges** between addresses.
|
| 4 |
+
It is designed for Graph Neural Networks (GNN), both **static embeddings** and **temporal graph learning**.
|
| 5 |
+
The dataset contains 2-hop graphs, i.e., it includes neighbors of neighbors for each address.
|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
## π Contents
|
| 10 |
+
|
| 11 |
+
- `edges_all/edges.parquet` β all transactions (full edge list).
|
| 12 |
+
- `edges_by_week/week=YYYY-Www/edges.parquet` β weekly slices.
|
| 13 |
+
- `edges_by_month/month=YYYY-MM/edges.parquet` β monthly slices.
|
| 14 |
+
- `meta/{week,month}_window_meta.parquet` β time window ranges and statistics.
|
| 15 |
+
- `labels/targets_global.parquet` β labeled addresses `(node_id, is_scam, is_contract, address)`.
|
| 16 |
+
- `mapping/address_id_map_labels.parquet` β `(address, node_id)` mapping.
|
| 17 |
+
- `targets/{week,month}_targets.parquet` β labeled nodes active in each window.
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
## π Edge Schema
|
| 22 |
+
|
| 23 |
+
| Field | Type | Units | Description |
|
| 24 |
+
|------------------|--------|----------|-------------|
|
| 25 |
+
| src_id | UInt64 | β | Source node ID (hash of lowercase Ethereum address). |
|
| 26 |
+
| dst_id | UInt64 | β | Destination node ID (hash of lowercase Ethereum address). |
|
| 27 |
+
| ts | Int64 | seconds | Unix timestamp of the transaction (UTC). |
|
| 28 |
+
| value_wei | STRING | wei | Transaction value in wei (exact decimal stored as string). |
|
| 29 |
+
| tx_fee_wei | STRING | wei | Transaction fee in wei (exact decimal stored as string). |
|
| 30 |
+
| block_number | Int64 | block | Ethereum block number of the transaction. |
|
| 31 |
+
| contract_creation| Bool | β | True if transaction created a smart contract. |
|
| 32 |
+
| tx_hash | STRING | hex | Unique transaction hash. |
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Notes
|
| 37 |
+
|
| 38 |
+
- Transactions are **not filtered**: all edges included.
|
| 39 |
+
- **Supervision**: loss computed only on labeled addresses.
|
| 40 |
+
- **Dynamic GNN**: use `edges_by_week/` or `edges_by_month/`.
|
| 41 |
+
- **Static embeddings**: use `edges_all/edges.parquet`.
|
lstm_dataset/daily_filtered.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91772ae11d8167b3aa6920f15f0388e67505b138e8f4d257c3d99734f12559b8
|
| 3 |
+
size 514964942
|
lstm_dataset/monthly.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c16d21902080684db4afee5f7585fa795b951ef0a97be774b794d7bde5cc7eb4
|
| 3 |
+
size 28464647
|
lstm_dataset/weekly.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b63f42c5e47185ea9efa182ecbcd2642dad46232918981374e812ff352c25e5d
|
| 3 |
+
size 67457678
|