Skip to content

Releases: cashubtc/nutshell

0.15.1

17 Mar 12:31
30cdb81
Compare
Choose a tag to compare

This update introduces Blink as a Lightning backend for the mint and includes various other housekeeping items with smaller bug fixes.

This release includes a database migration for the mint. Make sure to back up your mint database before upgrading.

Mint

  • Add Blink as a Lightning funding source
  • Fix: Quote expiry with absolute Unix time
  • Fix: Catch CashuErrors and print them nicely
  • Fix: Do not check MeltQuote status before payment attempt
  • Fix: Mint seed encryption cashu/mint/encrypt.py

Wallet

  • Token invalidation: add setting for batch size

Protocol

New Contributors

0.15.0

15 Feb 17:38
ecad957
Compare
Choose a tag to compare

Nutshell upgrades to Cashu v1

The Cashu protocol has recently been updated to its first stable version. This release of Nutshell now supports the v1 protocol. The Cashu v1 protocol paves the way for Ecash with multiple denominations (sat, msat, usd, ...) and payment methods (Lightning, On-chain, ...). This update has been a long time in the making, with significant changes in the overall software architecture and several database migrations.

Mint runners: Always backup your mint database before upgrading.

With this release, Nutshell is also preparing for exciting upgrades in the future. These upgrades will enable you to run a Cashu mint with replication in a distributed cluster for highly available services and significantly increased throughput. Furthermore, a single deployment of a mint will be able to serve many "virtual mints" for different users.

Mint

  • New v1 API implementation with backwards compatibility. Old v0 wallets will keep working with the mint.
  • Mint can now rotate keysets by using BIP32 key derivation.
  • Each keyset can now have a separate seed from which it is generated.
  • Mint stores the seed for each keyset in the database. The seed can optionally be encrypted using a separate CLI tool cashu/mint/decrypt.py.
  • Fix P2PK multisig checks.
  • Supports database backups before future migrations via env var DB_BACKUP_PATH
  • New safety settings for limiting the maximum balance of the mint (MINT_MAX_BALANCE) and the maximum amount for mint (MINT_MAX_PEG_IN) and melt (MINT_MAX_PEG_OUT) requests.

Wallet

  • New v1 API implementation with backwards compatibility. The wallet will still work with old v0 mints.
  • Support for multiple denomination in the same wallet.
  • Many smaller issues fixed.

0.14.1

19 Dec 09:37
375b278
Compare
Choose a tag to compare

Updates in a Nutshell

  • Stateless Mint: Nutshell mint can now be run "stateless" meaning that all state is in the database. This is a step towards being able to run multiple mints workers in parallel for heavy load scenarios.
  • Max balance for mints: a new MINT_MAX_BALANCE environment flag makes sure that the mint can only hold a maximum amount.
  • CLI: Create an invoice without blocking with cashu invoice <amount> -n

What's Changed

Full Changelog: 0.14.0...0.14.1

0.14.0

14 Nov 19:39
286f850
Compare
Choose a tag to compare

Nutshell 0.14.0 brings many new features and improvements. These include a completely redesigned approach to use ecash spending conditions (programmable ecash) and the ability to transact offline (using offline signature validation). Protocol changes are according to the new specifications NUT-10, NUT-11, and NUT-12.

Protocol updates

Well-known spending conditions

Nutshell now supports NUT-10 spending conditions. This is a standardized way to create complex contracts between two Cashu users, if the mint supports a certain type of contract. One example is the P2PK implementation (see below).

Pay to Pubkey (P2PK)

P2PK allows you to lock a token to a specific pubkey. That way, only the intended receiver can redeem a token and nobody else. The recipient receives the token by providing a valid signature when redeeming it with the mint. The contract is enforced by the mint. To create a pubkey lock as a receiver, enter cashu lock. To send to this lock, the sender enters cashu send <amount> --lock <p2pk_lock_of_receiver>. This token can now be redeemed by the receiver. Read the specifications in NUT-11

DLEQ proofs

