Questions tagged [signature]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
66 votes
5 answers
55k views

Get public key of any ethereum account

Can I somehow get the public key of an ethereum account knowing just the corresponding ethereum address (e.g. 0x54dbb737eac5007103e729e9ab7ce64a6850a310)?
Edward Ruchevits's user avatar
46 votes
1 answer
36k views

What does v, r, s in eth_getTransactionByHash mean?

In Ethereum JSON-RPC I found the return is: Returns Object - A transaction object, or null when no transaction was found: hash: DATA, 32 Bytes - hash of the transaction. nonce: QUANTITY - the number ...
jiebang's user avatar
  • 993
44 votes
6 answers
33k views

Create and sign OFFLINE raw transactions?

I'm looking to create a raw transaction, sign it, and broadcast it using the eth.sendRawTransaction RPC method. I would like to do this offline using code or an open-source library OR online but ...
Nico's user avatar
  • 807
39 votes
1 answer
11k views

Where is the private key for a contract stored?

This is a question that I am asked often by developers who assume that a contract has a private key of its own to sign any transactions that it makes.
J-B's user avatar
  • 8,711
34 votes
2 answers
17k 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
  • 483
33 votes
4 answers
20k 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,016
32 votes
5 answers
13k views

How can I sign a piece of data with the private key of an Ethereum address?

I would like to use the key pair of one of my Ethereum accounts to sign a piece of data. How can this be done?
Piper Merriam's user avatar
29 votes
3 answers
4k views

Is Ethereum secure against an attack by quantum computers?

Does Ethereum implement Post-quantum cryptography? Or will the network break once a malicious actor gains control of an effective quantum computer?
Shelvacu's user avatar
  • 1,385
26 votes
6 answers
26k views

How do you sign an verify a message in javascript proving you own an Ethereum address?

Is there a js library or even just pure js where I can sign and verify I own an Ethereum address?
Patoshi パトシ's user avatar
21 votes
2 answers
8k views

Is it safe to reuse Ether addresses?

I believe it's viewed as unsafe in Bitcoin because of the way transactions are signed. Is this also true for Ether addresses?
clewisjr1's user avatar
  • 261
20 votes
4 answers
35k views

How to properly create a raw transaction and sign it using web3 in browser

I want to create and sign a transaction in browser using web3. In order to create a raw transaction, I think I have to do something like this (hopefully you can fill the gaps of my knowledge) var pk =...
S1r_Mar71n's user avatar
20 votes
2 answers
15k views

How can I verify a signature with the web3 javascript API?

Using the javascript web3 API I can create a signature like this: > web3.eth.sign(eth.coinbase, "0xdeadbeef") "...
J-B's user avatar
  • 8,711
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,143
15 votes
3 answers
15k views

Invalid sender error on private chain

I created a transaction in Go, signed it with a EIP155Signer signer, but when I try to publish the transaction through the Go client to the private blockchain, I get the error Invalid sender. Any idea ...
thanos's user avatar
  • 844
13 votes
2 answers
2k views

What if two ether functions have the same signature?

It should not be hard to find collision. There is only 4 294 967 296 possible signatures.
gkucmierz's user avatar
  • 773
12 votes
1 answer
1k views

Ethereum signature verification not matching

