Questions tagged [secp256k1]

This tag should be used for anything related to the secp256k1 algorithm used for Bitcoin's public key cryptography.

Filter by
Sorted by
Tagged with
1 vote
1 answer
42 views

How is a Bitcoin transaction signed using ECDSA?

I am quite familiar with the way secp256k1 ECDSA works as well as the equations that are utilised. However, I have no idea how this ECDSA applies to signing Bitcoin (SegWit Format) and transferring it ...
user avatar
  • 113
2 votes
1 answer
35 views

How does ECDSA work when generating the public key?

I know the curve has formula y^{2}=x^{3}+ax+b. However, some websites are saying that a=0 and b=7 for secp256k1? What is secp256k1? Is it the curve that is always used or does it generate the field in ...
user avatar
  • 113
1 vote
1 answer
54 views

Why is the Generator Point G for secp256k1 curve typically indicated in (y,-x) quadrant?

Generator Point G for the secp256k1 curve is typically indicated below where the curve intersects the y-axis. At x=0, y=sqrt(7) and -sqrt(7), which are both small numbers less than 3, but G is an ...
user avatar
  • 33
1 vote
1 answer
63 views

Is it feasible to calculate EC private key k from public key K for very low values of k?

If an EC private key k is very small, say "1", is it feasible to calculate the private key k from its public key K, since there would only be one step back to generator point G and therefore ...
user avatar
  • 33
0 votes
1 answer
52 views

Is there a way to determine whether a specific point on the secp256k1 curve is a valid Bitcoin public key?

Let's first define a valid Bitcoin private key as a number in the range of [1, 115792089237316195423570985008687907852837564279074904382605163141518161494336], and a valid Bitcoin public key as a ...
user avatar
2 votes
1 answer
61 views

Can secp256k1 have different parameters and still be called secp256k1?

