Inspiration

The motivation for the same was derived from this talk organised by Partisia Blockchain delivered by the Co-founder Brian Gallagher on AI is the new kid in the Block discussing how Partisia is the most suitable chain for Multi-Party computation.

What it does

Federated learning is a way of training AI models on many devices without moving data. Main problem with this is that you can have malicious clients in a network that can sabotage the network and reduce model accuracy. We can solve this problem by leveraging a Proof of Stake architecture & Partisia Blockchain's concept of MPC(Multi Party Computation) & BYOC(Bring your own coin)

How we built it

It is a dual-side platform where both a general user who wants their model to be trained and a client who will train the deep learning models uploaded by various users at their end using their own private datasets.

User side:

  • A user comes & uploads their DL model they want to be trained.
  • Various parameters like the number of epochs, desired accuracy, number of activation functions & initial weights and biases are chosen.
  • The model is then dumped on chain & sent to a decentralised server of zkPFL through parsing & encrypted on IPFS.
  • The user has to pay a base fees of 100 MPC(Concept of BYOC is utilised) Tokens as an incentive for the clients to train their model.

Client side:

  • The client follows the Proof-of-Stake mechanism to avoid network spamming.
  • They stake an amount of 500 MPC tokens(Concept of BYOC is utilised) initially to participate in the training process.
  • They then connect to a server on-chain which is decentralised( a smart contract server).
  • They choose which model they wish to train from the list of models currently live(or available) for training.
  • They receive the model along with initial weights & biases from the server.
  • Each client then trains the model at their own end using their own private dataset.
  • The concept of Partisia Blockchain's MPC then comes into play. Each client trains the model & learns a new set of weights & biases but they cannot share this with other clients to increase comeptency & thus increasing the reward they receive maintaining a fair competiton & also to avoid malicious clients to affect the parameters of the model.
  • Each client separately sends the new learnt weights and biases to the zk-nodes which do an off-chain computation & commits a zk-proof of it on-chain by summing up all the matrices & then aggregating them to improve the accuarcy after each epoch.
  • The aggregated weights & biases are now sent to the clients for next round of training .
  • The process continues until the desired accuracy set by the user is reached & the newly learnt weights & biases are now sent back to the user.
  • The rewards are distributed proportionally to the time it took for each client to train the model & also how accurately they trained the model. This maintains the ecosystem more active & thus keeps the network running.

Challenges we ran into

We encountered challenges while working on zkComputation within the zk_compute.rs file. One notable issue arose when a function declared as public was incorrectly identified as private, rendering it inaccessible to the main contract file. Additionally, difficulties emerged concerning the zkStateChange and zkState enum. Despite our efforts to resolve these errors by referencing example contracts and seeking assistance from the Partisia Discord community, we encountered persistent obstacles. Through collaborative problem-solving and timely support from the community, we strived to overcome these challenges and advance our project.

Accomplishments that we're proud of

We are proud that we tried to solve the error of malicious clients in federated learning by leveraging Multi party Computation , most unique feature of Partisia Blockchain. We also succesfully deployed the contract on Partisia blockchain.

What we learned

MPC, BYOC , zkRUST

What's next for zkPFL

We plan to continue the project. We'll go through more edge cases & increase the type of model variety that can be trained. We also plan to import the server to GoLang for decreasing latency. We wish to collaborate with Partisia for helping us to make this idea come to life utilising Partisia Blockchain's ecosystem.

Feedback regarding Partisia Blockchain and its use of multi-party computation (MPC):

  1. Innovative Approach: Partisia Blockchain's integration of multi-party computation represents a groundbreaking approach to ensuring privacy and security within blockchain networks. By leveraging MPC techniques, the platform enables multiple parties to jointly compute functions over their inputs while keeping those inputs private. This not only enhances confidentiality but also preserves the integrity of data transactions.

  2. Enhanced Privacy: The utilization of MPC by Partisia Blockchain significantly enhances privacy by allowing computations to be performed on encrypted data without revealing the underlying information. This ensures that sensitive data remains confidential throughout the entire transaction process, mitigating risks associated with data exposure and unauthorized access.

  3. Decentralized Trust: Partisia Blockchain's implementation of MPC aligns with the core principles of decentralization by eliminating the need for a trusted third party to oversee transactions. Instead, consensus is achieved through collaborative computation among multiple participants, fostering a more resilient and trustless ecosystem.

  4. Scalability and Efficiency: MPC offers inherent scalability benefits by distributing computational tasks across multiple parties, thereby reducing the burden on individual nodes and improving overall network efficiency. This distributed approach facilitates faster transaction processing while maintaining the robustness of the blockchain network.

  5. Interoperability and Compatibility: Partisia Blockchain's adoption of MPC technology enhances interoperability by enabling seamless integration with existing blockchain platforms and applications. This compatibility ensures that the benefits of MPC can be leveraged across various use cases and industries, promoting widespread adoption and innovation.

  6. Security Assurance: With MPC, Partisia Blockchain ensures a higher level of security by eliminating single points of failure and reducing the risk of malicious attacks. The cryptographic protocols underlying MPC provide mathematical guarantees of security, offering users peace of mind knowing that their data is protected against unauthorized access and manipulation.

Overall, Partisia Blockchain's integration of multi-party computation represents a significant advancement in blockchain technology, offering unparalleled levels of privacy, security, and efficiency. As the platform continues to evolve, its innovative approach is poised to drive transformative change across diverse industries, unlocking new opportunities for decentralized collaboration and value exchange.

Share this project:

Updates