Skip to main content
Rust • Swift • Kotlin • Node.js • WASM

Build secure messaging with LibXMTP

A shared library implementing the XMTP messaging protocol with MLS (Messaging Layer Security), multi-wallet identity, and cross-platform bindings for end-to-end encrypted group messaging.

XMTP Logo

Quick start

Get up and running with LibXMTP in your application

1

Install the library

Choose your platform and install LibXMTP using your package manager.
npm install @xmtp/node-bindings
2

Create a client

Initialize an XMTP client with your wallet or identity credentials.
import { Client } from '@xmtp/node-bindings'

// Create a client with wallet authentication
const client = await Client.create(
  accountAddress,
  {
    env: 'production',
    dbPath: './xmtp.db'
  }
)
The client manages your local database, identity state, and network connections. Each client is bound to a single Inbox ID and Installation ID.
3

Create or join a group

Start a new conversation or sync existing groups from the network.
// Create a new group
const group = await client.conversations.createGroup(
  [member1Address, member2Address],
  {
    groupName: "Team Discussion",
    groupImageUrl: "https://example.com/image.png"
  }
)

// Sync groups from the network
await client.conversations.sync()
const groups = await client.conversations.list()
4

Send and receive messages

Exchange end-to-end encrypted messages with group members.
// Send a message
await group.send("Hello, team!")

// Stream incoming messages
const stream = await group.streamMessages()
for await (const message of stream) {
  console.log(`${message.senderInboxId}: ${message.content}`)
}
{
  "id": "msg_abc123",
  "senderInboxId": "0x1234...",
  "content": "Hello, team!",
  "sentAt": 1234567890,
  "contentType": "text"
}

Explore by topic

Deep dive into LibXMTP’s core features and capabilities

Core concepts

Learn about MLS protocol, identity system, and client architecture

Language bindings

Platform-specific guides for Node.js, Swift, Kotlin, and WASM

Security

Credential validation, key rotation, and revocation mechanisms

Groups & conversations

Create groups, manage permissions, and configure policies

Message handling

Send messages, handle content types, and stream updates

Development

Set up your dev environment, run tests, and contribute

Key features

What makes LibXMTP powerful for secure messaging

MLS Protocol

Built on Messaging Layer Security (MLS) using OpenMLS for cryptographic operations, providing forward secrecy and post-compromise security.

Multi-wallet identity

Link multiple Ethereum wallets (EOA and smart contract) to a single inbox with support for association and revocation.

Cross-platform bindings

Use LibXMTP from Node.js (NAPI), Swift/iOS (Uniffi), Kotlin/Android (Uniffi), or WebAssembly with consistent APIs.

Configurable permissions

Fine-grained group policies control who can add/remove members, update metadata, and manage admin roles.

Resources

Additional materials to help you build with LibXMTP

GitHub repository

View source code, report issues, and contribute to the project

XMTP documentation

Learn about the broader XMTP ecosystem and protocol

Ready to build secure messaging?

Start integrating LibXMTP into your application today. Follow our quickstart guide to have encrypted group messaging running in minutes.

Get Started Now