Questions tagged [ecdsa]

In cryptography, the Elliptic Curve Digital Signature Algorithm offers a variant of the Digital Signature Algorithm which uses elliptic curve cryptography.

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

Failing to verify signature

I'm trying to verify a signature using OpenZeppelin's SignatureChecker library, but always returns false. This is the verify function from the lib: function isValidSignatureNow( address ...
user avatar
  • 307
1 vote
1 answer
56 views

Get Signature for Tuple input for EIP712 [duplicate]

I'm using web3.js to try and sign a tuple and get the signature. I'm utilizing draft-EIP712Upgradeable.sol in order to hash and recover the input in solidity. I originally looked at the following link ...
user avatar
0 votes
0 answers
68 views

How to Export public key from Metamask

【Front】 const keyB64 = await window.ethereum.request({ method: 'eth_getEncryptionPublicKey', params: [accounts], }); const publicKey = Buffer.from(keyB64, 'base64') ...
user avatar
0 votes
0 answers
22 views

Using Solidity, how do you verify an ECDSA signature created on an external and sovereign blockchain?

I need to verify a signature on Ethereum using Solidity only. The verification needs to happen using ECDSA with the curve being secp256k1. The verification is not for Ethereum or an Ethereum generated ...
user avatar
0 votes
0 answers
13 views

how is raw transactions created and signed? using ecdsa packages

what are the steps involved in creating a signature to be sent to ethereum network via a rpc node? assuming the below is the rlp transaction format to be sent. { to, value, gasLimit, ...
user avatar
0 votes
0 answers
60 views

I cannot generate the ECDSA public key from her private key sequentially (printing problem?)

I cannot generate the public keys in sequence. output :./keysgo.go:33:33: cannot use PrivateKey (type []byte) as type string in argument to Public Thank you so much for your help important to keep ...
user avatar
0 votes
0 answers
75 views

I cannot generate the ECDSA public key from her private key sequentially

I cannot generate the public keys in sequence. output :./keysgo.go:33:33: cannot use PrivateKey (type []byte) as type string in argument to Public Thank you so much for your help important to keep ...
user avatar
2 votes
1 answer
368 views

solidity cannot verify ethers.js signed data (signTypedData)

i am using _signTypedData in etherjs to sign and encode a signature out of the data as follows const domain = { name: "og-nft", version: "1", }; const types = { ...
user avatar
0 votes
1 answer
86 views

Simpler verification of externally-created ECDSA signatures in Solidity

I just want to use ecrecover to verify with a public key that the corresponding private key signed a message passed through a variable in solidity. What's the simple way to do this? I have inserted ???...
user avatar
  • 1
0 votes
1 answer
841 views

How to recover an ethers.js signed message in go-ethereum?

I generated a signed message using ethers.js. Here's how I did that: const provider = new ethers.providers.Web3Provider(web3Provider.provider); const signer = provider.getSigner(); await signer....
user avatar
0 votes
0 answers
17 views

Go Ethereum "invalid signature recovery id" when recovery byte is >= 4 [duplicate]

I have a signed message that was generated by Metamask. It looks like this: ...
user avatar
1 vote
1 answer
531 views

How to use function Recover from ECDSA library?

I have an error when trying to use Recover function of ECDSA Library. What is the problem? import "hardhat/console.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; ...
user avatar
  • 59
0 votes
1 answer
30 views

Verifying the signature of a transaction seems circular

I'm reading Mastering Ethereum. Around page 116 it says; "to verify the signature one must have the signature (r and s), the serialized transaction, and the public key that corresponds to the ...
user avatar
0 votes
1 answer
238 views

Solidity: recover address from hashed message

I recently was going through some sol contracts, because I am planning to create my own one. So I stumbled upon this function call: function tryRecover(bytes32 hash, bytes memory signature) internal ...
user avatar
0 votes
2 answers
528 views

Using ECDSA to verify a signature inside smart contract

Following the technique to verify ethereum signature with ECDSA. Sign it like you mean it: creating and verifying Ethereum signatures Signing and Verifying Messages in Ethereum A Closer Look At ...
user avatar
1 vote
1 answer
200 views

Signing a tuple (struct) for ECDSA.recover

I'm using web3js, and I'm trying to sign a tuple correctly. Below you can see the solidity code for verification. I'm using draft-EIP712Upgradeable.sol struct NFTVoucher { uint256 tokenId; ...
user avatar
0 votes
0 answers
22 views

different between offline transaction raw and online

i use this code : const EthereumTx = require('ethereumjs-tx').Transaction const privateKey = Buffer.from( '2EE0C********', 'hex', ) const txParams = { nonce: 686, gasPrice: ...
user avatar
0 votes
1 answer
236 views

What is the purpose of OpenZeppelin ECDSA.sol contract?

what is the purpose of the ECDSA contract ( https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol ) ? Contract looks like a wrapper around builtin ...
user avatar
  • 101
6 votes
1 answer
850 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 ...
user avatar
1 vote
2 answers
112 views

web3.eth.accounts.sign 'K' generation

I have been searching for the actual implementation of the web3.eth.accounts.sign to find out how the random variable k is generated. But I could not find the implementation of the method web3.eth....
user avatar
1 vote
0 answers
41 views

Could Insufficient Funds error mean the signature is incorrect? - using golang and raw transactions

I want to sign a transaction "offline" without using crypto.sign. The code looks like the following: unsignedTx := types.NewTransaction(nonce, to, amount, gasLimit, gasPrice, nil) networkID ...
user avatar
1 vote
0 answers
180 views

Is the ECDSA signature hash, its derived v value and the chainID still a thing?

I was browsing some code at the go-ethereum and I noticed this method to validate the signature: https://github.com/ethereum/go-ethereum/blob/56dec25ae26bf749b93c3ea69538fabea60c5768/crypto/crypto.go#...
user avatar
3 votes
1 answer
74 views

Do miners undergo a sunken cost of attempting to verify an invalid transaction signature?

In the case of an 'invalid' transaction whereby the state transition of the execution is deemed to conflict in some way and reverts, the transaction itself is actually valid; gas is consumed, tx ...
user avatar
  • 626
2 votes
1 answer
462 views

Signing a raw transaction, wrong R and S values

I am trying to sign a raw transaction in javascript without relying on dependencies like web3, ethereumjs, etc. I am following the python tutorial found here, and porting to JS as I go: https://...
user avatar
0 votes
1 answer
63 views

Is there any other signature mechanism like ECDSA to verify the signed message if its tampered or not?

I would like to know if there are other signature verification methods other than ECDSA, to verify the message (eg., string, number) signed by a signer. Actually if there are alternative algorithms ...
user avatar
  • 27
1 vote
0 answers
185 views

Delegate transaction signature

What's the most efficient and trust-less way to sign a transaction through a middle-ware? Thanks for your help.
user avatar
  • 55
1 vote
1 answer
247 views

Knowing the message, can a signature be derived from an address or pubkey?

tl;dr if I were to sign an Ethereum message, eg. web3.eth.personal.sign("Bitcoin", "SOME-ETH-ADDRESS"), would it be reasonably safe to use a 32-byte hash of the signature as the private key for a ...
user avatar
2 votes
1 answer
349 views

secp256k1 library does not create correct public key

I am trying to get public key from private key using secp256k1 library. https://github.com/bitcoin-core/secp256k1 I set same private key(sk) in here. https://github.com/ethereumbook/ethereumbook/blob/...
user avatar
  • 73
1 vote
2 answers
403 views

Cross-posted from Stack-Overflow: Using Google Cloud Key Management Service to sign an Ethereum transaction

Cross-posted from question I've been working on writing a signer service for an Ethereum transaction manager and I need to sign Ethereum transactions using Google KMS Golang APIs. I'll try and ...
user avatar
1 vote
1 answer
252 views

What's wrong with my code, I am signing a transaction? Invalid v,r,s error?

func main() { privateKey, err := crypto.GenerateKey() if err != nil { log.Fatal(err) } auth := bind.NewKeyedTransactor(privateKey) balance := new(big.Int) balance....
user avatar
2 votes
0 answers
359 views

Signing a raw transaction, OpenSSL, C++

I'm trying to sign my raw transaction and each time I'm getting a different signature (r, s). Please help me how to sign transactions properly in C++ OpenSSL. I'm trying the following way but ...
user avatar
  • 51
1 vote
1 answer
262 views

Lib to sign messages using the same version of ECDSA of Ethereum

I want to sign a message using the private key of my physical RSA digital certificate and I want to validate this signature onchain. Does anyone know a lib that can sign messages offchain using the ...
user avatar
0 votes
0 answers
67 views

What way there is to implement a new signing scheme in Ethereum?

I want to deploy a new signing scheme for the Ethereum transactions as an alternative to the currently implemented ECDSA. This will be for future research purposes on post-quantum signing schemes. The ...
user avatar
0 votes
1 answer
210 views

How do I get the address from a signature?

As stated in the question, I have the v, r and s values of a signature given and am trying to find the belonging address. All questions similar to this solved it by either using a solidity smart ...
user avatar
1 vote
1 answer
1k views

How to pass bytes32 to Web3.methods.function.call

I have a contract that is doing an ecrecover: function recover(bytes32 h, uint8 v, bytes32 r, bytes32 s) public returns (address) { return ecrecover(h, v, r, s); } It works ...
user avatar
0 votes
1 answer
83 views

Is S of the signature(R,S) invalid when it is larger than N/2 in Ethereum? [duplicate]

In ECDSA, both signature(r,s) and (r,-s) are valid. However, in Bitcoin, it seems that the signature fails to be verified when s-part in the signature is bigger than half of the group order from this ...
user avatar
  • 57
1 vote
2 answers
523 views

Can transaction hash be used to get v, r, s parameters using web3js?

I am trying to create a function which can be used to get the v, r, s parameters (ECDSA) of the signature. So i am thinking to pass a random tx hash from etherscan and it will return v,r,s parameters ...
user avatar
0 votes
0 answers
154 views

Ethereum Signature Information

I am currently working with Ethereum Signatures (ECDSA and r, s ,v values) and I'm looking for official information about the recovery id v. A few posts like this one explain how the calculation is ...
user avatar
1 vote
1 answer
100 views

What should we do if s in the ecdsa signature is greater than n/2?

What should we do if s in the ecdsa signature is greater than n/2? As we all know, in the ECDSA signature of Ethernum, the output s must be smaller than n/2, where s is the signature output and n is ...
user avatar
  • 165
0 votes
2 answers
175 views

Can't find v, r & s values in the signed transaction of myetherwallet

I tried to create a simple transaction using myetherwallet by importing my account from metamask. Once I've put the 'to' address, ether value and gas price, I clicked on 'generate transaction' which ...
user avatar
  • 301
2 votes
1 answer
1k views

How to generate public key from private key in Rust?

How to generate Ethereum public key from private key in Rust? I found rust-secp256k1 and it seems to be what I need, but there is no documentation at all, which makes this crate for me, Rust newbie, ...
user avatar
  • 3,027
2 votes
1 answer
1k views

Signing a transaction: What is actually signed? [noob question]

I'm trying to wrap my head around how signing transactions actually works. As I understand ECDSA signatures roughly work like this: There is a magic function, let's call it sign that takes two ...
user avatar
  • 1,092
1 vote
1 answer
564 views

web3py: get public key from transaction

I'm trying to retrieve the public key of an address from a transaction. I'm getting the transaction via tx = web3.eth.getTransaction('xxx') According to the docs the public key should be retrievable ...
user avatar
  • 1,092
0 votes
1 answer
162 views

Facing an issue in transaction signature generation using a C library

I'm trying to generate a signature for a raw transaction using an ECDSA library implemented in C. Here are the transaction parameters: const txParams = { "nonce": "0x05", "gasPrice": "...
user avatar
  • 1
1 vote
1 answer
3k views

account recovery with web3 privateKeyToAccount()

I'm currently stucked by this strange thing: I started by exporting my private key(fdba67e41f7c6767100969ae3f045d10a59e35d380acf5b37a3b208bd2969347) from my metamask account, which i can use to login ...
user avatar
5 votes
1 answer
2k views

Is the signature generated by "web3.personal.sign" different with "web3.eth.sign"?

Are web3.personal.sign and web3.eth.sign difference in value of generate signature ? Or both of them generate an equal output ? I could test web3.eth.sign using testRPC, however web3.personal.sign ...
user avatar
  • 2,508
0 votes
0 answers
439 views

(NEW UPDATE: I need to run "testrpc") Signing a message using "ethereumjs-abi"? (Error: Invalid JSON RPC response: "")

I am trying to sign a message using following JavaScript code (from HERE) function constructPaymentMessage(contractAddress, amount) { return ethereumjs.ABI.soliditySHA3( ["address", "uint256"], ...
user avatar
  • 2,508
2 votes
2 answers
2k views

How can I simply sign an Ethereum transaction?

I want to use blockcypher to work with the Ethereum network. In the documentation they give an example of a signer tool written on Go, but I'm use Python. What is the simplest way to sign a ...
user avatar
6 votes
1 answer
389 views

Any understandable cryptography book/article/lecture to introduce to signatures, hashes, ECDSA etc..? [closed]

It's a long time I'm searching for cryptography lectures related to ethereum inside mechanisms, and everything I found has a high mathematical level. I'm an engineer, not a mathematics, so any article ...
user avatar
1 vote
0 answers
808 views

ECDSA Transaction Signature Values (V-R-S) -- Interpreting and presenting it to layman users

In Quorum + Web3, I used getTransaction and it returned me the necessary details and also V-R-S. Understand that VRS is part of the ECDSA signature. There is a need to interpret and present these ...
user avatar
  • 1,845