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
0
votes
1answer
15 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/...
13
votes
3answers
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, ...
0
votes
1answer
26 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 ...
0
votes
0answers
27 views

Why this sighnature not valid and pubkey not on curve?

sighnature details: Z(hash of a message ?): 2bd8e1dfd43c0dcdb7310a2d29312a3a61c1430cf0b05df31069335f34e4a591 RS: ...
0
votes
1answer
94 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..??
-2
votes
1answer
74 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.
0
votes
1answer
62 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: ...
0
votes
0answers
64 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 ...
1
vote
1answer
140 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" ...
2
votes
1answer
113 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? ...
1
vote
1answer
54 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 ...
-1
votes
1answer
67 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 ...
3
votes
1answer
97 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=...
4
votes
1answer
219 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 ...
0
votes
3answers
489 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 ...
0
votes
0answers
64 views

need help generate single publickey on cuda device

I am trying to generate a public key from a hash on a cuda device. I couldn't find a ready source for that task. So I want to try to modify/ create a new function for this task. the source code I want ...
2
votes
1answer
153 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 ...
1
vote
2answers
310 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 (...
0
votes
1answer
80 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 ...
0
votes
0answers
36 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 ...
1
vote
0answers
32 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 ...
1
vote
1answer
351 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 ...
2
votes
0answers
83 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 ...
0
votes
2answers
184 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 = ...
5
votes
1answer
176 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 ...
0
votes
1answer
97 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?
2
votes
0answers
75 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,...
9
votes
2answers
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 ...
2
votes
2answers
455 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 &...
1
vote
1answer
101 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 ...
1
vote
2answers
516 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 ...
2
votes
1answer
249 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 ...
3
votes
3answers
1k 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 ...
0
votes
1answer
170 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 ...
0
votes
2answers
414 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....
1
vote
1answer
189 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,...
0
votes
1answer
817 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 ...
0
votes
0answers
188 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('...
0
votes
1answer
365 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 ...
0
votes
1answer
560 views

Question about Python library coincurve/libsecp256k

I am a noob with cryptography, just trying to learn using python and the library Coincurve ( https://github.com/ofek/coincurve ) which is a mature Python binding for libsecp256k1. The following code ...
4
votes
1answer
809 views

Bitcoin scripts that force disclosure of the private key

Context: I am creating an example code that would demonstrate an atomic swap between Elements and Bitcoin, with the aim that the swap transactions cannot be trivially linked, as it would be with ...
0
votes
1answer
100 views

Private key generation doubt

I read that the private key pk has to be any number between 1 and n, where n is almost 10^77. Since pk' s function is practically to be used as a scalar for multiplying the generator point G, why does ...
7
votes
3answers
2k views

What is the reasoning behind the choice of 2^256-2^32-977 for the prime on the secp256k1 curve?

In Bitcoin's elliptic curve (secp256k1), the prime p = 2^256 - 2^32 - 2^9 -2^8 - 2^7 - 2^6 - 2^4 - 1 the generator point Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 ...
3
votes
2answers
203 views

Can a Bitcoin (secp256k1) key be converted to a Ed25519 (Tor v3) key?

If I have secp256k1 keypair that is widely known, like a Bitcoin address, can I convert that into a Ed25519 key pair such that someone could access a .onion address in a deterministic way?
0
votes
1answer
157 views

Generator Point G multiple

if in a curve y2 mod p = x3+ 7 mod p ( ecdsa-secp256k1) p=115792089237316195423570985008687907853269984665640564039457584007908834671663 G=...
1
vote
1answer
564 views

tiny-secp256k1 and ECDSA signing determinism

I noticed in bitcoin when using the tiny-secp256k1 library to sign the signature for a signature hash of an input, the signature is always the same. However in other ECDSA secp256k1 libraries (im ...
0
votes
1answer
1k views

How public key is calculated from a base58 encoded private key?

I followed this post and created a private key for bitcoin wallet. The post says after finding the random 256 bit(32 bytes) integer the version number should be prepended and the checksum should be ...
2
votes
1answer
427 views

Is there a list of coins that are bip-32 compatible?

BIP 32 allows me to derive keys based off a root key pair, and all these keys will be on the secp256k1 curve. That means I'll be able to use BIP 32 for other coins that are also based on your curve. ...
0
votes
1answer
225 views

Problematic Digital Signature with SECP256K1

I am trying to test out TestNet3 and I have a keypair generated using Java crypto library. The private key is 23F847360E1EB348A212F443C633058080A8EB9F05AD132F8B82D51FE672EADD and the public key is ...
2
votes
1answer
2k views

SECP256K1 Minimum Value for Private Key

I've been looking into Elliptic Curve Cryptography, in particular the SECP256K1 spec which is used in Bitcoin and Ethereum. So I understand that the Generator point G is fixed based on the spec and ...