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: Bitcoin Lightning Network plugin #1278

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

Conversation

AbdelStark
Copy link

Relates to:

Risks

Low. It's an optional client to use.

Background

What does this PR do?

What kind of change is this?

Features (non-breaking change which adds functionality)

Why are we doing this? Any context or related work?

Nostr is the simplest open protocol that is able to create a censorship-resistant global "social" network once and for all.

It's nature and strong focus on censorship-resistance makes it a perfect fit for the Eliza agent framework.

Configuration

Here are the env variables that need to be set in the .env file:

Variable Description Example
BITCOIN_LNBITS_NODE_URL The LNBits Node URL wss://relay.damus.io,wss://relay.primal.net
BITCOIN_LNBITS_ADMIN_KEY The LNBits Node admin key ...
BITCOIN_LNBITS_READ_KEY The LNBits Node read key ...

Sample configuration:

# Bitcoin Lightning Network
## lnbits information
BITCOIN_LNBITS_NODE_URL="https://demo.lnbits.com"
BITCOIN_LNBITS_ADMIN_KEY="..."
BITCOIN_LNBITS_READ_KEY="..."

Pluging must be set in the Character definition, example:

{
    "name": "goku",
    "clients": ["direct"],
    "modelProvider": "anthropic",
     "plugins": ["@ai16z/plugin-bitcoin-lightning-network"]   
}

Changes summary

  • Add env variables for Lightning Networl in .env.example.
  • Implement Bitcoin lightning network plugin in Eliza (in packages/plugin-bitcoin-lightning-network).
    • Implement PayInvoice action
    • Implement LNBitsProvider for interactions with LNBits Node to process payments.

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Where should a reviewer start?

Detailed testing steps

  • As anon
      - run pnpm run dev --characters="characters/ln.character.json"
      - interact with agent to ask for payment of an invoice: "Pay this invoice lnbc1270n1pnktxjgpp5s3df3ksvh9g27x9t7m4n4g0r7hvcyrs5d3qt8lf6dt6xhrd2hr5sdqqcqzzsxqyz5vqsp503sljhzqeu8zpcwl8retv6v849yl3z2vkj5v47ah62mef8zktxsq9qxpqysgqlxrj3rwk3tjamezv543dmadn3up374c2g4529pjcld2ww7s25rzhrt7e2627tdq4r4rjwxchmp24gp327cfnc62hxe99gn2eps77eeqqapgzf6"

Screenshots

Screenshot 2024-12-20 at 17 24 46

Screenshot 2024-12-20 at 17 30 51

Screenshot 2024-12-20 at 17 25 10

Screenshot 2024-12-20 at 17 25 25

Discord username

abdel.stark

@shakkernerd shakkernerd deleted the branch elizaOS:develop December 22, 2024 07:02
@odilitime odilitime reopened this Dec 22, 2024
@wtfsayo wtfsayo self-requested a review January 6, 2025 18:29
@wtfsayo wtfsayo added the testing label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants