BOLT #3 revocationpubkey, a blinded key: revocation_basepoint * SHA256(revocation_basepoint || per_commitment_point) + per_commitment_point * SHA256(per_commitment_point || revocation_basepoint)
(revocation_basepoint, per_commitment_point)
| 91 | |
| 92 | |
| 93 | def derive_revocation_pubkey(revocation_basepoint, per_commitment_point): |
| 94 | """BOLT #3 revocationpubkey, a blinded key: |
| 95 | |
| 96 | revocation_basepoint * SHA256(revocation_basepoint || per_commitment_point) |
| 97 | + per_commitment_point * SHA256(per_commitment_point || revocation_basepoint) |
| 98 | """ |
| 99 | h1 = _sha256(revocation_basepoint, per_commitment_point) |
| 100 | h2 = _sha256(per_commitment_point, revocation_basepoint) |
| 101 | term1 = coincurve.PublicKey(revocation_basepoint).multiply(h1, update=False) |
| 102 | term2 = coincurve.PublicKey(per_commitment_point).multiply(h2, update=False) |
| 103 | return coincurve.PublicKey.combine_keys([term1, term2]).format(compressed=True) |
| 104 | |
| 105 | |
| 106 | def _add_number(num): |
no test coverage detected