Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
whatsmeow_signal
What it is
The Signal protocol for WhatsApp linked devices: Libsignal implements the
whatsmeow port's signal::{CurveSignatures, SignalProtocol} traits
(crates/whatsmeow/src/signal.rs), so it is a whatsmeow::Signal;
libsignal() returns it as the Arc<dyn whatsmeow::Signal> a Client
takes. LibsignalProtocol and LibsignalCurveSignatures are older aliases.
AGPL-3.0-only.
How it works
- XEdDSA and Curve25519 keys:
libsignal-core, unmodified, git tagv0.105.2(the rootCargo.tomlpins it). - X3DH, Double Ratchet and sender keys: libsignal's
rust/protocolmodules vendored from tagv0.74.1intosrc/protocol/and patched (NOTICEand each file header list the changes). Official libsignal can't be used as a dependency for these: since v0.75 it rejects bundles and pre-key messages without Kyber (WhatsApp has none); every version writes version-3 messages with the byte0x34, which whatsmeow's MAC check rejects ("no valid sessions" — it recomputes the MAC over0x33); and its sender key wire format (distribution UUID + chain ID) is not WhatsApp's (32-bit key ID). - Records cross the store as libsignal's
RecordStructureandSenderKeyRecordStructureprotobufs (proto/storage.proto, field numbers unchanged). whatsmeow's Go stores keep JSON records, so a Go whatsmeow database can't be imported as is.
Start here
src/lib.rs: the trait implementations and error mapping.src/interop_test.rs+testdata/generator/README.md: the Go interop rig.tests/client_end_to_end.rs: the real whatsmeowClientonLibsignalagainstwhatsapp_fake_server(a dev-dependency cycle cargo allows; it must stay an integration test so both sides share one crate instance).
Checks
cargo test -p whatsmeow_signal(replaystestdata/interop_transcript.json)- After touching
src/protocol/: also run the live Go test, seetestdata/generator/README.md.
Gotchas
- Don't upgrade the vendored modules to a newer libsignal tag wholesale: newer
code assumes Kyber and SPQR. Port fixes by hand and record them in
NOTICE. - Never log or put in errors a
SignalAddress: its name is a phone number or LID. LibsignalProtocol::seeded/LibsignalCurveSignatures::seededexist only undercfg(test); production randomness isStdRng::from_os_rngper call.- The transcript replay pins Rust's exact output for its seeds; a
randupgrade can changeStdRngand require re-recording. - Do not take code from whatsapp-rust, wa-agent, libsignal-node or go.mau.fi/libsignal (GPL); the Go oracle only calls it.
Related
crates/whatsmeow/AGENTS.md(the trait boundary)