Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

0
votes
1answer
27 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 ...
0
votes
3answers
53 views

What is Witness and what data does it contain?

I've learned about the Segregated Witness but couldn't find info on braking it apart. I know usually when legacy addresses are used the public keys for example will be under Scriptig. With P2SH, I ...
0
votes
1answer
29 views

How to find out addressHeader p2shHeader

I am trying to find out the location or a method (may be) for addressHeader and p2shHeader parameter for any altcoin. The following list contains these 2 parameters for few coins but I am unable to ...
1
vote
2answers
27 views

How nodes verify if the hash on a P2SH output is from a valid script?

I understand how the validation works if someone wants to spend coins from a multisig address. But what if the receiver makes a mistake and provides an invalid script hash to the sender? Is there ...
0
votes
3answers
91 views

Ledger Nono S (ledgerjs) signP2SHTransaction is Producing Invalid Signature

I was receiving Errors while using signatures produced by signP2SHTransaction function of @ledgerhq/hw-app-btc. So I created a script using bitcore-lib to cross check it against the signature produced ...
2
votes
2answers
78 views

Hard time distinguishing change and withdraw amount for P2SH address

I am trying to extract the exact amount of BTC deposited and withdrawn from BTC address (from hardware wallets like Trezor, ledger nano, ...). So if the address is pay-to-pubkey-hash then I can easily ...
1
vote
4answers
85 views

How is it possible that the same WIF Private Key generates two different addresses?

I am wondering if you can explain this. I went here: https://coinb.in/#newSegWit Created the SegWit Address below: 3ASaGJ8h2bLn6Jha3hncBzXUKRCLyfv9bk RedeemScript ...
2
votes
2answers
36 views

When you pay from a P2SH address, does its change go into a P2SH address too?

Because that means you must always keep the redeem script around to make the change addresses, and if it's a multisignature script, then you'll need to have the script with those public keys around, ...
7
votes
1answer
84 views

What's the use of not relaying non-standard transactions if anyone can still use them using P2SH?

It seems that non-standard transactions are not normally relayed because there is a concern this might break the network or it might make future upgrades harder. But anyone can use these non-standard ...
0
votes
1answer
84 views

How to spend an UTXO P2SH pay-to-script-hash

Anyone knows specific instructions on how to claim an unspent P2SH TX (pay-to-script-hash) based on a redeem script? No multisig. I am looking for node.js JS instructions in bitcore-lib or similar. ...
0
votes
1answer
110 views

How to generate a native Segwit address and P2SH Segwit address from a standard WIF?

Can I have the steps to generate a native Segwit address from a standard WIF? And the steps to generate a P2SH Segwit address from the same WIF? How do these two formats differ and why are there two?...
0
votes
2answers
125 views

P2SH signature verification in python

I am trying to understand and verify P2SH script by writing a python code to parse real transaction in blockchain. I have chosen below Transaction randomly. TxID: ...
2
votes
2answers
157 views

Bitcoin - Technical difference between P2PKH and P2SH address generation?

I was convinced that the only difference between the generation of addresses starting with '1' and '3' was simply changing the prefix added to the digest from 0x00 to 0x05 after the ripemd160 part. ...
4
votes
1answer
72 views

Why is my P2SH sigScript field prepended with 0x00?

I created a P2SH transaction and signed it using coinb.in. The sigScript field for this transaction is: da 00 47 3044 0220 ...
5
votes
2answers
273 views

What the difference between old segwit (3) and new segwit address (bc)?

i'm not that kind of person who understands cryptography and math, can you tell me simply the main purpose of new segwit address? are transactions fee the same for new segwit (bc1)? instead of "Old ...
1
vote
2answers
215 views

What redeem script is used in bitcoin core wallet when generate the address?

I'm trying to generate the address 38DGj87axzmQiZeAd1w1y5FEmuu5a7pfBa in my bitcoin core wallet with code. First, I dump the private key from the address, then I calculate the address from the ...
1
vote
1answer
107 views

How does a P2SH script get executed?

I'm trying to visualize how a typical P2SH script gets executed, as I realize that it's a special form of script that gets executed slightly differently to a standard script. Before P2SH: Before ...
0
votes
1answer
58 views

Can you create a valid p2sh transaction with the redeem script in the scriptsig alone?

From my understanding, for a p2sh transaction to be valid the redeem script must hash to the same value as the output script being used to fund the transaction. So can't you just put the redeem ...
1
vote
1answer
106 views

