We’re rewarding the question askers & reputations are being recalculated! Read more.

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
52 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
40 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
40 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
92 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
49 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('ethereum-bip44'); ...
0
votes
1answer
113 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
139 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 ...
2
votes
1answer
266 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
72 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 ...
3
votes
3answers
1k 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
113 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
84 views

Generator Point G multiple

if in a curve y2 mod p = x3+ 7 mod p ( ecdsa-secp256k1) p=115792089237316195423570985008687907853269984665640564039457584007908834671663 G=...
1
vote
1answer
276 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
365 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
230 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
173 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
862 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 ...
5
votes
2answers
634 views

BIP32 recommends a 256 bit seed. Why do most Bitcoin wallets only use a 128 bit seed?

According to BIP32's "Master key generation" section, "256 bits is advised". See https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Master_key_generation Why did BIP32 consider 256 bits ...
4
votes
1answer
2k views

How can a deterministic wallet have one private key but multiple public keys

If we take for example bread wallet. There is one mnemonic to remember, which means one private key? But when you use the app, your public address constantly changes. So more than one public key? ...
1
vote
2answers
291 views

Private key exported from Electrum, unable to recreate Address with Python

I have created a new Electrum wallet, and here is an address: 1JkZLnmFfpVFLT2ZMtKzc6BuXMdmY41EHA By right-clicking on it, I choose "Private key" which gives: ...
5
votes
1answer
816 views

How were the secp256k1 base point coordinates decided?

79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 seems very random to me. I see how this point is on the curve, but how ...
5
votes
1answer
400 views

C secp256k1: What do prefixes 0x06 and 0x07 in an uncompressed public key signify?

In the eckey_impl.h header file, the implementation of secp256k1_eckey_pubkey_parse checks if the first byte of a 65-byte public key is 0x04, 0x06 or 0x07. Where can I find documentation regarding the ...
8
votes
1answer
886 views

Why was the Schnorr code removed from Bitcoin Core?

I was looking for the Schnorr implementation in Bitcoin Core and was surprised to see that it was removed on Nov 2016 (commit e06e878fd7dcc99825025fa99aedb86bc7d5c29f). Why was the source code ...
6
votes
1answer
504 views

Is there a point on the secp256k1 curve for any given X coordinate?

There function in libsecp256k1 that allows you to directly set the field element to 32 bytes of your choice. Does secp256k1 always return a valid group element for any 32 byte value? ...
1
vote
1answer
851 views

Is the following a valid bitcoin private key? - FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE

