Skip to main content

Questions tagged [secp256k1]

The tag has no usage guidance.

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

Problem recovering public-key from signature using secp256k1 module

When i try to recover the pubklic key using : const publicKey = signature.recoverPublicKey(message_hash); It return a point Point { px: ...
Mohamed Hkima's user avatar
0 votes
0 answers
10 views

Solana-Ethereum bridges

Ethereum uses the secp256k1 public key cryptography and Solana uses the ed25519 public key cryptography. How is that situation handled in the case of bridges? Let's say that we want to certify a block ...
Mathieu Dutour Sikiric's user avatar
2 votes
1 answer
67 views

C code to sign a message compatible (such that can be verified) with Metamask, mycrypto, etc

I am on macOS and trying to put together the code to sign (and once I succeed to verify) a message with an Ethereum private key. So, the private key (just used to test, no funds there lol) is: ...
capodieci's user avatar
0 votes
0 answers
24 views

public key recovery failed intermittently with go-ethereum

I am trying to recover public key from signature and digest. below is my code. It's failing sometimes with error recovery failed package main import ( "crypto/ecdsa" "crypto/...
Pankaj Kumar's user avatar
0 votes
1 answer
44 views

getPublicKey is not a function

I'm trying to generate public key from private key using secp256k1, but I'm getting error saying: getPublicKey is not a function const { getPublicKey, ecdsaSign } = require("ethereum-cryptography/...
That Web3 Guy's user avatar
1 vote
1 answer
227 views

Signing messages in cpp

I am trying to execute eth transactions from cpp. For that we need to be able to sign messages using Elliptic curve algorithm. I have found this repo, but output signature is different from what we ...
Jatin Garg's user avatar
2 votes
1 answer
241 views

Can I use a BLS12-381 private key to sign Ethereum transactions?

I'm new to cryptography and I've recently been studying BLS signatures. Please forgive me if I make any mistakes while writing. I've tried generating a BLS key pair and using the private key to derive ...
pgermani's user avatar
1 vote
0 answers
114 views

Generate EDSCA recoverable signature for use with OpenZeppelin EDSCA contract (Embedded/C/C++ Hardware wallet)

I'd like to sign a message on an Arduino-compatible microcontroller, and create a recoverable signature which can be used with EIP-191 and Ethereum's erecover / OpenZeppelin's ECDSA smart contracts to ...
xtools's user avatar
  • 111
1 vote
0 answers
167 views

How do I convert a JWK to an Ethereum Public & Private Key?

I'm generating a P-256K key pair using Azure Key Vault & it returns it in JWK format. I don't know a lot about cryptography, but I need to convert this to a public & private key in the ...
Adrian D.'s user avatar
  • 554
0 votes
1 answer
596 views

What makes an Ethereum keypair valid?

As I understand Ethereum (and Bitcoin) use the ECDSA algorithm which relies on the secp256k1 curve. The secp256k1 curve is what generates the public keys given a private key. However, recently, I ...
vw1262's user avatar
  • 15
3 votes
0 answers
182 views

How to store secure private keys on a server, that are being used for 'gasless' minting using EIP-712 based messages?

NOTE: By 'gasless' I mean that I won't have to mint the tokens for the user, they can mint it themselves provided they have a valid signature. Hi, In my NFT (ERC-721) contract, I'm allowing callers to ...
Sol Man's user avatar
  • 31
1 vote
1 answer
429 views

Elliptic curves for eth2 keys and addresses

It appears that eth2 will use the BLS curve for at least some keys instead of secp256k1 which is used for eth1. And in eth2 there are both validator keys and account keys. My question is what curve ...
kimon's user avatar
  • 113
2 votes
0 answers
119 views

Is there only one valid r,s,parity for a given transaction signed by one private key?

As I understand it in secp256k1 there are infinitely many secrets which, for the same message to be signed, can lead to a valid signature. So the same private key can sign the exact same message and ...
Cedric Martin's user avatar
0 votes
1 answer
414 views

How to calculate a valid signature?

I am trying to create a signature that is valid on https://etherscan.io/verifySig, but it shows always that my signature is invalid: I created a random private and public key: private key: ...
Andy's user avatar
  • 71
6 votes
1 answer
2k views

How to convert public key (64 bytes) to compressed public key (33 bytes)

I currently have a generated 64-byte public key that has been recovered from an Ethereum transaction. How do I convert this key into a 33-byte compressed public-key? The problem I'm having seems ...
cheethas's user avatar
  • 103
1 vote
1 answer
3k views

ethers.js wrong signature

From the same private key in ethers.js and secp256k1 I get the same eth address. But if I sign a message I get a different (wrong) signature in ethers.js. What is wrong with my code? import { ...
Boris's user avatar
  • 13
2 votes
1 answer
674 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://...
Albert Renshaw's user avatar
2 votes
1 answer
637 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/...
xiaofo's user avatar
  • 73
2 votes
1 answer
2k 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, ...
Roman Frolov's user avatar
  • 3,177
1 vote
0 answers
127 views

How to change Go Ethereum ECC Curve

In Geth\crypto I found the default implementation of ECC curve (secp256k1). I would like to change it to secp256r1 curve for my private network. In normal circumstances, all I need to change is the ...
Consy's user avatar
  • 592
0 votes
1 answer
289 views

Can Ethereum Contracts Store Bitcoin?

I know that Ethereum and Bitcoin both you the same underlying elliptic curve, so I'm wondering, is it possible to store bitcoin in an Ethereum contract?
Loourr's user avatar
  • 101
2 votes
1 answer
1k views

Secp256k1 bindings are not compiled. Pure JS implementation will be used

I am trying to create a meteor dapp that can sign a piece of data and then recover the address it was signed with. When I run the dapp I get this error in the console: Secp256k1 bindings are not ...
Joe's user avatar
  • 1,183
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
5 votes
2 answers
4k views

Deriving Ethereum address from Bitcoin address

As far as I know Ethereum private keys are compatible with Bitcoin private keys, as described in Can I use the same private key for Ethereum and Bitcoin? . HOWEVER Can I derive an Ethereum public ...
Mikko Ohtamaa's user avatar
28 votes
2 answers
10k views

Can I use the same private key for Ethereum and Bitcoin?

Both Bitcoin and Ethereum private keys are usually a 256-bit number, isn't it possible to use the same private key for both Bitcoin wallets and Ethereum accounts? For instance, the Bitcoin wiki states:...
q9f's user avatar
  • 33k