A year and a bit in
Hey folks! I put this repo up on July 1, 2025, because I wanted to build with WhatsApp in Rust. Almost a year and a half later, I've seen that same code make it into desktop apps, JavaScript through WebAssembly, and even a little ESP32. Getting a QR code to scan felt like a big deal back then. These days I spend a lot more time thinking about what happens on the tenth reconnect, or when somebody upgrades and opens the same account database again. I'm glad this project has been around long enough for those to be the problems we get to work on.
We shipped v0.7.0 on August 7, 2026. Almost four months and 809 pull requests later, here we are. The repo had around 700 stars when I wrote those release notes. By late November it had passed 1,100. Thank you for sticking around. v0.7.0 · whatsapp-rust on GitHub
Built with whatsapp-rust
I really wanted to talk about ZapFast. Carmine Paolino built a native WhatsApp desktop app in Rust and egui, and it picked up over 5,300 stars in its first three months on GitHub. He also got 21 PRs merged here. That work lets us retransmit missing video packets on request and adds forward error correction to 1:1 calls. He kept capture timestamps through the send path and fixed a case where you could see the other person but couldn't hear them. ZapFast · Retransmission · Video FEC · Capture timing · Call audio
I had a look through GitHub's dependency graph and the manifests behind it.
- ZeroClaw has an optional WhatsApp Web channel built on the published Rust crates. ZeroClaw · Channel manifest
- OmniGet uses a pinned SDK revision for its PhoneChat component. OmniGet · PhoneChat manifest
- TinyChannels, the channels project behind OpenHuman, uses the SDK in its optional WhatsApp Web provider. TinyChannels provider manifest · OpenHuman
- Moltis has a dedicated WhatsApp crate, and OpenCrabs uses the SDK for its WhatsApp channel. Moltis · OpenCrabs
- Baileys uses pieces of the Rust core through its WASM bridge. The bridge brings Rust code for things like WhatsApp binary nodes and Signal into JavaScript. Baileys · whatsapp-rust-bridge
On our side, there's also Oxidezap, a desktop and browser client, and whatsapp-rust-esp32, whose ESP32-C3 target works without external RAM. Oxidezap · ESP32 client · Used by
What's new
Mobile registration and primary-device sessions
We started with companion linking. The experimental mobile-core feature adds mobile registration, primary-device sessions and companion management. The host supplies the transport, clock, storage and trust configuration. With persistent storage, registration checkpoints can survive a restart, including cases where a code request may have reached the server before the connection went away. mobile-transport-native supplies a Tokio TCP adapter if you need one. Our maintained checks use synthetic flows and selected native and browser profiles. Live registration, real SMS delivery and production interoperability are still unverified. #1853 · Mobile API · Support matrix
A new Signal engine and a protobuf runtime we own
We rewrote the Signal engine as a sans-I/O implementation inside wacore-libsignal. It reads historical session, prekey and sender-key records, so an SDK upgrade can pick up an existing linked account. The crate also owns the X25519 and XEdDSA implementations. Hosts can observe peer identity changes and compute numeric security codes for supported identities. #1842 · #1895 · #1837
We also moved the protobuf runtime into waproto. We still start with the WhatsApp Web schema from whatspec. The SDK now owns the Rust types, wire readers, writers and views its consumers depend on. Buffa remains available as a reference for tests. If you imported Buffa's traits or containers directly, there are replacements in the migration guide. #2121 · #2122
Calls and media
- Bring your own media backend.
voip-controlcarries the call flow and the interfaces for an external backend.voip-engine-wacoreenables the built-in engine.voip-relay-nativeadds the native relay, which can use a datagram dialer supplied by the app. #1509 · #1849 - Video calls handle packet loss better. Direct calls can retransmit packets on request, reconstruct some missing packets with forward error correction, and request a fresh keyframe after a gap. Apps can observe peer video transitions, including screen sharing. Group calls can ask a specific participant for a keyframe. #1727 · #1872 · #1879 · #1887
- Media downloads have explicit limits. You can cap wire and plaintext bytes across attempts and stream encrypted downloads into memory with a compatible async HTTP adapter. You can also edit a caption while reusing the attachment already on the CDN. #1730 · #2016 · #2014
Messaging, sync and hosting
- Recovery for messages and history. With inbound durability enabled, the client can retain decrypted messages in memory through a failed store write and reconnect. A persisted pending record also supports recovery after a restart. Hosts can opt in to durable capture for history sync chunks and group notifications. #1679 · #1751 · #1657 · #1699
- Business and channels. There are catalog, product and business profile operations, channel admin and follower operations, and channel polls with live tallies and a way to read back your own votes and reactions. #1252 · #1993 · #1249 · #1552 · #1554 · #1555
- Groups and app state. Member adds can share recent history, communities can have hidden subgroups, and apps can request an app-state resync. Sync also exposes call logs, favorite chats and stickers, and recoverable chat labels and memberships. #1550 · #1522 · #1267 · #1275 · #1544 · #2155
- More control over the connection. Hosts can pause and resume a session, defer new dial attempts, watch outbound stanzas and intercept inbound stanzas or decrypted payloads. Browser hosts can supply a single-threaded runtime and use the browser SQLite profile with SQLite initialization supplied by the host. #1265 · #1594 · #1260 · #1239 · #1240 · #1734 · #1766
Performance and memory
In our benchmarks, v0.8.0 used less CPU than v0.7.0 in paced DM ping-pong and when opening and holding multiple sessions. Peak memory was lower in the high-load DM ping-pong test.
Fixes worth knowing about
- Hosted devices receive Business Coexistence DMs. We include those devices in 1:1 fan-out. #2118
- Group sends recover from more roster and identity problems. Group notifications update stored metadata in place. A group device refresh skips individual prekey lookups for missing participant identities and isolates an identity conflict to the affected contact. #2114 · #1900
- Reconnect and shutdown recover from stuck work. Pending IQs get probed before the keepalive watchdog reconnects.
reconnect_immediately()wakes an ordinary reconnect backoff, and shutdown interrupts an in-flight dial. #1543 · #1905 · #1877 - Fewer duplicate events on resend. If a sender's outbox resends a group message with the same ID under a new sender-key iteration, the receive path can suppress the duplicate event. #1352
- Downloads support encrypted media reuploads. The download path accepts reuploads that lack the encrypted file hash, with MAC and plaintext hash verification. The retry result also exposes the optional message secret from the notification. #2135
- Calls handle more of the rough edges we saw in apps. Fixes cover silent audio in 1:1 video calls, jitter dropping speech, and group video offers the official client previously rejected. #1720 · #1815 · #1886
API stabilization
This is still a pre-1.0 release. A lot of the API work came down to giving operations and state types you can distinguish at the call site. A message's ID and the ID of an edit now describe different things. Group metadata and a cached routing roster have different calls. A client that is trying to reconnect differs from one whose run has ended. And adapters now get typed errors all the way down to HTTP, cache and storage. If you maintain a binding or your own backend, give yourself time for the upgrade. #1601 · #1583 · #1576 · #2119
Upgrading from v0.7.0
Start with Cargo features and the compiler version, then update the call sites your app uses. Test the upgrade with a copy of your existing account store.
Cargo features and existing accounts
| In v0.7.0 | In v0.8.0 |
|---|---|
| Rust 1.94 minimum | Set your minimum to Rust 1.95. The repository's own toolchain pin is Rust 1.100. |
| Passkey linking compiled in | Add the passkey feature if you use PasskeyAuthenticator or passkey pairing. QR and pair-code linking still work with the default features.
|
simd feature
| Remove it from your dependency and forwarded features. |
sqlite-storage selected bundled SQLite
| Default builds still bundle SQLite. For a custom feature set, select sqlite-storage-bundled to bundle it, or use sqlite-storage with system SQLite 3.54.0 or newer.
|
voip-runtime included the native relay
| Use voip for the native profile or add voip-relay-native to a custom feature set. Choose voip-control for an injected media backend and voip-engine-wacore for the built-in engine.
|
danger-skip-cert-chain-verify Cargo feature
| Remove the feature. Normal clients use the default strict verification. Local mock fixtures that need a verification override can opt in through the builder's runtime Noise policy. |
In-tree whatsapp-rust-chat-store
| Update the Git dependency to oxidezap-chat-store in oxidezap/client and follow that client's integration.
|
Cargo features · SQLite floor · Chat-store extraction · Extracted package
The bundled SQLite backend runs its schema migrations when you open the database. The Signal engine can read the old session, prekey and sender-key formats. Reopen the same device ID when using a shared database. If your app also keeps its own chat archive, treat its schema and data migration separately from the SDK's account store. Signal storage compatibility tests · SQLite construction
Send, edit and address an existing message
send_message still covers a send with default options. For explicit options, replace send_message_with_options with send(SendRequest). The examples take a caller-supplied ID for a new message. You can omit it to let the SDK generate the ID. When you edit, use a reference to the original message. Save the original content ID if you'll edit it again. The ID returned by an edit identifies that edit operation. #1406 · #1601 · #1614
v0.7.0
use whatsapp_rust::{Client, Jid, SendOptions};
use whatsapp_rust::prelude::{MessageBuilderExt, wa};
pub async fn send_and_edit(
client: &Client,
chat: &Jid,
content_id: &str,
) -> Result<(), Box<dyn std::error::Error>> {
let sent = client
.send_message_with_options(
chat,
wa::Message::text("hello"),
SendOptions::default().with_message_id(content_id),
)
.await?;
client
.edit_message(chat, sent.message_id, wa::Message::text("hello again"))
.await?;
Ok(())
}v0.8.0
use whatsapp_rust::{Client, EditRequest, Jid, MessageId, SendOptions, SendRequest};
use whatsapp_rust::prelude::{MessageBuilderExt, wa};
pub async fn send_and_edit(
client: &Client,
chat: &Jid,
content_id: &str,
) -> Result<(), Box<dyn std::error::Error>> {
let request = SendRequest::new(chat, wa::Message::text("hello")).with_options(
SendOptions::default().with_message_id(MessageId::new(content_id)?),
);
let sent = client.send(request).await?;
let edit = EditRequest::new(sent.message_ref()?, wa::Message::text("hello again"));
client.edit_message(edit).await?;
Ok(())
}From a bot handler, use MessageContext::message_ref() to preserve the original message's address and author. Revoke, pin, keep and reaction operations accept that reference. Raw entry points such as revoke_message_raw and send_reaction_raw are for adapters that already own wire addressing. Build chat read, clear and delete ranges with message_range(last, last_system, [(target, timestamp)]). Replace the removed free message_key helper with target.to_raw_key() when you need a protobuf key. Keep channel and status IDs scoped to those features. #1630 · #1632 · #1652
Protobufs, errors and time
- Replace
whatsapp_rust::buffaandwaproto::buffaimports withwhatsapp_rust::protobuforwaproto::protobuf. Import the message trait and containers fromprotobuf. The generated WhatsApp types still live inwathrough the prelude, which also exportsprotobuf_codecfor common message types. #2121 · #2122 - Construct generated messages with
Defaultand field assignment, generated setters, orproto!. Use..when destructuring non-exhaustive structs and a fallback in enum and oneof matches. A decode and re-encode can drop unknown fields. Keep the original bytes when forwarding must preserve them. #1676 · #1736 - Replace
whatsapp_rust::anyhowand old adapter result signatures with the relevant SDK errors. For example, HTTP adapters returnHttpError, stores returnStoreError, and custom caches returnCacheResult<T>. Your app can still add its ownanyhowdependency and wrap typed failures at its application boundary. #2119 - Replace
whatsapp_rust::chronoand implicit datetime assumptions withTimestamp. Read Unix seconds withas_secs()and milliseconds withas_millis(). Keep date formatting in the application and preserve optional timestamps, including missing group rekey times. #1926 · #1711
use whatsapp_rust::prelude::{proto, protobuf_codec, wa};
use whatsapp_rust::protobuf::DecodeError;
pub fn roundtrip_message() -> Result<wa::Message, DecodeError> {
let message = proto!(wa::Message {
conversation: "Hello"
});
let wire = protobuf_codec::message_to_vec(&message);
protobuf_codec::message_decode(&wire)
}Bot lifecycle and callbacks
BotBuilder now defaults to a bounded, concurrent adapter. It holds 256 waiting events, runs up to 16 callbacks concurrently, and counts newly dropped events when the mailbox is full. Replace explicit EventDelivery::Concurrent with EventDelivery::ConcurrentUnbounded to keep spawn-per-callback delivery. Choose Ordered when accepted callbacks must run in enqueue order. If your consumer needs to resume processing encrypted messages after a restart, persist them through InboundDurabilityHook and make the consumer idempotent.
The IncomingCall, LoggedOut and TemporaryBan variants now carry boxed payloads. So does the GroupUpdate::action field. Use as_ref() when you need a reference to the payload. Remove matches on the retired PushNameUpdate event. #1310 · #1402 · #1417 · #1587 · #1607
Replace wait_for_connected with wait_for_session_ready where callers need authentication and critical sync. Use wait_for_socket_ready in place of wait_for_socket. For boolean checks, is_session_ready covers the full session and is_socket_connected checks just the Noise socket. run returns a completion reason. logout reports deregistration and local cleanup separately. BotHandle::shutdown returns a report you can propagate with into_result(). Lifecycle API · #1576 · #1606 · #2013
use whatsapp_rust::bot::{BotHandle, BotShutdownError};
pub async fn stop(handle: BotHandle) -> Result<(), BotShutdownError> {
handle.shutdown().await.into_result()
}Downloads and calls
Pass DownloadLimits::default() to keep the old behavior at the media layer. Your HTTP adapter may impose its own limits. When you set caps, pick a streaming HTTP adapter and pass the wire and plaintext limits explicitly. For lower-level helpers, construct DownloadParams with encrypted, plaintext or reupload. Pass it to download or download_to_writer in place of the removed download_from_params and download_from_params_to_writer aliases. Handle errors by their phase if you drive media reupload yourself. #1575 · #1612 · #1653 · #1656 · #1730
use whatsapp_rust::Client;
use whatsapp_rust::download::{ClientDownloadError, DownloadLimits, Downloadable};
pub async fn fetch_media(
client: &Client,
media: &dyn Downloadable,
) -> Result<Vec<u8>, ClientDownloadError> {
client.download(media, DownloadLimits::default()).await
}Replace events() with take_events() and move the owned queue to one consumer task. Fan out from that task when multiple parts of your app need updates. Use wait_ended() when you only need to know when the call finishes. Replace the legacy video-state events with the typed CallEvent::PeerVideoStateChanged event. Call hangup_local() for local teardown or terminate() to end an active call and signal its peer. #1609 · #1624
use whatsapp_rust::voip::{CallEvent, CallHandle};
pub async fn forward_events(
call: &CallHandle,
mut handle_event: impl FnMut(CallEvent),
) {
let Some(mut events) = call.take_events() else {
return;
};
while let Ok(event) = events.recv().await {
handle_event(event);
}
}Contacts, groups, MEX and data types
| If you used | Move to |
|---|---|
| Contact picture getters or lookup | client.pictures().lookup(ProfilePictureRequest::new(target, size)). Handle found, unchanged, missing and unauthorized separately. Choose an explicit contact, group or community route.
|
| An empty image to remove a picture | Call remove_profile_picture on the owning facade.
|
| Group lists and lookups | Use list_participating() for summaries, fetch_metadata(...) or fetch_metadata_batch(...) for full server metadata, and routing_info(...) for the cached participant routing view. Read hierarchy through metadata.hierarchy(), which replaces group_type(...).
|
| Community creation using a struct literal | Use CreateCommunityOptions::new(name)? and handle partial success when linking subgroups.
|
MEX query or mutate
| Build an operation request with mex_operation! and call client.mex().execute(request). Use generated variable constructors or assign fields after Default where supported.
|
| Struct literals for public SDK types, including events, status options and group types | Use their public constructors or builders. Patterns on extensible types should leave room for new fields and variants. |
| An unconditional success after setting the push name | Inspect PushNameOutcome. Retry app-state sync with sync_push_name(name) if the presence update succeeded, sync failed, and that name is still current.
|
Pictures · Picture removal · Groups · Community creation · MEX · DTO construction · Push name
use whatsapp_rust::{
Client, ContactError, Jid, ProfilePictureLookup, ProfilePictureRequest, ProfilePictureTarget,
ProfilePictureType,
};
pub async fn contact_picture(
client: &Client,
contact: &Jid,
) -> Result<ProfilePictureLookup, ContactError> {
let request = ProfilePictureRequest::new(
ProfilePictureTarget::Contact(contact),
ProfilePictureType::Full,
);
client.pictures().lookup(request).await
}SQLite, custom stores and other host adapters
Open a single device with SqliteStore::open. For a multi-account application, open SqliteDatabase once and take a store for the existing device ID. Use the database facade for provisioning or deleting accounts. An existing store may have an uninitialized label view. Rebuild it with client.labels().rebuild().await? and check the returned is_complete() before using it as a full snapshot. #1573 · #1603 · #2155
use whatsapp_rust::store::{SqliteDatabase, SqliteDatabaseConfig, SqliteStore};
use whatsapp_rust::wacore::store::error::StoreError;
pub async fn open_account_store(url: &str, device_id: i32) -> Result<SqliteStore, StoreError> {
let database = SqliteDatabase::open(url, SqliteDatabaseConfig::default()).await?;
Ok(database.store(device_id))
}- Store implementations. Update to the typed storage errors. Implement atomic trusted-contact token merges and app-state patch commits. Implement the required
commit_snapshot_with_labelsmethod so the MACs, version and applicable label projection commit together. Review the Signal session-lock and optional atomic-write contracts before reusing a custom store. Preserve the attempt count and source when constructingStoreError::RetriesExhausted. #1681 · #1729 · #1738 · #1891 · Storage traits - Runtime and transport implementations. Align your future and trait bounds with the target. The browser runtime can use local futures, and spawned tasks must honor the runtime's cancellation contract. Move connection work to the public builder, connection facade and interceptor APIs if your integration reached into the built-in stanza handlers or client fields. For code using
PersistenceManager, replaceget_device_arc()withget_device_snapshot()for reads and apply changes throughprocess_command(). #1734 · #1608 · #1685 - Low-level Signal consumers and bindings. Rebuild against the current
wacore-libsignalexports. The runtime rewrite preserves persisted records, while Rust types and adapter boundaries have changed. Recompile and run your binding's historical-record and native/WASM checks against the exact SDK revision you ship. #1842 · Signal exports
The standalone consumer fixtures cover additional call sites, including plugins, media, retry policies, MEX, and browser adapters. Build with the same Cargo features and target you ship. Exercise reconnect, receive after restart and shutdown on the upgraded copy.
Support the project
If whatsapp-rust helps with something you're building and you'd like to chip in, you can do that through GitHub Sponsors.
Pix no Brasil
Se preferir apoiar via Pix, copie a chave aleatória abaixo e cole no campo de chave Pix do seu banco. Você escolhe o valor.
f7851ce7-2c81-4848-b343-63e7b0a58c7a
Thank you
Carmine, thank you for making time to send those patches upstream while building ZapFast. And @Salientekill, thank you for digging through device discovery and identity verification to get those group sends working again. Salientekill's device discovery fix · Group fan-out fix
Thanks to everyone who built on this release while it was still on main, came back with a repro, or helped me figure out why a perfectly normal message on one phone looked completely different on another.
Contributors
@acoBOYZ, @alitura1, @Artjosh, @assisjp, @bryantebeek, @caumeira, @chumarrento, @crmne, @eternalwaitt, @fdciabdul, @FelipeMayerDev, @franklinbaldo, @gergesh, @Guflly, @i-am-v-alexander-v, @jlucaso1, @joaomdsferro, @kritzerenkrieg, @LLawli, @marsian83, @nizarfadlan, @pauloswear, @pedrobartolini, @purpshell, @Salientekill, @SecondNewtonLaw, @senamakel, @skhahehe, @thecreepervibe, @wprimadi, @Yoryoboy, @yousefamar, @zahidcoder, @zyl71.
Automated updates and checks came from autofix-ci[bot], codspeed[bot] and dependabot[bot].
First contributions on GitHub
@Artjosh also co-authored call lifecycle fixes. #1617 · #1621