# owasp-blt/blt-bacon architecture

> Architecture diagram of the GitHub repository owasp-blt/blt-bacon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/owasp-blt/blt-bacon
- Repository: https://github.com/owasp-blt/blt-bacon

## Overview

##### Project type and purpose
- From the README and file tree, BACON is a backend‐heavy integration service that ties together Bitcoin Core, the Runes token protocol, GitHub/BLT issue events, USPTO trademark data, and a mobile frontend (the BLT iOS app). Its goal is to mint and distribute BACON tokens on Bitcoin, provide trademark alerts, and maintain a blockchain-backed company scoreboard.

##### File structure
- Top-level files only.
- BACON_Funding_Requirements.md – project planning.
- LICENSE, README.md – documentation.
- setup_bacon_node.sh – deployment script for the BACON node.
- No separate “src” folder shown, implying that the core service (“BACON node”) is likely packaged/deployed by the shell script.
- No direct frontend code; the primary frontend is the existing BLT iOS app (external to this repo).

##### README for architecture clues
- Components mentioned: Bitcoin Core, Runes protocol, POA consensus engine, BLT bug logging tool (GitHub issues), USPTO trademark API, company scoreboard, BLT iOS app.
- Integration points: JSON-RPC to Bitcoin Core, HTTP/webhooks from GitHub/BLT, REST calls to USPTO, push notifications to iOS.

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Systems
    subgraph "External Systems" 
        direction TB
        GitHub["GitHub / BLT Issues"]:::external
        USPTO["USPTO Trademark API"]:::external
        iOSApp["BLT iOS App"]:::external
    end

    %% Central Service
    subgraph "BACON Node Service" 
        direction TB
        Webhook["Webhook Listener"]:::service
        POA["POA Consensus Module"]:::service
        RunesMint["Runes Token Minting Engine"]:::service
        Trademark["Trademark Monitor"]:::service
        DB["Internal Database"]:::database
    end

    %% On-chain Components
    subgraph "On-Chain Components"
        direction TB
        BitcoinCore["Bitcoin Core Node"]:::blockchain
        BlockchainNet["Blockchain Network"]:::blockchain
    end

    %% Documentation & Scripts
    subgraph "Documentation & Scripts"
        direction TB
        README["README.md"]:::docs
        Funding["BACON_Funding_Requirements.md"]:::docs
        License["LICENSE"]:::docs
        SetupScript["setup_bacon_node.sh"]:::scripts
    end

    %% Connections
    GitHub -->|"Webhook (HTTP)"| Webhook
    Webhook -->|"Event→POA Vote"| POA
    POA -->|"signals Mint"| RunesMint
    RunesMint -->|"JSON-RPC"| BitcoinCore
    BitcoinCore -->|"broadcast TX"| BlockchainNet
    Trademark -->|"REST Call"| USPTO
    Trademark -->|"stores data"| DB
    DB -->|"fetch/store"| Webhook
    DB -->|"fetch/store"| POA
    DB -->|"fetch/store"| RunesMint
    DB -->|"fetch/store"| Trademark
    RunesMint -->|"update"| DB
    DB -->|"Push Notification"| iOSApp
    DB -->|"REST → Scoreboard"| iOSApp

    %% Documentation Links
    click README "https://github.com/owasp-blt/blt-bacon/blob/main/README.md"
    click Funding "https://github.com/owasp-blt/blt-bacon/blob/main/BACON_Funding_Requirements.md"
    click License "https://github.com/owasp-blt/blt-bacon/tree/main/LICENSE"
    click SetupScript "https://github.com/owasp-blt/blt-bacon/blob/main/setup_bacon_node.sh"

    %% Styles
    classDef external fill:#d3d3d3,stroke:#666,stroke-width:1px
    classDef service fill:#add8e6,stroke:#036,stroke-width:1px
    classDef database fill:#90ee90,stroke:#060,stroke-width:1px
    classDef blockchain fill:#98fb98,stroke:#070,stroke-width:1px
    classDef docs fill:#fffacd,stroke:#aa0,stroke-width:1px
    classDef scripts fill:#ffe4b5,stroke:#a50,stroke-width:1px
```