What I want to achieve is sign a message and then verify the signature whether verified by same address or not. Contract to Invoke ecrecover method to verify the address contract MyAuth { ...
Susmit's user avatar
  • 1,784
11 votes
3 answers
5k views

Using AWS CloudHSM to sign transactions

Does somebody knows how to properly use AWS CloudHSM to sign ethereum transactions (Keccak256)?
Lucas Yamamoto's user avatar
11 votes
1 answer
8k views

What are the IDs for the various Ethereum chains? [duplicate]

I'm looking to find the chain ID's for each network (homestead, etc.). I believe the v-value of signatures is associated with these to some extent. I'm also under the impression that the ropsten ID ...
Cisplatin's user avatar
  • 273
11 votes
4 answers
3k views

How can I verify a secp256r1 signature using solidity

Sorry if you find these questions are basic, but I am new to encryption. As far as I know, Solidity have ecrecover function for this purpose, but it use secp256k1 signature. which I am intend to use ...
john's user avatar
  • 211
10 votes
2 answers
9k views

Getting an address from ethereumjs-utils ecrecover

I am trying to sign a string using web3.eth.sign() and then get the public key I signed with from the signature. To do this I am using ecrecover() from ethereumjs-utils, which returns a buffer. When I ...
Joe's user avatar
  • 1,143
9 votes
2 answers
9k views

How to use ethers keccak256?

I tried to use ethers' keccak256 function like this: import { keccak256 } from "@ethersproject/keccak256"; const signature = keccak256("balanceOf(address)"); But the script ...
Paul Razvan Berg's user avatar
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
8 votes
1 answer
8k views

Can I web3.eth.sign with private key

I want to use web3.eth.sign to create a signature that will be stored in blockchain and verified later by a contract (with ecrecover). I'd like to use as few libraries as possible. Web3 docs specify ...
xaxa's user avatar
  • 325
8 votes
1 answer
3k views

How do I extract the v, r, s values from a signed transaction?

If I have a signed transaction such as ...
Elliot Solskjaer's user avatar
8 votes
1 answer
2k views

Why is s in transaction signature limited to n/2+1

In the Yellow paper, appendix F "Signing Transactions", it says a valid signature must satisfy: (281) 0 < s < secp256k1n ÷ 2 + 1 However, in both the cited paper here (ECDSA ...
lenin's user avatar
  • 160
8 votes
1 answer
1k views

Getting wrong address from ECDSA.recover()

I'm signing typed data using _signTypedData() method of ethers. But when I retrieve the signer's address in Solidity Smart Contract using ECDSA.recover(), it returns the wrong address. Let me know if ...
Yash Gajjar's user avatar
8 votes
1 answer
811 views

How to verify signature in NodeJs via web3j?

I am sending an EIP_712 signature from metamask to the java backend (web3j) and I need to verify it on backend java application. In this topics it is discussed the support of EIP-712 in java (web3j): ...
reza ghasemi's user avatar
7 votes
3 answers
9k views

Is it possible to sign a message in Solidity?

I am trying to sign and verify a signature in Solidity. I understood that it is possible to verify a signature using ecrecover. However, I am not able to find any useful information on signing.
Consy's user avatar
  • 572
7 votes
2 answers
10k views

Sign message with web3 and verify with openzeppelin-solidity ECDSA.sol

I'm trying to get a little example working with ECDSA.sol here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/cryptography/ECDSA.sol This contract: Generate a random(...
Rob Hitchens's user avatar
  • 54.4k
7 votes
2 answers
5k views

Do I have to unlock my account in geth to call a web3.eth.sign() in JavaScript?

I have: A geth account Access to web3 API I want to: Invoke the function, web3.eth.sign(coinbase, sha) If I put this in a javascript file sign.js, and I call node.js, will it sign my message? Or ...
EhtereumUser12321's user avatar
7 votes
3 answers
4k views

Retrieve the signature of a transaction on the blockchain

How can you find the signature of a transaction? web3.eth.getTransaction() doesn't appear to make that available.
dbryson's user avatar
  • 6,323
7 votes
1 answer
1k views

Can a message hash be recovered from a signature?

A message can be signed and its signing public key recovered given the signature and message hash... signature = web3.personal.sign(<account>,<message hash>) pubKey = web3.personal....
o0ragman0o's user avatar
  • 4,280
7 votes
1 answer
1k views

Demystify Transaction signing process

Can someone explain in layman term, why the transaction needs to be signed and the role of public key, private key in transaction signing process. From what I have read so far: When user creates a ...
viral kapadia's user avatar
7 votes
1 answer
2k views

How are tuples handled for the function selector?

How are tuple types encoded into the function signature to generate the 4 byte function selector? The official specification doesn't state anything for tuple types.
Ybrin's user avatar
  • 185
7 votes
1 answer
851 views

Is it possible to sign transactions offline in Mist?

is this planned to be implemented? Would be great to be able to sign transactions securely on an air-gapped machine. I understand that IceBox has offline signing, but they don't support contracts/...
Donavan Theodor's user avatar
7 votes
1 answer
480 views

Can I compress a raw, signed transaction into 140 characters

I would like to basically Make SMS payments of Ether (or bitcoin). The basic Idea I'm thinking about is: 1) Private key signs a transaction on a mobile phone. 2) Raw transaction is 'compressed' ...
ZMitton's user avatar
  • 2,710
7 votes
2 answers
7k views

How to sign transaction using web3.js via metamask

I'm trying to make a signed transaction in browser with web3 injected from metamask and send the transaction to my backend-server and then submit it to blockchain. However, it's hard to find how I can ...
fd asdf's user avatar
  • 73
7 votes
1 answer
2k views

How can we verify BGLS aggregate signatures in Solidity?

BGLS [1] is an aggregate signature scheme by Boneh et al., that allows aggregation of signatures on n different messages from n different signers. What I want to achieve is to verify such signatures ...
Saffie's user avatar
  • 235
7 votes
1 answer
2k views

Signing messages as a Gnosis Safe (eip1271 support)

Does Gnosis Safe have a native way to validate it's own eip1271 signatures? I know that Gnosis Safe's can have contract accounts as owners and it will verify those signatures according to eip1271 but ...
smhtm's user avatar
  • 81
6 votes
1 answer
2k views

Verification of externally-created ECDSA signatures in Solidity

I have ECDSA signatures created using Golang without using web3 or anything related to Ethereum, and I want to verify these in Solidity. Step 1: Signing the message in Golang My Go code to create ...
Saffie's user avatar
  • 235
6 votes
3 answers
9k views

Signing a raw transaction in Go

I need to sign an offline transaction in golang. I have the following, which is a slight modification of this answer to a similar question: import "github.com/ethereum/go-ethereum/core/types" import "...
ethereum_alex's user avatar
6 votes
1 answer
7k views

Verifying personal.sign signature with pyethereum

I'm trying to verify a signed message from Metamask with pyethereum. I can not seem to recover the correct address from the signature. Lack of documentation isn't helping matters. On the client ...
Mike Shultz's user avatar
  • 1,172
6 votes
2 answers
9k views

how to use personal_sign

https://github.com/ethereum/go-ethereum/wiki/Management-APIs {"method": "personal_sign", "params": [message, account, password]} The param message is a hex string, how can I generate it from a tx? ...
alpha's user avatar
  • 183
6 votes
2 answers
847 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
  • 133
6 votes
2 answers
1k views

How to sign a message using secp256k1 in Ruby?

I'm trying to write a sign function in Ruby for Ethereum using secp256k1. I have access to this sign_compact function which seems to be for Bitcoin: https://github.com/lian/bitcoin-ruby/blob/master/...
Cisplatin's user avatar
  • 273
6 votes
1 answer
969 views

Signatures differ in web3js and web3j

I'm using web3J version 3.0.0-alpha4 and hit following problem. When I sign the same raw message (it's simply string like "TEST" for now) I get different signatures using web3js i web3j. The signature ...
Starspire's user avatar
5 votes
1 answer
7k views

How to get private keys on Truffle from Ganache accounts

Doing some ERC-735 tests on truffle+ganache I got stuck when creating claim signatures. They need to be signed from my ganache account, but I don't know its private key. The code to be used is this: ...
Juan Ignacio Pérez Sacristán's user avatar
5 votes
3 answers
4k views

Get rid of Metamask sign confirmation dialog

I am using web3 for users to sign some random string from web application. I give user string, he/she signs it after Metamask dialog's "Sign" button. but there is a problem when i want user to sign ...
O. Shekriladze's user avatar
5 votes
2 answers
4k views

smart contract transaction signature

I have a thought about the smart contract. I would like to know when the smart contract sends a transaction (send ether to someone) did it sign the transaction if yes how it does? does it have a ...
Sig Touri's user avatar
  • 1,030
5 votes
1 answer
6k views

Experiencing an "invalid signature error" when trying to use the "permit" feature of ERC20 tokens that support EIP712

I'm currently writing a few smart contracts in solidity and interacting with them through web3. The premise being that a token can be deposited into a pool and can then subsequently withdraw at a ...
ziyadparekh's user avatar

1
2 3 4 5
10