Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [p2sh]

The tag has no usage guidance.

0
votes
1answer
69 views

P2SH-P2WPKH - has always segwit UTXOs?

I've been reading a lot of docs on BTC transaction structure, and find it really confusing when it comes to SegWit story. So, the very first thing is, if I've P2SH-P2WPKH address, does it mean that ...
1
vote
1answer
76 views

Converting Litecoin M-addresses to a more commonly accepted format

Is there any way to convert an (LTC) M prefix address to an L prefix address? Many services an apps that accept and transfer LTC reject M-addresses as invalid, even though they are given out by ...
1
vote
0answers
49 views

How verify p2sh spending transaction signature using public key with btcsuite?

I'm trying to verify inputs signatures in Go using Verify Signature script of package btcec. Decoding this p2sh spending transaction rawSpendingTxd := ...
0
votes
1answer
27 views

Manually create a transaction to spend the output of a P2SH tx

I want to manually create a transaction to spend the output of a P2SH tx, but I don't know where the redeem script should be placed in the new transaction? I followed an online tutorial Building a ...
1
vote
1answer
57 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> &...
0
votes
1answer
31 views

Retrieve money back from wrong prefix address

Normally, p2pkh address is generate by Base58(Prefix+ PublicKeyHash + Checksum), and prefix is set 0x00. What if by accidently, prefix is set 0x05, then the address prefix becomes 3, which becomes ...
1
vote
2answers
81 views

Testnet Bitcoin wallet: which script in hash addresses?

Why does the Testnet Wallet create receiving addresses in the form of script hash addresses (prefix 2) instead of "plain" m/n-prefixed addresses? Is there any security reason? And, which script does ...
0
votes
1answer
48 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 ...
0
votes
1answer
50 views

Error when sending transaction: “Signature is found in scriptCode”

I'm trying to send transaction with scriptSig: OP_PUSHDATA<Sig> OP_PUSHDATA<Data1> OP_PUSHDATA<Data2> OP_PUSHDATA<Data3> OP_PUSHDATA<RedeemScript> But I get error: ...
0
votes
1answer
66 views

Sending P2SH transaction with non-standard script

I'm trying to send transaction with script: ScriptSig: OP_PUSHDATA<Sig> OP_PUSHDATA<Data1> OP_PUSHDATA<Data2> OP_PUSHDATA<Data3> OP_PUSHDATA<RedeemScript> Since the ...
0
votes
1answer
58 views

ScriptSig raw hex to sign raw tx

i have a p2sh address that is created using an uncompressed public key (from my ledger nano) and a compressed public key (bitcoincore wallet). It requires both signatures to send the funds. When i use ...
0
votes
3answers
169 views

What is Witness and what data does it contain?

I've learned about the Segregated Witness but couldn't find info on braking it apart. I know usually when legacy addresses are used the public keys for example will be under Scriptig. With P2SH, I ...
0
votes
1answer
45 views

How to find out addressHeader p2shHeader

I am trying to find out the location or a method (may be) for addressHeader and p2shHeader parameter for any altcoin. The following list contains these 2 parameters for few coins but I am unable to ...
1
vote
2answers
49 views

How nodes verify if the hash on a P2SH output is from a valid script?

I understand how the validation works if someone wants to spend coins from a multisig address. But what if the receiver makes a mistake and provides an invalid script hash to the sender? Is there ...
0
votes
3answers
212 views

Ledger Nono S (ledgerjs) signP2SHTransaction is Producing Invalid Signature

I was receiving Errors while using signatures produced by signP2SHTransaction function of @ledgerhq/hw-app-btc. So I created a script using bitcore-lib to cross check it against the signature produced ...
2
votes
2answers
94 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 ...
1
vote
4answers
142 views

How is it possible that the same WIF Private Key generates two different addresses?

I am wondering if you can explain this. I went here: https://coinb.in/#newSegWit Created the SegWit Address below: 3ASaGJ8h2bLn6Jha3hncBzXUKRCLyfv9bk RedeemScript ...
2
votes
2answers
78 views

When you pay from a P2SH address, does its change go into a P2SH address too?

Because that means you must always keep the redeem script around to make the change addresses, and if it's a multisignature script, then you'll need to have the script with those public keys around, ...
7
votes
1answer
111 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 ...
0
votes
1answer
219 views

How to spend an UTXO P2SH pay-to-script-hash

Anyone knows specific instructions on how to claim an unspent P2SH TX (pay-to-script-hash) based on a redeem script? No multisig. I am looking for node.js JS instructions in bitcore-lib or similar. ...
1
vote
1answer
337 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?...
0
votes
2answers
165 views

P2SH signature verification in python