Discrete-log equality (DLEQ) proofs are now generated by the mint and handed over to wallets. Wallets can use these to verify the signature of the mint given their public key. Wallets can also send DLEQ proofs to other receiving wallets via cashu send --dleq <amount>. Receiving wallets will validate the DLEQ proof before redeeming the token via the mint. Read more information in the DLEQ PR and the specification in NUT-12.

Other Improvements

  • Wallet secret derivation fixed. Old tokens will not be restored with the new secret derivation. Use cashu selfpay to send yourself entire balance once.
  • cashu info now shows all mints
  • Wallet stores mint keysets for offline verification.
  • Mint DB with Postgres support
  • Include nostr submodule in project repo
  • Improve Docker pipeline for wallet and mint

All changes

Full Changelog: 0.13.0...0.14.0

DLEQ + P2PK - RC2

18 Oct 13:25
cfab668
Compare
Choose a tag to compare
DLEQ + P2PK - RC2 Pre-release
Pre-release

This is a release candidate for Cashu Nutshell 0.14.0.

What's Changed

Full Changelog: 0.14.0-rc1...0.14.0-rc2

0.13.0 – Ecash backups

26 Jul 10:52
4c1ff8b
Compare
Choose a tag to compare

This update marks a significant milestone in the journey of Cashu. Cashu aims to be an open ecash protocol for the web built on Bitcoin. In order to fulfill this promise, ecash must become easy and safe to use. One of the big challenges for ecash lies in its barer asset nature: if you lose your wallet, your funds are gone. Not anymore!

Background: Deterministic secret derivation

Typically, ecash is minted by generating random data and receiving a mint's blind signature on it. However, we can also derive the data deterministically from a root private key using a standardized BIP32-compatible derivation path. This allows us to derive the root private key as a BIP39 seed phrase (mnemonic) and to derive the same (pseudo-random) data over and over again. If a user loses access to their wallet, we can use this to re-generate all tokens (more precisely the blinded messages) and re-request the mint's signatures on them. Currently, this works over API calls to the mint but we plan to add the ability to restore all ecash from a public copy of the mint's database which will improve the user's privacy during the restore process. See this PR for more details.

Generating a seed phrase

The seed phrase (or mnemonic) is generated when you start the wallet for the first time. To see the seed phrase, enter the following command and write it down somewhere.

cashu info --mnemonic

Note: You can use multiple wallets with Nutshell by using the flag --wallet wallet_name. Every wallet will have its own mnemonic.

Restoring from a backup

If you lose your wallet and want to restore your balance, first make sure that you did not initialize a wallet already. Backup restore will only work if your wallet is completely fresh. To be sure of that, you can move your local wallet data directory to another place: cp -r ~/.cashu/wallet ~/.cashu/wallet_bak. If you used a custom wallet name, replace wallet with the name of your wallet.

When your data directory is empty (i.e. no wallet is initialized yet) you are ready to restore your ecash. Enter the following command to restore your backup.

cashu restore

You will be prompted to enter your mnemonic. After doing so, press enter and you should soon see your balance restored.

Important notes

No backups of old ecash

The seed phrase is generated upon the first startup of the updated wallet. From that moment on, all new ecash will be derived deterministically and can be restored from the seed phrase. This means that, without any further action, you will not be able to restore your old balance in case of a loss of your wallet! In order to be able to restore your old balance as well, you can make one self-payment with your entire balance for each mint. Simply enter cashu send <your_balance> and cashu receive <token>. You need to repeat this step for every mint you are using.

Avoid concurrent use in multiple wallets

Since the BIP32 derivation is stateful (i.e., a counter needs to be kept track of), the same mnemonic should not be used across multiple wallets at the same time. That means, if you restore your backup on a new device, you must not keep using the same mnemonic on your old device in the future. Using the same seed phrase over multiple wallets will lead to unpredictable behavior and should be avoided at all times!

New Contributors

  • @dni made their first contribution in #276

Full Changelog: 0.12.3...0.13.0

0.12.3 - P2PK

08 Jul 21:19
84793fa
Compare
Choose a tag to compare

Pay to pubkey – P2PK

Getting ready for a new type of Nostr zaps

This Nutshell release introduces a new token lock type called Pay-to-Pubkey or P2PK. This allows you to create ecash tokens that can only be spent by their designated recipient. A token locked with P2PK can be posted online without any third party being able to spend it.

