Questions tagged [p2sh]

Pay to Script Hash is a transaction output format that allows you to lock funds to the execution of arbitrary scripts. It was defined in BIP0016.

Filter by
Sorted by
Tagged with
60
votes
3answers
68k views

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 ...
3
votes
4answers
2k views

Electrum 2.0: non-BIP39/32 standardisation complicates matters immensely. Why?

Electrum 2.0 has been causing me some frustration, insofar as it seems to be a non-standard implementation of BIP32/BIP39 (HD wallets, mnemonic seed, respectively). The wallet in question is a 2of2 ...
5
votes
1answer
807 views

Pay to Script Hash Execution

Combining the spending transaction scriptSig and funding transaction scriptPubKey, we get: <OP_0> <sig A> <sig C> <redeemScript> <OP_HASH160> <redeemScriptHash> &...
1
vote
1answer
2k views

How to get legacy address and private key from Segwit P2SH address?

I have a Segwit P2SH address (starting with 3...) with the corresponding private key and need to obtain the legacy address (starting with 1...) and the private key. Is this possible?
5
votes
1answer
1k views

What is meant by “relaxed standards” for P2SH redeem scripts in Bitcoin Core 0.10.0?

From the Bitcoin Core 0.10.0 release notes: Standard script rules relaxed for P2SH addresses The IsStandard() rules have been almost completely removed for P2SH redemption scripts, allowing ...
6
votes
3answers
1k views

What are the implications of BIP 12 vs BIP 16 and OP_CODEHASHCHECK?

There is a discussion about two different Bitcoin Improvement Proposals - BIP 12 and BIP 16, and probably only one of them is going to be included in Bitcoin 0.6 (miners will decided which by a ...
2
votes
2answers
157 views

Hard time distinguishing change and withdraw amount for P2SH address

I am trying to extract the exact amount of BTC deposited and withdrawn from BTC address (from hardware wallets like Trezor, ledger nano, ...). So if the address is pay-to-pubkey-hash then I can easily ...
8
votes
1answer
7k views

Difference between a SegWit address and a P2SH address

Let there be an address 3ABCDEFGHJKDJHDH.... How can I understand if it's a SegWit address or a MultiSig address?
5
votes
2answers
2k views

P2SH address decoding

What is the process of decoding the P2SH address? We have this information so far. Let's run through an example tx bea1e7ae7ecdc502215717f30d62a12085bb2866d8db730dfb626b60c337534c The hex script (...
4
votes
1answer
1k views

Redeem script for segwit addresses

How does one derive the Redeem Script for the new Pay-to-Witness Pubkey Hash addresses? With existing P2SH it's revealed after providing N number of Public Keys through a createmultisig function in ...
4
votes
1answer
669 views

Clarification of BIP32 hierarchical deterministic multisig scripts

As everyone is aware, I'm a huge proponent of Vitalik Buterin's pybitcointools Python 2.7/3.x library. I am having a some trouble understanding the BIP32 concepts, which are coded in the deterministic/...
7
votes
1answer
533 views

Does OP_HASH160 consume the top stack element?

In a standard P2PKH configuration, the scripts look like: Pubkey script: OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG Signature script: <sig> <pubkey> When redeeming ...
10
votes
1answer
3k views

What is an explanation of the P2SH voting in layman's terms?

Reading this question and looking in the bitcointalk forums at the related discussion, there seems to be some kind of miner vote being done on whether a change will be implemented in the bitcoin ...
8
votes
2answers
233 views

How can one know which way mining pools will vote for P2SH?

Is there a list somewhere showing how each mining pool will vote on the P2SH question? and If a pool says that it is voting one way, is it possible to independently verify that they are indeed ...
8
votes
2answers
2k views

What the difference between old segwit (3) and new segwit address (bc)?

i'm not that kind of person who understands cryptography and math, can you tell me simply the main purpose of new segwit address? are transactions fee the same for new segwit (bc1)? instead of "Old ...
7
votes
1answer
237 views

What's the use of not relaying non-standard transactions if anyone can still use them using P2SH?

It seems that non-standard transactions are not normally relayed because there is a concern this might break the network or it might make future upgrades harder. But anyone can use these non-standard ...
2
votes
1answer
254 views

How is the P2SH address obtained in decodescript

Im trying to understand how to obtain the p2SH address when decoding an output script. r.push_back(Pair("p2sh", CBitcoinAddress(CScriptID(script)).ToString())); source As far as I understand ...
1
vote
1answer
1k views

How to generate a native Segwit address and P2SH Segwit address from a standard WIF?

Can I have the steps to generate a native Segwit address from a standard WIF? And the steps to generate a P2SH Segwit address from the same WIF? How do these two formats differ and why are there two?...
1
vote
1answer
120 views

Create an arbitrary script with two locktimes and p2sh

Alice, Bob and Carol create a p2sh address that initially requires 3/3 signatures. After some time (lock1 using OP_CHECKLOCKTIMEVERIFY) only Alice and Carol can spend and Bob is permanently forgot. ...
1
vote
1answer
747 views

Single signature P2SH redeem script

How would one go about creating a single signature P2SH transaction? (Analogous to a "2 of 3 multisig P2SH" but instead I'm asking about a "1 of 1".) Would one wrap a standard P2PKH scriptPubKey ...
5
votes
1answer
384 views

Where the P2SH script gets written?

I understand that when I'm doing a transaction, I'm locking those bitcoins to whoever provide the solution to a script that has the hash I posted. But, where does the hash get written? I would ...
4
votes
1answer
468 views

How does a P2SH script get executed?

I'm trying to visualize how a typical P2SH script gets executed, as I realize that it's a special form of script that gets executed slightly differently to a standard script. Before P2SH: Before ...
4
votes
1answer
2k views

Step by step example to redeem a P2SH output required

I have been following BIP16 in creating a P2SH transaction. I want to create a simple (one signature) P2SH. I am getting an error when trying to broadcast the tx. Error is 16: mandatory-script-verify-...
2
votes
1answer
380 views

Storing scripts (smart contracts) outside the blockchain

I'm following "Mastering Bitcoin" from Andreas Antonopoulos in order to understande the Bitcoin implementation. In the chapter about transactions, he points some advantages of P2SH transactions: ...
1
vote
1answer
118 views

Does P2SH unlocking script only consist of operants?

I have a question about the P2SH unlocking script. Can I put common operants and operators in the P2SH unlocking script? And if yes, how can I create such script? e.g. unlocing script: <sig1> &...
1
vote
1answer
282 views

When and where to add extra information when signing P2SH raw transaction?

This post is quite long so in summary: I'm wondering where I can add extra information when signing a raw transaction (in this case a cleartext of a digest). I'm also wondering if Missing inputs (code ...
0
votes
1answer
579 views

How do I spend a non-standard P2SH transaction

I was sent a P2SH puzzle address. I have solved the puzzle, which is to say I have created a script that matches the hash, and I know what to put on the stack before the script. Sadly, what I am ...
0
votes
1answer
288 views

with what number do multisig addresses (non-P2SH) start?

I have never seen a n-m address implemented as multisig (not P2SH). What number does it start with (i.e., regular addresses start with 1, p2sh start with 3 ...) ? In other words, where do they fit ...