mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
bitcoin/script: support for creating p2sh-p2wpkh.
We want this because P2SH is something we can tell bitcoind to pay to; we can't (yet?) do that with "raw" P2WPKH. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <ccan/tal/tal.h>
|
||||
|
||||
struct bitcoin_address;
|
||||
struct bitcoin_tx_input;
|
||||
struct pubkey;
|
||||
struct sha256;
|
||||
struct rel_locktime;
|
||||
@@ -36,6 +37,15 @@ u8 *bitcoin_redeem_secret_or_delay(const tal_t *ctx,
|
||||
/* Create an output script using p2sh for this redeem script. */
|
||||
u8 *scriptpubkey_p2sh(const tal_t *ctx, const u8 *redeemscript);
|
||||
|
||||
/* Create the redeemscript for a P2SH + P2WPKH. */
|
||||
u8 *bitcoin_redeem_p2wpkh(const tal_t *ctx, const struct pubkey *key);
|
||||
|
||||
/* Create a witness which spends the 2of2. */
|
||||
void bitcoin_witness_p2sh_p2wpkh(const tal_t *ctx,
|
||||
struct bitcoin_tx_input *input,
|
||||
const struct bitcoin_signature *sig,
|
||||
const struct pubkey *key);
|
||||
|
||||
/* Create an input script to accept pay to pubkey */
|
||||
u8 *scriptsig_pay_to_pubkeyhash(const tal_t *ctx,
|
||||
const struct pubkey *key,
|
||||
|
||||
Reference in New Issue
Block a user