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
1 answer
46 views

How is tapscript different than P2PKH using opcodes from a developer perspective?

I'm going to use ordinals as an example because they illustrate my question the most effectively. My understanding is that ordinals are created by writing opcodes into the transaction just like you ...
ChristianOConnor's user avatar
0 votes
1 answer
35 views

Error validating transaction: Transaction orphaned, missing reference (TESTNET)

RAWTRANSACTION HEX ...
Tepan's user avatar
  • 3
0 votes
0 answers
24 views

collision attack on bitcoin p2sh

Book "mastering bitcoin" 3rd edition, on page 73, there is a statement as following: "but there are organizations that expect to receive billions of dollars in bitcoins to addresses ...
fa william's user avatar
0 votes
1 answer
36 views

HOW TO SPEND THE P2SH only use Redeemscript hex ? no private key involved

the codes i use to build the transaction import hashlib import base58 # Define previous transaction details prev_txid = 'ec5596bf71a498fc944e912f0bc21f0ead3806965402d74f1d670c2fff7c08c2' prev_index = ...
Tepan's user avatar
  • 3
2 votes
2 answers
47 views

Can a spend before a timestamp condition be put on a Bitcoin UTXO?

How to make spending conditions of a UTXO in Bitcoin such that before a particular timestamp, say t, it can be spent only in one way and, after t, it can be spent only in another way.
Kirti Singh's user avatar
1 vote
2 answers
81 views

Why do some P2SH spending transactions have data both in the ScriptSig and Witness field?

I wonder if the wallet screwed up or if I am missing something in my bitcoin understanding. Here is the tx output being spent: "value": 0.00180675, "n": 154, ...
J S's user avatar
  • 35
2 votes
2 answers
60 views

What if someone locks some bitcoin with a script which only requires a user to know a preimage, but it matches the p2sh template? [duplicate]

The basic script for a lightning network HTLC output has a conditional branch which requires a user to know a preimage of a hash. It also requires the user to give a valid signature, but it got me ...
yonson's user avatar
  • 43
0 votes
1 answer
73 views

descriptor and Custom script

I have a Multisignature address 1-3 with a verification of OP_3, just a simple script to understand custom scripts in Bitcoin Script definition #OP_1 <Public Key> <Public Key> <Public ...
monkeyUser's user avatar
0 votes
0 answers
50 views

Lib bitcoinconsensus verification returns SCRIPT_ERR_INVALID_STACK_OPERATION on a P2SH multisig output

I tried to verify an old transaction 6a26d2ecb67f27d1fa5524763b49029d7106e91e3cc05743073461a719776192 P2SH multisig input 0 using lib bitcoinconsensus and I got SCRIPT_ERR_INVALID_STACK_OPERATION. ...
Alec Matusis's user avatar
4 votes
1 answer
242 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
73 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
  • 3
2 votes
1 answer
462 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,069
0 votes
1 answer
107 views

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

My raw Transaction ...
Tepan's user avatar
  • 3
0 votes
1 answer
107 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
  • 3
1 vote
1 answer
206 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
185 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
3 votes
1 answer
763 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
494 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
272 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
81 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
197 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
2 votes
1 answer
135 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
148 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
3 votes
1 answer
354 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
  • 131
5 votes
1 answer
106 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
  • 802
0 votes
1 answer
516 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
51 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
7 votes
1 answer
380 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,025
0 votes
1 answer
137 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
85 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,025
0 votes
1 answer
66 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
141 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
159 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
98 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
205 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
293 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
  • 167
6 votes
1 answer
437 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
91 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
396 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
161 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
3 votes
1 answer
132 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
122 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
350 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
231 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
169 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
  • 287
0 votes
1 answer
123 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
-1 votes
1 answer
257 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
176 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
151 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

1
2 3 4 5