Post
Topic
Board Bitcoin Technical Support
Merits 7 from 2 users
Re: Does signing message leak private key?
by
BrewMaster
on 05/12/2019, 17:11:30 UTC
⭐ Merited by Jet Cash (5) ,Abdussamad (2)
that case is not related to your concern. it is a bad implementation of ECDSA that affected normal wallets and HD wallets alike.

Quote
I am concerned if i sign a same message from 2 different address (that are generated from same seed) then how to be sure same 'k' value isn't used? There is a possibility for someone to recover private key from both the signatures right that sign the same message?
if the wallet you were using had a terrible code then it could happen but you mentioned Electrum. this wallet is a good one and the code is solid. it is using a method for generating the random k value known as RFC-6979, it deterministically creates the digital signature so the RNG problems don't exist here at all.

here is some references you can read:
RFC doc: https://tools.ietf.org/html/rfc6979
electrum source code: https://github.com/spesmilo/electrum/blob/428b63822b359d56d6ececabf406a43589545d24/electrum/ecc.py#L417
the library it calls: https://github.com/warner/python-ecdsa/blob/aea736c610752bf1478febfd15b11c711debcf61/src/ecdsa/keys.py#L1022-L1055
there is also libsec256k1 which electrum uses but i couldn't find the code there. you can look into that too.
https://tools.ietf.org/html/rfc6979