Skip to main content

make first and simple checks for donnors relations to grantees/other donnors on public funding rounds on WEB3

Project description

Sybil Checks Package

pip install SybilChecks

from SybilChecks import checks

Intro

This package was developed during ODC Data Builders Hackathon on Jan-2023, OpenData Community . It intends to make it easier to do first basic checks on donors of public funds rounds. It can integrate systems of risk analysis as a ‘Lego’ for feature engineering or as a start for further data analysis on wallets. It cointans 5 functions, 4 of them tests behaviours and flags booleans outputs for the behaviour tested ,and 1 returns a dataset of historical transactional data till the current date.

The idea is to make it easier to do basic tests around participants and flags suspicious behaviours that could culminate in Sybil identification.

How it works

The package was created using Covalent API therefore it is imperative that the users get an <api_key> , as it is a necessary variable on every function.

Functions variables :
wallet_id = type: ‘str’, wallet address that will be evaluated
api_key = type: ‘str’, your covalent api_key
chain_id = type: ‘str’, covalent id for the network you want the historical transactions
round_start = type: ‘str’, format : ‘%Y-%m-%d’, date of the round start or date when the round was announced. Example : ‘2022-12-05’
round_finish = type: ‘str’, format : ‘%Y-%m-%d’, date of the round end or date when donors were not able to make donations anymore. Example : ‘2022-12-31’
list_for_testing = type : ‘list’, present on the wallet_initiated module, it should contain a list of unique wallet addresses of donors and grantees but not the wallet tested .
list_of_donors = type : ‘list’, present on the trx_between_donors module, it should contain a list of unique wallet addresses of donors .
wallets_lists = type : ‘list’, present on the wallet_historical_trx module, it should contains all wallets address that is intended to get the lifetime transactional data on the specified chain_id

Fuctions:

first_trx_during_round(wallet_id, api_key, chain_id, round_start, round_finish):
Function tests if the wallet was ‘initiated’ (tried its first transaction), on the specific chain tested, during the period specified. This module does not distinguish between failed or successful transactions. Output: list['wallet_id', True/False]

wallet_initiated(wallet_id, api_key, chain_id, list_for_testing) :
Function tests if the first funds were received by one of the wallets in the <list_for_testing> variable . It returns ‘True’ only if the first successful and not ‘0’ value transaction was made by some of the wallets in the list. Output: list['wallet_id', True/False]

Example:
Trx_1 : from x_wallet / successful : False / value: 1 (function will discart)
Trx_2 : from x_wallet / successful : True / value: 0 (function will discart)
Trx_3 : from n_wallet / successful : True / value: 10 (function will accept)
If list_for_testing contains 'n_wallet' then module returns True

trx_between_donors(wallet_id, api_key, chain_id, list_of_donors) :
Function tests if round donors have transitioned between themselves, there is not distinction between successful and failed transactions nor about when these transactions occurred. In this module wallet_id must be in list_of_donors. Output: list['wallet_id', True/False]

donors_trx_during_round(wallet_id, api_key, chain_id, round_start, round_finish, list_of_donors) :
Function tests if round donors have transitioned between themselves during the period of grant round or announcement of the round, there is no distinction between successful and failed transactions. wallet_id must be in list_of_donors. Output: list['wallet_id', True/False]

wallet_historical_trx(wallets_list , api_key, chain_id):
This function was developed to make it easier to get historical transactional data from a list of wallets. It bridges the gap between the API usage and a final treated dataset.

Further development:

The package has little study around time optimization due to hackathon time constraints. It can be slow when used to check a lot of wallets owing to making one API call for each function ‘check’. Further development would include:

  • modules to import and treat a dataset and use it to retrieve the validations for the other modules.
  • One module that builds and processes networks algorithms and returns network metrics as degree of centrality, closeness and so on ..

Acknowledgements to:

  • Covalent Network, due to the service and support on their discord
  • Simon from 0x9simon due to his discussion around Gas Provision Network. It inspired the construction of the module ‘wallet_initiated’

If you want to contribute, please contact Stefi :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SybilChecks-0.0.4.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SybilChecks-0.0.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file SybilChecks-0.0.4.tar.gz.

File metadata

  • Download URL: SybilChecks-0.0.4.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for SybilChecks-0.0.4.tar.gz
Algorithm Hash digest
SHA256 90fc350b8ecd5e4ac1ab4444042a476860574e3f3ca889f2fcb6e5ed882d57a5
MD5 7b95e58fb8c761bcb9b3ec48ec751297
BLAKE2b-256 e066f3276644ee1e4745f2436a92d6ae16cd061513e2cb42a6cec5bab38426e7

See more details on using hashes here.

File details

Details for the file SybilChecks-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: SybilChecks-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for SybilChecks-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d7f603e413344a0979fddc281805996d5d83cce52d3fbfcf857ae6e581c93e2e
MD5 87db62827e8e2bb2249ca0a313117652
BLAKE2b-256 13dddd2f9e3f20a0ef3e9c4ed8f5e97314c0a35058e6f600636349182ab95872

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page