-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
108a0a2
commit ba2af6e
Showing
8 changed files
with
32 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Cashu | ||
# Cashu Protocol | ||
The Cashu protocol defines 3 types of interactions that can happen between a client and a mint, where the client can exchange: | ||
|
||
1. bitcoin for ecash tokens (**mint**) | ||
2. ecash tokens for bitcoin (**melt**) | ||
3. ecash tokens for ecash tokens (**split**) | ||
3. ecash tokens for ecash tokens (**swap**) | ||
|
||
The core goal of the `cashuclient` library is to handle all 3 of those interactions as well as the creation, serialization, and storage of the ecash tokens. | ||
The core goal of the `cashu-client` library is to handle all 3 of those interactions as well as the creation, serialization, and storage of the ecash tokens. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
# Install and Build Instructions | ||
The library is not available on Maven Central; to use, you must build and deploy locally. | ||
|
||
To build the library locally and deploy to your local Maven repository, clone the git repository and run the following command: | ||
```shell | ||
./gradlew publishToMavenLocal | ||
``` | ||
|
||
The library will be available in your local Maven repository (typically at `~/.m2/repository/` for macOS and Linux systems) under the group ID `me.tb` and the artifact ID `cashuclient`. You can import it in your project as you would any other Maven dependency, provided you have your local Maven repository (`mavenLocal()`) configured as a dependency source: | ||
The library will be available in your local Maven repository (typically at `~/.m2/repository/` for macOS and Linux systems) under the group ID `me.tb` and the artifact ID `cashu-client`. You can import it in your project as you would any other Maven dependency, provided you have your local Maven repository (`mavenLocal()`) configured as a dependency source: | ||
```kotlin | ||
// root-level build.gradle.kts | ||
allprojects { | ||
// root-level settings.gradle.kts | ||
dependencyResolutionManagement { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
} | ||
``` | ||
|
||
```kotlin | ||
// app-level build.gradle.kts | ||
implementation("me.tb.cashuclient:0.0.1-SNAPSHOT") | ||
implementation("me.tb.cashu-client:0.0.1-SNAPSHOT") | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Swap | ||
The swap operation consists of sending to the mint a list of valid proofs and asking for signatures on a list of blinded messages, presumably to trade certain denominations for others. For example if you own tokens `[32, 16, 4, 4, 1]` and you want to make a payment for 43 sat, you might request a swap on token `[16]` and ask for signatures on new tokens `[8, 4, 2, 2]`, giving you a new token pool of `[32, 8, 4, 4, 4, 2, 2, 1]`. You can then use `[32, 8, 2, 1]` to make your 43 sat payment. | ||
|
||
The swap operation is always triggered by a requirement for new denominations, but is unlikely to be called _directly_ by the user. Rather, the swap is triggered by the wallet itself when it needs to either build a token or request a [melt](./melt.md) for which it doesn't have the correct denominations. In its simplest form, the wallet would call a swap because it would need one specific denomination (say you have [32, 16] and you want to make a 36 sat payment, you just need a swap for [4]). | ||
|
||
The workflow would be the following: | ||
|
||
1. You need the make a payment for `x` satoshis, and need to know if you have the right denominations to do so. Call `isswapRequired()`. | ||
2. If you have enough total balance but don't have the correct denominations to compose into your desired total, you need to swap. | ||
3. You call swap with the new denominations you need, and enough tokens to pay for them. |
This file contains 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