Using P2PK

  • The receiver generates a public key lock via cashu lock.
  • The sender locks tokens to this public key via cashu send <amount> --lock <P2PK_lock>.
  • The receiver then receives the tokens via cashu receive <locked_token>.

Background

In an upcoming upgrade we will also add DLEQ proofs (PR) which allow anyone to check the validity of the mint's signature on a token without having to contact the mint.

These two features combined, P2PK and DLEQ proofs, allow for a very interesting use case: publicly verifiable payments to a pubkey in the form of ecash. As soon as the ecash is publicly posted, the transaction can be viewed as complete: The token can evidently be spent only by the intended recipient, and the validity of its signature can be verified client-side. In such a case, the recipient of this ecash can remain fully offline but be confident that they received a transaction.

It gets even more interesting: This ecash can be attached to anything.... including as a reply to a Nostr note! TBD

The P2PK feature also includes a new timelock feature that allows you to release a token from its lock after a certain time has passed. After the timelock is passed, the token can either be spent by everyone

Note: This feature is still experimental and some parts are incomplete. Things to add are multisignature spending paths and signature flags that can commit to the outputs of a transaction as well.

NUT updates

  • NUT-09: wallet can now show mint information with cashu info -m (#262)
  • NUT-07: Mint responds with token proof's pending state #277

Other changes

  • Wallet: Ability to configure a HTTP proxy (#269)
  • Fix corner case for fee reserve output calculation (#260 and #261)

Full Changelog: 0.12.1...0.12.3

0.12.1

23 Jun 18:30
339c3fb
Compare
Choose a tag to compare

This release includes a ton of performance and stability improvements!

NUTs:

Mint:

  • Use httpx library instead of requests for asynchronous operations
  • Transition from using DB locks to asyncio locks (for compatibility with RaspberryPi systems and LNbits)

Wallet:

  • Huge performance increase thanks to db optimizations
  • Multimint swaps in Nutshell! Enter cashu swap or use the wallet API.
  • Option to mint tokens of a specific denomination (for headless operation)
  • Option to send existing token denominations without a /split (for high-frequency payments)
  • Improve wallet REST API

What's Changed

New Contributors

Full Changelog: 0.12.0...0.12.1

Big nut energy

12 May 15:34
4088ab2
Compare
Choose a tag to compare

So many new things

Wallet REST API, TokenV3, coin selection

This new release of Nutshell will make you go nuts!

Wallet: New TokenV3 format

The new TokenV3 format makes it a lot easier to parse Cashu tokens. It is already supported by all known Cashu wallets.

Wallet: coin selection of all tokens from old epochs

If the a mint rotates its keys to a new epoch, the wallet will now automatically select all coins from past epochs and redeem them for new ones. That means that all tokens in the wallet should be from the latest epoch which is a requirement for making the Proof of Liabilities Scheme for Ecash work.

Wallet: New REST API

This is a huge improvement for the wallet's utility. This update provides a simple REST API for almost all of the functionality of the wallet that is otherwise accessible via the command line interface. This will make it a lot easier to write apps that can use the Nutshell wallet in the background, for example faucets or other third party software that wants to use Nutshell.

NUT updates

Misc

Fixes

New Contributors

Full Changelog: 0.10.0...0.12.0

NUT-08: Lower Lightning fees

19 Mar 14:38
258de87
Compare
Choose a tag to compare
  • Implements NUT-08: mint returns overpaid Lightning fees to wallet
  • New FakeWallet backend for testing
  • PostgreSQL support enabled (@trbouma)
  • CLI improvements (@sihamon)
  • Use Pydantic settings class

Mint runners: a few config flags have changed with 0.10.0:

MINT_SERVER_HOST -> MINT_LISTEN_HOST
MINT_SERVER_PORT -> MINT_LISTEN_PORT
LNBITS_ENDPOINT -> MINT_LNBITS_ENDPOINT
LNBITS_KEY -> MINT_LNBITS_KEY

New config flag:

MINT_LIGHTNING_BACKEND which can bei either LNbitsWallet or FakeWallet. The latter is only for testing.