mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-17 07:14:23 +01:00
7.0 KiB
7.0 KiB
┌──────────────────┐
│ CORE LN │
│ │
│ │
│ - lightningd │
│ - channeld │
│ - openingd │
│ │
└────────▲─────────┘
│
│
│ UNIX FILE DESCRIPTORS
│
HSMD │
┌─────────────────────────────┼──────────────────────────────────────┐
│ │ │
│ ┌──────────┼───────────┐ │
│ │ │ │ │
│ │ ┌────────▼─────────┐ │ │
│ │ │ CLN CLIENT │ │ │
│ │ │ │ │ │
│ │ │ │ │ │
│ BROKER │ │ SIGNER LOOP │ │ --------- BITCOIND │
│ │ └────────▲─────────┘ │ │
│ │ │ │ │
│ │ │ │ │
│ │ | MPSC │ │
│ │ │ │ │
│ │ │ │ │
│ │ ┌──────▼──────┐ │ │
│ │ │ MQTT BROKER │ │ │
│ │ └──────▲──────┘ │ │
│ │ │ │ │
│ └──────────┼───────────┘ │
│ │ │
│ │ │
│ │ MQTT │
│ │ │
│ │ │
│ ┌────────────┼────────────┐ │
│ │ │ │ │
│ │ ┌──────▼──────┐ │ │
│ │ │ MQTT CLIENT │ │ │
│ │ └──────▲──────┘ │ │
│ │ │ │ │
│ SPHINX-KEY │ │ │ │
│ │ │ MPSC │ │
│ │ │ │ │
│ │ │ │ │
│ │ ┌──────────▼──────────┐ │ │
│ │ │ VLS PROTOCOL SIGNER │ │ │
│ │ └──────────▲──────────┘ │ │
│ │ │ │ │
│ │ │ │ │
│ │ │ HAL SPI │ │
│ │ │ │ │
│ │ │ │ │
│ │ ┌───────▼───────┐ │ │
│ │ │ SD CARD, LEDs │ │ │
│ │ └───────────────┘ │ │
│ │ │ │
│ └─────────────────────────┘ │
│ │
└────────────────────────────────────────────────────────────────────┘
Modules
HSMD: Daemon taken out of Core Lightning that handles private key material, and serves signing requests remotely.BROKER: Proxies HSMD requests fromCORE LNtoSPHINX-KEYvia MQTT.SPHINX-KEY: Stores the private keys, and responds to signing requests.
Key Components
CORE LN: Sends HSMD requests toCLN CLIENTvia UNIX file descriptors.CLN CLIENT: Reads and writes HSMD requests and responses via UNIX file descriptors. Lives inbroker/unix_fd.rs.SIGNER LOOP: Loops on HSMD requests received onCLN CLIENT, and sends them toMQTT BROKERvia ruststd::sync::mpscthread communication channels. Lives inbroker/unix_fd.rs.MQTT BROKER: Receives requests fromSIGNER LOOPviampscchannels, and sends them toSPHINX KEYover the internet via authenticated MQTT. Lives inbroker/mqtt.rs.BITCOIND: Provides on-chain data toBROKERfor validation of the operations ofVLS PROTOCOL SIGNER.MQTT CLIENT: Receives MQTT messages fromMQTT BROKERover the internet and sends them toVLS PROTOCOL SIGNERviampscchannels.MQTT CLIENTlives insphinx-key/src/conn/mqtt.rsandVLS PROTOCOL SIGNERlives insigner/src/lib.rs.SD CARD: Persists data fromVLS PROTOCOL SIGNER. Communicates withVLS PROTOCOL SIGNERvia the SPI protocol implemented inesp_idf_hal::spi.LEDs: Show users and engineers the state of the sphinx-key, for both UX and debugging. Also communicate withVLS PROTOCOL SIGNERviaesp_idf_hal::spi.
Paste the code block above into asciiblock.com to make edits. Then press the download button on the top right of the pane to bring it back here.