Linked Questions

18
votes
4answers
13k views

workflow on signing a string with private key, followed by signature verification with public key

I know this question has been asked and answered, but while trying to get everything to work, I've come across some problems. This is what I'm trying to do: 1. take a target string 'Schoolbus' 2. ...
24
votes
1answer
9k views

How can I verify a cryptographic signature that was produced by an Ethereum address key pair

If I have a cryptographic signature from an Ethereum address key pair, how can I verify that signature?
24
votes
1answer
12k views

Ethereum ecrecover signature verification and encryption

The question of signing and verifying signatures with Solidity has been asked in these questions, both of which I have tried to study: How can I sign a piece of data with the private key of an ...
13
votes
1answer
4k views

Does ecRecover in solidity expects the “\x19Ethereum Signed Message:\n”-prefix

I struggle heavy to actually recover the ethereum address from a hash and the {r, s, v} from a signature with the ecRecover-method in solidity. What i want is to sign another ethereum-address. So i ...
9
votes
2answers
5k views

How does one properly use ecrecover to verify Ethereum signatures?

I've been searching to figure out what I'm doing wrong here, but I've had no luck yet. As far as I can tell, I'm using ecrecover correctly, but I can't seem to get back the signing Ethereum address. ...
15
votes
1answer
2k views

Getting the wrong address back from ecrecover

When I sign a string using the following code I get back a different address to the one I signed with. The address returned is different for different strings. const util = require('ethereumjs-util') ...
5
votes
1answer
2k views

Solidity ecrecover and web3j Sign.signMessage() are not compatible, is it?

Using Web3j to sign and verify a message is fine but when I use the signature generated by Web3j to verify using ecrecover in solidity it doesnot seem to work correctly. The signer address is ...
1
vote
2answers
2k views

Should signed text messages use the “\x19Ethereum Signed Message” prefix?

Background: I want to implement sign message feature in Trezor. Is there a standard for signing text messages? So far I found out that etherscan.io signs messages without the prefix, i.e. it signs ...
6
votes
2answers
503 views

Issue while trying to verify signature

I am using the following to sign a message var str="Trial with signature"; text=web3.sha3(str); var sig=web3.eth.sign(eth.accounts[0],text); Now after obtaining the hash value from the text and ...
4
votes
1answer
598 views

How does ecrecover actually work?

I have a basic understanding of elliptic curves, so I'm more interested to find out how does ecrecover specifically verify signatures. It has rather weird requirements, like this prefix thing (excerpt ...
0
votes
3answers
514 views

Unable to use ecrecover in solidity to recover address used to sign a message, simply returns 0x0 address

I do the following in geth: var msgHash = web3.sha3("hello") var signature = eth.sign(eth.accounts[0], msgHash) var r = signature.slice(0,64) var s = "0x" +signature.slice(64,128) var v = signature....
3
votes
1answer
531 views

I need help with signatures

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 ...
3
votes
1answer
483 views

Ecrecover after eth_sign update with preamble

I've just discovered that with b59c839 geth is now pre-appending the string: *\x19Ethereum Signed Message:\n<length of message>* before signing the passed message. I've read here that to use ...
0
votes
2answers
369 views

How to call this solidity function with Web3js when executing the contract?

I’m new with ethereum. I’m definitely struggling with the last 4 parameter of this function, so I’m asking the problem directly. mapping(address => uint256) nonces; /* * Proxy transfer token. ...
0
votes
2answers
322 views

Trouble with ecrecover()

I have a test routine in Truffle which hashes data, signs it and passes the signature data to a contract to verify. The first test hashes a single string and its signature is successfully verified by ...

15 30 50 per page