You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current recovery process needed to be updated to derive the correct master priv key from the seed by specifying our
custom BIP32 path (m/52h/0h/2h/0) when we create the wallet.
We also export 2 descriptor methods: one to get the private swap-in wallet descriptor, which can be used as-is, and the other to get the
public swap-in wallet descriptor, which can be used to create a watch-only wallet to monitor swap-in funds and to recovery funds using our recovery procedure.
Both descriptor use the refund master key, and not the master key itself because we use hardened paths to derive the refund key, which means that it is not
possible to compute the refund master public key from the master public: importing the descriptor would fail.
:warning: to recover swap-in funds sent to older versions of Phoenix (up to and including version 2.1.2) pleaser refer to [this guide](https://github.com/ACINQ/lightning-kmp/blob/v1.5.15/RECOVERY.md)
3
+
:warning: to recover swap-in funds sent to older versions of Phoenix (up to and including version 2.1.2) please refer to [this guide](https://github.com/ACINQ/lightning-kmp/blob/v1.5.15/RECOVERY.md)
4
4
5
-
The following steps lets you recover on-chain funds managed by `lightning-kmp`.
5
+
The following steps let you recover on-chain funds managed by `lightning-kmp`.
6
6
7
7
## Closed channels
8
8
@@ -36,52 +36,75 @@ The swap transaction's output can be spent using either:
36
36
Funds can be recovered using the second option and [Bitcoin Core](https://github.com/bitcoin/bitcoin).
37
37
This process needs at least Bitcoin Core 26.0.
38
38
39
-
This process will become simpler once popular on-chain wallets (such as [electrum](https://electrum.org/)) add supports for output script descriptors.
39
+
This process will become simpler once popular on-chain wallets (such as [electrum](https://electrum.org/)) add support for output script descriptors.
40
40
41
-
### Get your wallet descriptor
41
+
### Create recovery wallet
42
42
43
-
lightning-kmp provides both a public descriptor and private descriptor for your swap-in wallet.
44
-
The public descriptor can be used to create a watch-only wallet for your swap-in funds.
45
-
The private descriptor can be used to recover your swap-in funds, after the refund delay has passed.
46
-
:warning: Do not share this private descriptor with anyone !
43
+
#### Compute your refund master private key
47
44
48
-
### Create recovery wallet
45
+
For security reasons, we don't directly export the refund master private key used for swap-ins, so you will need to manually insert it in the descriptor.
46
+
You can obtain your extended master private key in [electrum](https://electrum.org/).
49
47
50
-
Create a wallet to recover your funds using the following command:
48
+
1. Create a new wallet, and choose `Standard wallet`
49
+
2. Choose `I already have a seed`
50
+
3. Enter your 12-word seed, and in the `Options` menu select `BIP39 seed`
51
+
4. In the `Script type and Derivation path` dialog select `legacy(p2pkh)` and override the derivation path with `m/52h/0h/2h/0`
52
+
5. In the `Console` tab, enter `wallet.keystore.xprv`. This will give you your refund master private key
51
53
52
-
```sh
53
-
bitcoin-cli createwallet recovery
54
-
```
54
+
#### Create your refund wallet descriptor
55
55
56
-
### Import descriptor into the recovery wallet
56
+
Copy the descriptor from the `SWAP_IN WALLET` section in the `Wallet Info` menu on your Phoenix wallet. It should look like this:
57
57
58
-
`lightning-kmp` provides a public and private descriptor for your swap-in wallet, which both use the following template:
For example, your public descriptor will look like this:
67
+
You can check that the extended public key in this descriptor matches the extended public key of the wallet you created with Electrum to compute your refund master private key.
65
68
69
+
Replace the `refund master public key` with your refund master private key. For example:
We can import our private descriptor into our recovery wallet:
82
+
### Import your descriptor into the recovery wallet
83
+
84
+
We can import our private descriptor into our recovery wallet. Since your replaced you refund master public key with your refund master private key, the descriptor checksum is no longer valid, but bitcoin core will give you the correct checksum:
Once those funds have been recovered and the refund delay has expired (the `confirmations` field of the previous command exceeds `25920`), you can send them to your normal on-chain wallet.
152
-
Compute the total amount received (in our example, 1.5 BTC), choose the address to send to (for example, `bcrt1q9ez7rt33wynwpah582lnqlj3u0tpzsrkj2flas`) and create a transaction using all of the received funds:
177
+
For now, this process involves selecting the inputs that you want to spend and creating the spending transaction manually, as documented below, but future versions of Bitcoin Core will probably make this easier.
178
+
179
+
For example, if `listtransactions` lists a UTXO `5e9d2a387572fe0c8a4996c2f34373b3fbbdb19ff106b84fc91c2450eb27cbe7:0` of `0.002` Bitcoin, this is how you would send it to your on-chain address.
0 commit comments