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
0 answers
61 views

How to extract p2sh from tx block

I'm trying to extract p2sh addresses from blocks and I am not doing something correctly. What I have tried is: def decodep2sh(self, redeemscript): sha256 = hashlib.sha256(bytes.fromhex(...
2 votes
1 answer
166 views

What was the first ever BIP 16 transaction? (Read: Not BIP 13)

I'm having a very difficult time finding the first-ever P2SH transaction on the blockchain. I do not have a query tool to answer this question myself, sadly. All internet searches result in this ...
  • 43
0 votes
0 answers
34 views

Spend from multiple P2SH addresses with Bitcoin Core

I have P2SH wallet keys from block io backup. The keys and the redeem script example: BIP32 Public Key: xpub661MyMwAqRbcGWq****************************************...
2 votes
1 answer
62 views

How come an `OP_3` P2SH redeem script is spendable?

I completed a round trip transaction with the redeem script hash: 31vFvEkyAb2iusbPip36H9rVt6pxExuaVR, whose redeem script is OP_3 (0x53) (yes I know not secure). I can understand OP_1 redeem script ...
  • 63
0 votes
1 answer
39 views

P2SH to P2PK transaction - mandatory-script-verify-flag-failed (Opcode missing or not understood) (error 26)

I am trying to spend a P2SH UTXO based on a redeem script that requires no signatures and simply needs the correct input to equal the OP_HASH160 digest in the corresponding P2SH locking script. My ...
  • 63
1 vote
1 answer
65 views

Bitcoin Exchange only sends funds to P2PKH and P2SH addresses, but my address is Bech32. What can I do to get that fund into my account?

This is the email that I've received from my exchange: There are three bitcoin address formats currently in use: P2PKH addresses which begin with the number 1. P2SH addresses starting with the ...
  • 111
5 votes
1 answer
62 views

Why wasn't P2SH-wrapped P2WPK added to any BIP?

Pieter Wuille wrote this: There is no such thing as P2WPK; the only valid witness v0 programs are P2WPKH (OP_0 + hash160 of pubkey) or P2WSH (OP_0 + sha256 of script). But I don't understand the ...
  • 637
0 votes
1 answer
68 views

how to hash a bitcoin address for transactions?

