Add Cashu ecash support#14
Open
kravens wants to merge 1 commit into
Open
Conversation
Introduce optional Cashu ecash integration so users can mint, send, and redeem bearer ecash tokens against an external mint, alongside the existing LNbits Lightning wallet. - internal/cashu: minimal mint client (NUT-00/03/04/05 style) with blinded-message crypto, token (de)serialization, and types - /cashu command with mint/send/receive(redeem/claim) subcommands - Inline query support to share claimable Cashu tokens in group chats (claim/cancel buttons) - Config block (cashu.enabled/mint_url/unit) with validation; disabled by default and a no-op unless explicitly enabled - Cashu-specific error types and English translations Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds optional Cashu ecash support to BitTipBot. Users can mint, send, and redeem bearer ecash tokens backed by an external Cashu mint, alongside the existing LNbits Lightning wallet.
New
internal/cashu/— a minimal mint client (client.go), blinded-message crypto (crypto.go), token serialization (token.go), and shared types (types.go)./cashucommand (internal/telegram/cashu.go) with subcommands:mint <amount> [memo]— pay the mint's Lightning invoice to create ecashsend <amount>— produce a Cashu token to hand outreceive/redeem/claim <token>— swap a token back into the walletinternal/telegram/cashu_inline.go) — share a claimable Cashu token in a group chat via inline query, with Claim / Cancel buttons.Wiring
cashuconfig block (enabled,mint_url,unit) with validation ininternal/config.go; example inconfig.yaml.example.CashuClientadded toTipBot, constructed only when enabled.handler.go, inline-query entry ininline_query.go.internal/errors/types.goand English strings intranslations/en.toml.Why
Lets the bot custody and transfer value as Chaumian ecash (better privacy, instant offline-style transfers) without replacing the existing Lightning/LNbits flow.
Notes for reviewers
cashu.enabled: false(the default), no client is constructed and every code path is a no-op — zero impact on existing deployments.sat.go build ./...passes.mint.minibits.cashis the example default.🤖 Generated with Claude Code