Skip to content

Commit 90d1f4e

Browse files
committed
Make VssStore public
We currently have the `SqliteStore` public so others can use it outside of just their ldk-node wallet but did not do the same for the `VssStore`. This makes it public along with the 2 derivation path consts used when deriving the keys so people can more easily replicate the key schema as well
1 parent 3ed1d13 commit 90d1f4e

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/builder.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ use crate::wallet::persist::KVStoreWalletPersister;
7676
use crate::wallet::Wallet;
7777
use crate::{Node, NodeMetrics};
7878

79-
const VSS_HARDENED_CHILD_INDEX: u32 = 877;
80-
const VSS_LNURL_AUTH_HARDENED_CHILD_INDEX: u32 = 138;
79+
/// Child index used for deriving the VSS XPriv from the wallet seed.
80+
pub const VSS_HARDENED_CHILD_INDEX: u32 = 877;
81+
/// Child index used for deriving the LNURL-auth XPriv from the VSS XPriv.
82+
pub const VSS_LNURL_AUTH_HARDENED_CHILD_INDEX: u32 = 138;
83+
8184
const LSPS_HARDENED_CHILD_INDEX: u32 = 577;
8285
const PERSISTER_MAX_PENDING_UPDATES: u64 = 100;
8386

src/io/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub mod sqlite_store;
1111
#[cfg(test)]
1212
pub(crate) mod test_utils;
1313
pub(crate) mod utils;
14-
pub(crate) mod vss_store;
14+
pub mod vss_store;
1515

1616
/// The event queue will be persisted under this key.
1717
pub(crate) const EVENT_QUEUE_PERSISTENCE_PRIMARY_NAMESPACE: &str = "";

src/io/vss_store.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// http://opensource.org/licenses/MIT>, at your option. You may not use this file except in
66
// accordance with one or both of these licenses.
77

8+
//! Objects related to [`VssStore`] live here.
9+
810
use std::boxed::Box;
911
use std::collections::HashMap;
1012
use std::future::Future;
@@ -36,7 +38,6 @@ use vss_client::util::retry::{
3638
MaxAttemptsRetryPolicy, MaxTotalDelayRetryPolicy, RetryPolicy,
3739
};
3840
use vss_client::util::storable_builder::{EntropySource, StorableBuilder};
39-
4041
use crate::io::utils::check_namespace_key_validity;
4142

4243
type CustomRetryPolicy = FilteredRetryPolicy<
@@ -84,7 +85,12 @@ pub struct VssStore {
8485
}
8586

8687
impl VssStore {
87-
pub(crate) fn new(
88+
/// Constructs a new [`VssStore`].
89+
///
90+
/// **Caution**: VSS support is in **alpha** and is considered experimental.
91+
/// Using VSS (or any remote persistence) may cause LDK to panic if persistence failures are
92+
/// unrecoverable, i.e., if they remain unresolved after internal retries are exhausted.
93+
pub fn new(
8894
base_url: String, store_id: String, vss_seed: [u8; 32],
8995
header_provider: Arc<dyn VssHeaderProvider>,
9096
) -> io::Result<Self> {

0 commit comments

Comments
 (0)