mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-18 06:14:21 +01:00
2.2 KiB
2.2 KiB
Exporting channels backup
A Static Channel Backup (SCB) file is automatically generated by the Breez SDK in the background. More specifically, the SCB file is updated whenever a new channel is opened.
The SCB file can be used as a last resort to recover funds in case the Greenlight node becomes inaccessible ("doomsday" scenario). In order to recover the funds using the SCB information, users can initialize a new core lightning node with its HSM secret using their seed. Then, trigger a channel recovery through the recoverchannel method provided by CLN.
In order to use the recoverchannel method, the user needs to provide the SCB file. It can be retrieved from the SDK's working directory as follows:
Rust
{{#include ../../snippets/rust/src/static_channel_backup.rs:static-channel-backup}}
Swift
{{#include ../../snippets/swift/BreezSDKExamples/Sources/StaticChannelBackup.swift:static-channel-backup}}
Kotlin
{{#include ../../snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/StaticChannelBackup.kt:static-channel-backup}}
React Native
{{#include ../../snippets/react-native/static_channel_backup.ts:static-channel-backup}}
Dart
{{#include ../../snippets/dart_snippets/lib/static_channel_backup.dart:static-channel-backup}}
Python
{{#include ../../snippets/python/src/static_channel_backup.py:static-channel-backup}}
Go
{{#include ../../snippets/go/static_channel_backup.go:static-channel-backup}}
C#
{{#include ../../snippets/csharp/StaticChannelBackup.cs:static-channel-backup}}