Linked Questions

35 votes
4 answers
21k 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. ...
shiso's user avatar
  • 1,036
36 votes
2 answers
18k 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 ...
arik's user avatar
  • 503
30 votes
1 answer
14k 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?
Piper Merriam's user avatar
16 votes
1 answer
6k 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 ...
user2762996's user avatar
16 votes
1 answer
4k 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') ...
Joe's user avatar
  • 1,183
9 votes
2 answers
7k 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. ...
ryepdx's user avatar
  • 1,342
7 votes
1 answer
6k 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 ...
earthouser's user avatar
2 votes
4 answers
9k 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 ...
joho's user avatar
  • 21
6 votes
1 answer
2k 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 ...
andrewjack's user avatar
1 vote
3 answers
2k 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....
hextet's user avatar
  • 1,593
7 votes
2 answers
889 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 ...
Aravind_R's user avatar
  • 143
3 votes
1 answer
1k 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 ...
Suzuko's user avatar
  • 31
0 votes
2 answers
1k 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. ...
user2284570's user avatar
  • 1,040
1 vote
2 answers
1k views

Public key validation through private key

What is a good way to validate that the public key claimed to belong to a particular user really belongs to him without revealing the associated private key? Can this be done with zero-knowledge ...
NowsyMe's user avatar
  • 1,365
1 vote
2 answers
1k 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 ...
Craig's user avatar
  • 118

15 30 50 per page