From 91c7b1861d16b9423f97e5f964b6106d71d584d0 Mon Sep 17 00:00:00 2001 From: Feyynt Date: Thu, 30 Sep 2021 14:46:40 +0200 Subject: [PATCH] Update fix-commitment-tx.md --- doc/fix-commitment-tx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/fix-commitment-tx.md b/doc/fix-commitment-tx.md index 413690b..1b41a18 100644 --- a/doc/fix-commitment-tx.md +++ b/doc/fix-commitment-tx.md @@ -116,7 +116,7 @@ Your funds may still be recovered following these steps: 10. **Variant A:** we assume your key is key A (in this example: "02948634a3000bd6b92c757f296928bfc5f26d8fc5eb9bd2d037b0c5e815cf43dd"). So we click on the "Add Unknown" button in PSBT-Toolkit (middle column under Input Functions), insert key A in the field Data, Input Index 0 and “cc” in the field Key (which is a custom key for `chantools` so it knows what key to look for). 11. Now we add the public key and the signature of B. So click on “Add signature” in PSBT-Toolkit, insert Input Index 0, Public Key of B (in this example: "038a0fbe274e9fbeb9f091c37c008dfc372c51150c4af3b109a72b6d26e644784d") and signature of B (in this example: "3044022052aaf4d85600198e567cea40dacc248dc700ab9f0ef17235c71a534fb9202a37022045749ae4918ca89c0969a9cf7738f28286ef6c1386fb33105dab11e2b58ab3f501") -12. PSBT-Toolkit currently has a little bug, we just need to fix the script. It's marked as "redeem script" (0x04) in the PSBT but we actually want a "witness script" (0x05). So we just convert the obtained string from Base64 to Hex, look for the "04" in the string (2 bytes before the actual script starts, so you can just need to search for the witness script we obtained in line three of step 5) and change it to "05". Then convert everything back to Hex. +12. PSBT-Toolkit currently has a little bug, we just need to fix the script. It's marked as "redeem script" (0x04) in the PSBT but we actually want a "witness script" (0x05). So we just convert the obtained string from Base64 to Hex, look for the "04" in the string (2 bytes before the actual script starts, so you can just search for the witness script we obtained in line three of step 5) and change it to "05". Then convert everything back to Base64. There are a lot of free tools online for string conversion. Otherwise you can use the following simple commands. For Base64 to Hex: `echo "" | base64 -d | xxd -p -c999`.