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

Function payer_key

lightningd/offer.c:395–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395static bool payer_key(struct lightningd *ld,
396 const u8 *public_tweak, size_t public_tweak_len,
397 struct point32 *key)
398{
399 struct sha256 tweakhash;
400 secp256k1_pubkey tweaked;
401
402 payer_key_tweak(&ld->bolt12_base, public_tweak, public_tweak_len,
403 &tweakhash);
404
405 /* Tweaking gives a not-x-only pubkey, must then convert. */
406 if (secp256k1_xonly_pubkey_tweak_add(secp256k1_ctx,
407 &tweaked,
408 &ld->bolt12_base.pubkey,
409 tweakhash.u.u8) != 1)
410 return false;
411
412 return secp256k1_xonly_pubkey_from_pubkey(secp256k1_ctx,
413 &key->pubkey,
414 NULL, &tweaked) == 1;
415}
416
417static struct command_result *json_createinvoicerequest(struct command *cmd,
418 const char *buffer,

Callers 2

json_payersignFunction · 0.85

Calls 1

payer_key_tweakFunction · 0.85

Tested by

no test coverage detected