Questions tagged [p2pkh]
Pay-to-PubKey-Hash is the standard format for making payments on the Bitcoin network.
76
questions
1
vote
1
answer
72
views
Is there a standard P2PKH?
I was implementing a small application that computes the bitcoin address starting from a private key (256-bit number). I am surprised about the lack of a single trustworthy reference to this, unlike ...
2
votes
1
answer
88
views
Having issues properly generating a p2pkh address in Rust code. (for research purposes not for real use)
I have followed the steps to generate a p2pkh compressed base58 address and am consistently checking it to find that I get an invalid checksum.
I am using this python code to check the address:
(...
1
vote
1
answer
65
views
Bitcoin Exchange only sends funds to P2PKH and P2SH addresses, but my address is Bech32. What can I do to get that fund into my account?
This is the email that I've received from my exchange:
There are three bitcoin address formats currently in use:
P2PKH addresses which begin with the number 1. P2SH addresses
starting with the ...
2
votes
3
answers
233
views
A question about the role of OP_DUP in the P2PK(H) transaction specification, and possibility of slightly smaller single address transactions
Original Thread: Why OP_DUP instead of providing the PubKey twice in P2PKH?
I am struggling to understand the logic in the most popular answer and my "reputation" is < 50 so I cannot ...
1
vote
1
answer
45
views
Please help me understand this P2PKH transaction
I'm trying to understand Pay-to-Pubkey-Hash transactions. I picked a random P2PKH transaction in a blockchain explorer: ab3f542ad5add941f8ba4282cebab0cca81266a83cab6b98ebb8ae730477a570
As far as I ...
0
votes
1
answer
61
views
Should an offline address generated from private key send funds to wallet?
I'm trying to use the python package python-bitcoinlib to send a timelock transaction on testnet. The github has two examples to create an address, and then use that address to send the bitcoin to ...
0
votes
0
answers
52
views
Convert pubkey to pubkeyhash with java
I need to get pubkeyhash of string pubkey. I try the following code with Bitcoinj :
public static String convertP2pkToP2pkh(String p2pk, NetworkParameters np) {
return LegacyAddress.fromKey(np, ...
1
vote
2
answers
121
views
When The Unlocking Script Is Created, Who Verifies The Script?
I am familiar with the many ways an unlocking script is created. But in this scenario, lets use P2PKH. When we generate the unlocking script (excuse the simplicity):
<dup> <hash160> <...
5
votes
1
answer
318
views
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 ...
2
votes
1
answer
102
views
Why does SegWit implement new address formats?
I would consider myself quite up-to-par with the concept and in-depth functionalities of SegWit (segregated witness).
I just don't understand one key aspect of it; P2SH and bech32 addresses.
why on ...
2
votes
1
answer
206
views
Creating a raw transaction from scratch/
I am currently learning bitcoin technology. So I came up around the term raw transaction. There are many tools to create a raw transaction but I want to do it all by myself.
My Idea is to write a raw ...
4
votes
2
answers
173
views
Is it possible to use a P2PKH output with a schnorr signature?
I know that Bitcoin has many different transaction output types (P2SH, P2WPKH, P2WSH, P2TR, etc).
And I know that P2PKH is an old transaction output type that has existed since before Segwit and ...
0
votes
1
answer
330
views
How to generate p2pkh ScriptPubKey for coinbase transaction
One part of coinbase transaction is p2pkh ScriptPubKey (according to the book i read). Coinbase transaction here refers to the first transaction in a block , not Coinbase software/company.
Suppose i ...
3
votes
1
answer
169
views
Why P2SH seems to be never smaller than 34 characters, unlike P2PKH?
Why base58 of P2SH invoice address seems to be never smaller than 34
characters; unlike base58 of P2PKH invoice address, in which 33 characters
is very common?
Bitcoin wiki tells (format and emphasis ...
2
votes
2
answers
112
views
tracking invoice address type migration
I'd love to see charts with stats on percent of utxos by invoice address type (specially P2PKH, P2SH, P2SH-P2WPKH, P2WPKH, P2TR), over time; and same for percent of coin supply.
No doubt I can pay a ...
3
votes
1
answer
247
views
Is there a way to convert a P2PKH address into P2TR?
As far as I understand, Taproot enhances privacy by allowing someone to only reveal a specific key path, which in my understanding means that it's fairly flexible - is it possible to construct a P2TR ...
1
vote
1
answer
366
views
Why OP_DUP instead of providing the PubKey twice in P2PKH?
We know that a P2PKH script looks as follows:
scriptPubKey: OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <Signature> <PubKey>
Since full nodes are maintaing ...
0
votes
0
answers
53
views
Trying to verify this P2PKH transaction
I am trying to understand the unlocking portion of the transactions inputs of this pay-to-public-key-hash transaction: https://www.blockchain.com/btc/tx/...
2
votes
2
answers
1k
views
Is - a valid bitcoin address character
I came across address like this s-272edf45031dd498e7b3ae89e11ff21b
In the Address with Balance List
Is the '-' a valid character?
0
votes
1
answer
485
views
Convert Electrum p2pkh wallet to p2wpkh one?
Is it possible, in Electrum, to convert a p2pkh wallet to a p2wpkh one, so I can use the Lightning network?
2
votes
1
answer
313
views
p2pkh vs. p2pk keeping public key private
I just got into learning Bitcoin programming through Jimmy Song's Programming Bitcoin.
Jimmy says that some of p2pkh's advantages over p2pk include:
a smaller ScriptPubKey
keeping one's public key ...
1
vote
1
answer
123
views
Ho do I generate the output script of a bitcoin transaction?
When I mean output script I mean the output script from step 11 from this question:
Redeeming a raw transaction step by step example required
Then the actual output script: 76 a9 14 ...
2
votes
1
answer
260
views
How Bitcoin decide which scriptPubKey use?
I'm studying Bitcoin protocol, and I'm able to create address by my bash script.
The addresses "P2PKH" and "P2PK" have the same procedure.
Compressed or uncompressed public key – ...
2
votes
1
answer
69
views
How is a locking script reliably detected as a P2PKH script?
I've taken this example from a p2pkh guide:
1976a9145fb0e9755a3424efd2ba0587d20b1e98ee29814a88ac
This is broken down into:
19 - byte length of the following unlocking script
76 - OP_DUP: Duplicates ...
2
votes
1
answer
103
views
Bitcoin's Liquid Network - Unable to Broadcast PSET P2PKH issuance transaction using go-elements
While working on go-elements I've been trying to expand on pset_test.go by implementing functions that broadcast different kinds of PSET transaction. Unfortunately I can't find many technical ...
1
vote
0
answers
41
views
Why does printing a scriptPubKey have an extra OP_PUSHBYTES_20? [duplicate]
I am building a P2PKH script pubkey in code, and the standard format is:
OP_DUP OP_HASH160 <PUBKEYHASH> OP_EQUALVERIFY OP_CHECKSIG
However, when I print it (I'm using the bitcoin Rust crate) it ...
3
votes
3
answers
678
views
How to move/sweep your Bitcoin Core bitcoins safely and air-gapped to your new fancy cold storage?
I have stored my bitcoins on Bitcoin Core in a few P2PKH addresses with many UTXOs. I would like to have a plan, how these bitcoins can be moved air-gapped to a more up-to-date setup (not discussed ...
0
votes
1
answer
157
views
Are P2PKH or P2SH transactions malleable?
BIP66 fixed one source of transaction malleability and segwit, to my understanding, fixed the rest of the sources. Yet, there are still many common types of non-segwit transactions in use, like P2PKH ...
1
vote
1
answer
445
views
Decodescript for a Testnet pubkey hash address
This is the address information:
bitcoin-cli validateaddress n35oDVMPNkHRzBKy7q9RDB7r5e8qbVa9SW
{
"isvalid": true,
"address": "n35oDVMPNkHRzBKy7q9RDB7r5e8qbVa9SW",
"scriptPubKey": "...
0
votes
1
answer
400
views
"scriptSig" for P2SH-P2WPKH
I'm not sure I understand the fields of my input. I have a P2SH address (Testnet). This is the input of my transaction:
"vin": [
{
"txid": "...
2
votes
2
answers
137
views
Why can't P2PKH's scriptPubKey be shortened to only OP_CHECKSIG?
For P2PKH, the scriptPubKey is OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG. Why can't it check the signature only? Why can't it be shortened to just one opcode — OP_CHECKSIG?
Why ...
4
votes
1
answer
2k
views
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 ...
3
votes
1
answer
768
views
Why is 'p2pkh:' prepended at the beginning of private key addresses in electrum?
I recently started a Blockchain course and came across the electrum software. While going through the list of wallet addresses and associated private keys I found that 'p2pkh' is placed at the start ...
1
vote
0
answers
55
views
How can I check my transaction signature is correct?
I have tried recreating the exact transaction from "Appendix B: Funding Transaction Test Vectors" from BOLT 3 from the Lightning RFCs. My transaction looks exactly the same when parsed, except my ...
0
votes
1
answer
204
views
Bitcoin Signature Verification
I am trying to implement the OP_CHECKSIG opcode of Bitcoin and verify whether a signature is valid or not. I have the signature that I recieve from the transaction data and the public key(the hex ...
3
votes
1
answer
2k
views
How does OP_CHECKSIG work
Hi I am learning bitcoin and learning how scripting works and how to use P2PKH. I was wondering how does OP_CHECKSIG work. I want to understand what is the data that the private key signs to create ...
2
votes
2
answers
2k
views
How do I extract the address from a scriptPubKey?
I am creating a block parser and just learned about Scripts in Bitcoin yesterday which is kind of confusing so far. I want to extract the addresses involved in each transaction. Right now, I am able ...
2
votes
0
answers
48
views
Script and DER in P2PKH
Im trying to figure out the script and DER
In P2PKH, the "first part (scriptsig)" push in stack (<sig><pubK>) because is it DER?
Instead the "second part (scriptPubKey)" you can map the ...
0
votes
1
answer
294
views
P2SH to LTC address with M
Are there anyone know how to convert P2SH address (like 34A5PyCvPJKYtHmj9jmKhGzBBwpGuAkZog) to MANDhrctLRAygo3dFckfWvEaWeQizSwWNK?
I tried to decode with Base58Check, then removed 05 and added 032, ...
2
votes
2
answers
191
views
If I was developing a Bitcoin wallet, should I support both legacy and compatibility addresses?
To receive funds, I was thinking of giving a user the option of displaying two QR codes:
Legacy - p2phk e.g. 1AKDDsfTh8uY4X3ppy1m7jw1fVMBSMkzjP
Compatibility - p2sh(p2wpkh) e.g. ...
0
votes
2
answers
423
views
how to get the sender's address in bitcoinj
I'm trying to modify the simple wallettemplate to get the sender's address in the transaction list. However since TransactionInput.getFromAddress() doesn't exist now and getConnectedOutput()....
0
votes
1
answer
1k
views
convert "M" address to "3" address LTC [closed]
currently im facing with 1 issue that i need to convert all my litecoin address in my fullnode to legacy address (prefix with "M"). Im know that we have a tool https://litecoin-project.github.io/p2sh-...
0
votes
1
answer
388
views
Is P2SH-wrapped P2PKH possible?
There is a known form of address that called P2SH-wrapped SegWit, wrapping SegWit address as Base58 (P2SH) address.
Thinking about such address type, I come up with the question: Is P2SH-wrapped P2PKH ...
6
votes
1
answer
2k
views
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 ...
0
votes
1
answer
299
views
Struggling to successfully broadcast a p2pkh transaction
I've been experimenting with sending bitcoin transactions with python for the past week. I successfully was able to send p2wpkh->ALL address types, p2sh-p2wpkh->ALL address types.
What I am ...
3
votes
1
answer
382
views
scriptcode, scriptsig, pubkeyscript confusion
I've been banging my head on a desk for a few days trying to understand the segwit protocol properly.
Another roadblock has thrown me off-guard and I am struggling to grasp the concept of "scriptCode:...
1
vote
2
answers
751
views
Checking signature only vs. P2PKH
It is clear to me why it's potentially unsafe to only use a check on == in scriptPubKey. For one, not verifying a signature in the redeem script means that someone could impersonate the redeemer. From ...
1
vote
1
answer
161
views
P2PKH - Sharing a wallet address does not reveal my pub key?
Is it technically correct to say that if I share my address with the network, nobody has access to my pubkey still?
But if I share a valid signature to a P2PKH UTXO, someone can derive my pubkey and ...
0
votes
1
answer
318
views
Access funds on legacy address related to segwit address from which I have private key
The situation
Hello. Our company running BTC pool. We've been mining BTC for a while and used segwit address 32Z3eXSPgxcHj2fnQy8d6dg66eVtZfxrBM as pool adress.
But when we finally found a first ...
1
vote
1
answer
182
views
Can I prove a double spend attempt with a signed tx with same input? [closed]
I am designing an cross-chain atomic swap in a custom blockchain - Protoblock. I think it can be done as long as Protoblock knows how to parse p2pkh bitcoin transactions. The critical part is being ...