Questions tagged [p2pkh]
Pay-to-PubKey-Hash is the standard format for making payments on the Bitcoin network.
55
questions
0
votes
1answer
25 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?
0
votes
0answers
72 views
How to write a pay-to-pubkey-Hash script in python?
How do i write a pay-to-pubkey-Hash script in python that show the stack in this order?
OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG
How do I use The cryptographic algorithms used in OP_HASH160 and ...
2
votes
1answer
39 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 ...
0
votes
1answer
53 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
1answer
70 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
1answer
34 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
1answer
66 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
0answers
22 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 ...
2
votes
2answers
163 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
1answer
54 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
1answer
109 views
Decodescript for a Testnet pubkey hash address
This is the address information:
bitcoin-cli validateaddress n35oDVMPNkHRzBKy7q9RDB7r5e8qbVa9SW
{
"isvalid": true,
"address": "n35oDVMPNkHRzBKy7q9RDB7r5e8qbVa9SW",
"scriptPubKey": "...
0
votes
1answer
101 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": "...
0
votes
1answer
43 views
Why can't P2PKH's scriptPubKey be shortened to only OP_CHECKSIG?
For P2PKH, the scripPubKey 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 ...
0
votes
1answer
609 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 ...
2
votes
1answer
256 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
0answers
45 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
1answer
112 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 ...
2
votes
1answer
711 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 ...
0
votes
1answer
545 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
0answers
32 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
1answer
147 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
2answers
118 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
2answers
277 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
1answer
751 views
convert “M” address to “3” address LTC
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
1answer
248 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 ...
4
votes
1answer
904 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
1answer
171 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 ...
2
votes
1answer
241 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:...
0
votes
2answers
453 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
1answer
131 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
1answer
219 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
1answer
156 views
Can I prove a double spend attempt with a signed tx with same input?
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 ...
0
votes
1answer
656 views
bitcoin public key vs public key hash vs. pub key [duplicate]
I am not talking about the privacy related concerns just the security aspect and the ability for someone to 'break my private key'.
The addresses that my wallet generates are p2pkh addresses. If i ...
2
votes
2answers
2k views
Bitcoin - Technical difference between P2PKH and P2SH address generation?
I was convinced that the only difference between the generation of addresses starting with '1' and '3' was simply changing the prefix added to the digest from 0x00 to 0x05 after the ripemd160 part.
...
5
votes
2answers
765 views
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 ...
3
votes
2answers
3k views
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?
1
vote
2answers
60 views
When you create a multisig address from existing addresses, do the funds move there?
If you have three addresses, lets say A, B and C and they each have 1 BTC. When you create a multisig address out of the three addresses, will it have a balance of 3 BTC or do you have to send the ...
4
votes
4answers
372 views
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 ...
15
votes
3answers
3k views
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 ...
0
votes
2answers
184 views
Why is this script invalid, and how can I generate valid public key/digital signature pairs?
Why does the default P2PKH transaction at http://bitcoin-script-debugger.visvirial.com/ return NULL rather than true? I haven't tried to swallow the gory details of OP_CHECKSIG yet, but everything ...
0
votes
1answer
130 views
P2SH in Hardware wallet?
I am designing a hardware wallet and the software that will work with it.
I plan to provide P2PKH transactions support in the software for hardware wallet to sign.
Is it mandatory to support P2SH ...
1
vote
1answer
772 views
Convert P2SH to P2PKH
I'm using btcrecover to recover a Ledger BIP39 backup seed that I wrote down but seems to be wrong. The tool only accepts P2PKH addresses and my account was created very recently in this kind of ...
4
votes
4answers
437 views
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 <PublicKeyHash> ...
10
votes
2answers
6k views
Bech32 conversion to legacy P2PKH?
Electrum now generates Bech32 addresses for SegWit wallets.
Example: bc1qnntcclssmtuvfw2te7q49lzvw67cfvpzxger4j
Pubkey: 023f1b3421c6ae0c1758834d40806c2418194b507be261fa343a0636653f3ec75b
If I ...
3
votes
3answers
838 views
How it is possible to validate existing Pay to Public Key Hash transaction without public key?
These are my understanding or assumptions.
Sign a document requires secret key and message only as below
SignDocument(secret key, message) => signature
And verification of signature requires ...
2
votes
1answer
126 views
How can blockchain.info show the output address of a transaction when the output address has never been used in any other transaction?
I've stumbled across a transition on blockchain.info where the output address was displayed even though the output address had never been used in any other transaction.
How can blockchain.info know ...
0
votes
1answer
413 views
Bitcoin P2PKH transaction - two questions
Trying to learn the basics of the bitcoin's standard transaction script here. For a transaction where Alice has sent coins to Bob, who is now trying to redeem them, we have the concatenated scriptSig ...
0
votes
3answers
87 views
OP_HASH160 pops the public key from stack after hashing it?
This guide https://bitcoin.org/en/developer-guide#p2pkh-script-validation mentions
"The operation executed next, OP_HASH160, pushes onto the stack a hash of the data currently on top of it—in this ...
2
votes
1answer
263 views
How does Bitcoin prevent replay-attacks? [duplicate]
How does Bitcoin prevent replay-attacks for P2PKH transactions?
As far as I understand, when a transaction is made to pay bitcoins to another account, the P2PKH script is used.
scriptPubKey: OP_DUP ...
1
vote
1answer
86 views
Inconsistency in pubkey hashes usage explanation
I am learning about blockchain and reading a lot of stuff, but one question bothers me for last few days.
So in docs they say that P2PKH transactions use hash of the public key instead of a public key ...