Generate local signatures with additional randomness
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Wed, 19 Apr 2023 22:08:29 +0000 (15:08 -0700)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Thu, 20 Apr 2023 19:14:21 +0000 (12:14 -0700)
commit78b967f5b0a1ad7c135cd459895047fa697260fa
tree279d00b8e847faee2c3d1882eea4671aed254640
parent2c5bd1c56fd5aeb7cf9b049584cf24bd1852c15d
Generate local signatures with additional randomness

Previously, our local signatures would always be deterministic, whether
we'd grind for low R value signatures or not. For peers supporting
SegWit, Bitcoin Core will generally use a transaction's witness-txid, as
opposed to its txid, to advertise transactions. Therefore, to ensure a
transaction has the best chance to propagate across node mempools in the
network, each of its broadcast attempts should have a unique/distinct
witness-txid, which we can achieve by introducing random nonce data when
generating local signatures, such that they are no longer deterministic.
lightning/src/chain/keysinterface.rs
lightning/src/ln/chan_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/payment_tests.rs
lightning/src/util/crypto.rs