How bhanutej10/mtrp works
MTRP is a Kotlin Multiplatform mesh-messaging protocol and reference SDK, with Android and desktop user interfaces. The principal workflow is composing a message, preparing its identity and encrypted packet, selecting and sending over an available channel, then relaying packets toward their destination; the SDK also supports discovery, adaptive channel scoring, fragmentation, and store-and-forward. Core routing and channel-selection calls are visible in sampled source, while several security, transport, and relay details are documented capabilities whose implementation wiring was not sampled.
Main entry points: MtrpApi.kt Messaging API · DesktopMtrpSdk.kt Desktop SDK setup · ChannelManager.kt Channel manager · MeshRouter.kt Mesh router
Components 20
Client applications
- Android messaging UI
app/src/androidMain/kotlin/dev/mtrp/app/ui - Desktop UI
app/desktopMain/kotlin/dev/mtrp/desktop - Desktop startup
app/desktopMain/kotlin/dev/mtrp/desktop/Main.kt - Desktop SDK setup
app/desktopMain/kotlin/dev/mtrp/desktop/DesktopMtrpSdk.kt
Messaging and security
- Messaging API
sdk/core/src/commonMain/kotlin/dev/mtrp/core/api/MtrpApi.kt - Identity and cryptography
sdk/core/src/commonMain/kotlin/dev/mtrp/core/crypto - Packet format
sdk/core/src/commonMain/kotlin/dev/mtrp/core/packet/MtrpPacket.kt - Fragment assembly
sdk/core/src/commonMain/kotlin/dev/mtrp/core/packet/FragmentAssembler.kt
Routing and channel management
- Mesh router
sdk/core/src/commonMain/kotlin/dev/mtrp/core/routing/MeshRouter.kt - Neighbour and route tables
sdk/core/src/commonMain/kotlin/dev/mtrp/core/routing/NeighbourTable.kt - Channel manager
sdk/core/src/commonMain/kotlin/dev/mtrp/core/channel/ChannelManager.kt - Adaptive channel scorer
sdk/core/src/commonMain/kotlin/dev/mtrp/core/routing/ChannelScorer.kt
Transports and delivery
- Store-forward queue
sdk/core/src/commonMain/kotlin/dev/mtrp/core/queue/StoreForwardQueue.kt - Retry scheduler
sdk/core/src/commonMain/kotlin/dev/mtrp/core/queue/RetryScheduler.kt - WiFi and Nostr
sdk/core/src/commonMain/kotlin/dev/mtrp/core/transport/internet - Ethernet and LoRa
sdk/core/src/commonMain/kotlin/dev/mtrp/core/transport - Mobile transports
sdk/core/src/androidMain/kotlin/dev/mtrp/core/transport - Silent relay service
sdk/core/src/commonMain/kotlin/dev/mtrp/core/routing
Other components
- Android user
- Desktop user
Connections 23
- Android user → Android messaging UI: uses
app/src/androidMain/kotlin/dev/mtrp/app/ui/MtrpNavHost.kt - Desktop user → Desktop UI: uses
- Desktop startup → Desktop SDK setup: initializes
app/desktopMain/kotlin/dev/mtrp/desktop/Main.kt - Desktop startup → Desktop UI: opens
app/desktopMain/kotlin/dev/mtrp/desktop/Main.kt - Android messaging UI → Messaging API: calls
app/src/androidMain/kotlin/dev/mtrp/app/ui/chat/ChatScreen.kt - Desktop UI → Messaging API: calls
app/desktopMain/kotlin/dev/mtrp/desktop/ui/MessagesPanel.kt - Desktop SDK setup → Messaging API: configures
app/desktopMain/kotlin/dev/mtrp/desktop/DesktopMtrpSdk.kt - Messaging API → Identity and cryptography: encrypts
sdk/core/src/commonMain/kotlin/dev/mtrp/core/api/MtrpApi.kt - Messaging API → Packet format: builds
sdk/core/src/commonMain/kotlin/dev/mtrp/core/api/MtrpApi.kt - Messaging API → Channel manager: selects channel
sdk/core/src/commonMain/kotlin/dev/mtrp/core/api/MtrpApi.kt - Channel manager → Mesh router: registers transports
sdk/core/src/commonMain/kotlin/dev/mtrp/core/channel/ChannelManager.kt - Channel manager → Adaptive channel scorer: ranks channels
sdk/core/src/commonMain/kotlin/dev/mtrp/core/channel/ChannelManager.kt - Mesh router → Neighbour and route tables: updates tables
sdk/core/src/commonMain/kotlin/dev/mtrp/core/routing/MeshRouter.kt - Messaging API → Store-forward queue: queues delivery
sdk/core/src/commonMain/kotlin/dev/mtrp/core/api/MtrpApi.kt - Retry scheduler → Store-forward queue: retries queued
- Desktop SDK setup → Retry scheduler: starts
app/desktopMain/kotlin/dev/mtrp/desktop/DesktopMtrpSdk.kt - Desktop SDK setup → WiFi and Nostr: registers
app/desktopMain/kotlin/dev/mtrp/desktop/DesktopMtrpSdk.kt - Desktop SDK setup → Ethernet and LoRa: registers
app/desktopMain/kotlin/dev/mtrp/desktop/DesktopMtrpSdk.kt - Channel manager → Mobile transports: dispatches
- Channel manager → Fragment assembly: fragments packets
sdk/core/src/commonMain/kotlin/dev/mtrp/core/channel/FragmentingChannelManager.kt - Fragment assembly → Packet format: reassembles
sdk/core/src/commonMain/kotlin/dev/mtrp/core/channel/FragmentingChannelManager.kt - Mesh router → Silent relay service: handles relay
sdk/core/src/commonMain/kotlin/dev/mtrp/core/routing/MeshRouter.kt - Mesh router → Packet format: processes incoming
sdk/core/src/commonMain/kotlin/dev/mtrp/core/routing/MeshRouter.kt