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
1
vote
0answers
10 views

P2SH address as a product of public keys

Assuming the multisig 2 of 3, if I do have extended public keys (xpub) for all 3 cosigners (with proper derivations), can I somewhat get the result address (P2SH)? How to calculate the "script&...
3
votes
1answer
140 views

Bitcoin-qt getnewaddress returns address starting with 2

I am expecting it starts with '3' the the results below: getnewaddress "" "p2sh-segwit" 2NFcKJTPZs1syYhwaBkXty6Vt6FEKxD3HTC Is this because I am running on a private block chain?
2
votes
1answer
43 views

Transaction Puzzles, Awareness and Questions

I was just reading about the two following scenarios: My understanding is that we have two transactions here that don't follow the usual scriptSig/scriptPubKey situation, and I think transactions ...
0
votes
1answer
27 views

Pay to script hash address transaction not accepted by miners

I have fixed my initial transactions and have been able to send coins to a p2sh address Now I want to spend those coins but when I try to broadcast my transactions either the website (blockcypher) ...
0
votes
1answer
56 views

Invalid p2sh transaction accepted by the network

I have try to build a 2 of 2 p2sh transaction from scratch using the book "programming bitcoin" by Jimmy Song, we are not directly guided to make one of those so I had to modify some of the ...
1
vote
0answers
32 views

Calculating P2WKH nested in P2SH addr/redeem script hash from pubkey

My calculation of the hash160 doesn't seem to be correct - what are my sins? Tx spending the input: https://www.blockchain.com/btc/tx/d490cc0a5b9799e09b02dd4b20a6d7ca297c09c425983efc13b382f6023d0376 ...
0
votes
0answers
32 views

Bitcoin sigscript

Please see the image Anyone has idea why this signature script is too short? Is this only r value ? If yes then where is s value ? And what is witness 1
1
vote
1answer
27 views

How are p2sh address spent

So, I was looking into how P2SH transactions are working and by looking at different blog post and in particular to this answer, I have the following question. So, let's take the same transaction: ...
2
votes
2answers
69 views

How a new wallet knows balances locked in P2SH transactions?

If my old wallet created and submitted a P2SH TX to the blockchain, and I migrate to a completely different wallet, how can the new wallet detect that that UTXO belongs to me? Since the script is ...
0
votes
1answer
61 views

Three different HEX having same wallet address how possible?

HEX1: 1111111111111111111111111111111111111111111111111111111111111111 public key: ...
1
vote
1answer
26 views

Read the “value” being redeemed in a Bitcoin P2SH Script

Is there any way for a Bitcoin P2SH Script to read the amount of Satoshis being redeemed?
2
votes
1answer
61 views

Are P2SH transactions with disabled opcodes relayed/mined?

Many OPCODES like OP_AND, OP_CAT, OP_SUBSTR are disabled as described in https://en.bitcoin.it/wiki/Script. Although, with Bitcoin Core 0.10.0 Gavin Andresen proposed "any Script" in P2SH ...
1
vote
1answer
46 views

Is the `addmultisignature` API call dependent on order of public keys in the array? Or is it lexicographically sorted?

Say Alice and Bob are part of a partnership business that accepts Bitcoin. They store all their main funds in cold storage until the end of 3 months, when they cash out and use a new address. This ...
0
votes
2answers
73 views

Clarifications on hd multisig wallet

I need clarification on multisig hd wallets. Let's imagine we have a 2/3 multisig. The first key is generated by the user on a mobile wallet, the second is kept on a server while the third is off-line ...
0
votes
0answers
36 views

How to SignRawTransaction from p2sh with bitcoinj?

Looking for demo to signrawtransaction from p2sh with bitcoinj!!! This is bitcoinj code: org.bitcoinj.core.Transaction public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script ...
2
votes
1answer
193 views

What happens if a P2SH redeem script is lost?

Assume Bob creates a complicated Bitcoin Script and asks Alice to make a payment to a hash of this script. (Using a P2SH transaction) If Bob loses the script (i.e. the source code of the script), is ...
0
votes
0answers
22 views

Nbitcoin: The redeem provided does not match the scriptPubKey of the coin

Trying to spend litecoin from a p2sh address, i get this error when trying to convert utxos to scriptcoin. var add1 = "MP3RwwmVDoHw3h25uKHn8PLA8DhjaZtooQ"; var fromadd = BitcoinAddress....
0
votes
1answer
66 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 ...
0
votes
1answer
54 views

Bitcoin script verification fails after certain time period

So I want to write a bitcoin script so that after a certain time period (say for example after 30 mins), the verification fails and transaction is marked invalid even if it gets broadcasted. Time ...
1
vote
1answer
63 views

how to find p2sh/p2wsh in utxo set after wallet recovery

i'm trying to understand how wallets remember a redeem script for p2sh/p2wsh for spending, after recovering from their seed, because the utxo set only has the hash in it, right? there are a nearly ...
2
votes
0answers
21 views

Ypub test vectors missing for mainnet

Following extended key derivation scheme in BIP49 is there a publicly available test vector repository for mainnet? The test vectors in https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki#...
0
votes
1answer
122 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": "...
2
votes
1answer
65 views

What is the link between address and use of the UTXO?

I state that I'm still a beginner. I need some clarification. I am using the Testnet. This is the information regarding the address I used to receive funds from a Faucet bitcoin-cli validateaddress ...
0
votes
1answer
62 views

