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

Function per_commit_point

common/derive_basepoints.c:123–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123bool per_commit_point(const struct sha256 *shaseed,
124 struct pubkey *commit_point,
125 u64 per_commit_index)
126{
127 struct secret secret;
128
129 if (!per_commit_secret(shaseed, &secret, per_commit_index))
130 return false;
131
132 /* BOLT #3:
133 *
134 * The `per_commitment_point` is generated using elliptic-curve
135 * multiplication:
136 *
137 * per_commitment_point = per_commitment_secret * G
138 */
139 if (secp256k1_ec_pubkey_create(secp256k1_ctx,
140 &commit_point->pubkey,
141 secret.data) != 1)
142 return false;
143
144 return true;
145}
146
147bool derive_payment_basepoint(const struct secret *seed,
148 struct pubkey *payment_basepoint,

Callers 7

dump_commitments_infosFunction · 0.85
print_basepointsFunction · 0.85
mainFunction · 0.85

Calls 1

per_commit_secretFunction · 0.85

Tested by

no test coverage detected