Skip to content

Commit 501fabc

Browse files
ConorOkusclaude
andcommitted
docs: trim examples to Rust LDK samples, add TS to Key Management, fix LDK Server tagline
- examples.md: remove the Kotlin/Swift sample apps and all LDK Node entries, leaving the three Rust LDK samples (Sample Node, Lightning Signer, Tor). - key_management.md: add the missing TypeScript tab to the "Spending On-Chain Funds" custom-signer wrapper, verified against the v0.2.0.0 SignerProviderInterface and OutputSpender. - HomeServerPromo.vue: widen the content box so the LDK Server tagline sits on one line on desktop (still wraps gracefully on narrow viewports). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c3554f9 commit 501fabc

3 files changed

Lines changed: 69 additions & 41 deletions

File tree

docs/.vitepress/theme/components/HomeServerPromo.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
<div class="ldk-server-inner">
44
<div class="ldk-server-content">
55
<h2>LDK Server</h2>
6-
<p>
7-
Deployable with a clean API, enterprise features, and built-in
8-
LSP support
9-
</p>
6+
<p>Deployable with a clean API, enterprise features, and built-in LSP support</p>
107
<a
118
class="ldk-server-cta"
129
href="https://github.com/lightningdevkit/ldk-server"
@@ -69,7 +66,9 @@
6966
}
7067
7168
.ldk-server-content {
72-
max-width: 30rem;
69+
/* Wide enough for the tagline to sit on one line on desktop; flex-shrink
70+
still lets it wrap on narrow/mobile viewports. */
71+
max-width: 52rem;
7372
}
7473
7574
.ldk-server-icon {

docs/examples.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,10 @@ Click the links below and learn from community-built example projects
77
This sample serves as a complete reference for constructing a lightning node with
88
LDK. This is a good starting point if you want a self-guided tour.
99

10-
### [Kotlin/Android Sample App](https://github.com/conorokus/umlando-wallet)
11-
12-
This sample uses the Kotlin bindings provided by [ldk-garbagecollected](https://github.com/lightningdevkit/ldk-garbagecollected) to create a self-custodial mobile lightning wallet on Android.
13-
14-
### [Swift/iOS Sample App](https://github.com/Roy0Anonymous/Vajra-Wallet)
15-
16-
This sample uses the Swift bindings provided by [ldk-swift](https://github.com/lightningdevkit/ldk-swift) to create a self-custodial mobile lightning wallet on iOS.
17-
1810
### [Rust node with sample Lightning Signer integration](https://gitlab.com/lightning-signer/lnrod/)
1911

2012
A Rust lightning node implementation based on LDK and the Lightning Signer projects. Aims to be production ready at some point.
2113

2214
### [Rust node with sample Tor integration](https://github.com/TonyGiorgio/ldk-sample-tor)
2315

2416
A Rust lightning node sample implementation based on LDK with an embedded Tor daemon.
25-
26-
### [LDK Node](https://github.com/lightningdevkit/ldk-node)
27-
28-
A ready-to-go Lightning node library built using LDK and [BDK](https://bitcoindevkit.org/).
29-
30-
### [LDK Node Rust Sample](https://github.com/optout21/ldk-node-sample)
31-
32-
A sample lightning node command-line app built on top of LDK Node (similar to ldk-sample).
33-
34-
### [LDK Node Swift Sample App](https://github.com/reez/Monday/tree/main/LDKNodeMonday)
35-
36-
This sample uses [ldk-node-swift](https://github.com/lightningdevkit/ldk-node/blob/main/Package.swift) bindings to quickly build a self custodial lightning mobile wallet on iOS. Watch the video tutorial [here](https://www.youtube.com/watch?v=rcU3LU6iZCs).
37-
38-
### [LDK Node Swift Sample app using Bitcoin Design Guide](https://github.com/bdgwallet/dailywallet)
39-
40-
This sample is a good starting point for building a sample iOS wallet with a strong focus on user experience.
41-
42-
### [LDK Node Flutter Sample App](https://github.com/LtbLightning/ldk-node-flutter-demo)
43-
44-
This sample is a starting point for an LDK Node Flutter app.
45-
46-
### [LDK Node React Native Sample App](https://github.com/LtbLightning/ldk-node-rn-demo)
47-
48-
This sample is a starting point for an LDK Node React Native app.
49-
50-
### [LDK Node Sample Desktop App](https://github.com/jbesraa/ldk-node-desktop)
51-
52-
This sample is a desktop node manager for LDK Node.

docs/key_management.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,69 @@ class LDKSignerProvider : SignerProvider.SignerProviderInterface {
342342

343343
```
344344

345+
```typescript [TypeScript]
346+
import * as ldk from "lightningdevkit";
347+
348+
// Wrap a KeysManager so destination/shutdown scripts come from your BDK wallet.
349+
class BDKKeysManager {
350+
constructor(
351+
private readonly inner: ldk.KeysManager,
352+
private readonly wallet: BdkWallet
353+
) {}
354+
355+
// We drop all occurrences of `SpendableOutputDescriptor_StaticOutput` (since
356+
// they will be spendable by the BDK wallet) and forward any other descriptors
357+
// to the inner KeysManager. `spend_spendable_outputs` lives on the
358+
// OutputSpender trait.
359+
//
360+
// Note you should set `locktime` to the current block height to mitigate fee
361+
// sniping. See https://bitcoinops.org/en/topics/fee-sniping/ for more info.
362+
spendSpendableOutputs(
363+
descriptors: ldk.SpendableOutputDescriptor[],
364+
outputs: ldk.TxOut[],
365+
changeDestinationScript: Uint8Array,
366+
feerateSatPer1000Weight: number
367+
): ldk.Result_TransactionNoneZ {
368+
const onlyNonStatic = descriptors.filter(
369+
(d) => !(d instanceof ldk.SpendableOutputDescriptor_StaticOutput)
370+
);
371+
return this.inner
372+
.as_OutputSpender()
373+
.spend_spendable_outputs(
374+
onlyNonStatic,
375+
outputs,
376+
changeDestinationScript,
377+
feerateSatPer1000Weight,
378+
ldk.Option_u32Z.constructor_none() // locktime
379+
);
380+
}
381+
382+
// Build a SignerProvider that returns the BDK wallet's scripts and redirects
383+
// every other method to the inner KeysManager.
384+
asSignerProvider(): ldk.SignerProvider {
385+
const inner = this.inner.as_SignerProvider();
386+
const wallet = this.wallet;
387+
return ldk.SignerProvider.new_impl({
388+
// We return the destination and shutdown scripts derived by the BDK wallet.
389+
get_destination_script(_channelKeysId: Uint8Array): ldk.Result_CVec_u8ZNoneZ {
390+
const script = wallet.getNewAddress().scriptPubkey(); // Uint8Array
391+
return ldk.Result_CVec_u8ZNoneZ.constructor_ok(script);
392+
},
393+
get_shutdown_scriptpubkey(): ldk.Result_ShutdownScriptNoneZ {
394+
// Derive a ShutdownScript from the wallet's (witness) address, e.g. via
395+
// ldk.ShutdownScript.constructor_new_witness_program(version, program).
396+
// ...
397+
},
398+
// ... and redirect the remaining methods to the `inner` KeysManager.
399+
generate_channel_keys_id(inbound: boolean, userChannelId: bigint): Uint8Array {
400+
return inner.generate_channel_keys_id(inbound, userChannelId);
401+
},
402+
derive_channel_signer(channelKeysId: Uint8Array): ldk.EcdsaChannelSigner {
403+
return inner.derive_channel_signer(channelKeysId);
404+
},
405+
} as ldk.SignerProviderInterface);
406+
}
407+
}
408+
```
409+
345410
:::

0 commit comments

Comments
 (0)