can someone tell me how bitcoin hash a btc address? when you try to hash it on this website, you will get the same result as down below Bitcoin Address : 1JKRgG4F7k1b7PbAhQ7heEuV5aTJDpK9TS Result (...
1 vote
1 answer
37 views

Are PubKeys from multisig scripts addresses?

Are PubKeys from multisig scripts addresses? I.e. are they ever HASH160'd and re-used as normal P2PKH addresses in the future transactions?
5 votes
1 answer
288 views

Did the P2SH BIP-0016 make some Bitcoin unspendable?

The P2SH feature currently in use was introduced to Bitcoin in 2012 with BIP-0016. It was successfully activated on 2012-04-01 with block 173805. The BIP turned a particular "hashlock" ...
0 votes
1 answer
60 views

Should an offline address generated from private key send funds to wallet?

I'm trying to use the python package python-bitcoinlib to send a timelock transaction on testnet. The github has two examples to create an address, and then use that address to send the bitcoin to ...
0 votes
1 answer
50 views

Why wrapping P2PK inside P2SH didn't catch on?

Call it a pay-to-public-key-script-hash (P2PKSH), like so: Locking script: OP_HASH160 OP_DATA_20 redeem_script OP_EQUAL Redeem script: OP_DATA_20 pubkey OP_CHECKSIG Unlocking script: <push ...
0 votes
1 answer
30 views

What determines if a descriptor can have ranges?

For example, an address for a simple P2SH script puzzle like x+5=6 will always be the same address, so my understanding is that should not be ranged. Where can I understand the general logic for ...
1 vote
1 answer
60 views

Is it possible to import a P2SH address as solvable with nonstandard type script?

I am trying to import a P2SH address as watch-only using the importmulti RPC command. I provide the scriptPubKey, timestamp, and redeemscript values. The value of scriptPubKey that I'm submitting is ...
0 votes
1 answer
54 views

How to Generate P2SH Address from XPUB Ledger

I'm trying to Generate unused receiving Addresses for a Segwit P2SH wallet in my Ledger. I tried https://pypi.org/project/bitcoinlib/ but without success, the addresses weren't right. This is from my ...
0 votes
0 answers
100 views

redeemScript/witnessScript does not match scriptPubKey for P2SH-P2WSH type transaction

I am trying to retrieve some money from my script which has been signed by three public keys. My final goal is Retrieve the unspent from the script by P2WSH Transaction BUT every time I am Geeting ...
  • 101
0 votes
1 answer
54 views

OP_SHA256 - Hashing the string representation

I'm building my own Bitcoin script interpreter for learning purposes. I've compared my results with https://siminchen.github.io/bitcoinIDE/build/editor.html And the script OP_16 OP_SHA256 which ...
  • 37
0 votes
1 answer
102 views

OP_HASH160: Computing script hash in a concrete P2SH transaction

I'm having troubles with understanding how script hash is computed in P2SH transactions. From BIP-16 documentation (https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki): scriptSig: [...
user avatar
1 vote
1 answer
78 views

Can The Redeem Script Consist Of Only 1 Public Key In P2SH Transactions:

I have a few questions relating to Bitcoin Signatures And P2SH: Why is P2SH used as opposed to other forms? Is it still prevalent today - has SegWit made it redundant or less useful, if not, what is ...
  • 157
5 votes
1 answer
318 views

What is the largest multisig quorum currently possible?

Bitcoin script allows for a UTXO to be (un)encumbered by an N-of-N signature. When N is 1, this is referred to as a single signature. What are the limits of N for this application? What is the ...
1 vote
1 answer
52 views

How can bitfinex send LTC to a Bitcoin address?

It's my fault. However, how come bitfinex doesn't guard against this error? Also how can it be possible? 32uxxMqwrpEKTDodF8BZkuRJGs8ruujoti is clearly not an LTC address. I am not even sure how the ...
1 vote
0 answers
144 views

Solution for P2SH non-standard derivation paths

Creating P2SH (Nested Segwit) addresses from an imported BECH32 (Native Segwit) XPUB, when running Bitcoin Core (pre-2020 software) wallet (as watch-only, with private keys disabled) can lead to non-...
0 votes
1 answer
107 views

p2sh addresses in elements

I'm building a script and have it's hex representation, then I convert it to a pubkey and address, which results in something like: 3NqNAUBEWarVjKerLcCnPrTGbaQ4QFcAfr or ...
  • 133
2 votes
1 answer
102 views

Why does SegWit implement new address formats?

I would consider myself quite up-to-par with the concept and in-depth functionalities of SegWit (segregated witness). I just don't understand one key aspect of it; P2SH and bech32 addresses. why on ...
2 votes
1 answer
82 views

Why does a script length of 254 need three bytes?

I'm looking at some raw txs (P2SH in that case) for learning, and I have one question about a particular tx: tx hash 0aeae24fa55544da49ba06ec338c9beee592ab4bea71eb8085908f377dd46084, i use this tool ...
  • 21
0 votes
1 answer
170 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
1 answer
48 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
1 answer
133 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 ...
  • 29
0 votes
2 answers
94 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": "...
  • 247
0 votes
1 answer
84 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 ...
  • 107
0 votes
1 answer
129 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 ...
1 vote
2 answers
133 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
1 answer
110 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 - ...
  • 75
3 votes
1 answer
169 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 ...
  • 637
2 votes
2 answers
112 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 ...
  • 637
0 votes
0 answers
302 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
2 votes
1 answer
676 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
0 answers
194 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 = "...
5 votes
2 answers
580 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
1 answer
166 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?
  • 10k
2 votes
1 answer
68 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&...
  • 1,646
3 votes
1 answer
206 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?
  • 175
2 votes
1 answer
187 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 ...
  • 320
0 votes
1 answer
99 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) ...
  • 2,548
0 votes
1 answer
108 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 ...
  • 2,548
1 vote
0 answers
241 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 ...
1 vote
1 answer
210 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
2 answers
207 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
1 answer
265 views

Three different HEX having same wallet address how possible?

HEX1: 1111111111111111111111111111111111111111111111111111111111111111 public key: ...
1 vote
1 answer
43 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?
  • 41

1
2 3 4 5