Stack Exchange Network

Stack Exchange network consists of 175 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
0answers
24 views

Pass Multiple addresses in redeem p2sh script

I have the following code const script = this.app.env.bitcoin.script.compile([ hashOpcode, Buffer.from(secretHash, "hex"), this.app.env.bitcoin.opcodes.OP_EQUALVERIFY, Buffer.from(...
1
vote
1answer
96 views

Multisig scripts hashing (p2sh): difference between legacy and segwit

Some time ago I noticed that, given the same inputs, addmultisigaddress and createmultisig Bitcoin core's methods were generating different p2sh (addresses). I asked around and a user from the ...
2
votes
2answers
145 views

How can one see if an address is multisig?

Some addresses on this page indicate whether the address is a multisig, and what the threshold signature scheme is. How do they detect this?
0
votes
1answer
38 views

Can payment from a P2SH address provide change to itself?

In the gavinandresen Multisig Test test, could change have been redirected to the originating 3QJmV3qfvL9SuYo34YihAf3sRCW3qSinyC P2SH address for the multisig payments? In Mastering Bitcoin by ...
0
votes
1answer
40 views

How to verify signature of multisig transaction

How to verify signature of multisig transaction (2-2) after it being signed by first owner? How can I understand if that owner used wrong private key => wrong signature?
0
votes
2answers
29 views

Public Addresses: '3' vs '1' in front [Bitcoin]

I just wanted to confirm, is it true that for a bitcoin (public) address it should always have a '1' in front of it. For certain transactions though I see that there is a '3' in front. How is this ...
0
votes
0answers
32 views

Bitcore ZCash addresses conversion to t-address

I have an issue while creating simple zcash address: I am using the following network params: const bc = require("bitcore-lib") const zcashNetwork = { name: 'livenet', alias: 'mainnet', ... }; ...
0
votes
1answer
42 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, ...
0
votes
1answer
23 views

Destination address(es) when redeeming an HTLC

Starting from this text at https://en.bitcoin.it/wiki/Script: "The script for a typical Bitcoin transfer to destination Bitcoin address D simply encumbers future spending of the bitcoins with two ...
1
vote
2answers
99 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
1answer
82 views

How do I know that my Ledger HW Wallet is using receive addresses for my wallet and not another remote wallet?

I'm a paranoid newb, I bought a hardware wallet (Ledger nanos) and have transferred funds to it. I noticed that it generates P2SH addresses, so how could I know if the script hashed is spendable by my ...
0
votes
1answer
167 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-...
1
vote
1answer
137 views

bitcoinj java library not decoding input addresses for some transactions

I'm trying to "extract" sender's addresses from OP_RETURN Bitcoin transactions, but my code is not working properly. getWalletAddressOfSender(final Transaction tx) public static Address ...
1
vote
1answer
48 views

Security implications of removing CHECKSIG in a test

If I conduct an htlc transaction on testnet that does not include OP_CHECKSIG will it still cost an attacker more than (say) $10 in processing power or storage to subvert my tests? Details: I'm ...
0
votes
1answer
105 views

Is P2SH-wrapped P2PKH possible?

There is a known form of address that called P2SH-wrapped P2PKH, wrapping SegWit address as Base58 (P2SH) address. Thinking about such address type, I come up with the question: Is P2SH-wrapped P2PKH ...
1
vote
1answer
40 views

Verification of untypical scriptSig

I want to be able to redeem a P2SH output with a script doing a multisig but also additional checks. The scriptSig to redeem this output thus has to provide enough signatures, as well as some specific ...
1
vote
1answer
173 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
862 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 ...
0
votes
1answer
128 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
91 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
38 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
142 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
122 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
96 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
139 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
88 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
834 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
83 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
81 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
321 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
120 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
225 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
163 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
178 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
410 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
728 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
246 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
516 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
104 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 ...
7
votes
2answers
1k 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
801 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 ...
3
votes
1answer
364 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
141 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
222 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 ...
2
votes
2answers
1k 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
919 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
279 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
170 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
252 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 ...