MultiversX Tracker is Live!

Calculation of different Pubkeys in Lightning according to BOLT03

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 113 Views

Lightning uses different Pubkeys to gain more privacy and security, I am not sure how they are calculated. In BOLT03 it says:

The corresponding private keys can be similarly derived, if the basepoint secrets are known (i.e. the private keys corresponding to localpubkey, local_htlcpubkey, and local_delayedpubkey only):

privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)

I was wondering whether its the same per_commitment_point we use for our local commitment revocation path, which secret later gets reveiled to revoke the local commitment tx.

Meaning that the "to_local" path looks as the following:

OP_IF # Penalty transaction <revocationpubkey>
OP_ELSE `to_self_delay` OP_CHECKSEQUENCEVERIFY OP_DROP <local_delayedpubkey>
OP_ENDIF
OP_CHECKSIG

where the local_delayedpubkey is calculated like this:

local_delayedpubkey = basepoint_local_delayedpubkey + SHA256(per_commitment_point || basepoint_local_delayedpubkey) * G

and the revocationpubkey is calculated as follows:

revocationpubkey_local = revocation_basepoint_remote * SHA256(revocation_basepoint_remote || per_commitment_point) + per_commitment_point * SHA256(per_commitment_point || revocation_basepoint_remote)

With both paths using the same per_commitment_point which was created locally or to write it differently:

per_commitment_point_local

meaning that when I have to recover from a force close, I always need to not my latest per_commitment_point_local to sweep my "to_local" funds when I broadcast my force close transaction


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments