38
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 ...
36
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 ...
35
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.
...
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), ...
22
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 ...
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 ...
20
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 ...
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 ...
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/...
13
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 ...
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 ...
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 ...
12
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 ...
12
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:
...
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 ...
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 ...
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, ...
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 ...
10
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.
...
10
votes
Accepted
Why do compressed and uncompressed public keys have to produce different addresses?
My question is: Why cant you just uncompress the compressed public key (effectively making it an uncompressed public key) and then derive the address. That way even if you use the compressed key, ...
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 ...
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-...
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 ...
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 ...
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 ...
8
votes
Is a P2TR address a compressed public key?
SEC encoded public keys are either:
Uncompressed 65-byte encoding: 0x04 + [32-byte X coordinate] + [32-byte Y coordinate]
Compressed 33-byte encoding:
0x02 + [32-byte X coordinate] (if Y coordinate ...
7
votes
What is the difference between your address and your public keys
cited:
A Bitcoin address is a 160-bit hash of the public portion of a public/private ECDSA keypair.
a picture may make it easier to understand how an address is generated from a public key;
Image ...
7
votes
Why is it not possible to get the private key out of the public key?
Mathematicians like their analogies, sometimes those analogies can be helpful, but they can equally be confusing, particularly to those new to a field.
In mathematics a "group" consists of a ...
7
votes
Accepted
Is a P2TR address a compressed public key?
Pay to Taproot uses x-only pubkeys.
In Bitcoin, a private key d is a scalar, and its corresponding public key Q is the elliptic curve point found by multiplying d with the generator G of secp256k1: Q =...
6
votes
Why can't we switch private and public keys?
No.
Your private key can be decoded/reversed to reveal your public key. Public keys can not be reversed to reveal the private key. If you share your private key they have EVERYTHING.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
public-key × 508private-key × 205
address × 101
wallet × 62
bitcoin-core × 51
transactions × 51
ecdsa × 44
bip32-hd-wallets × 42
address-generation × 40
secp256k1 × 35
signature × 34
blockchain × 26
hash × 23
cryptography × 23
script × 21
xpub × 19
multi-signature × 18
electrum × 17
security × 16
python × 16
bitcoind × 13
transaction-verification × 9
encryption × 9
base58 × 9
mnemonic-seed × 8