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

Function bitcoin_witness_p2wpkh

bitcoin/script.c:252–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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