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
5 views

Generate P2SH-P2WPKH

I want to replicate the same scenario of bitcoin-cli getnewaddress "" "p2sh-segwit".To achieve my goal I'm following this guide My Wif is: cPc4kNYhmuEym2VuskuLbhvPnJwXZGKcR6eRQL4Rv3KCJKUsatmQ then ...
1
vote
1answer
12 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
65 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
0answers
38 views

How this bitcoin code works?(Fake transaction works?) [closed]

I dont know how this code works.Can someone tell me?Creator tell me it's to use the p2sh to generate a "fake" transaction.But the code seems missing something to work.And i also cannot build it in the ...
0
votes
1answer
63 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
55 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
38 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
61 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
54 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
32 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
65 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
246 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
41 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
248 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
35 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
88 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
50 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
86 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
55 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
23 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
137 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
32 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
64 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
48 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
36 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
256 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
267 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
75 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
45 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
120 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
33 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
111 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
165 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
513 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
343 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
198 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
71 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
406 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
278 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 ...
1
vote
1answer
118 views

Does P2SH unlocking script only consist of operants?

I have a question about the P2SH unlocking script. Can I put common operants and operators in the P2SH unlocking script? And if yes, how can I create such script? e.g. unlocing script: <sig1> &...
0
votes
1answer
40 views

Retrieve money back from wrong prefix address

Normally, p2pkh address is generate by Base58(Prefix+ PublicKeyHash + Checksum), and prefix is set 0x00. What if by accidently, prefix is set 0x05, then the address prefix becomes 3, which becomes ...
1
vote
2answers
229 views

Testnet Bitcoin wallet: which script in hash addresses?

Why does the Testnet Wallet create receiving addresses in the form of script hash addresses (prefix 2) instead of "plain" m/n-prefixed addresses? Is there any security reason? And, which script does ...
0
votes
1answer
170 views

Access funds on legacy address related to segwit address from which I have private key

The situation Hello. Our company running BTC pool. We've been mining BTC for a while and used segwit address 32Z3eXSPgxcHj2fnQy8d6dg66eVtZfxrBM as pool adress. But when we finally found a first ...
0
votes
1answer
138 views

Error when sending transaction: “Signature is found in scriptCode”

I'm trying to send transaction with scriptSig: OP_PUSHDATA<Sig> OP_PUSHDATA<Data1> OP_PUSHDATA<Data2> OP_PUSHDATA<Data3> OP_PUSHDATA<RedeemScript> But I get error: ...
0
votes
1answer
243 views

Sending P2SH transaction with non-standard script

I'm trying to send transaction with script: ScriptSig: OP_PUSHDATA<Sig> OP_PUSHDATA<Data1> OP_PUSHDATA<Data2> OP_PUSHDATA<Data3> OP_PUSHDATA<RedeemScript> Since the ...
0
votes
1answer
150 views

ScriptSig raw hex to sign raw tx

i have a p2sh address that is created using an uncompressed public key (from my ledger nano) and a compressed public key (bitcoincore wallet). It requires both signatures to send the funds. When i use ...