-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Milestone
Description
This feature is required to make the language bindings interop with LDK.
The LDK workflow is the following:
- LDK gives you an output script in raw bytes which you must use to build a ready-to-be-broadcast transaction (the funding transaction)
- You must give this tx in its raw form back to LDK, which will then broadcast it (potentially using BDK as well, see Provide a way to broadcast raw transaction for LDK compatibility #157)
I have recreated what is required in Rust in this small cli tool. Of this workflow, I believe only a few lines would be "new" APIs for the bindings, namely:
// 1. transform the LDK output script from raw bytes into a Script type using either one of:
// let script: Script = Script::from_hex(&output_script_hex).unwrap();
let script: Script = Script::from(output_script_raw);
// 2. extract the tx from the psbt
let funding_tx: Transaction = psbt.extract_tx();
// 3. serialize the tx to give it back to LDK
let funding_tx_encoded = funding_tx.serialize();ConorOkus
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done