2021-12-23 20:57:33 +01:00
|
|
|
#ifndef LIGHTNING_COMMON_PSBT_KEYPATH_H
|
|
|
|
#define LIGHTNING_COMMON_PSBT_KEYPATH_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include <ccan/short_types/short_types.h>
|
2023-07-10 21:59:41 +02:00
|
|
|
#include <wally_psbt.h>
|
2021-12-23 20:57:33 +01:00
|
|
|
|
|
|
|
struct bitcoin_tx;
|
|
|
|
struct ext_key;
|
|
|
|
struct wally_map;
|
|
|
|
|
2023-07-10 21:59:41 +02:00
|
|
|
/* psbt_output_set_keypath - Set the keypath of a PSBT output.
|
2021-12-23 20:57:33 +01:00
|
|
|
*
|
|
|
|
* @index - child index of the wallet key
|
|
|
|
* @ext - extended public key of the immediate parent of the wallet key
|
2023-07-10 21:59:41 +02:00
|
|
|
* @is_taproot - PSBT output has taproot script
|
|
|
|
* @output - PSBT output to set
|
2021-12-23 20:57:33 +01:00
|
|
|
*/
|
2023-07-10 21:59:41 +02:00
|
|
|
void psbt_output_set_keypath(u32 index,
|
2021-12-23 20:57:33 +01:00
|
|
|
const struct ext_key *ext,
|
2023-07-10 21:59:41 +02:00
|
|
|
bool is_taproot,
|
|
|
|
struct wally_psbt_output *output);
|
2021-12-23 20:57:33 +01:00
|
|
|
|
|
|
|
/* psbt_add_keypath_to_last_output - augment the last output with the
|
|
|
|
* given wallet keypath
|
|
|
|
*
|
|
|
|
* @tx - transaction to modify
|
|
|
|
* @index - child index of the wallet key
|
|
|
|
* @ext - extended public key of the immediate parent of the wallet key
|
2023-07-10 21:59:41 +02:00
|
|
|
* @is_taproot - if the output is taproot
|
2021-12-23 20:57:33 +01:00
|
|
|
*/
|
|
|
|
void psbt_add_keypath_to_last_output(struct bitcoin_tx *tx,
|
|
|
|
u32 index,
|
2023-07-10 21:59:41 +02:00
|
|
|
const struct ext_key *ext,
|
|
|
|
bool is_taproot);
|
2021-12-23 20:57:33 +01:00
|
|
|
|
|
|
|
#endif /* LIGHTNING_COMMON_PSBT_KEYPATH_H */
|