@@ -32,12 +32,19 @@ cargo build --release
3232``` swift
3333import vss_rust_client_ffi
3434
35- // Initialize VSS client with LNURL-auth
35+ let mnemonic = " abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
36+ let passphrase: String ? = nil
37+ let storeId = try vssDeriveStoreId (
38+ prefix : " bitkit_v1_regtest" ,
39+ mnemonic : mnemonic,
40+ passphrase : passphrase
41+ )
42+
3643try await vssNewClientWithLnurlAuth (
3744 baseUrl : " https://vss.example.com" ,
38- storeId : " my-app-store " ,
39- mnemonic : " abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about " ,
40- passphrase : nil ,
45+ storeId : storeId ,
46+ mnemonic : mnemonic ,
47+ passphrase : passphrase ,
4148 lnurlAuthServerUrl : " https://auth.example.com/lnurl"
4249)
4350
@@ -73,12 +80,19 @@ vssShutdownClient()
7380``` python
7481from vss_rust_client_ffi import *
7582
76- # Initialize VSS client with LNURL-auth
83+ mnemonic = " abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
84+ passphrase = None
85+ store_id = vss_derive_store_id(
86+ prefix = " bitkit_v1_regtest" ,
87+ mnemonic = mnemonic,
88+ passphrase = passphrase
89+ )
90+
7791await vss_new_client_with_lnurl_auth(
7892 " https://vss.example.com" ,
79- " my-app-store " ,
80- " abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about " ,
81- None , # passphrase
93+ store_id ,
94+ mnemonic ,
95+ passphrase,
8296 " https://auth.example.com/lnurl"
8397)
8498
@@ -117,12 +131,19 @@ vss_shutdown_client()
117131``` kotlin
118132import uniffi.vss_rust_client_ffi.*
119133
120- // Initialize VSS client with LNURL-auth
134+ val mnemonic = " abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
135+ val passphrase: String? = null
136+ val storeId = vssDeriveStoreId(
137+ prefix = " bitkit_v1_regtest" ,
138+ mnemonic = mnemonic,
139+ passphrase = passphrase
140+ )
141+
121142vssNewClientWithLnurlAuth(
122143 baseUrl = " https://vss.example.com" ,
123- storeId = " my-app-store " ,
124- mnemonic = " abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about " ,
125- passphrase = null ,
144+ storeId = storeId ,
145+ mnemonic = mnemonic ,
146+ passphrase = passphrase ,
126147 lnurlAuthServerUrl = " https://auth.example.com/lnurl"
127148)
128149
@@ -171,6 +192,15 @@ Initialize the global VSS client connection with LNURL-auth authentication. Prov
171192#### ` vssShutdownClient() -> Void `
172193Shutdown the VSS client and clean up resources. Optional but recommended for clean application shutdown.
173194
195+ ### Utility Functions
196+
197+ #### ` vssDeriveStoreId(prefix: String, mnemonic: String, passphrase: String?) -> String `
198+ Derives a deterministic VSS store ID from a mnemonic and optional passphrase using BIP32 key derivation.
199+
200+ - ` prefix ` : A prefix to include in the store ID (e.g., "bitkit_v1_regtest")
201+ - ` mnemonic ` : BIP39 mnemonic phrase (12 or 24 words)
202+ - ` passphrase ` : Optional BIP39 passphrase
203+
174204### Data Operations
175205
176206#### ` vssStore(key: String, value: Data) -> VssItem `
@@ -294,4 +324,4 @@ This project is licensed under the MIT License - see the LICENSE file for detail
294324
295325- [ VSS Server] ( https://github.com/lightningdevkit/vss-server ) - The VSS server implementation
296326- [ vss-client] ( https://crates.io/crates/vss-client ) - The underlying Rust client library
297- - [ UniFFI] ( https://mozilla.github.io/uniffi-rs/ ) - The FFI binding generator
327+ - [ UniFFI] ( https://mozilla.github.io/uniffi-rs/ ) - The FFI binding generator
0 commit comments