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

Function bip32_pubkey

common/key_derive.c:253–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251
252
253bool bip32_pubkey(const struct ext_key *bip32_base,
254 struct pubkey *pubkey, u32 index)
255{
256 const uint32_t flags = BIP32_FLAG_KEY_PUBLIC | BIP32_FLAG_SKIP_HASH;
257 struct ext_key ext;
258
259 if (index >= BIP32_INITIAL_HARDENED_CHILD)
260 return false;
261
262 if (bip32_key_from_parent(bip32_base, index, flags, &ext) != WALLY_OK)
263 return false;
264
265 if (!secp256k1_ec_pubkey_parse(secp256k1_ctx, &pubkey->pubkey,
266 ext.pub_key, sizeof(ext.pub_key)))
267 return false;
268 return true;
269}

Callers 9

json_newaddrFunction · 0.85
json_listaddrsFunction · 0.85
json_add_utxoFunction · 0.85
psbt_using_utxosFunction · 0.85
finish_psbtFunction · 0.85
p2wpkh_for_keyidxFunction · 0.85
onchaind_funding_spentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected