ClusterManager

The ClusterManager can be used to create new or load existing clusterings. The following example will create a new clustering using the legacy heuristic. To overwrite an existing clustering, set should_overwrite=True.

heuristic = blocksci.heuristics.change.legacy.unique_change
cm = blocksci.cluster.ClusterManager.create_clustering(<cluster_directory>, chain, heuristic)

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().

Various change address detection heuristics are available in blocksci.heuristics.change. If you don’t want to include change addresses in your clustering, choose blocksci.heuristics.change.none.unique_change() as your heuristic.

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 0x10f303570>, 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