The secp256k1 standard (as defined in https://www.secg.org/sec2-v2.pdf, section 2.4.1) has a set of recommended parameters. Is there a particular reason why these parameters are just 'recommended', ...
user avatar
4 votes
1 answer
90 views

Who is the creator of the secp256k1 standard?

There are different accounts as to who created the secp256k1 standard, for example: Mastering Bitcoin, p.61: Bitcoin uses a specific elliptic curve and set of mathematical constants, as defined in a ...
user avatar
1 vote
1 answer
53 views

Elliptic Curve and SECP256K1

Just for curiosity, considering that there is a server communicating with other machine (local machine let's call it). If we have the two public keys from Local and Server and we know that Private and ...
user avatar
7 votes
2 answers
632 views

How is the generator point G chosen in the secp256k1 curve used in Bitcoin?

The generator point G in the secp256k1 curve used in Bitcoin is a known constant: Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 Gy = ...
user avatar
1 vote
1 answer
43 views

What will be the security risks if we persist "e" as part of schnorr signature=(r,s,e) and extract publicKey from signature at verification

We know unlike ecrecover, it is impossible to get to public key given schnorr signature = (r,s) since rG = sG-eP . So, would like to understand what are the security risks, if we say signature=F(r,s,e)...
user avatar
0 votes
3 answers
84 views

Why do private keys have a range limit?

I am reading about ECDSA, and I find that the private key must be in (0,n), with n = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141. Is n the total number of points on the ...
user avatar
1 vote
1 answer
61 views

How is the secp256k1 API defined? In what ways is it restricted?

I'm familiar with proprietary APIs where a third party decides what data and functionality is available to developers communicating with their server. However, secp256k1 is an open source ...
user avatar
1 vote
1 answer
29 views

Error while installing libwally

I am trying to install libwally on my debian machine. I followed the installation guide but running ./configure I got the warning === configuring in src/secp256k1 (/home/standup/libwally-core/src/...
user avatar
  • 191
15 votes
3 answers
4k views

Why is it not possible to get the private key out of the public key?

From how I understand it, the equation for the public key is defined as so: K = k * G With K being the public key, k the private key and G the generator point. Is G a constant? (as far as I read, ...
user avatar
0 votes
1 answer
29 views

What are the risks of using a non-randomized context with signing contexts?

I am designing an API which will utilize libsecp256k1. I am trying to hide most of the low-level stuff, and context is one of the things I want to handle for a consumer of my API. It would be ...
user avatar
0 votes
0 answers
36 views

Why this sighnature not valid and pubkey not on curve?

sighnature details: Z(hash of a message ?): 2bd8e1dfd43c0dcdb7310a2d29312a3a61c1430cf0b05df31069335f34e4a591 RS: ...
user avatar
0 votes
1 answer
174 views

public key to private key using HASH TABLE (Pollard's kangaroo for SECPK1)

I have done a little bit of research on HASH TABLE (Pollard's kangaroo for SECPK1) I was wondering if there is any way to extract the private key range using the public key or the public address..??
user avatar
-2 votes
1 answer
133 views

How to get bitcoin transaction nonce from transaction signature?

Subj. Looking for a code for calculate/get bitcoin transaction nonce. Help me please. ??? Thank you.
user avatar
0 votes
1 answer
99 views

Difference between Bitcoin private key space and secp256k1 modulo

I've read online that the group order for the Bitcoin secp256k1 curve is: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 Its decimal is: ...
user avatar
0 votes
0 answers
147 views

How does Ed25519 fit in with BIP32/44 HD wallet paths?

From my understanding, BIP39/32/44 all use the secp256k1 elliptic curve standard from Bitcoin. But I noticed that cryptos such as Polkadot and Cardano have their own registered coin type path for ...
user avatar
1 vote
1 answer
150 views

Why MakeNewKey in key.cpp isn't called when getnewaddress or generate

Hi I'm student studying bitcoin-core. I tested bitcoin regtest mode, and I want to know when CKey::MakeNewKey() is called. when I do this, bitcoin-cli -regtest createwallet "wallet1" ...
user avatar
  • 27
2 votes
1 answer
174 views

Why Schnorr was added to secp256k1 library instead of a separate library?

Schnorr signatures are often compared as superior to the Elliptic Curve ones. Then why developers added Schnorr into libsecp256k1 library which is, as the name suggests, an Elliptic Curve library? ...
user avatar
1 vote
1 answer
101 views

How to find the secp256k1 api?

I want to use the secp256k1 library https://github.com/bitcoin-core/secp256k1 (or, more specifically I want to use the python wrapper https://github.com/electrumsv/electrumsv-secp256k1). I have a ...
user avatar
  • 11
-1 votes
1 answer
68 views

Orderly Transition Away from ECC? Or Bitcoin to zero?

Let's say asymmetric public key cryptography is wide open, and can be broken using a public key or the signature. Namely, that I can determine the private key using the information revealed in a ...
user avatar
3 votes
1 answer
152 views

How to verify a lnurl-auth callback with python

I want to create a Python implementation of an lnurl-auth server. I started a quick HTTP server to be the callback url, and captured the signed callback sent by BLW on Android. ?tag=login &k1=...
user avatar
4 votes
1 answer
262 views

What is the difference between secp256k1_ecmult_gen and secp256k1_ecmult?

libsecp256k1 has two implementations, secp256k1_ecmult in ecmult.h and secp256k1_ecmult_gen in ecmult_gen.h, to multiply the points of an elliptic curve. secp256k1_ecmult_gen supports simple ...
user avatar
0 votes
3 answers
705 views

What is the math behind Bitcoin's elliptic curve?

I have seen many videos regarding the math behind the bitcoin elliptical curve but none of them show the public key generation. They are just defining few steps. I need the complete math behind the ...
user avatar
2 votes
2 answers
186 views

secp256k1 lib compiling issue "invalid use of incomplete type secp256k1_context"

I make a small test code (test.cpp), try to show the problem I meet: to compile use g++ -o test test.cpp -lsecp256k1 #include <stdio.h> #include "secp256k1.h" static ...
user avatar
  • 45
1 vote
2 answers
455 views

secp256k1 recovery id and how does the code work

Here I have some questions regarding the recovery id (recid) defined in secp256k1 implementation. I had found few posts about how the recid is defined and what does it mean, also the source code (...
user avatar
  • 45
0 votes
1 answer
91 views

Public key Exceeding Mod P? A Clarification Request On The Discrete Logarithm Problem

I tried to observe / implement the discrete logarithm problem but I noticed something about it; but before I get into it let me give some clarification which is open to correction. a = b^x mod P ...
user avatar
0 votes
0 answers
49 views

How to calculate the new sequence number N for the new final field Fp curve?

Are there simplified algorithms or online services or Python scripts where can calculate a new ordinal N for a new finite field Fp in an elliptic curve? y^2 = x^3 + 7 I know that SageMath exists and ...
user avatar
1 vote
0 answers
33 views

4 ERRORS GENERATED WHILE INSTALLING BITCOIND

I need your help plz. I have been struggling for weeks to make bitcoind work in my mac terminal. I installed all required programs and dependencies: xcode, bitcoin core, openssl, homebrew, and cloned ...
user avatar
1 vote
1 answer
486 views

Using secp256k1 in personal project

I am trying to use secp256k1 for a toy project that I am working on for learning purposes. I am using Ubuntu 20.04 and I can clone and compile the library just fine. I have tried to include it in a ...
user avatar
2 votes
0 answers
99 views

Linking libsecp256k1 as shared library to Bitcoin Core

I'm not sure if this question is better suited in the context of Autotools, but since it's about Bitcoin Core, I'll try to ask it here. I am trying to Compile/Link libsecp256k1 as a shared library ...
user avatar
  • 21
1 vote
2 answers
221 views

How to change the field of the elliptic curve to the new value N while keeping the default Secp256k1 parameters?

I want to change the margin of the elliptic curve to the new N value, while doing so I want to keep the parameters Standard G-point Generator Secp256k1 that is, I want to replace: N = ...
user avatar
5 votes
1 answer
197 views

What are the co-ordinates of generator G in his uncompressed form on secp256k1?

I was looking at BitcoinWiki and it says that G, in it's uncompressed form, has a value of: G = 04 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798 483ADA77 26A3C465 5DA4FBFC ...
user avatar
  • 449
1 vote
1 answer
135 views

In compressed public keys, is the 2 or 3 the parity or the sign?

In different places I've read that the 2 or 3 is the sign or is the parity of the elided Y coordinate? Which of these is it, or are the sign and parity equivalent in some way?
user avatar
  • 143
2 votes
0 answers
97 views

Is there a simpler form of BIP32-like key derivation?

I've read about BIP32 key derivation functions, and also: Any Elliptic Curve could work in the BIP32 scheme. The only property of a Curve that BIP32 relies on is that a * G + b *G = (a + b mod N) * G,...
user avatar
  • 143
9 votes
2 answers
1k views

Why doesn't basepoint G of Secp256K1 seem to be on the Elliptic Curve?

From what I understood are these the coordinates of basepoint G of Secp256K1 on the Elliptic Curve, in hexadecimal and decimal format. Hexadecimal Gx = (79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB ...
user avatar
2 votes
2 answers
607 views

Openssl magic values? Secp256k1 and ECDSA similarities? What makes secp256k1 special?

Part 1: Running this command seems to be a reliable way to produce a pubkey from a valid private key that for Bitcoin. Is this a correct assumption? openssl ec -inform DER -text -noout -in <(cat &...
user avatar
1 vote
1 answer
121 views

Does secp256k1 library provide API for generating uncompressed key?

Hi I am right now want to do a make a small tool to generate some test vector for ecdsa. Openssl is quite good, for support secp256k1 bitcoin provides an excellent library. However, it looks what I ...
user avatar
  • 45
1 vote
2 answers
701 views

produce a public key from private key with ecc, with clear description about k=k*g

According to this answer: https://bitcoin.stackexchange.com/a/63996/100526 When he wants to generate a public key from the private key, he has used K=k*G. but I can't understand it's result. If we ...
user avatar
2 votes
1 answer
308 views

Positive or negative private key of a bitcoin wallet?

Private key is a number. Is the question positive or negative? Is it possible to know a positive private key or negative if you only know the public key? For instance: Positive private key: 2 ...
user avatar
  • 49
3 votes
3 answers
2k views

How to subtract two points on an elliptic curve?

Please tell me if there is a formula for A-B, (That is, subtraction of two points / minus). I know how two points are added, A + B this addition is described in detail (Please tell me how you can ...
user avatar
0 votes
1 answer
206 views

Is it possible to add two secp256k1 points to get a "shared key"?

As I know from the Elliptic Curve Diffie Hellman (ECDH), you can create a "Shared Key": https://asecuritysite.com/encryption/ecdh2 This will look like this: dA × dB × G = Shared Key QB = dB × G QA ...
user avatar
0 votes
2 answers
471 views

Problem to link to libsecp256k1 on ARM architecture

Trying to compile with g++ -o addr 69_addr2.cpp $(pkg-config --cflags --libs libbitcoin) is getting me this error: /usr/bin/ld: /home/pi/libbitcoininstall/lib/libsecp256k1.a(libsecp256k1_la-secp256k1....
user avatar
  • 458
1 vote
1 answer
237 views

Why not every [x,y] coordinate on the Secp256k1 curve corresponds to a valid uncompressed publicKey?

First, some background. 1. There are some coordinates x,y satisfying y^2(mod p)=x^3+7(mod p) on the Secp256k1 curve that do not correspond to a valid Bitcoin uncompressed publicKey of the form 04[x,...
user avatar
  • 321
1 vote
1 answer
913 views

Is there a Python or SageMath implementation for solving the ECDL problem for small secret multiplier?

I am looking for a Python script or SageMath code implementation for testing the Baby Step - Giant Stepand Pollard Rhoalgorithms on the secp256k1 curve. I have read that these algorithms are well ...
user avatar
  • 321
0 votes
0 answers
230 views

secp256k1.publicKeyCreate generating symbollic key

Following is my code: const bip39 = require("bip39"); var HDKey = require('hdkey'); var bip32 = require("bip32"); var bitcoin = require('bitcore-lib'); var EthereumBip44 = require('...
user avatar
  • 121
0 votes
1 answer
406 views

What is the context in libsecp256k1?

I am experimenting with making a wallet for educational purposes, and would like to use libsecp256k1 directly. Aside from creating a context, and using it in calls, all I have perhaps learned so far ...
user avatar