Skip to content

jooray/nutband

Repository files navigation

nutband

Experimental minimalistic python-only user interface for cashu, using cashu nutshell implementation.

Should be buildable to apk and ipa through buildozer, running on android, ios and desktop platforms. I have not managed to build anything else than desktop now though.

Video introduction

I made a short video introduction about this project:

Nutband - a post fiat apocalypse Cashu client working over Reticulum

Goal

The goal of this project is to experiment with cashu over Reticulum mesh network protocol using LXMF.

Status = short version

Only sending and receiving tokens is enabled, mint selection or invoices do not work yet.

Very hacky!!!

LXMF proxy on the mint side

This is how you run a proxy on the mint side. Proxy should be run by the mint operator and users should verify the identity of the mint operator. Possibly some mints could operate only through LXMF, but having correct address replaces all certificate authentication, so be sure!

python3 lxmf_proxy_server.py https://localhost:3338 localhost_mint

This runs the proxy that forwards all messages to localhost:3338. localhost_mint is the name of the identity (in case you run more proxies).

Mapping on the client side

The map is now static in source code:

            # TODO: Config this:
            mappings = {
                "https://8333.space:3338": "197b2a93cdcd63217f0c7c08950abcde"
            }

You should change the URL of the mint and the identity. URL does not have to work, it can be bogus.

Status and plans

Some things that I would like to improve:

  • the radios have very low bandwidth. I refresh keysets on the launch, but that might not be the best idea, it can add a minute until launch. The UI is responsive though
  • user interface is done in Kivy, so this should compile straight to APK and iOS app. That's why I based it on nutshell (a Python Cashu implementation). Reticulum stack is also pure python. The problem is that nutshell indirectly depends on sec256k1 and bitarray which are C libraries and they don't compile well using buildozer. It's a dependency of a dependency, so I can't easily replace it, even though there are pure python implementations available (not api compatible though). I don't know how to solve this and so far I settled on desktop. If anyone has skills with building for Android and iOS, pull requests welcome.
  • keyset sharing is very inefficient, I think an xpub based schema could work better. The mint could say "this xpub, derive keys according to standard denominations yourself". Not sure if it's interesting for mainstream cashu, maybe it could be a parameter during requesting keysets ("please give me your keysets, I'm OK with xpub, I can derive them myself").
  • I should pack the jsons better, in binary form and compress it.

Building

My build and dev environment is dockerized.

Useful pieces

The lxmf client and proxy are possibly useful beside this project. The client (lxmf_wrapper_client.py) has get and post methods that are somewhat compatible with httpx.AsyncClient API (somewhat = enough that nutband runs and nutshell library thinks it's talking to a http server).

The lxmf_proxy_server.py contains a standalone proxy that listens for LXMF requests, decodes them, sends them over through HTTP and delivers a reply over another LXMF message. Pairing is done using random IDs.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages