If I use web3.sign(myData, myPrKey) , then get (v, r, s) set to use it in solidity ecrecover().
Is it possible that there is another set of signature(v2, r2, s2), which is also working for same data and same private key (myData, myPrKey)?
Or is there only one possible signature (v, r, s) for (myData, myPrKey) ?
Mar 27, 2022, 11:02 AM
Only one because timestamp is also considered
Mar 27, 2022, 11:05 AM
Sorry, I don't get it. I sign it via js web3. And there is no timestamp, which I put in. Only data and my private key (plus web3 add prefix).
And check this signature via solidity smart contract ecrecover ()
And check this signature via solidity smart contract ecrecover ()
But if I don't use one?
Or you are saying, that js web3 using nonce?
when I do web3.sign()
Mar 27, 2022, 11:10 AM
Idk what you are trying to do so I can’t answer that I’m afraid
Mar 27, 2022, 11:12 AM
I have contract. In contract admin = someAddress. Map(bytes32 => bool) myStorage
Have js script: sign(data, prKeyAdmin). Get v, r, s
Then user call contract, and if ecrecover (data, v, r, s) == admin then put data to myStorage true.
can be (data, v2, r2, s2) == admin? //data stays same as previous set of v, r, s
Have js script: sign(data, prKeyAdmin). Get v, r, s
Then user call contract, and if ecrecover (data, v, r, s) == admin then put data to myStorage true.
can be (data, v2, r2, s2) == admin? //data stays same as previous set of v, r, s
Mar 27, 2022, 11:16 AM
Theoretically possible, but computationally impossible to actually do that
Mar 27, 2022, 12:14 PM
Thanks. And can I generate via this js script two sets of (v1, r1, s2) and (v2, r2, s2)?
For one data, if I know prkey of admin
For one data, if I know prkey of admin
Mar 27, 2022, 12:21 PM
You can't
Well you can, in a couple million years :)
Mar 27, 2022, 12:22 PM
Thanks again. I guess I need to read how it works on deeper lvl, to understand, why first v1, r1, s1 I generate easily, and second set v2, r2, s2 for million years :)
Mar 27, 2022, 12:24 PM
Well the basic idea is to find two private keys which maps to the same address, aka hash collision
Mar 27, 2022, 12:24 PM