Open-source peer-to-peer messaging SDK for Zapp applications, built on the Holepunch/Pear stack (Hyperswarm + Bare).
ZappMessaging provides a comprehensive P2P messaging solution with no central server:
- Direct Messages: Private peer-to-peer conversations addressed by public key, with no accept step in the SDK
- Group Chats: Multi-person chats with invite system and permissions
- Media Transfer: Chunked image and GIF transfer with content-addressed storage
- No Accounts: Peer discovery over the Hyperswarm DHT with Noise-encrypted transport
- Privacy-First: Keypair-based identity, no phone numbers or tracking
- Resilient Delivery: An optional blind peer mirrors encrypted cores and relays connections, so chat keeps working behind restrictive networks without seeing message contents
core/- Platform-agnostic JavaScript modules (CommonJS, Bare runtime)ios/- Swift framework for iOS apps with XCFrameworkandroid/- Kotlin library for Android apps with AARserver/- Blind-peer relay and invite mailbox for offline delivery
import ZappMessaging
let sdk = ZappMessagingSDK(
config: ZappMessagingConfig(dataDir: appSupportDirectory)
)
try await sdk.initialize()
// Chat identity is derived from the host wallet's BIP39 seed.
let identity = try await sdk.restoreFromSeedPhrase(seedPhrase, displayName: "Alice")
print("Chat public key: \(identity.publicKey)")
let conversation = try await sdk.createConversation(
type: .direct,
participants: [recipientPublicKey],
displayName: "Bob"
)
let message = try await sdk.sendMessage(
conversationId: conversation.id,
content: "Hello!"
)
print("Sent \(message.id)")See ios/README.md for setup, configuration, and the full Swift surface.
- Discovery: Order-independent topic derived from both public keys
- Use Case: Private conversations, direct deals, customer support
- Access: An inbound invite auto-joins the pairwise topic, replies with the reciprocal core key, and then raises
conversation.invite_received. Accept and block policy is the host application's responsibility
- Discovery: Random group ID with invite system
- Use Case: Trading groups, project teams, private communities
- Access: Invite-based with member management and permissions
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ iOS/Android │ │ Native Wrapper │ │ JS Worklet │
│ App │◄──►│ (Public API) │◄──►│ (Core Logic) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
┌─────────────────┐
│ Hyperswarm │
│ (P2P Network) │
└─────────────────┘
- Core API Reference - IPC protocol between the native wrappers and the worklet
- iOS SDK - Swift setup and usage
- Android SDK - Kotlin setup and usage
- Server - Blind-peer relay and invite mailbox deployment
- P2P Runtime: BareKit worklet (JavaScript in Bare kernel)
- Networking: Hyperswarm (DHT-based peer discovery with Noise protocol)
- Crypto: Hypercore-Crypto (Ed25519 keypairs, Blake2b hashing)
- Storage: Corestore (RocksDB-backed atomic storage)
- Offline Delivery: Blind-peer mirroring via
blind-peeringandprotomux-rpc - Compatibility: B4A (Buffer/Uint8Array cross-platform)
- iOS: BareKit XCFramework with Swift Package Manager
- Android: BareKit AAR with Gradle support
- IPC: NDJSON (newline-delimited JSON) over BareKit IPC
- Architecture: Single JavaScript core with platform-native wrappers
See CONTRIBUTING.md for development setup, commit message and pull request expectations, and the Developer's Certificate of Origin sign-off.
Report vulnerabilities through the private security advisory flow. Do not file them as public issues.
Apache License 2.0 - see LICENSE file for details.
- JustZappIt - Landing site
- zapp-android - Android app