MCPcopy Create free account
hub / github.com/ElementsProject/lightning / bitcoin_witness_p2wpkh

Function bitcoin_witness_p2wpkh

bitcoin/script.c:253–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253u8 **bitcoin_witness_p2wpkh(const tal_t *ctx,
254 const struct bitcoin_signature *sig,
255 const struct pubkey *key)
256{
257 u8 **witness;
258
259 /* BIP141: The witness must consist of exactly 2 items (≤ 520
260 * bytes each). The first one a signature, and the second one
261 * a public key. */
262 witness = tal_arr(ctx, u8 *, 2);
263 witness[0] = stack_sig(witness, sig);
264 witness[1] = stack_key(witness, key);
265 return witness;
266}
267
268/* Create an output script for a 32-byte witness. */
269u8 *scriptpubkey_p2wsh(const tal_t *ctx, const u8 *witnessscript)

Callers 1

mainFunction · 0.85

Calls 2

stack_sigFunction · 0.85
stack_keyFunction · 0.85

Tested by

no test coverage detected