Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Dec 11, 2023
1 parent 108a0a2 commit ba2af6e
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
1 change: 0 additions & 1 deletion docs/architecture.md

This file was deleted.

6 changes: 3 additions & 3 deletions docs/cashu.md
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.
9 changes: 6 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# cashu-client
A Kotlin Multiplatform client library to interact with the [Cashu protocol].
<br>
# About [cashu-client](https://github.com/thunderbiscuit/cashu-client)
A Kotlin Multiplatform client library to interact with the [Cashu protocol].

---

This website provides high-level documentation for understanding and leveraging the [cashu-client](https://github.com/thunderbiscuit/cashu-client) library. You can read our [API docs here](https://thunderbiscuit.github.io/cashu-client/).

The main goals of this library are:

Expand Down
13 changes: 8 additions & 5 deletions docs/install.md
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")
```
4 changes: 0 additions & 4 deletions docs/overview.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/split.md

This file was deleted.

10 changes: 10 additions & 0 deletions docs/swap.md
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.
11 changes: 5 additions & 6 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ plugins:

# page tree
nav:
- Readme: "index.md"
- Documentation:
- Overview: "overview.md"
- Getting Started:
- About: "index.md"
- Install: "install.md"
- Cashu: "cashu.md"
- Architecture: "architecture.md"
- Architecture:
- Cashu Protocol: "cashu.md"
- Mint: "mint.md"
- Split: "split.md"
- Swap: "swap.md"
- Melt: "melt.md"

0 comments on commit ba2af6e

Please sign in to comment.