Skip to main content

FLEX-block

FLEXblock is an implementation of blockchain functionality for simulating descentralized federated learning experiments. It is intended to extend the 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
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
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

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:

Release files for flexBlock 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flexBlock 0.0.1
File Size Uploaded
flexBlock-0.0.1.tar.gz 22.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flexBlock 0.0.1
File Interpreter ABI Platform
flexBlock-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 51.2 kB

Release files / flexBlock-0.0.1.tar.gz

Download URL flexBlock-0.0.1.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
955c1c6290711d23231eed6efbe252f4e0e37e037595e116efc68a7bbcc034f6
BLAKE2b-256 checksum
How to use checksums
9577ec8269d5cd4fe9ec6c093e7e054235909162d4dc1e83a96f1871bf6ad458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.11

Release files / flexBlock-0.0.1-py3-none-any.whl

Download URL flexBlock-0.0.1-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eae3eb15e512155e1a2b937367182314b8ec498b2ecdc7081f2f278ef55b6e91
BLAKE2b-256 checksum
How to use checksums
8d56a13617cd1522c0146eec2dc913c7e82b71005a8a8c83c16ed59dfaf31c15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page