How-To Guide: Running an Ecash Mint

This article is featured in Bitcoin Magazine’s “The Withdrawal Issue”. Click here to subscribe now.

A PDF pamphlet of this article is available for download.

Chaumian ecash, a privacy-preserving payment system, was conceptualized in the early ’80s and known to be the first cryptocurrency ever invented. Although this technology experienced a period of dormancy, the advent of Bitcoin has revived interest in this technology. As we stride into an era increasingly concerned with digital privacy, ecash is experiencing a renaissance, primarily due to our discovery of Bitcoin as the foundational money layer for the internet.

Cashu allows the use of ecash on Bitcoin, empowering ordinary users to operate a mint that is connected to the Lightning Network. This enables everyone to offer perfectly private, untraceable Bitcoin payment services to their peers, social circles, or larger communities.

Chaumian mints use a technique known as blind signatures, which obscure user activities from the custodian managing the service. Users, upon making a payment over the Lightning Network, receive ecash that is stored as data pieces on their devices, very similar to physical cash. These ecash tokens, denominated in satoshis, can be exchanged between users or be converted back into a payment on the Lightning Network with the help of the mint.

An important advantage of ecash is that transactions between users can occur through any communication medium, such as a chat client or a QR code, with the mint not involved in the actual token exchange. This ensures the mint is oblivious to transaction specifics, including who transacted with whom. Even during fund withdrawal from the mint, user identity remains anonymous.

The integration of Cashu promises a realm of near-perfect privacy in the world of Bitcoin custody. This tutorial explains how you can set up and run a Cashu mint today and become a blinded Uncle Jim yourself.

Cashu on LNbits

The easiest way to run a Cashu mint is through the LNbits Cashu extension. For that, you already need a Lightning node with LNbits installed. If you are using popular node distributions like Umbrel, look for the LNbits app and install it. Once LNbits is set up, it takes only a couple of clicks: Go to the extension overview and look for the Cashu extension and install and enable it. You should now see the extension available for all users of your LNbits instance.

As a user, click on the extension and create a new Cashu mint. Enter the details for your mint and select the backend wallet that will be used for funding the mint. That’s it! You can copy the mint URL and use it with any Cashu wallet, such as Nutstash.app or Cashu.me.

Beware, you are responsible for keeping your mint operational and the deposited funds in this wallet safe. You also need to manage your node well such that your users can easily make and receive payments on the Lightning Network. Additionally, you also have no way of knowing the activity of your users. This means you’re unable to censor anyone specifically from using your mint. Chaumian mints are so privacy-preserving that censorship is practically impossible.

Cashu Nutshell

The most advanced way of running a Cashu mint today is to use the reference implementation called Nutshell. For this, you first have to clone the GitHub repository and follow the instructions of setting up your Python environment in the Readme.

Once your environment is ready, you have to set up your mint configuration which includes connecting it to a Lightning backend. Currently, you can use any LNbits instance as a Lightning backend (which in turn allows you to use all popular Lightning node implementations). In the near future, you will also be able to use your Lightning node directly without an LNbits middleware. However, for now, this is the recommended way since LNbits allows you to separate access to your node’s funds to dedicated wallets and thus serves as an extra layer of security in case something goes wrong.

To set up your mint’s preferences, copy the example configuration file .env.example to .env and edit the following entries in the file:

# Network settings

MINT_LISTEN_HOST=127.0.0.1 # Use 0.0.0.0 for public access

MINT_LISTEN_PORT=3338

# Lightning funding source

MINT_LIGHTNING_BACKEND=LNbitsWallet

MINT_LNBITS_ENDPOINT=https://legend.lnbits.com

MINT_LNBITS_KEY=YourLNbitsAPIKey

Note that if you just want to experiment (or develop) and not connect your mint to the Lightning Network, you can use the backend type “MINT_LIGHTNING_BACKEND=FakeWallet” which will handle all invoices as automatically paid. It’s great for trying things out!

Lastly, we set some contact details so that our users can reach us in case something goes wrong, and we also set some safety limits such that only small invoices can be created on our mint.

MINT_INFO_NAME=”Bitcoin Magazine’s Cashu mint”

MINT_INFO_DESCRIPTION=”Hide your nuts with Bitcoin Magazine”

MINT_INFO_DESCRIPTION_LONG=”This mint is used for a special event hosted by Bitcoin Magazine. Please withdraw your funds at the end of the event.”

MINT_INFO_CONTACT=[[“email”,”contact@me.com”], [“twitter”,”@me”], [“nostr”, “npub…”]]

MINT_MAX_PEG_IN=10000 # 10k sats maximum per invoice

Remember that you can’t identify individual users. That means, if you want to close your mint again, you have to give every user the opportunity to withdraw by themselves. Add the setting “MINT_PEG_OUT_ONLY=TRUE” to your configuration file so that only peg-outs are allowed if you want to close down your mint.

This article is featured in Bitcoin Magazine’s “The Withdrawal Issue”. Click here to subscribe now.

A PDF pamphlet of this article is available for download.



Source link

Related Posts

Please enter CoinGecko Free Api Key to get this plugin works.