In secp256k1 (Bitcoin's elliptic curve) it is defined that valid private keys may range from 1 to FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141 - 1. (https://crypto....
1
vote
0answers
41 views

C secp256k1: creating bindings in another language with FFI

I am attempting to create bindings from the C library libsecp256k1 into Scheme (the guile implementation) but I am guessing my question applies to other target languages. Say I want to export the ...
0
votes
2answers
76 views

C secp256k1: What is the purpose of the idiom '(void)data;'?

The following code is contained in the file secp256k1.c: static void default_illegal_callback_fn( const char* str, void* data) { (void)data; fprintf(stderr, "[libsecp256k1] illegal ...
0
votes
0answers
92 views

C secp256k1 : Segmentation Fault when passing NULL context to secp256k1_ecdsa_verify

Passing a NULL context to secp256k1_ecdsa_verify results in a segmentation fault (see attached code). I have the feeling this behavior is unintended as the secp256k1 library appears to be systematic ...
3
votes
1answer
313 views

C secp256k1 : what is the purpose of secp256k1_context_randomize?

In the course of studying the secp256k1 library API, I came acrosssecp256k1_context_randomize which seems similar to providing a seed to a pseudo-random generator. At the same time, the file secp256k1....
1
vote
1answer
121 views

C secp256k1 : ec_pubkey_parse successful on NULL context despite attribute

Looking at the main API file secp256k1.h of the C library, we have: SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse( const secp256k1_context* ctx, secp256k1_pubkey* ...
2
votes
0answers
860 views

Cannot build secp256k1 C library on Debian stretch

I was hoping that someone would be able to suggest something about this (the same process works perfectly fine on my Debian Jessy machine) $ uname -a Linux front 4.8.0-1-amd64 #1 SMP Debian 4.8.7-1 (...
4
votes
1answer
2k views

OpenSSL and Secp256k1 differing in implementation of ECDSA signatures?

OpenSSL (from ssl in Mac OS X Version 10.11.6) and Secp256k1 (from the bitcoin-core repository) seem to differ in their implementations of ECDSA. I'm having issues with these differences and want to ...
1
vote
0answers
405 views

Can I quickly check the cofactor of secp256k1 is 1

I was wondering if there was a quick way to check that the group underlying the elliptic curve secp256k1 was indeed cyclic with the usual point G a generator. I am given the prime number underlying ...
1
vote
2answers
2k views

C++ and secp256k1

I am working on a tiny C++ bitcoin application for a university project. I'm using Blockcypher API to create transactions, but I faced a problem with signing transaction's hash that returns one of the ...
1
vote
2answers
613 views

How do I add two secp256k1 keys together?

I have two public/private keypairs, A and B. I want to add them together to get a new keypair AB. I'd also like to be able to add the public keys of A and B to get the public key of AB. How do I do ...
3
votes
1answer
569 views

How to determine if a public key point y is negative or positive, odd or even?

Take a bitcoin public key (x, y) and its additive inverse (x, -y). How do you identify which is the positive point and which is the negative point? Example Private key 1 -> (x, y) x = ...
1
vote
1answer
154 views

x , y coordination division

python code def inverse(x, p): return pow(x,p-2,p) p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f #private key 2 -->(x , y) value xx = ...
4
votes
1answer
2k views

order of group of points of secp256k1

points on curve secp256k1 form a group E(Fp) over field Fp. p = 2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1 is prime. n is the order of group E, n=...
6
votes
3answers
1k views

How do you derive the lambda and beta values for endomorphism on the secp256k1 curve?

You can see a little background about this on this bitcointalk post by the late Hal Finney. Beta and lambda are the values on the secp256k1 curve where: λ^3 (mod N) = 1 β^3 (mod P) = 1 As seen ...
1
vote
2answers
208 views

What sort of tasks can an ASIC be developed to do?

I know requiring a lot of memory is one thing that makes an algorithm ASIC resist. Are there any others? Could an ASIC be developed to do Elliptic Curve Crypto? Like adding two points, or signing a ...
4
votes
1answer
429 views

What are the weakest cryptographic guarantees in Bitcoin?

I read in this Github pull that Bitcoin relies on weaker cryptographic guarantees than SHA256. What are the weaker cryptographic guarantees being referred to? Could it be that RipeMD is 160 bits? ......
52
votes
2answers
29k views

What does the curve used in Bitcoin, secp256k1, look like?

I'm reading up on ECC curves and on many of them I see an illustration that looks like this What does the comparable curve in Bitcoin look like, or are all curves generally the same?
2
votes
2answers
2k views

Does the 256-bit integer secret exponent define the X, Y pair?

I'm trying to understand better how bitcoin works and I'm stuck. I've read a blog showing how to construct the WIF from the 256-bit secret integer and up to that point, I think I follow. However I'm "...
2
votes
1answer
267 views

Can secp256k1 be implemented efficiently on a 8-bit processor and very limited RAM?

We are trying to build a much simpler version of Trezor. We do have an finished PCB design from a previous project and would like to know whether this design can be modified, without changing the ...
5
votes
2answers
4k views

Is this the proper way to use Bouncy Castle to generate a Bitcoin compatible key?

I'd like to use Bouncy Castle to generate the keypair for use with all *coin variants. Is this the correct implementation to get the correct ECC curve that the *coin variants use? Org....
6
votes
1answer
1k views

Where and how is secp256k1 used within Bitcoin?

Bitcoin is unique that is uses secp256k1 to secure it's transactions; and any cryptographic attack against this algorithm is probably going to be percieved as an attack against the bitcoin network. ...