# imdaisyadams/chaum-pedersen-protocol-poc architecture

> Architecture diagram of the GitHub repository imdaisyadams/chaum-pedersen-protocol-poc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imdaisyadams/chaum-pedersen-protocol-poc
- Repository: https://github.com/imdaisyadams/chaum-pedersen-protocol-poc

## Overview

##### Component Details

- Inside, create a component for "ZKP Client Implementation" (src/client.rs)
- Subcomponents for:
- Proof Generator
- Registration Handler
- Login Handler
- gRPC Client Stub

- Protocol Buffer definition (zkp_auth.proto)

- Inside, create a component for "ZKP Server Implementation" (src/server.rs)
- Subcomponents for:
- Challenge Generator
- Proof Verifier
- User Registry
- gRPC Server Implementation

##### Interaction Flows

- Registration Flow:
- Client → Server: Registration Request
- Server → Client: Challenge
- Client → Server: Proof Submission
- Server → Client: Verification Result

- Login Flow:
- Similar to registration but with different protocol messages

##### Technical Details

Annotations for:
- Protocol Buffer Messages (from zkp_auth.proto)
- Docker container boundaries (reference Dockerfile.client and Dockerfile.server)
- Zero-knowledge proof components:
- Challenge generation
- Proof creation
- Verification process

##### Additional Elements

- Container boundaries
- Protocol message types

##### Infrastructure Layer

At the bottom, add:
- Docker Compose configuration
- Network configuration between containers
- Port mappings

Special Considerations:

##### Cryptographic Flow
- Zero-knowledge proof stages
- Where discrete logarithm calculations occur
- Where sensitive data is handled

##### Security Boundaries
- Clear delineation of trust boundaries
- Indication of encrypted communication channels
- Separation of concerns between components

##### Deployment View
- Docker container isolation
- Network interfaces
- Exposed ports and services

- High-level: Overall client-server architecture
- Mid-level: Component interactions and protocol flow
- Detail-level: Specific cryptographic operations and proof verification steps

Remember to use standardized symbols for:
- Components (solid rectangles)
- Protocol messages (small rectangles or circles on communication lines)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style definitions
    classDef client fill:#e1f5fe,stroke:#01579b
    classDef server fill:#ffebee,stroke:#b71c1c
    classDef communication fill:#e8f5e9,stroke:#1b5e20
    classDef container fill:none,stroke:#666,stroke-dasharray: 5 5
    classDef infra fill:#fff3e0,stroke:#e65100
    
    subgraph ClientContainer["Client Container"]
        Client["ZKP Client Implementation"]
        ProofGen["Proof Generator"]
        RegHandler["Registration Handler"]
        LoginHandler["Login Handler"]
        GRPCClient["gRPC Client Stub"]
        
        Client --> ProofGen
        Client --> RegHandler
        Client --> LoginHandler
        RegHandler & LoginHandler --> GRPCClient
    end
    
    subgraph Communication["gRPC Communication Layer"]
        Proto["Protocol Buffer Definition"]
        CommChannel["Secure Channel"]
    end
    
    subgraph ServerContainer["Server Container"]
        Server["ZKP Server Implementation"]
        ChallengeGen["Challenge Generator"]
        ProofVerifier["Proof Verifier"]
        UserRegistry["User Registry"]
        GRPCServer["gRPC Server Implementation"]
        
        Server --> ChallengeGen
        Server --> ProofVerifier
        Server --> UserRegistry
        GRPCServer --> Server
    end
    
    subgraph Infrastructure["Infrastructure Layer"]
        Docker["Docker Compose"]
        Network["Network Configuration"]
        Ports["Port Mappings"]
    end
    
    %% Interactions
    GRPCClient <--> CommChannel
    CommChannel <--> GRPCServer
    Proto --> CommChannel
    
    %% Infrastructure connections
    Docker --> ClientContainer
    Docker --> ServerContainer
    Network --> CommChannel
    
    %% Apply styles
    class Client,ProofGen,RegHandler,LoginHandler,GRPCClient client
    class Server,ChallengeGen,ProofVerifier,UserRegistry,GRPCServer server
    class Proto,CommChannel communication
    class Docker,Network,Ports infra
    class ClientContainer,ServerContainer container
    
    %% Click events
    click Client "https://github.com/imdaisyadams/Chaum-Pedersen-Protocol-POC/blob/main/src/client.rs"
    click Server "https://github.com/imdaisyadams/Chaum-Pedersen-Protocol-POC/blob/main/src/server.rs"
    click Proto "https://github.com/imdaisyadams/Chaum-Pedersen-Protocol-POC/blob/main/zkp_auth.proto"
    click ClientContainer "https://github.com/imdaisyadams/Chaum-Pedersen-Protocol-POC/blob/main/Dockerfile.client"
    click ServerContainer "https://github.com/imdaisyadams/Chaum-Pedersen-Protocol-POC/blob/main/Dockerfile.server"
    click Docker "https://github.com/imdaisyadams/Chaum-Pedersen-Protocol-POC/blob/main/docker-compose.yml"
    click Infrastructure "https://github.com/imdaisyadams/Chaum-Pedersen-Protocol-POC/blob/main/build.rs"
    click Communication "https://github.com/imdaisyadams/Chaum-Pedersen-Protocol-POC/blob/main/Cargo.toml"
```
