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
0
votes
1answer
26 views

How bitcoin browsers check P2PK and P2SH balance?

Suppose someone sends bitcoins to me using P2PK, I only enter my address starting with 1 in the bitcoin browser, can i get results? my public key hash doesn't appear in either UTXO, only one UTXO has ...
0
votes
1answer
24 views

How Bitcoin browsers update balance of an address?

Suppose i have a Bitcoin address for the first time and Alice sends me 1 Bitcoin using P2SH. As far as I know, Bitcoin browsers will scan the entire blockchain. In this case, my public key is not ...
0
votes
1answer
49 views

Parsing P2SH address from output script

I have already looked at link. I am trying to generate P2SH address from output script but no luck. I am using transaction 40eee3ae1760e3a8532263678cdf64569e6ad06abc133af64f735e52562bccc8 for testing ...
0
votes
2answers
22 views

non-mandatory-script-verify-flag (unknown error) with a script that runs ok in btcdeb

after learning a lot about script (and playing with them on the testnet) i made a way longer script. $ btc decodescript 7455886f94935688789352885279935b88946e935b88945187 { "asm": "...
0
votes
1answer
32 views

Hiding data in OP_RETURN statement?

I'm reading this article, and quote The blockchain transaction’s OP_RETURN data can be decrypted using AES-256 GCM to provide a backup command and control domain name How did someone able to ...
0
votes
0answers
38 views

Can i recover missed phrase on p2sh wallet?

i have a wallet from past with p2sh format ,also i know my private key but i just lost 4 character of that,i tried few apps to recover that but no one works(they work on another wallets prefectly),i ...
0
votes
0answers
19 views

Non-mandatory-script-verify-flag (unknown error)

I am trying to learn how scripts are working. In a testnet i got some scripts working and learned a lot about what not to do. But now I am struggeling getting this to work. Originaly I worked with a ...
1
vote
2answers
48 views

What if I change PubKeyHash in scriptPubKey of a transaction to my PubKeyHash?

Suppose a person A makes a transaction to person B and sends it to bitcoin network. Suppose I changed PubKeyHash in scriptPubKey of a transaction to my PubKeyHash and send it to bitcoin network. The ...
0
votes
1answer
32 views

P2SH-Multisig transaction not going through

I have some funds locked in a testnet P2SH address which requires 2-of-3 signatures. This is the address: 2NEKRqUqoDtsELzpBa5wuWEiJeVbio5cSa2 and the 3 keys: #1 - ...
3
votes
1answer
118 views

Why P2SH seems to be never smaller than 34 characters, unlike P2PKH?

Why base58 of P2SH invoice address seems to be never smaller than 34 characters; unlike base58 of P2PKH invoice address, in which 33 characters is very common? Bitcoin wiki tells (format and emphasis ...
2
votes
2answers
99 views

tracking invoice address type migration

I'd love to see charts with stats on percent of utxos by invoice address type (specially P2PKH, P2SH, P2SH-P2WPKH, P2WPKH, P2TR), over time; and same for percent of coin supply. No doubt I can pay a ...
0
votes
0answers
131 views

How do you Derive Addresses from a BIP49 Master Public Key using P2WPKH-P2SH?

I am trying to derive addresses from a master public key (aka extended public key) in python. I don't fully understand the math behind the key derivation, but have been able to decode the master ...
1
vote
1answer
90 views

What are the scriptPubKey, scriptSig, redeem script and witness for the various output types?

scriptPubKey, redeem script, witness script, witness program are defined in this StackExchange post. What are the scriptPubKey, scriptSig, redeem script and witness for the various output types (P2PKH,...
0
votes
0answers
60 views

Generate P2SH bitcoin address from WIF in BitcoinJ Java

I'm trying to create P2SH-Segwit bitcoin address from the WIF private key. I'm using the BitcoinJ library in Java. See the following code. String base58PrivateKeyString = "...
4
votes
2answers
315 views

Why are P2WSH addresses larger than P2SH addresses?

One would, perhaps naively, assume that both addresses are hashes of scripts and therefore ought to be the same size.
2
votes
1answer
74 views

How to spend from a custom P2SH script using bitcore-lib

My Javascript/typescript project uses bitcore-lib. It uses Script.buildScriptHashOut to build custom P2SH outputs. How do I spend from this custom output?
1
vote
0answers
35 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
186 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
100 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
68 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
85 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
118 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
55 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
95 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
143 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
110 views

Three different HEX having same wallet address how possible?

HEX1: 1111111111111111111111111111111111111111111111111111111111111111 public key: ...
1
vote
1answer
36 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
86 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
59 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
125 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 ...
2
votes
1answer
235 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
1answer
111 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 ...
1
vote
1answer
106 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
106 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
28 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
262 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
89 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
88 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
42 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
128 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
222 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
129 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
188 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
181 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 --------- ...
3
votes
1answer
163 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 ...
1
vote
1answer
574 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
57 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 (...
3
votes
1answer
125 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/...
5
votes
1answer
610 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
198 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<...