difference between signing a message and signing a p2sh

can i use the sign message function to sign the serialized hex for a p2sh transaction? Are the ecdsa functions used the same or are they different? It looks like the output is in a different format ...
1
vote
0answers
39 views

When did BIP16 pass the 550/1000 threshold?

BIP16 says on 01 Feb 2012, if more than 550 out of the previous 1000 blocks include "/P2SH/" in the coinbase, then BIP16 will activate on 15 Feb 2012 (Source). BIP16 was later revised. On 15 Mar 2012,...
0
votes
0answers
73 views

Generate p2sh-segwit and address bech32

When I use bitcoin-cli getnewaddress "" "p2sh-segwit" which kind of script is inside And can I convert if in bech32?
1
vote
1answer
129 views

How to Verify P2SH Signature

I am trying to debug an issue where i believe i might have a bad signature but i am trying to figure out how to approach it. What is this a signature of. Private key + what (redeem script? entire raw ...
1
vote
1answer
100 views

Old p2sh address not signing correctly on core v0.17

https://pastebin.com/kdQPkELN if anyone can see why i am getting a 16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)failure.... It is a p2sh ...
0
votes
1answer
125 views

Standardness rules related to BIP 16 (P2SH)

I can read in BIP0016 wiki the P2SH Specification Transactions that redeem these pay-to-script outpoints are only considered standard if the serialized script - also referred to as the ...
2
votes
2answers
123 views

P2SH non-segwit and no multi-sig

I have a P2SH no segwit address (regtest) I create the redeem script with SHA256 and RIPEMD160 of my public key and prepend 0x0014 ---------- Redeem Script --------- ...
0
votes
1answer
86 views

Create Custom script from bitcoind

I'm able to create multisig with bitcoin-cli with addmultisigaddress bitcoin-cli addmultisigaddress 2 '["'$ADDR_MITT_1'","'$ADDR_MITT_2'","'$ADDR_MITT_3'"]' But How can I add extra OP like CLTV or ...
3
votes
1answer
126 views

Sign P2SH transaction with Openssl

I have an P2SH 1-3 and I want to use openssl to sign a transaction. my redem script is ...
0
votes
1answer
360 views

Segwit with Multisig

I was analyzing a Bitcoin transaction that works both with Segwit and non-Segwit for multisig Scripts. Here is the transaction: https://www.blockchain.com/en/btc/tx/...
2
votes
1answer
46 views

why is my p2sh raw transaction not being mined or erroring ERROR: 64: NON-MANDATORY-SCRIPT-VERIFY-FLAG (EXTRA ITEMS LEFT ON STACK AFTER EXECUTION?

I created this 2-of-2 multi-signature address for testnet following the instructions on the book Programming Bitcoin. I tried to spend the funds in this address following the standard forms (...
2
votes
1answer
95 views

Create Custom Script with 2-3

I'm studying P2SH, and I want to create a custom script. I already created one tx but without OP_CHECKMULITISIG as you can check at this link https://tbtc.bitaps.com/...
4
votes
1answer
397 views

How is OP_CHECKTEMPLATEVERIFY a scaling solution

I was wondering about OP_CHECKTEMPLATEVERIFY or OP_SECURETHEBAG as it was previously called. As far as I understand it you can commit on how to spend the coins later this way. But it doesn't enable ...
0
votes
1answer
122 views

spend from p2sh with bitcoinj

i am try to spend the coins on a p2sh first, i generate p2sh and send coins to that p2sh ECKey clientKey = new ECKey(); ECKey serverKey = new ECKey(); ECKey thirdPartyKey = new ECKey(); List<...
1
vote
2answers
733 views

Non SegWit P2SH bytes structure

I'm working on a bitcoin block explorer in golang, in which I'd like to gather as much informations as possible about transactions. I am able to extract addresses from every type of output, and mostly ...
1
vote
0answers
47 views

Is possible extract the original script P2MS from the transaction locked with the P2SH address?

This is a stupid question because if the P2SH contains the hash160 (and the hash160 contains the sha256) of the P2MS doesn't possible return to the original hex P2MS. So, but for verifying the P2SH I ...
0
votes
0answers
215 views

How to use “OP_CHECKSEQUENCEVERIFY” in regtest?

I have created a P2sh includes OP_CHECKSEQUENCEVERIFY and funded the same. I was trying to redeem the coins. But i could not understand the working of OP_CHECKSEQUENCEVERIFY. Below is the example ...
1
vote
0answers
83 views

(P2WSH-nestedin-P2SH) Problem in solving question 1+5=6

this is my first question at this platform. this matter has scratched my head badly, please pay patient to read my question. i am trying to move traditional p2sh tx into p2wsh-nestedin-p2sh tx and ...
1
vote
1answer
155 views

Clarification on the script P2SH, how is executed to Bitcoin core?

This question is a continuation of the my post yesterday. Today I have a question on P2SH execution so, an example of the script should be this OP_0 <A Signature> <B Signature> OP_2 <...
0
votes
0answers
69 views

Create P2SH address is not same as address saved on rpc node

I have a private key and trying to create P2SH address on testnet like my node created but they're not same. Please help me a bit, thanks so much. PrivateKey: ...
1
vote
1answer
315 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
53 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
87 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
83 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
40 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
442 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 ...
3
votes
2answers
615 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?