Questions tagged [p2sh]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Curiosity on P2PKH and P2PK [duplicate]

I have some question on the P2PKH and P2PK they are two methods for locking the output, is a correct definition? Why the P2Pkh was introduced inside the bitcoin? Also, the P2PKH is identified with the ...
1
vote
1answer
39 views

Hardened address generation with BIP44 watch-only wallet with xpub

I am puzzled by the hardened key derivation from a watch-only BIP44 wallet. Let me first explain what I am trying to do. I am implementing a 2-of-3 multisig scheme I am using Bcoin node and wallet ...
0
votes
1answer
24 views

How to build a p2sh who's scriptsig contains a Signature

I have created a P2SH address, funded it, and am attempting to move the funds with a TX. The redeemScript for the TX requires the TX signature (OP_CHECKSIGVERIFY), but in order to create this ...
0
votes
1answer
40 views

In practice, are redeemScripts commonly reused?

In regards to P2SH-P2WSH transactions, are Txout-script values identical between transactions? Is it reasonable to expect a business or vendor that accepts bitcoin to be using the same redeemScript ...
0
votes
0answers
23 views

Method to create P2SH address

I am trying to create a htlc smart contract manually by writing a script and finding the hex using the btcc compiler. Now node A has to create a transaction using that hex and lock money in that p2sh ...
0
votes
0answers
30 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
115 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
161 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
41 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
55 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
34 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
1answer
86 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
27 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
103 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
108 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
266 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
168 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
51 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
130 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
51 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
226 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
1k 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
168 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
101 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
165 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
136 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
111 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
157 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
100 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
1k 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
95 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
87 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
344 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
139 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
250 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
175 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
193 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
446 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
819 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
270 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
547 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
110 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
898 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
388 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
157 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
237 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?