When and where to add extra information when signing P2SH raw transaction?

This post is quite long so in summary: I'm wondering where I can add extra information when signing a raw transaction (in this case a cleartext of a digest). I'm also wondering if Missing inputs (code ...
0
votes
2answers
288 views

Is it possible to convert an address from p2pkh to p2sh?

Is it possible to convert a p2pkh address to a p2sh address? Also, will the balance of the p2pkh address carry over to the p2sh address?
0
votes
3answers
331 views

Bitcoin-tx sign/redeem p2sh transaction (Unable to sign input, invalid stack size (possibly missing key))

I'm seeking help in redeeming a p2sh transaction using the standard tools from bitcoin core, e.g., bitcoin-cli or using directly the RPC commands via curl would also be fine. Creating the P2SH ...
3
votes
4answers
140 views

Why bother checking both public key and signature in P2PKH transactions?

In a P2PKH pubkey script, first, the public key provided by the intended spender is verified to be correct and then this key is used to verify the spender's signature. I wonder why just verifying the ...
1
vote
1answer
94 views

segwit nested in p2sh

I understand that P2SH addresses are used to allow "segwit unaware" wallets to create outputs spendable by segwit wallets (please correct me if I got something wrong). For new clients I think I got it:...
0
votes
1answer
172 views

Why is not Bech32 address selected as default in Bitcoin Core 0.16.0?

So, thankfully Bitcoin Core 0.16.0 came to us, general people. But however, native segwit address Bech32 wasn't selected as default. Is not it better to use a Bech32 address right away rather than ...
1
vote
1answer
35 views

Can I use opcodes traditionally used for verifying keys to verify payment sizes?

Can I use binary opcodes usually used for verifying keys to verify payment sizes? It looks like these opcodes like OP_EQUALVERIFY and OP_NUMEQUALVERIFY are used for checking signatures or keys, ...
0
votes
1answer
38 views

P2SH in Hardware wallet?

I am designing a hardware wallet and the software that will work with it. I plan to provide P2PKH transactions support in the software for hardware wallet to sign. Is it mandatory to support P2SH ...
1
vote
1answer
42 views

anyonecanspend final condition of a script can be spotted just by looking at the script hash, without the redeem data?

Consider the following scenario. Alice, Carol and Bob create and fund a script with the following rules: if now, alice pubkey, bob pubkey else if now+500 blocks, bob pubkey, carol pubkey else if now+...
0
votes
1answer
117 views

funding and spending a “no-multisig/no segwit” P2SH tx

I got inspired by this thread: Single signature P2SH redeem script Assume I want to "hide" my address as long as can be. So I want a P2SH tx, which only shows a redeemscript (hash of my pubkey) on ...
1
vote
1answer
313 views

Single signature P2SH redeem script

How would one go about creating a single signature P2SH transaction? (Analogous to a "2 of 3 multisig P2SH" but instead I'm asking about a "1 of 1".) Would one wrap a standard P2PKH scriptPubKey ...
1
vote
1answer
285 views

Convert P2SH to P2PKH

I'm using btcrecover to recover a Ledger BIP39 backup seed that I wrote down but seems to be wrong. The tool only accepts P2PKH addresses and my account was created very recently in this kind of ...
3
votes
1answer
308 views

How to quickly find the private key from Segwit P2SH address?

I have a very large list of Segwit addresses for bitcoin, starting with '3' and do not know the corresponding legacy '1' address for them. How can I quickly find the corresponding legacy address to ...
2
votes
1answer
604 views

Step by step example to redeem a P2SH output required

I have been following BIP16 in creating a P2SH transaction. I want to create a simple (one signature) P2SH. I am getting an error when trying to broadcast the tx. Error is 16: mandatory-script-verify-...
10
votes
2answers
2k views

How do bech32 addresses compare to P2SH addresses in transaction size?

Bech32 (starts with bc1) and P2SH (starts with 3) can both be used for segwit transactions. I know bech32 is supposed to create smaller transactions, but I'd like to know how much smaller (than P2SH). ...
0
votes
1answer
209 views

P2SH-P2WPKH private key or revert to P2WPKH

Is there a way to get the private key out of an P2SH-P2WPKH address, using Bitcoin Core 0.15.1? If not, is there a way to get the origin P2WPKH address to get the private key out of this address?
1
vote
1answer
111 views

Access my wallet using a 16 digit passphrase

I had a wallet years ago on a PC I sold. I mined bitcoin on it and what not. Recently I found a 16 digit passphrase I wrote down for my wallet. That is all I have and probably all I needed. If I only ...
1
vote
1answer
94 views

how to spend an utxo when the corresponding scriptsig is longer than 256 bytes?

I am trying to spend an utxo sent to a p2sh address. The scriptsig (including the redeem script) is longer than 256 bytes. When the transaction is serialized there is only one byte to indicate the ...
0
votes
1answer
334 views

How do I spend a non-standard P2SH transaction

I was sent a P2SH puzzle address. I have solved the puzzle, which is to say I have created a script that matches the hash, and I know what to put on the stack before the script. Sadly, what I am ...
0
votes
1answer
950 views

How to get legacy address and private key from Segwit P2SH address?

I have a Segwit P2SH address (starting with 3...) with the corresponding private key and need to obtain the legacy address (starting with 1...) and the private key. Is this possible?
2
votes
1answer
302 views

How to properly backup a address with private key after 'addwitnessaddress' command

I've received my balance to my addresss that starts with 3 which is after 'addwitnessaddress' command. I'd like to know that how do I properly backup my balance to keep safety. Bitcoin Core has a ...
0
votes
1answer
136 views

How to get balance of a bitcoin p2sh address? [duplicate]

I send some BTCs to a p2sh address. How can I get the balance of the address? Local regtest mode
1
vote
2answers
378 views

Create Pay to Witness Script Hash in Pay to Script Hash Address

I'm trying to generate a multisignature, segwit compatible address as a P2WSH nested in BIP16 P2SH as described in BIP141. Basically, I want to construct a P2WSH-nested-in-P2SH address from n public ...
1
vote
3answers
3k views

How to generate bitcoin P2SH WIF key and address pair from sha256 private key?

lets say i have sha256 Private Key Hexadecimal Format 0000000000000000000000000000000000000000000000000000000000000001 how can i get P2SH address and its corresponding WIF private KEY ? by P2SH i ...
1
vote
1answer
223 views

Signature scheme for P2SH

I am trying to sign a raw transaction that spends output #2 (txindex 1) from this transaction: 267c6d75851efa18afb7edeb2da00c09afc575231db84b3277fc7ea3e174ecbd The output is a 1-of-4 multisig P2SH ...
1
vote
2answers
359 views

signrawtransaction of a P2SH-P2WPKH spend seems to be broken?

I'm trying to spend a SegWit output on testnet using the Bitcoin core's RPC commands. Without importing the private key into my wallet (i.e. w/o addwitnessaddress). I wonder if anyone had luck ...
6
votes
1answer
6k views

Difference between a SegWit address and a P2SH address

Let there be an address 3ABCDEFGHJKDJHDH.... How can I understand if it's a SegWit address or a MultiSig address?
2
votes
2answers
630 views

How does P2SH unlocking work?

"Mastering Bitcoin" by Antonopoulos in its P2SH section describes how the unlocking and locking scripts are executed and evaluated by nodes. The author gives this as example of an unlocking script: &...
3
votes
0answers
320 views

Electrum Seed Purpose for MultiSig Wallet

I'm curious as to what exactly is protected by the seed that Electrum generates for a multisig wallet. My knowledge of the protocol implementation is rather basic, so please correct me where I'm wrong ...
2
votes
1answer
343 views

Verifying a P2SH transaction script by hand. How should I concatenate OP CODES in order to hash the script?

I'm reading this: Transaction 40eee3ae1760e3a8532263678cdf64569e6ad06abc133af64f735e52562bccc8 paid to P2SH address 3P14159f73E4gFr7JterCCQh9QjiTjiZrG. You can see the redeem script in ...
1
vote
1answer
291 views

what is the difference between OP_CHECKMULTISIG and OP_CHECKMULTISIGVERIFY

I would like to learn the difference, explained as simple as possible, between OP_CHECKMULTISIG / OP_CHECKMULTISIGVERIFY and OP_CHECKSIG / OP_CHECKSIGVERIFY. The only explanation I found is: Same as ...
1
vote
1answer
77 views

Create an arbitrary script with two locktimes and p2sh

Alice, Bob and Carol create a p2sh address that initially requires 3/3 signatures. After some time (lock1 using OP_CHECKLOCKTIMEVERIFY) only Alice and Carol can spend and Bob is permanently forgot. ...