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

Function scriptpubkey_p2wpkh

bitcoin/script.c:282–291  ·  view source on GitHub ↗

Create an output script for a 20-byte witness. */

Source from the content-addressed store, hash-verified

280
281/* Create an output script for a 20-byte witness. */
282u8 *scriptpubkey_p2wpkh(const tal_t *ctx, const struct pubkey *key)
283{
284 struct ripemd160 h;
285 u8 *script = tal_arr(ctx, u8, 0);
286
287 add_op(&script, OP_0);
288 pubkey_to_hash160(key, &h);
289 script_push_bytes(&script, &h, sizeof(h));
290 return script;
291}
292
293u8 *scriptpubkey_p2wpkh_derkey(const tal_t *ctx, const u8 der[33])
294{

Callers 12

tx_to_usFunction · 0.85
replace_penalty_tx_to_usFunction · 0.85
scriptpubkey_to_remoteFunction · 0.85
json_newaddrFunction · 0.85
finish_psbtFunction · 0.85
commit_txFunction · 0.85
p2wpkh_for_keyidxFunction · 0.85
initial_commit_txFunction · 0.85
mainFunction · 0.85

Calls 3

add_opFunction · 0.85
pubkey_to_hash160Function · 0.70
script_push_bytesFunction · 0.70

Tested by

no test coverage detected