ClusterManager¶
The ClusterManager can be used to create new or load existing clusterings.
The following example will create a new clustering using the multi-input heuristic and attempting to skip Coinjoin transactions.
To overwrite an existing clustering, set should_overwrite=True
.
cm = blocksci.cluster.ClusterManager.create_clustering(<cluster_directory>, chain)
Instead of creating a new clustering, you can also load a previously created clustering.
cm = blocksci.cluster.ClusterManager(<cluster_directory>, chain)
From the cluster manager you can retrieve all clusters using clusters()
or retrieve a specific cluster based on an address using cluster_with_address()
.
Due to the risk of cluster collapse, BlockSci does not cluster change addresses by default.
A few change address detection heuristics are available in blocksci.heuristics.change
and can be passed to the clusterer using the heuristic
keyword, though we do not recommend using them for clustering without further refinement.
-
class
blocksci.cluster.
ClusterManager
¶ Class managing the cluster dat
-
cluster_with_address
(address: Address) → blocksci.cluster.Cluster¶ Return the cluster containing the given address
-
clusters
() → blocksci.cluster.ClusterRange¶ Get a list of all clusters (The list is lazy so there is no cost to calling this method)
-
static
create_clustering
(location: str, chain: blocksci.Blockchain, start: int = 0, stop: int = -1, heuristic: blocksci.heuristics.change.ChangeHeuristic = <blocksci.heuristics.change.ChangeHeuristic object at 0x137d9f730>, should_overwrite: bool = False, ignore_coinjoin: bool = True) → blocksci.cluster.ClusterManager¶
-
tagged_clusters
(tagged_addresses: Dict[Address, str]) → blocksci.cluster.TaggedClusterIterator¶ Given a dictionary of tags, return a list of TaggedCluster objects for any clusters containing tagged scripts
-