Package: anti-sybil
BrightID Anti-SybilThis package provides a framework to evaluate the quality of different anti-sybilalgorithms, by simulating differentattackstoBrightID's social graph.Comparing performance of different algorithms in detecting sybils in different attacksAlgorithmsSybilRankis a well-known sybil detection algorithm that is based on the assumption that sybils have limited social connections to real users. It relies on the observation that an early-terminated random walk starting from a non-Sybil node in a social network has a higher degree-normalized (divided by the degree) landing probability to land at a non-sybil node than a sybil node.GroupSybilRankis an enhanced version of the SybilRank algorithm. In this algorithm, a graph is created in which the BrightID groups are nodes  and edges are weighted based on affinity between groups. Then original SybilRank algorithm will be applied to this graph of groups and users get scores from the best group they belong to. This algorithm achieved best results so far in identifying sybils based on modeledattacksand is being used as official BrightID anti-sybil algorithm.
up edges.WeightedSybilRankis an enhanced version of the SybilRank algorithm that uses the number of common neighbors of the tow connected nodes as weight (trustworthy factor) of the edge.AttacksLone AttacksOne attacker attempting to propagate score to the Sybils to verify them by connecting to other nodes and creating groups.
We assumed that an attacker will have one account with a normal or above-average number of direct connections to honest users which they can use for interconnections to sybil accounts.One attacker attempts to connect to some of the seed nodes and create some sybil nodes.implementation-graphOne attacker attempts to connect to some of the top-ranked honests and create some sybil nodes.implementation-graphOne attacker attempts to connect to some of the honests and create some sybil nodes.implementation-graphOne attacker attempts to connect to one of the top-ranked honests and create multiple (duplicate) groups of the sybils.implementation-graphA seed node attempts to create some sybils nodes.implementation-graphAn honest node attempts to create some sybils nodes.implementation-graphCollaborative AttacksMultiple attackers attempting to propagate score to the Sybils to verify them by connecting to other nodes and creating groups.
Attackers are able to connect to each other and each others’ sybil accounts in any way.
We assumed that each attacker will have one account with a normal or above-average number of direct connections to honest users which they can use for interconnections to sybil accounts.
All these attacks can be performed by one or more groups of attackers who collaborate together.One or more groups of attackers attempt to connect to some of the seeds and create some sybil nodes.implementation-graph for single group-graph for multiple groupsOne or more groups of attackers attempt to connect to some of the top-ranked honests and create some sybil nodes.implementation-graph for single group-graph for multiple groupsOne or more groups of attackers attempt to connect to some honest and create some sybil nodes.implementation-graph for single group-graph for multiple groupsA group of attackers attempts to connect to some of the top-ranked honests  and create multiple (duplicate) groups of the sybils.implementation-graph for signle groupOne or more groups of seed nodes attempt to create some sybil nodes.implementation-graph for single group-graph for multiple groupsOne or more groups of honest nodes attempt to create some sybil nodes.implementation-graph for single group-graph for multiple groupsManual attackThis is a way to manually add new nodes/edges/groups to the BrightID graph and see how different algorithms rank those nodes. You can useMANUAL_ATTACK_OPTIONSvariable in theconfig.pyfile to define the manual attack. This example adds 3 sybil nodes, connect them toxGUyVQLYV80pajm8QP-9cfHC7xri49V58k02kqTAiUIas attacker and add them to a new group.graph for this manual attackMANUAL_ATTACK_OPTIONS = {
    'top': True,
    'connections': [
        ['xGUyVQLYV80pajm8QP-9cfHC7xri49V58k02kqTAiUI', 'sybil1'],
        ['xGUyVQLYV80pajm8QP-9cfHC7xri49V58k02kqTAiUI', 'sybil2'],
        ['xGUyVQLYV80pajm8QP-9cfHC7xri49V58k02kqTAiUI', 'sybil3'],
        ['sybil1', 'sybil2'],
        ['sybil1', 'sybil3'],
    ],
    'groups': {
        'new_group_1': [
            'sybil1',
            'sybil2',
            'sybil3'
        ]
    }
}Install$ git clone https://github.com/BrightID/BrightID-AntiSybil.git
$ cd BrightID-AntiSybil
$ pip3 install .Running TestsYou can configure the algorithms and attacks you want to test by editing theconfig.pyfile inanti_sybil/tests/attacks/config.pyand then run the tests by$ python3 anti_sybil/tests/attacks/run.pyThe result will contain:An interactive graph (example) per algorithm/attack that visualize the graph and scores each sybil/attacker/honest node achievedA CSV file (example) that has a column per algorithm/attack and provide following information for each algorithm/attackResultsGroupSybilRank one group group target attackNo. Successful Honests416Successful Honests Percent78.1954887218045Sybils scored >= %0.080091533180778Avg Honest - Avg Sybil17.4819290581162Max Seed100Avg Seed59.6248484848485Min Seed31.88Max Honest100Avg Honest29.3145290581162Min Honest0Max Attacker13.96Avg Attacker13.96Min Attacker13.96Max Sybil13.96Avg Sybil11.8326Min Sybil5.87Border14A chart to compare effectiveness of different anti-sybil algorithms to detect sybils in different attacksOld VersionThe old version of BrightID Anti-Sybil algorithms, tests and documents can be foundhere.