Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: XMTP #1441

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

feat: XMTP #1441

wants to merge 11 commits into from

Conversation

humanagent
Copy link

@humanagent humanagent commented Dec 24, 2024

End-to-end encrypted messaging

AI is transforming consumer tech, with messaging becoming the main channel for interacting with agent services. This shift will scale message traffic astronomically, analogous to the web’s rise in the 2000s. Just as Cloudflare and https secured web traffic, messaging will need robust scalable end-to-end encrypted messages to protect sensitive information.

Risks

Risks of not using end-to-end encryption for agent interactions exposes the users to what is called as Man in the Middle Attacks.

Man in the Middle Attacks: Intercept requests in between to alter or manipulate data sent or received by the AI service

  • Phishing: Messages can be intercepted and manipulated.
  • Privacy: Sensitive information read by unwanted parties
  • Tampering: Content can be altered without detection.

:::tip
More concrete sensitive data could include credit card details, private keys and passwords which is not yet widely spread but as agents become smarter more use cases will include this type of sharing.
:::

XMTP

Eliza agents come with a ready to use client that uses XMTP providing end-to-end encrypted messaging for every agent intereaction, crucial for privacy, security, and compliance provided by the XMTP network.

Features:

  • E2EE: End to end encrypted MLS encryption
  • Multi-agent: Support multi-agent through group chats
  • Interoperable: Works across all platforms and frontends
  • Scalable: Decentralized, open-source
  • Anonymous: By default every identity is ephemeral and anonymous.

Installation

Install the xmtp package

bun install xmtp

Usage

This is how you can use the xmtp package to create an agent and handle messages.

  • WALLET_PRIVATE_KEY: This will encrypt all messages and make it available through its public address or ens domain.
import { XMTP } from "xmtp";

const xmtp = new XMTP(onMessage, {
    encryptionKey: WALLET_PRIVATE_KEY,
});
await xmtp.init();
const onMessage = async (message, user) => {
    console.log(`Decoded message: ${message.content.text} by ${user.address}`);
    // Your AI model response
    await xmtp.send({
        message: response,
        originalMessage: message,
    });
};

For more information visit XMTP website

@humanagent humanagent mentioned this pull request Dec 24, 2024
@shakkernerd shakkernerd added the Plugin_new Mark PRs that are a new plugin label Dec 24, 2024
@shakkernerd shakkernerd changed the base branch from main to develop December 24, 2024 21:12
@shakkernerd
Copy link
Member

We can continue the convo in here from #1285

odilitime
odilitime previously approved these changes Dec 25, 2024
@humanagent
Copy link
Author

Hey @shakkernerd ! I just removed the plugin so we keep the scope clean for XMTP about this PR, wdyt?

I am going over the rest of the plugins and the DevSchool video and id like to spend more time into that to make them better and is not necessarily related to XMTP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants