Skip to main content

📚 XMTP-JS

The xmtp-js library is written in Typescript for use with Javascript applications. It will be available as an npm package or can be downloaded directly from its GitHub repository.

info

The roadmap for future language support and functionality will be developed in collaboration with the community.

Functionality includes

FunctionDescription
Wallet-based authenticationConnecting to a user's wallet in order to get the wallet address, to sign keys used for message signing and encryption, and to authenticate incoming messages
Wallet connection managementManaging changes in wallet addresses or chain ids; managing connection issues
Key pair generationCreating keys used for message signing and encryption, and advertising them to the network
Key storageStoring keys securely
Key signingSigning keys with a connected wallet
Relationship initiationCreating a secure messaging relationship between two wallets
Conversation initiationCreating a container of messages between two wallets
Message sendingCapturing plaintext and submitting it to the network
Message history retrievalRetrieving the history of messages between two wallets
Message history filteringFiltering message history by date or by address
Message streamingReceiving new messages in real-time
Message content validationMiddleware for ensuring security of messages
Message format validationMiddleware for ensuring messages are properly formatted for the network

Signal's X3DH protocol is used for key agreement between the sender and the receiver. IdentityKeys serve as proxies for wallet identity. The public IdentityKeys are signed by the wallets to prove their authenticity. Public keys in their uncompressed format are signed using Keccak/SHA3 and ECDSA.

The shared secret produced by X3DH is processed through HKDF with SHA256 to derive the symmetric encryption key. The messages are encrypted with AES-256-GCM to provide confidentiality and message authentication.