I am trying to understand and verify P2SH script by writing a python code to parse real transaction in blockchain. I have chosen below Transaction randomly. TxID: ...
2
votes
2answers
334 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. ...
4
votes
1answer
83 views

Why is my P2SH sigScript field prepended with 0x00?

I created a P2SH transaction and signed it using coinb.in. The sigScript field for this transaction is: da 00 47 3044 0220 ...
5
votes
2answers
490 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 ...
1
vote
2answers
464 views

What redeem script is used in bitcoin core wallet when generate the address?

I'm trying to generate the address 38DGj87axzmQiZeAd1w1y5FEmuu5a7pfBa in my bitcoin core wallet with code. First, I dump the private key from the address, then I calculate the address from the ...
2
votes
1answer
276 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 ...
0
votes
1answer
103 views

Can you create a valid p2sh transaction with the redeem script in the scriptsig alone?

From my understanding, for a p2sh transaction to be valid the redeem script must hash to the same value as the output script being used to fund the transaction. So can't you just put the redeem ...
1
vote
1answer
149 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 ...
1
vote
2answers
677 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?
0
votes
3answers
605 views

Bitcoin-tx sign/redeem p2sh transaction (Unable to sign input, invalid stack size (possibly missing key))

I'm seeking help in redeeming a p2sh transaction using the standard tools from bitcoin core, e.g., bitcoin-cli or using directly the RPC commands via curl would also be fine. Creating the P2SH ...
4
votes
4answers
212 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 ...
1
vote
1answer
137 views

segwit nested in p2sh

I understand that P2SH addresses are used to allow "segwit unaware" wallets to create outputs spendable by segwit wallets (please correct me if I got something wrong). For new clients I think I got it:...
0
votes
1answer
207 views

Why is not Bech32 address selected as default in Bitcoin Core 0.16.0?

So, thankfully Bitcoin Core 0.16.0 came to us, general people. But however, native segwit address Bech32 wasn't selected as default. Is not it better to use a Bech32 address right away rather than ...
1
vote
1answer
39 views

Can I use opcodes traditionally used for verifying keys to verify payment sizes?

Can I use binary opcodes usually used for verifying keys to verify payment sizes? It looks like these opcodes like OP_EQUALVERIFY and OP_NUMEQUALVERIFY are used for checking signatures or keys, ...
0
votes
1answer
51 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
48 views

anyonecanspend final condition of a script can be spotted just by looking at the script hash, without the redeem data?

Consider the following scenario. Alice, Carol and Bob create and fund a script with the following rules: if now, alice pubkey, bob pubkey else if now+500 blocks, bob pubkey, carol pubkey else if now+...
0
votes
1answer
145 views

funding and spending a “no-multisig/no segwit” P2SH tx

I got inspired by this thread: Single signature P2SH redeem script Assume I want to "hide" my address as long as can be. So I want a P2SH tx, which only shows a redeemscript (hash of my pubkey) on ...
1
vote
1answer
534 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 ...
1
vote
1answer
375 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 ...
3
votes
1answer
357 views

How to quickly find the private key from Segwit P2SH address?

I have a very large list of Segwit addresses for bitcoin, starting with '3' and do not know the corresponding legacy '1' address for them. How can I quickly find the corresponding legacy address to ...
3
votes
1answer
1k 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-...
12
votes
2answers
3k views

How do bech32 addresses compare to P2SH addresses in transaction size?

Bech32 (starts with bc1) and P2SH (starts with 3) can both be used for segwit transactions. I know bech32 is supposed to create smaller transactions, but I'd like to know how much smaller (than P2SH). ...
0
votes
1answer
267 views

P2SH-P2WPKH private key or revert to P2WPKH

Is there a way to get the private key out of an P2SH-P2WPKH address, using Bitcoin Core 0.15.1? If not, is there a way to get the origin P2WPKH address to get the private key out of this address?
1
vote
1answer
140 views

Access my wallet using a 16 digit passphrase

I had a wallet years ago on a PC I sold. I mined bitcoin on it and what not. Recently I found a 16 digit passphrase I wrote down for my wallet. That is all I have and probably all I needed. If I only ...
2
votes
1answer
120 views

how to spend an utxo when the corresponding scriptsig is longer than 256 bytes?

I am trying to spend an utxo sent to a p2sh address. The scriptsig (including the redeem script) is longer than 256 bytes. When the transaction is serialized there is only one byte to indicate the ...
0
votes
1answer
401 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
1k 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?
2
votes
1answer
363 views

How to properly backup a address with private key after 'addwitnessaddress' command

I've received my balance to my addresss that starts with 3 which is after 'addwitnessaddress' command. I'd like to know that how do I properly backup my balance to keep safety. Bitcoin Core has a ...