bitcoin/scrpt: add vanilla p2pkh support.

We are about to use it for our funding tx change output.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-02-07 12:14:21 +10:30
parent 75c6dd1981
commit 1bb66cde2a
2 changed files with 47 additions and 0 deletions

View File

@@ -33,6 +33,13 @@ 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 an output script using p2pkh */
u8 *scriptpubkey_p2pkh(const tal_t *ctx, const struct pubkey *pubkey);
/* Create an input script which spends p2pkh */
u8 *bitcoin_redeem_p2pkh(const tal_t *ctx, const struct pubkey *pubkey,
const secp256k1_ecdsa_signature *sig);
/* Create the redeemscript for a P2SH + P2WPKH. */
u8 *bitcoin_redeem_p2wpkh(const tal_t *ctx,
const struct pubkey *key);