# FLEX-block
FLEXblock is an implementation of blockchain functionality for simulating descentralized federated learning experiments. It is intended to extend the [FLEXible](https://github.com/FLEXible-FL/FLEXible) framework.
## Details
This repository includes both:
- An interface for creating your own blockchain architectures and working with them in a FLEX experiment.
- Some blockchain architectures to be used directly out of the box.
### Folder structure
- *flexBlock/pool*: contains the interface for creating blockchain architectures and some implementations of it.
- *flexBlock/blockchain*: contains the interface for creating blockchains and block to be used with architectures and some implementations of it.
- *notebooks*: some explanatory notebooks showing how to implement a custom blockchain architecture and working with the library.
- *tests*: contains tests for the features present in this library.
### Explanatory notebooks
- *cifar-10.ipynb*: Shows how to train a model in the cifar 10 dataset with a blockchain architecture.
- *Proof of federated Learning MNIST.ipynb*: Explains and shows how to use the Proof Of Federated Learning blockchain architecture for training a simple model in the popular MNIST dataset.
- *Custom blockchain.ipynb*: Shows how to create your own blockchain architecture and how to later use it in any kind of FLEX experiment.
## Features
The library implements an interface for creating your own blockchain architectures for FLEX experiments. Still, we offer some architectures out of the box.
| Architecture | Description | Citation |
|----------|:-----------------------------------:|------:|
| Proof of Work (PoW) | The most classical consensus mechanism used in blockchain where miners race into solving a hash puzzle. In this architecture the sets of miners(aggregators) and clients is disjoint. | [Federated Learning Meets Blockchain in Edge Computing: Opportunities and Challenges](https://ieeexplore.ieee.org/document/9403374) |
| Proof of Stake (PoS) | This network uses a consensus mechanism where miners have some reputation/tokens called stake and they are picked randomly according to their stake. In this architecture the sets of clients and miners are the same. | [Robust Blockchained Federated Learning with Model Validation and Proof-of-Stake Inspired Consensus](https://arxiv.org/abs/2101.03300) |
| Proof of Federated Learning (PoFL) | A very popular consensus mechanism for blockchain enabled federated learning. Based on Proof of Useful Work miners race to get the model with the most accuracy on a given dataset. In this architecure the sets of clients and miners is disjoint. | [Proof of federated learning: A novel energy-recycling consensus algorithm](https://ieeexplore.ieee.org/abstract/document/9347812) |
## Installation
In order to install this repo locally:
``
pip install -e .
``
FLEX-block is available on the PyPi repository and can be easily installed using pip:
Raw data
{
"_id": null,
"home_page": "https://github.com/FLEXible-FL/flex-block",
"name": "flexBlock",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.10",
"maintainer_email": "",
"keywords": "blockchain FL federated-learning flexible",
"author": "Mario Garcia Marquez",
"author_email": "mariogarciamarq@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/95/77/ec8269d5cd4fe9ec6c093e7e054235909162d4dc1e83a96f1871bf6ad458/flexBlock-0.0.1.tar.gz",
"platform": null,
"description": "# FLEX-block\n\nFLEXblock is an implementation of blockchain functionality for simulating descentralized federated learning experiments. It is intended to extend the [FLEXible](https://github.com/FLEXible-FL/FLEXible) framework.\n\n## Details\nThis repository includes both:\n- An interface for creating your own blockchain architectures and working with them in a FLEX experiment.\n- Some blockchain architectures to be used directly out of the box.\n\n### Folder structure\n- *flexBlock/pool*: contains the interface for creating blockchain architectures and some implementations of it.\n- *flexBlock/blockchain*: contains the interface for creating blockchains and block to be used with architectures and some implementations of it.\n- *notebooks*: some explanatory notebooks showing how to implement a custom blockchain architecture and working with the library.\n- *tests*: contains tests for the features present in this library.\n\n### Explanatory notebooks\n- *cifar-10.ipynb*: Shows how to train a model in the cifar 10 dataset with a blockchain architecture.\n- *Proof of federated Learning MNIST.ipynb*: Explains and shows how to use the Proof Of Federated Learning blockchain architecture for training a simple model in the popular MNIST dataset.\n- *Custom blockchain.ipynb*: Shows how to create your own blockchain architecture and how to later use it in any kind of FLEX experiment.\n\n## Features\n\nThe library implements an interface for creating your own blockchain architectures for FLEX experiments. Still, we offer some architectures out of the box.\n\n| Architecture | Description | Citation |\n|----------|:-----------------------------------:|------:|\n| Proof of Work (PoW) | The most classical consensus mechanism used in blockchain where miners race into solving a hash puzzle. In this architecture the sets of miners(aggregators) and clients is disjoint. | [Federated Learning Meets Blockchain in Edge Computing: Opportunities and Challenges](https://ieeexplore.ieee.org/document/9403374) |\n| Proof of Stake (PoS) | This network uses a consensus mechanism where miners have some reputation/tokens called stake and they are picked randomly according to their stake. In this architecture the sets of clients and miners are the same. | [Robust Blockchained Federated Learning with Model Validation and Proof-of-Stake Inspired Consensus](https://arxiv.org/abs/2101.03300) |\n| Proof of Federated Learning (PoFL) | A very popular consensus mechanism for blockchain enabled federated learning. Based on Proof of Useful Work miners race to get the model with the most accuracy on a given dataset. In this architecure the sets of clients and miners is disjoint. | [Proof of federated learning: A novel energy-recycling consensus algorithm](https://ieeexplore.ieee.org/abstract/document/9347812) |\n\n\n## Installation\n\nIn order to install this repo locally:\n\n``\n pip install -e .\n``\n\nFLEX-block is available on the PyPi repository and can be easily installed using pip:\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/FLEXible-FL/flex-block"
},
"split_keywords": [
"blockchain",
"fl",
"federated-learning",
"flexible"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8d56a13617cd1522c0146eec2dc913c7e82b71005a8a8c83c16ed59dfaf31c15",
"md5": "60900b904c4aa0976d6e4fa66e3324f9",
"sha256": "eae3eb15e512155e1a2b937367182314b8ec498b2ecdc7081f2f278ef55b6e91"
},
"downloads": -1,
"filename": "flexBlock-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "60900b904c4aa0976d6e4fa66e3324f9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.10",
"size": 28477,
"upload_time": "2024-03-13T08:47:38",
"upload_time_iso_8601": "2024-03-13T08:47:38.053240Z",
"url": "https://files.pythonhosted.org/packages/8d/56/a13617cd1522c0146eec2dc913c7e82b71005a8a8c83c16ed59dfaf31c15/flexBlock-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9577ec8269d5cd4fe9ec6c093e7e054235909162d4dc1e83a96f1871bf6ad458",
"md5": "f1bb2b1820e672547df3220d8c57a332",
"sha256": "955c1c6290711d23231eed6efbe252f4e0e37e037595e116efc68a7bbcc034f6"
},
"downloads": -1,
"filename": "flexBlock-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "f1bb2b1820e672547df3220d8c57a332",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.10",
"size": 22716,
"upload_time": "2024-03-13T08:47:40",
"upload_time_iso_8601": "2024-03-13T08:47:40.107024Z",
"url": "https://files.pythonhosted.org/packages/95/77/ec8269d5cd4fe9ec6c093e7e054235909162d4dc1e83a96f1871bf6ad458/flexBlock-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-13 08:47:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "FLEXible-FL",
"github_project": "flex-block",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "flexblock"
}