# Challenges

#### **Challenges Faced During Development**

Building the decentralized system was not without its hurdles. Several key challenges arose, each requiring innovative solutions and extensive research to overcome:

***

#### **1. Encryption Complexity and Synchronization**

* **Challenge:**
  * Implementing and integrating **Pedersen Commitments**, **Paillier Cryptosystem**, and **AES Encryption** was one of the most complex aspects of the project.
  * Each cryptographic scheme has unique properties, making it difficult to align them for seamless operation.
  * Ensuring compatibility and proper synchronization between these schemes while maintaining security and efficiency was a major technical hurdle.
* **Solution:**
  * Focused on defining clear workflows for each encryption scheme, identifying their strengths, and deciding how to use them optimally.
  * Conducted rigorous testing to ensure the outputs from one encryption scheme could feed into another where required.

***

#### **2. Maintaining Decentralization While Balancing On-Chain and Off-Chain Workloads**

* **Challenge:**
  * A core objective was to ensure the system remained **truly decentralized**, leveraging blockchains like Ethereum for **aggregation and verification layers**.
  * On-chain computations are inherently slower and significantly more expensive than off-chain alternatives, making it critical to decide which components should remain on-chain and which could be moved off-chain without compromising decentralization.
* **Solution:**
  * Adopted a **hybrid approach**:
    * Kept critical actions such as **aggregation, verification, and staking** on-chain for transparency and trust.
    * Delegated **intensive computations** (e.g., local training) and **storage operations** (e.g., model files) to off-chain systems like Walrus.
  * Implemented decentralized checks and balances to ensure the off-chain operations were verifiable on-chain.

***

#### **3. Lack of Established Resources and Research-Driven Implementation**

* **Challenge:**
  * There was no comprehensive guide or existing implementation for the problem we aimed to solve.
  * This required us to delve into academic **research papers** to understand the intricacies of cryptographic schemes, federated learning, and decentralized systems.
  * Translating theoretical concepts into practical, functional code was time-consuming and intellectually demanding.
* **Solution:**
  * Dedicated significant time to reading and analyzing research papers, focusing on cryptographic primitives and their applications in secure federated learning.
  * Iteratively implemented, tested, and refined concepts derived from research until a reliable system was built.
