Questions tagged [p2pkh]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
47 views

I cannot broadcast my raw tx (P2PKH) on testnet: Signature must be zero for failed CHECK(MULTI)SIG operation

I am trying to broadcast my transaction on the test network with no success so far. I get always this error: sendrawtransaction RPC error: {"code":-26,"message":"mandatory-...
Dot Brian's user avatar
1 vote
1 answer
109 views

Creating a P2PKH address

I have been learning about how P2PKH addresses are generated so I thought I would try and work through one myself manually. I start with the following public key hash: ...
user2334659's user avatar
5 votes
1 answer
292 views

How can I cheaply consolidate P2PKH outputs?

I have thousands of UTXOs that were created for experimental purposes back in 2016, programmatically, using P2PKH transactions, each generating hundreds of 10K-ish sat outputs. Since these are now ...
nakwa's user avatar
  • 153
2 votes
1 answer
173 views

Certain spent P2PKH outputs give error: Non-canonical DER signature

Certain rare spent P2PKH outputs give error: Non-canonical DER signature when I try to verify the spent output using both btcdeb (version 5.0.24) and bitcoinconsensus (version 0.20.2, using Rust ...
Alec Matusis's user avatar
3 votes
1 answer
149 views

Stuck dissecting a P2PKH Bitcoin transaction, what am I doing wrong?

I'm attempting to dissect a P2PKH transaction based on guidance from Rene Pickhardt's video (link). At around the 2:54 minute mark, he calculates the Bitcoin Address from the input. I'm interested in ...
ifuensan's user avatar
0 votes
1 answer
59 views

Do we pay cheaper fees for less security in P2TR rather than P2PKH?

Answer quote: P2TR now is a spiritual successor of P2PK: it locks funds directly to a key and only requires a signature to spend the funds. If P2TR UTXOs are guarded by Schnorr signatures and P2PKH ...
Mercedes's user avatar
  • 802
0 votes
0 answers
73 views

How to spend P2WSH address with full redem script and witness program?

I just put few dollar in here. Bech32 Address: bc1qx6c07u2s6pu6d5ede8ee9hmynahp9edgg764cm58gfxmryk3ryqsxarnnv Witness Script Hex 76a914b1217062623d9101426f61593cb1abc3e44ed00488ac Witness Script Asm ...
Tepan's user avatar
  • 3
0 votes
1 answer
258 views

How to use the base58 in c++

its been a while after i done with my python bitcoin miner And i realize that python is slower to do mining stuff, so i decided to rebuild it in c++ as you guys know c++ the faster than other ...
just.callme.client's user avatar
0 votes
0 answers
52 views

How do I create an p2pkh raw transaction using the latest Bitcoin core version? Any help? Thanks

Like the title says I need of help here, how can I create an p2pkh raw transaction using the latest version of Bitcoin core is it even possible? What are the required fields do I need to use the ...
davonte lawrence's user avatar
-1 votes
1 answer
36 views

Hi so I'm currently trying to spend an p2pkh utxo, how do create the raw transaction on Bitcoin core, how do I write it? What information do I need?

https://photos.app.goo.gl/nQMgbBqwyJYvNm516 https://photos.app.goo.gl/3B1KynyQdkB8EA9M9 Need help on to create this p2pkh transaction how is the data written where do write the script pubkey and the ...
davonte lawrence's user avatar
2 votes
1 answer
75 views

What is prepended to the front of a ScriptSig and ScriptPubKey of a P2PKH transction?

In some educational materials on bitcoin P2PKH transactions, I'll see 2 digits included in the front of what would be considered the ScriptSig. For example, what is the 8b in the front of the ...
jiamijiang's user avatar
-1 votes
1 answer
56 views

In bitcoin core can ScriptToUniv give us wallet address of public key?

a few days ago I created a PR https://github.com/bitcoin/bitcoin/pull/27546 where I proposed ScriptToUniv can give us wallet address of public key But some guy commented "Concept NACK Sorry, no. ...
saffi Khan's user avatar
2 votes
1 answer
115 views

Create offline bitcoin tx for p2pkh address in a user-friendly way?

You created vanity p2pkh-addresses in the past, you have access to the private keys (WIF) and addresses (1...). Now you want to spend the funds securely and in an offline way (you do not want to ...
hodddl's user avatar
  • 101
1 vote
1 answer
140 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 ...
Lepus Cyberneticus's user avatar
2 votes
1 answer
328 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: (...
Poseidon's user avatar
  • 693
3 votes
1 answer
354 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 ...
Raza's user avatar
  • 131
2 votes
3 answers
297 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 ...
Poseidon's user avatar
  • 693
1 vote
1 answer
79 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 ...
user138015's user avatar
0 votes
1 answer
137 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 ...
Cannabijoy's user avatar
1 vote
2 answers
169 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> <...
Jamo's user avatar
  • 167
6 votes
1 answer
436 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 ...
Matthias's user avatar
3 votes
1 answer
132 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 ...
bitcash complex's user avatar
3 votes
1 answer
599 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 ...
madhurkant's user avatar
4 votes
2 answers
241 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 ...
yzernik's user avatar
  • 223
0 votes
1 answer
586 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 ...
user6668201's user avatar
3 votes
1 answer
278 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 ...
Mercedes's user avatar
  • 802
2 votes
2 answers
123 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 ...
Mercedes's user avatar
  • 802
3 votes
1 answer
429 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 ...
monke's user avatar
  • 45
1 vote
1 answer
501 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 ...
csstudent1418's user avatar
0 votes
0 answers
74 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/...
poke's user avatar
  • 1
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?
s k's user avatar
  • 175
0 votes
1 answer
674 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?
Geremia's user avatar
  • 4,626
2 votes
1 answer
419 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 ...
yoyobigmanyo's user avatar
1 vote
1 answer
256 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 ...
user3776738's user avatar
2 votes
1 answer
336 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 – ...
monkeyUser's user avatar
2 votes
1 answer
78 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 ...
Andrej Mitrović's user avatar
2 votes
1 answer
112 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 ...
Francis's user avatar
  • 23
1 vote
0 answers
49 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 ...
Kyle's user avatar
  • 166
3 votes
3 answers
1k 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 ...
hodddl's user avatar
  • 101
1 vote
1 answer
196 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 ...
Pedro's user avatar
  • 743
1 vote
1 answer
549 views

Decodescript for a Testnet pubkey hash address

This is the address information: bitcoin-cli validateaddress n35oDVMPNkHRzBKy7q9RDB7r5e8qbVa9SW { "isvalid": true, "address": "n35oDVMPNkHRzBKy7q9RDB7r5e8qbVa9SW", "scriptPubKey": "...
MaXbeMan's user avatar
  • 125
0 votes
1 answer
530 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": "...
MaXbeMan's user avatar
  • 125
2 votes
2 answers
164 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 ...
Flux's user avatar
  • 163
4 votes
1 answer
3k 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 ...
rkagerer's user avatar
  • 163
3 votes
1 answer
888 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 ...
Anshu Jalan's user avatar
1 vote
0 answers
62 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 ...
Darius's user avatar
  • 789
0 votes
1 answer
284 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 ...
Shubham Saxena's user avatar
2 votes
2 answers
3k 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 ...
fon's user avatar
  • 77
2 votes
0 answers
57 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 ...
monkeyUser's user avatar
0 votes
1 answer
459 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, ...
newbie's user avatar
  • 85