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
0answers
9 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
28 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
35 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
25 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
14 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
45 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
50 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
31 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
28 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
36 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
52 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 ...
0
votes
1answer
76 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
75 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
77 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
48 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
102 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
127 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
36 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
72 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
315 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
54 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
402 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
38 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
140 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
65 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
108 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
59 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: ...
0
votes
0answers
27 views

Curiosity on P2PKH and P2PK [duplicate]

I have some question on the P2PKH and P2PK they are two methods for locking the output, is a correct definition? Why the P2Pkh was introduced inside the bitcoin? Also, the P2PKH is identified with the ...
1
vote
1answer
187 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
35 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
67 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
53 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
38 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
318 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 ...
2
votes
2answers
339 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?
0
votes
1answer
44 views

Can payment from a P2SH address provide change to itself?

In the gavinandresen Multisig Test test, could change have been redirected to the originating 3QJmV3qfvL9SuYo34YihAf3sRCW3qSinyC P2SH address for the multisig payments? In Mastering Bitcoin by ...
0
votes
1answer
82 views

How to verify signature of multisig transaction

How to verify signature of multisig transaction (2-2) after it being signed by first owner? How can I understand if that owner used wrong private key => wrong signature?
0
votes
2answers
58 views

Public Addresses: '3' vs '1' in front [Bitcoin]

I just wanted to confirm, is it true that for a bitcoin (public) address it should always have a '1' in front of it. For certain transactions though I see that there is a '3' in front. How is this ...
0
votes
1answer
130 views

P2SH to LTC address with M

Are there anyone know how to convert P2SH address (like 34A5PyCvPJKYtHmj9jmKhGzBBwpGuAkZog) to MANDhrctLRAygo3dFckfWvEaWeQizSwWNK? I tried to decode with Base58Check, then removed 05 and added 032, ...
0
votes
1answer
38 views

Destination address(es) when redeeming an HTLC

Starting from this text at https://en.bitcoin.it/wiki/Script: "The script for a typical Bitcoin transfer to destination Bitcoin address D simply encumbers future spending of the bitcoins with two ...
1
vote
2answers
114 views

If I was developing a Bitcoin wallet, should I support both legacy and compatibility addresses?

To receive funds, I was thinking of giving a user the option of displaying two QR codes: Legacy - p2phk e.g. 1AKDDsfTh8uY4X3ppy1m7jw1fVMBSMkzjP Compatibility - p2sh(p2wpkh) e.g. ...
0
votes
1answer
176 views

How do I know that my Ledger HW Wallet is using receive addresses for my wallet and not another remote wallet?

I'm a paranoid newb, I bought a hardware wallet (Ledger nanos) and have transferred funds to it. I noticed that it generates P2SH addresses, so how could I know if the script hashed is spendable by my ...
0
votes
1answer
603 views

convert “M” address to “3” address LTC

currently im facing with 1 issue that i need to convert all my litecoin address in my fullnode to legacy address (prefix with "M"). Im know that we have a tool https://litecoin-project.github.io/p2sh-...
1
vote
1answer
418 views

bitcoinj java library not decoding input addresses for some transactions

I'm trying to "extract" sender's addresses from OP_RETURN Bitcoin transactions, but my code is not working properly. getWalletAddressOfSender(final Transaction tx) public static Address ...
1
vote
1answer
57 views

Security implications of removing CHECKSIG in a test

If I conduct an htlc transaction on testnet that does not include OP_CHECKSIG will it still cost an attacker more than (say) $10 in processing power or storage to subvert my tests? Details: I'm ...
0
votes
1answer
212 views

Is P2SH-wrapped P2PKH possible?

There is a known form of address that called P2SH-wrapped SegWit, wrapping SegWit address as Base58 (P2SH) address. Thinking about such address type, I come up with the question: Is P2SH-wrapped P2PKH ...
1
vote
1answer
75 views

Verification of untypical scriptSig

I want to be able to redeem a P2SH output with a script doing a multisig but also additional checks. The scriptSig to redeem this output thus has to provide enough signatures, as well as some specific ...
1
vote
1answer
482 views

P2SH-P2WPKH - has always segwit UTXOs?

I've been reading a lot of docs on BTC transaction structure, and find it really confusing when it comes to SegWit story. So, the very first thing is, if I've P2SH-P2WPKH address, does it mean that ...
1
vote
1answer
2k views

Converting Litecoin M-addresses to a more commonly accepted format

Is there any way to convert an (LTC) M prefix address to an L prefix address? Many services an apps that accept and transfer LTC reject M-addresses as invalid, even though they are given out by ...
0
votes
1answer
310 views

Manually create a transaction to spend the output of a P2SH tx

I want to manually create a transaction to spend the output of a P2SH tx, but I don't know where the redeem script should be placed in the new transaction? I followed an online tutorial Building a ...