So, for my studies, I am supposed to interact with a contract function that has the following built in condition:
if (ecrecover(_h, _v, _r, _s) == msg.sender && _h == sha3(this))
I am supposed to provide _h, _v, _r and _s via contract transaction so that the statement equals true.
Our uni has a test server node which we can connect to via mist --rpc
and we can also open a web3 provider via http to that node.
I know how to sign messages in web3 and how to extract r, s and v so that ecrecover returns my address. But I can only get the right signature if I use the ethereum signature prefix and thus the condition _h == sha3(this)
will always fail. I don't know what to do. I've been trying to somehow access my private key so I can use ethereumjs-util to sign the message but I can't get it.
How can I get a signature with my testnet address that doesn't automatically add the prefix??!