Questions tagged [p2pkh]

Pay-to-PubKey-Hash is the standard format for making payments on the Bitcoin network.

81 questions
66
votes
3 answers

How to calculate transaction size before sending (Legacy Non-Segwit - P2PKH/P2SH)

I know that I pay the transaction fee per kB, so how can I calculate how large the transaction will be before I send it via the RPC api. I run a site using bitcoins, and I cannot let the user's balance go negative, so I need to know if they have…
macintosh264
  • 761
  • 1
  • 6
  • 3
30
votes
1 answer

What is P2PK, P2PKH, P2SH, P2WPKH - ELI5

Explain like I'm 5 years old and my other half of the brain is surgically removed :) I don't want to put a lot of stress on my brain Also what is the difference between BTC held in P2SH and Unspent P2SH Output…
user380208
  • 613
  • 1
  • 6
  • 11
20
votes
2 answers

Why do you use Bitcoin addresses instead of public keys?

Why do you hash the public key twice? Are there security benefits to abstracting away from the public key? Is it because the address can represent multiple things? I'm missing something. Could you theoretically send bitcoins directly to the public…
ihtkwot
  • 331
  • 2
  • 6
16
votes
3 answers

Why is P2PKH used instead of the simpler P2PK?

If elliptic curve cryptography is secure enough to be able to give away a public key without fear of anyone being able to calculate our private key from it, what's the reason for hashing our public key for use in P2PKH? In other words, what's the…
inersha
  • 2,928
  • 1
  • 17
  • 41
12
votes
2 answers

Bech32 conversion to legacy P2PKH?

Electrum now generates Bech32 addresses for SegWit wallets. Example: bc1qnntcclssmtuvfw2te7q49lzvw67cfvpzxger4j Pubkey: 023f1b3421c6ae0c1758834d40806c2418194b507be261fa343a0636653f3ec75b If I search for that Bech32 address on btc.com, I get…
Jonathan Cross
  • 1,410
  • 10
  • 30
7
votes
2 answers

How OP_EQUALVERIFY works in a standard transaction?

3 weeks ago I began learning about Bitcoins, and now I'm analyzing how it works internally. My problem is that I can't understand what two public key hashes are compare to use de OP_EQUALVERIFY, because I understand that sender's public key is…
Zanetti
  • 81
  • 1
  • 3
7
votes
1 answer

How is Public Key extracted from (message, digital signature, address)

I'm under the impression that a public key is revealed when you sign a message. Given these 3 inputs. P2PKH Address, Digital Signature, Message. Is the public key exposed? If so, how do you extract the public key from these 3 inputs? Also, I'm still…
Michael Tidwell
  • 472
  • 2
  • 11
7
votes
1 answer

How big is the input of a P2PKH transaction?

How many bytes does a P2PKH input have? I'm finding a few different numbers: Why does the default miner implementation use pay-to-pubkey? states: push + sig + push + key = 1 + 72 + 1 + 61 = 139 Princeton Bitcoin Book states [p.123]: The…
Murch
  • 71,155
  • 33
  • 180
  • 600
6
votes
2 answers

How did pay-to-pubkey hash come about? What is its history?

We know that early blocks all used pay-to-pubkey (p2pk) and at some point, we mostly switched to pay-to-pubkey-hash (p2pkh). What is the history behind this? Who made the changes and when did p2pkh become standard? Also, does this have anything to…
Jimmy Song
  • 7,709
  • 16
  • 35
6
votes
1 answer

What is the largest multisig quorum currently possible?

Bitcoin script allows for a UTXO to be (un)encumbered by an N-of-N signature. When N is 1, this is referred to as a single signature. What are the limits of N for this application? What is the technical cause of this limitation? Is it blockspace?…
Matthias
  • 61
  • 3
5
votes
2 answers

Is it possible to convert an address from p2pkh to p2sh?

Is it possible to convert a p2pkh address to a p2sh address? Also, will the balance of the p2pkh address carry over to the p2sh address?
John
  • 383
  • 2
  • 10
4
votes
1 answer

How to generate legacy receiving address in Bitcoin core 0.19.x.x

I must have missed the memo. I see Bitcoin Core 19.1.0.1 defaults to generating Bech32 receive addresses (prefixed with "bc1"), and offers a checkmark to generate P2SH addresses instead (prefixed with "3"). But if I want to generate the legacy…
rkagerer
  • 163
  • 1
  • 6
4
votes
4 answers

Why bother checking both public key and signature in P2PKH transactions?

In a P2PKH pubkey script, first, the public key provided by the intended spender is verified to be correct and then this key is used to verify the spender's signature. I wonder why just verifying the public key is not enough. The pubkey script…
cadaniluk
  • 143
  • 4
4
votes
4 answers

Why doesn't address contain a full scriptPubKey?

This is a general question, but let's suppose a P2PKH transaction. P2PKH address starts with "1" and the sender incorporates it into the scriptPubKey as: OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG Why does an address contain only…
tsusanka
  • 357
  • 3
  • 7
4
votes
1 answer

Trying to understand Pay-to-Public-Key-Hash

I am new to bitcoin and I am trying to understand Pay-to-Public-Key-Hash (P2PKH) from the book: Mastering Bitcoin: Unlocking Digital Cryptocurrencies (p. 127). I understand that digital keys (which are derived from private-keys) are not actually…
Node.JS
  • 143
  • 3
1
2 3 4 5 6