mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-21 11:04:19 +01:00
76
README.md
76
README.md
@@ -1,6 +1,6 @@
|
|||||||
# cashu
|
# cashu
|
||||||
|
|
||||||
**Cashu is a Chaumian Ecash wallet and mint with Bitcoin Lightning support.**
|
**Cashu is a Chaumian Ecash wallet and mint for Bitcoin Lightning.**
|
||||||
|
|
||||||
<a href="https://pypi.org/project/cashu/"><img alt="Release" src="https://img.shields.io/pypi/v/cashu?color=black"></a> <a href="https://pepy.tech/project/cashu"> <img alt="Downloads" src="https://pepy.tech/badge/cashu"></a> <a href="https://app.codecov.io/gh/callebtc/cashu"><img alt="Coverage" src="https://img.shields.io/codecov/c/gh/callebtc/cashu"></a>
|
<a href="https://pypi.org/project/cashu/"><img alt="Release" src="https://img.shields.io/pypi/v/cashu?color=black"></a> <a href="https://pepy.tech/project/cashu"> <img alt="Downloads" src="https://pepy.tech/badge/cashu"></a> <a href="https://app.codecov.io/gh/callebtc/cashu"><img alt="Coverage" src="https://img.shields.io/codecov/c/gh/callebtc/cashu"></a>
|
||||||
|
|
||||||
@@ -18,6 +18,16 @@ Cashu is an Ecash implementation based on David Wagner's variant of Chaumian bli
|
|||||||
<a href="#running-a-mint">Run a mint</a>
|
<a href="#running-a-mint">Run a mint</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
### Feature overview
|
||||||
|
|
||||||
|
- Full Bitcoin Lightning support
|
||||||
|
- Standalone CLI wallet and mint server
|
||||||
|
- Mint library includable into other Python projects
|
||||||
|
- PostgreSQL and SQLite database support
|
||||||
|
- Builtin Tor for hiding IPs for wallet and mint interactions
|
||||||
|
- Multimint wallet for tokens from different mints
|
||||||
|
- Send tokens to nostr pubkeys
|
||||||
|
|
||||||
## Cashu client protocol
|
## Cashu client protocol
|
||||||
There are ongoing efforts to implement alternative Cashu clients that use the same protocol such as a [Cashu Javascript wallet](https://github.com/motorina0/cashu-js-wallet). If you are interested in helping with Cashu development, please see the [docs](docs/) for the notation and conventions used.
|
There are ongoing efforts to implement alternative Cashu clients that use the same protocol such as a [Cashu Javascript wallet](https://github.com/motorina0/cashu-js-wallet). If you are interested in helping with Cashu development, please see the [docs](docs/) for the notation and conventions used.
|
||||||
|
|
||||||
@@ -113,15 +123,11 @@ Wallet: wallet
|
|||||||
Mint URL: https://8333.space:3338
|
Mint URL: https://8333.space:3338
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Get Cashu info
|
|
||||||
```bash
|
|
||||||
cashu balance
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Check balance
|
#### Check balance
|
||||||
```bash
|
```bash
|
||||||
cashu balance
|
cashu balance
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Generate a Lightning invoice
|
#### Generate a Lightning invoice
|
||||||
|
|
||||||
This command will return a Lightning invoice that you need to pay to mint new ecash tokens.
|
This command will return a Lightning invoice that you need to pay to mint new ecash tokens.
|
||||||
@@ -129,28 +135,13 @@ This command will return a Lightning invoice that you need to pay to mint new ec
|
|||||||
```bash
|
```bash
|
||||||
cashu invoice 420
|
cashu invoice 420
|
||||||
```
|
```
|
||||||
Returns:
|
|
||||||
```bash
|
|
||||||
Pay this invoice to mint 420 sat:
|
|
||||||
Invoice: lnbc4200n1p3nfk7zsp522g8wlsx9cvmhtyuyuae48nvreew9x9f8kkqhd2v2umrdtwl2ysspp5w2w6jvcnz4ftcwsxtad5kv3yev62pcp5cvq42dqqrmwtr2k6mk8qdq4vdshx6r4ypjx2ur0wd5hgxqyjw5qcqpjrzjqfe5jlwxmwt4sa4s8mqjqp8qtreqant6mqwwkts46dtawvncjwvhczurxgqqvvgqqqqqqqqnqqqqqzgqyg9qyysgqzaus4lsfs3zzk4ehdzrkxzv8ryu2yxppxyjrune3nks2dgrnua6nv7lsztmyjaf96xp569tf7rxdmfud5q45zmr4xue5hjple6xhcrcpfmveag
|
|
||||||
|
|
||||||
Execute this command if you abort the check:
|
The client will check every few seconds if the invoice has been paid. If you abort this step but still pay the invoice, you can use the command `cashu invoice <amount> --hash <hash>`.
|
||||||
cashu invoice 420 --hash 729da933131552bc3a065f5b4b3224cb34a0e034c3015534001edcb1aadadd8e
|
|
||||||
|
|
||||||
Checking invoice ...
|
|
||||||
```
|
|
||||||
|
|
||||||
The client will check every few seconds if the invoice has been paid. If you abort this step but still pay the invoice, you can use the command `cashu invoice <amount> --hash <hash>` as described above.
|
|
||||||
|
|
||||||
#### Pay a Lightning invoice
|
#### Pay a Lightning invoice
|
||||||
```bash
|
```bash
|
||||||
cashu pay lnbc120n1p3jfmdapp5r9jz...
|
cashu pay lnbc120n1p3jfmdapp5r9jz...
|
||||||
```
|
```
|
||||||
Returns:
|
|
||||||
```bash
|
|
||||||
Balance: 351 sat (Available: 351 sat in 7 tokens)
|
|
||||||
Balance: 339 sat (Available: 339 sat in 8 tokens)
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Send tokens
|
#### Send tokens
|
||||||
To send tokens to another user, enter
|
To send tokens to another user, enter
|
||||||
@@ -159,12 +150,12 @@ cashu send 69
|
|||||||
```
|
```
|
||||||
You should see the encoded token. Copy the token and send it to another user such as via email or a messenger. The token looks like this:
|
You should see the encoded token. Copy the token and send it to another user such as via email or a messenger. The token looks like this:
|
||||||
```bash
|
```bash
|
||||||
W3siYW1vdW50IjogMSwgIkMiOiB7IngiOiAzMzg0Mzg0NDYzNzAwMTY1NDA2MTQxMDY3Mzg1MDg5MjA2MTU2NjQxMjM4Nzg5MDE4NzAzODg0NjAwNDUzNTAwNzY3...
|
W3siYW1vdW50IjogMSwgIkMiOiB7IngiOi...
|
||||||
```
|
```
|
||||||
|
|
||||||
You can now see that your available balance has dropped by the amount that you reserved for sending if you enter `cashu balance`:
|
You can now see that your available balance has dropped by the amount that you reserved for sending if you enter `cashu balance`:
|
||||||
```bash
|
```bash
|
||||||
Balance: 420 sat (Available: 351 sat in 7 tokens)
|
Balance: 420 sat
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Receive tokens
|
#### Receive tokens
|
||||||
@@ -174,43 +165,10 @@ cashu receive W3siYW1vdW50IjogMSwgIkMiOi...
|
|||||||
```
|
```
|
||||||
You should see the balance increase:
|
You should see the balance increase:
|
||||||
```bash
|
```bash
|
||||||
Balance: 0 sat (Available: 0 sat in 0 tokens)
|
Balance: 0 sat
|
||||||
Balance: 69 sat (Available: 69 sat in 3 tokens)
|
Balance: 69 sat
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Burn tokens
|
|
||||||
The sending user needs to burn (invalidate) their tokens from above, otherwise they will try to double spend them (which won't work because the server keeps a list of all spent tokens):
|
|
||||||
```bash
|
|
||||||
cashu burn W3siYW1vdW50IjogMSwgIkMiOi...
|
|
||||||
```
|
|
||||||
Returns:
|
|
||||||
```bash
|
|
||||||
Balance: 420 sat (Available: 351 sat in 7 tokens)
|
|
||||||
Balance: 351 sat (Available: 351 sat in 7 tokens)
|
|
||||||
```
|
|
||||||
Use `cashu burn -a` to burn all used tokens or `cashu burn -f` to force a spent recheck on all tokens and burn them is they are used. This command is safe to use, it won't burn unspent tokens.
|
|
||||||
|
|
||||||
#### Check pending tokens
|
|
||||||
```bash
|
|
||||||
cashu pending
|
|
||||||
```
|
|
||||||
Returns
|
|
||||||
```bash
|
|
||||||
Amount: 64 sat Sent: 2022-09-28 06:53:03 ID: 33025ade-3efa-11ed-9096-16a10f0dbf61
|
|
||||||
|
|
||||||
W3siYW1vdW50Ijog...
|
|
||||||
|
|
||||||
Amount: 64 sat Sent: 2022-09-28 06:57:25 ID: cf588354-3efa-11ed-b5ec-16a10f0dbf61
|
|
||||||
|
|
||||||
W3siYW1vdW50Ijog...
|
|
||||||
|
|
||||||
Amount: 128 sat Sent: 2022-09-28 09:57:43 ID: fef371fa-3f13-11ed-b31a-16a10f0dbf61
|
|
||||||
|
|
||||||
W3siYW1vdW50Ij...
|
|
||||||
|
|
||||||
Balance: 1234 sat (Available: 1234 sat in 7 tokens)
|
|
||||||
```
|
|
||||||
You can either burn these tokens manually when the receiver has redeemed them, or you can receive them yourself if you want to cancel a pending payment.
|
|
||||||
|
|
||||||
# Running a mint
|
# Running a mint
|
||||||
This command runs the mint on your local computer. Skip this step if you want to use the [public test mint](#test-instance) instead.
|
This command runs the mint on your local computer. Skip this step if you want to use the [public test mint](#test-instance) instead.
|
||||||
|
|||||||
Reference in New Issue
Block a user