2022 Developer Survey is open! Take survey.
35 votes
Accepted

Why does hashing public keys not actually provide any quantum resistance?

Although hashing a public key by itself does provide quantum resistance, this is really only when it is considered by itself in a vacuum. Unfortunately, public key hashes do not exist in a vacuum and ...
user avatar
  • 60.6k
35 votes
Accepted

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

How I understood 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. That's correct. Now my first question, is G ...
user avatar
33 votes
Accepted

What are the potential attacks against ECDSA that would be possible if we used raw public keys as addresses?

The theory It is assumed that in order to forge an ECDSA signature you need to compute the private key for a given public key first (this operation is known as the "discrete logarithm" (DL), ...
user avatar
32 votes

Key derivation in HD wallets using the extended private key vs hardened derivation

There's a lot of confusion here, mostly bits and pieces of the whole scheme that is Hierarchical Deterministic derivation, and finally two questions that seem to indicate missing some point about it. ...
user avatar
  • 1,794
21 votes
Accepted

How would one "Encrypt" a message using a Bitcoin *public key* and use its private key to decrypt it?

Yes, this is possible. However, I want to upfront state that this is not advisable for multiple reasons: Bitcoin keys are intended to be single use for privacy reasons, and leveraging them for ...
user avatar
20 votes

Why do you use Bitcoin addresses instead of public keys?

Yes, you could send bitcoins directly to the public key: in fact, both Pay-to-PubKey (P2PK) and Pay-to-PubKey-Hash (P2PKH) were introduced in the first Bitcoin release. IIRC, P2PK is still used for ...
user avatar
  • 62.5k
15 votes

Why do you use Bitcoin addresses instead of public keys?

As @Murch correctly pointed out it is indeed possible to send bitcoin to either a public key or to the hash of a public key. The original motivation for using hashes of public keys was to shorten the ...
user avatar
14 votes

Is it possible to get the public key of a bitcoin address I do not have the private keys for with the standard client?

To be honest, it IS possible, but you need a signature made by that address. From that point, you can get the public key. See this piece of code: https://github.com/bitcoinjs/bitcoinjs-message/blob/...
user avatar
14 votes
Accepted

What are the DER signature and SEC format

DER The Distinguished Encoding Rules (DER) format is used to encode ECDSA signatures in Bitcoin. An ECDSA signature is generated using a private key and a hash of the signed message. It consists of ...
user avatar
  • 62.5k
13 votes
Accepted

What makes an extended public or private key?

The extended public key contains just a bit more information than the public key and chaincode, but the public key and chaincode are all that matter for key derivation. The rest is just metadata about ...
user avatar
  • 60.6k
12 votes

Is it possible to get the public key of a bitcoin address I do not have the private keys for with the standard client?

It is impossible. Given an ECDSA (compressed 65Bytes or not 33Bytes) public-key K, a Bitcoin address is generated using the cryptographic hash functions SHA-256 and RIPEMD-160. The public-key is ...
user avatar
  • 1,101
12 votes
Accepted

Can private keys remain offline for their entire life?

Yes, all three assumptions are correct. You can with some effort keep your private keys offline for their entire life. A description of how to sign transactions offline is found here: How to sign a ...
user avatar
  • 62.5k
12 votes
Accepted

On public keys compression, why an even or odd y coordinate corresponds to the positive / negative sign respectively?

There is no such thing as a negative or a positive value when you're talking in a finite field. For example, in Z7, the field of integers modulo 7. There holds: 0 = 7 = 14 = -7 1 = 8 = 15 = -6 2 = 9 ...
user avatar
11 votes

What is relation between scriptSig and scriptPubKey?

I had the same question as well and spent forever trying to understand it and finally cracked it. "The sender (A) only has the Bitcoin Address of the recipient (B), so how does he get the pubKeyHash ...
user avatar
11 votes

All Bitcoin Public Keys with non-zero balance

You can't get a database of all such public keys, but you can get some of them. An address, as you know, is a hash of a public key. When somebody sends coins to an address, you can think of the ...
user avatar
11 votes
Accepted

How do I get my public address in Bitcoin Core?

Edit: Answer to the question: How to get private keys out of Bitcoin Core After you found your addresses (by using the commands I listed below, for example) you can execute the folllowing command: ...
user avatar
  • 353
11 votes
Accepted

difference between Master Public/private Key and Public/private Key?

With "Master public key" you probably refer to deterministic key derivation after bip32. The correct term is "Master extended private key" (acronym xpriv) and "Master extended public key" (acronym ...
user avatar
11 votes
Accepted

What are the chances of getting duplicate wallet using bitcoinlib in python3?

When you create a private key, this process is (or at least should be) completely random - meaning that in theory, the probability of creating some specific private key is 1/N where N is the number of ...
user avatar
  • 336
11 votes
Accepted

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

No, there is not one private key. There is one Master private key. The master private key is then used to generate more private keys in a deterministic fashion, i.e. using the same master private key, ...
user avatar
  • 60.6k
10 votes
Accepted

How to uncompress a public key?

Points are decompressed by solving for y in the equation used for secp256k1's elliptic curve where x is the last 32 bytes of your public key. The equation is y^2 = x^3 + 7. You will get 2 possible y ...
user avatar
  • 60.6k
9 votes

How does ScriptPubKey know the public key of an Bitcoin address?

Addresses are really just shorthands for particular scripts. The standard address type (starting with a '1' on mainnet) does in fact correspond to the exact type of script you gave above. If you ...
user avatar
9 votes

Does the private key of Bitcoin change everytime the address changes?

You have many private keys Quintessentially, a wallet is a key chain for your private keys plus optional convenience and usability functions. When you create a wallet, at least one but usually lots ...
user avatar
  • 62.5k
9 votes

How to get the Public Keys of a bitcoin User

You cannot compute the public key of an address (that is not yours), because the address is computed from the hash of the public key. You can find the public key of your own address with the Bitcoin-...
user avatar
  • 245
9 votes

How does a wallet get the public key from an address?

Perhaps you're confused by the phrasing "the wallet", as it's only the receiver's wallet who needs to know the public key, and he has it, because he created the address in the first place. In what ...
user avatar
8 votes
Accepted

Why can't we switch private and public keys?

The ECDSA signature algorithm used by Bitcoin doesn't have symmetry between its private and public keys. If you read about how the algorithm works, they aren't even the same type of mathematical ...
user avatar
8 votes

Does the private key of Bitcoin change everytime the address changes?

If you are posting different questions I suggest, posting them up in different threads. But I'll try to answer all of them. 1) It doesn't work like that. Every address is a pair (private key, public ...
user avatar
  • 344
8 votes

How do I convert Public Key x value to y in Python and verify?

First, you need to understand what the two formats actually are. The first is the compressed SEC format and the second is the uncompressed SEC format. The difference between the two is that the ...
user avatar
  • 7,619
7 votes

How can I convert a bitcoin public key to a bitcoin address?

There is a step-by-step tutorial on the Bitcoin Wiki for converting Keys. For testing there is a very good website, where you can put in a private or public key and its show you the result of any ...
user avatar
7 votes
Accepted

Why does bitcoin use public keys as pseudonyms?

More accurately, the pseudonyms most commonly used are addresses, which are derived from public keys (not the longer public keys themselves). In order for Bitcoin's idea to work, you must have coins ...
user avatar
  • 4,327
7 votes
Accepted

About performing SHA-256 hashing on the public key

The result you are getting (3251...) is the result of sha256 on the string 0450.... The expected output on bitcoin.it is the result of sha256 on the bytes that are currently hex-encoded. To resolve ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible