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
4 votes
1 answer
222 views

How is this transaction valid?

Transaction in question: 16ac7736552c5791cff5643e6104c76c24018236b2193e014b308efea4f32f81 The P2SH input has a strange redeem script: OP_DUP OP_HASH160 OP_PUSHBYTES_20 ...
Vojtěch Strnad's user avatar
0 votes
0 answers
63 views

How to spend P2WSH address with full redem script and witness program?

I just put few dollar in here. Bech32 Address: bc1qx6c07u2s6pu6d5ede8ee9hmynahp9edgg764cm58gfxmryk3ryqsxarnnv Witness Script Hex 76a914b1217062623d9101426f61593cb1abc3e44ed00488ac Witness Script Asm ...
Tepan's user avatar
  • 1
2 votes
1 answer
355 views

What is the purpose of P2WPKH-P2SH?

When I ask the google what is the purpose of P2WPKH nested in P2SH, it says the following: This allows the user to send funds to a SegWit (Segregated Witness) address using a non-SegWit transaction, ...
dassd's user avatar
  • 1,029
0 votes
1 answer
77 views

Script evaluated without error but finished with a false/empty top stack element (Electrum gives error)

My raw Transaction ...
Tepan's user avatar
  • 1
0 votes
1 answer
74 views

HOW TO SPEND P2SH with Redeem Script Hex?, Already make the transaction but still have some error

I HAVE ERROR "scriptsig-not-pushonly" on this ...
Tepan's user avatar
  • 1
1 vote
1 answer
159 views

Native P2WSH over P2SH | P2SH-P2WSH

I'm in the process of attempting to generate a transaction using the Python Bitcoin Utils library. that involves P2WSH-over-P2SH (P2SH-P2WSH). My activity is on the regtest network. Below is the code ...
Deepanshu's user avatar
2 votes
1 answer
108 views

How can I spend a mix of UTXOs (p2sh, p2wpkh, p2wsh) along with a p2tr UTXO?

I'm constructing a script to spend multiple distinct UTXOs in a single transaction. I've successfully combined all UTXOs except for two. Succeeding in spending a P2TR with P2PKH UTXO. I encountered a ...
Mohsen Haydari's user avatar
2 votes
1 answer
319 views

How to build a transaction using bitcoinjs-lib

I'm trying to build a transaction using bitcoinjs-lib. Here is my last transaction. https://blockstream.info/api/tx/91feea5f5c7b67b3e56c0f5d23d6da3065855c23b4cc7dded8efd8ff8065500f { "weight&...
Berry Blue's user avatar
1 vote
1 answer
198 views

Transaction keep beeing rejected "non-mandatory-script-verify-flag"

I'm developping Bitcoin integration for Microsoft Dynamics Business Central to offer enterprise capability to apply Bitcoin receivable and payable to accounting. To send a transaction, I'm using ...
Maxime CATY's user avatar
4 votes
1 answer
198 views

How can I create a simple P2SH transaction in regtest?

I'm running bitcoind in the regtest mode on my computer. I need at least one transaction that spends a P2SH output in my local blockchain. Is there a way to create a P2SH transaction using bitcoin-cli?...
Amir reza Riahi's user avatar
0 votes
0 answers
79 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(...
bitcoinluvr6969's user avatar
2 votes
1 answer
185 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 ...
Tom's user avatar
  • 43
0 votes
0 answers
110 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****************************************...
notarobot's user avatar
2 votes
1 answer
112 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 ...
Peter's user avatar
  • 115
0 votes
1 answer
100 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 ...
Peter's user avatar
  • 115
2 votes
1 answer
236 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 ...
Raza's user avatar
  • 121
5 votes
1 answer
97 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 ...
Mercedes's user avatar
  • 797
0 votes
1 answer
345 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 (...
just.callme.client's user avatar
1 vote
1 answer
49 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?
Alec Matusis's user avatar
6 votes
1 answer
323 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" ...
bca-0353f40e's user avatar
  • 1,014
0 votes
1 answer
112 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 ...
Cannabijoy's user avatar
0 votes
1 answer
79 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 ...
bca-0353f40e's user avatar
  • 1,014
0 votes
1 answer
45 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 ...
Bitcoin_1o1's user avatar
1 vote
1 answer
111 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 ...
Jeff Trimmer's user avatar
1 vote
1 answer
115 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 ...
GoekhanDev's user avatar
0 votes
1 answer
84 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 ...
leslie's user avatar
  • 52
0 votes
1 answer
174 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
207 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 ...
Jamo's user avatar
  • 157
6 votes
1 answer
393 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 ...
Matthias's user avatar
1 vote
1 answer
79 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 ...
obfuscated's user avatar
1 vote
0 answers
301 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-...
DesertTraveller's user avatar
0 votes
1 answer
134 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 ...
T. Rossi's user avatar
  • 133
2 votes
1 answer
125 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 ...
bitcash complex's user avatar
2 votes
1 answer
104 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 ...
cc1cc1's user avatar
  • 21
0 votes
1 answer
273 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 ...
KHJUAF403456ZS3K564WAEF's user avatar
0 votes
1 answer
53 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 ...
KHJUAF403456ZS3K564WAEF's user avatar
0 votes
1 answer
212 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 ...
Ankit's user avatar
  • 29
0 votes
2 answers
149 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": "...
Antoni's user avatar
  • 277
0 votes
1 answer
110 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 ...
daisy's user avatar
  • 107
0 votes
1 answer
229 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 ...
amirreza karimi's user avatar
1 vote
2 answers
162 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 ...
inder128's user avatar
0 votes
1 answer
139 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 - ...
Keijyu's user avatar
  • 95
3 votes
1 answer
231 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 ...
Mercedes's user avatar
  • 797
2 votes
2 answers
121 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 ...
Mercedes's user avatar
  • 797
0 votes
0 answers
401 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 ...
amint's user avatar
  • 1
4 votes
2 answers
1k 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,...
Michael Folkson's user avatar
0 votes
0 answers
235 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 = "...
Lakshitha Kanchana's user avatar
6 votes
2 answers
677 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.
Bertram Lund's user avatar
2 votes
1 answer
218 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?
MCCCS's user avatar
  • 10.1k
2 votes
1 answer
95 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&...
Tony Sanak's user avatar
  • 1,664

1
2 3 4 5