Skip to content

Commit 0499e76

Browse files
committed
Store Cashu proofs in one blob
Persist the complete Cashu proof set with one versioned KV write so VSS-backed wallets avoid a round trip per proof. This should make startup much faster for VSS based cashu wallets.
1 parent 4e9d230 commit 0499e76

4 files changed

Lines changed: 316 additions & 87 deletions

File tree

orange-sdk/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name = "orange_sdk"
1616
default = ["spark"]
1717
uniffi = ["dep:uniffi", "spark", "cashu", "rand", "pin-project-lite"]
1818
spark = ["breez-sdk-spark", "uuid", "serde_json"]
19-
cashu = ["cdk", "cdk/npubcash", "serde_json"]
19+
cashu = ["cdk", "cdk/npubcash", "serde", "serde_json"]
2020
_test-utils = ["corepc-node", 'electrsd', "cashu", "uuid/v7", "rand"]
2121
_cashu-tests = ["_test-utils", "cdk-ldk-node", "cdk/mint", "cdk-sqlite", "cdk-axum", "axum"]
2222

@@ -32,6 +32,7 @@ breez-sdk-spark = { git = "https://github.com/breez/spark-sdk.git", rev = "0d8db
3232
tokio = { version = "1.0", default-features = false, features = ["rt-multi-thread", "sync", "macros"] }
3333
uuid = { version = "1.0", default-features = false, optional = true }
3434
cdk = { version = "0.16.0", default-features = false, features = ["wallet"], optional = true }
35+
serde = { version = "1.0", features = ["derive"], optional = true }
3536
serde_json = { version = "1.0", optional = true }
3637
async-trait = "0.1"
3738
log = "0.4.28"

orange-sdk/src/ffi/orange/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ impl From<OrangeVssAuth> for VssAuth {
125125
/// failures are unrecoverable, i.e., if they remain unresolved after internal
126126
/// retries are exhausted.
127127
///
128+
/// A VSS store must only be used by one active wallet instance at a time. Cashu
129+
/// proof mutations are serialized within one process, but separate instances can
130+
/// overwrite each other's proof snapshots.
131+
///
128132
/// [Versioned Storage Service (VSS)]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
129133
#[derive(Debug, Clone, uniffi::Object)]
130134
pub struct VssConfig {

orange-sdk/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ pub enum VssAuth {
218218
/// failures are unrecoverable, i.e., if they remain unresolved after internal
219219
/// retries are exhausted.
220220
///
221+
/// A VSS store must only be used by one active wallet instance at a time. Cashu
222+
/// proof mutations are serialized within one process, but separate instances can
223+
/// overwrite each other's proof snapshots.
224+
///
221225
/// [Versioned Storage Service (VSS)]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
222226
#[derive(Debug, Clone)]
223227
pub struct VssConfig {

0 commit comments

Comments
 (0)