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

Function per_commit_point

common/derive_basepoints.c:107–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107bool per_commit_point(const struct sha256 *shaseed,
108 struct pubkey *commit_point,
109 u64 per_commit_index)
110{
111 struct secret secret;
112
113 if (!per_commit_secret(shaseed, &secret, per_commit_index))
114 return false;
115
116 /* BOLT #3:
117 *
118 * The `per_commitment_point` is generated using elliptic-curve
119 * multiplication:
120 *
121 * per_commitment_point = per_commitment_secret * G
122 */
123 if (secp256k1_ec_pubkey_create(secp256k1_ctx,
124 &commit_point->pubkey,
125 secret.data) != 1)
126 return false;
127
128 return true;
129}
130
131bool derive_payment_basepoint(const struct secret *seed,
132 struct pubkey *payment_basepoint,

Callers 9

dump_commitments_infosFunction · 0.85
do_sign_local_htlc_txFunction · 0.85
pretend_got_revokeFunction · 0.85
print_basepointsFunction · 0.85
mainFunction · 0.85

Calls 1

per_commit_secretFunction · 0.85

Tested by

no test coverage detected