Questions tagged [segregated-witness]

This tag should be used for questions regarding Segregated Witness (segwit), an activated softfork that defined a new transaction format which doesn't include signatures in the transaction identifier (txid).

Filter by
Sorted by
Tagged with
0
votes
2answers
47 views

Generate P2SH-P2WSH

I want to generate P2SH-P2WSH with script P2PKH. My public key is 027712968e8f2f9dfa79abe10940a3d915a0c95a0b97750881e6201acf2b66da97 SHA256 and RIPEMD160 of Public key ---------- Witness Script ...
2
votes
1answer
66 views

Confusion about Addresses

I have a little bit confusion about addresses segwit and not segwit. I can see P2WPKH and P2WSH from this link https://en.bitcoin.it/wiki/BIP_0173, and they are segwit and start with bc (mainnet) or ...
1
vote
1answer
53 views

Generate P2WSH native

I want to create P2WSH native like https://en.bitcoin.it/wiki/BIP_0173. I have already a script to generate P2WPKH and it works, thank the python part and re-arrange group byte works. I read that ...
0
votes
0answers
8 views

Fail to sign the Segwit Transaction's input in bitcoinj

I want to spend from a segwit address and it has a P2WPH script, I created this transaction just like creating a normal P2PKH transaction, but just changed the address of the input to the segwit ...
0
votes
1answer
33 views

getting public key from any raw transaction - what to take care of?

i need to retrieve public key of transaction sender. now i know there are 03 compressed pubkeys and 04 uncompressed ones. but how is this working with segwit and multisig addresses? can you please ...
0
votes
2answers
21 views

Can I build a raw segwit transaction with no segwit inputs?

I am trying to build a segwit transaction between a regular p2pkh address and a p2sh 2-of-2 multi-signature address. I have successfully transacted back and forth between these two addresses before (...
0
votes
1answer
27 views

Why does Bisq claim that my “native segwit” receive addresses are “invalid”?

Every time I'm transferring over the funds from Bisq to Bitcoin Core, I get the error: Invalid address. (Or something along those lines.) Only after generating another receive address in Bitcoin ...
0
votes
0answers
32 views

Generate P2WPKH

I'm able to generate P2PKH from bash but I don't find the steps to generate P2WPKH (not wrap) I saw this link and I understand that I have to do base58 of Public key hash and prepend 00, but I don't ...
0
votes
1answer
16 views

Signing a Segwit Multisig Transaction

I am creating some test code which can create transactions and sign then, I already could do it with NON-Segwit multisig address, they were signed using my code and broadcasted. But when I tried with ...
0
votes
0answers
27 views

How to strip witness data from block in json/hex format?

I have a JSON format block (Height:500000) here. As you can see here, it is a segwit block and its actual size is 1048581 and stripped size (without witness data) is 981404. I want to strip full node'...
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/...
0
votes
0answers
34 views

Sign Raw Segwit (P2WPKH) Transaction Digest

I have a simple transaction that I want to sign the digest of, but I'm not sure if I've got the raw transaction correct, therefore my digest is incorrect. The transaction has one input and one output,...
3
votes
1answer
74 views

Can a coinbase transaction have a segwit output?

And more generally speaking, are there any restrictions on the output of a coinbase transaction?
2
votes
3answers
289 views

Are all three Bitcoin address types interoperable (legacy, segwit, native segwit)?

is it possible to send transactions back and forth between all 3 address types (legacy, segwit, native segwit-bech32)? Or is one of them not able to send to another?
0
votes
1answer
57 views

Signmessagewithprivkey result is different than txinwitness

I'm studying segwit and I'm doing some experiment in regtest. I create a raw transaction with P2SH address. My Transaction data without signature is: ...
0
votes
1answer
75 views

How to generate legacy receiving address in Bitcoin core 0.19.x.x

I must have missed the memo. I see Bitcoin Core 19.1.0.1 defaults to generating Bech32 receive addresses (prefixed with "bc1"), and offers a checkmark to generate P2SH addresses instead (prefixed ...
0
votes
1answer
42 views

What is the signature digest for Segwit outputs

(Assume there's no OP_CODESEPERATOR) For standard P2PKH, the signature digest is generated this way: NewTransaction settle the TxOuts well set all TxIn scripts to empty insert the Previous Locking ...
3
votes
1answer
67 views

Why does a same transaction signed separately have different witness values?

I signed a bitcoin testnet transaction using nbitcoin library and got an output: ...
3
votes
1answer
60 views

Why is a 20 byte hash acceptable in p2wpkh but p2wsh needs 32 bytes?

Why is it acceptable to use a 20 byte hash to represent single-sig witness programs whereas a 32 byte hash is used for pay to witness script hash?
0
votes
0answers
31 views

How do I ask for witness data from a Bitcoin full node?

So, I'm trying to build a Bitcoin block explorer using my own Python library. I'm doing it just as an exercise to better understand how Bitcoin works under the hood. Right now, when I send a block ...
0
votes
3answers
525 views

Convert bech32 Bitcoin address to legacy

I know that similar tools exist for BCH (e.g. https://cashaddr.bitcoincash.org/). Is there a way to convert a native segwit bech32 Bitcoin address to a legacy format?
0
votes
0answers
67 views

Issue generating private Key and segwit address with python

I used the following script to generate my private key and the corresponding segwit address. Then to test it, i sent funds to the address and imported the private key on blockchain wallet; RESULT: ...
1
vote
1answer
50 views

What is the scriptCode in a P2WSH transaction?

Let's say I am spending from a 2-of-2 multisig with this script: ...
2
votes
2answers
282 views

Is Segwit really safe and reduced?

In the Segwit rules, transactions propagated to legacy node doesn't have any signature. so it will be valid as well as in terms of fresh node(supporting Segwit). First question: In this point, if ...
1
vote
1answer
47 views

How a SegWit transaction is accepted without witness?

I would like ask 2 questions. First, as perspective of legacy node(doesn't upgrade software): When SegWit transactions are transferred, witness data is stripped. It means that there are no signatures ...
2
votes
1answer
41 views

Parsing stripped-witness blocks

I've read all the relevant BIPs, and am still confused. Are segwit enabled blocks stripped of witness data and marker and flag bytes when they are propagated to non-segwit peers? Or are they just ...
3
votes
1answer
137 views

Would a Schnorr PubKey be a different length than a Taproot PubKey like P2WPKH and P2WSH?

A P2WPKH PubKey is shorter than a P2WSH PubKey. Would this also be the case that a Taproot PubKey is larger than a Schnorr PubKey? If so, wouldn't people be incentivised to use the Schnorr PubKey and ...
-2
votes
1answer
40 views

Bitcoin And BitcoinCash Input Value [closed]

According to bip 143 (https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki), bitcoin transaction has the information about the input value as part of the witness. i heard bitcoincash has ...
1
vote
1answer
80 views

Error Signing P2SH-P2WSH MultiSig - “Unable to sign input, invalid stack size (possibly missing key)”

I am trying to create and spend a P2SH-P2WSH transaction using bitcoin-cli but am getting "Unable to sign input, invalid stack size (possibly missing key)" when I try to sign the Multi-Sig transaction ...
7
votes
2answers
513 views

Most efficient way to store Segwit Address in a database

This is not a duplicate of What is the most efficient way to store bitcoin addresses in a database? but it's the same question except I need a segwit answer. Let's say I wanted to store every ...
0
votes
1answer
54 views

How to spend from a segwit address generated by a legacy wallet?

I used atomic pay payment gateway and a segwit address was generated by XPUB key i'm unable to spend the coins i sent to the generated address and coins are not visible in my legacy wallet what to do ?...
0
votes
1answer
42 views

Witness data storage localisation in the blockchain

Since segregated witness is in place inside Bitcoin blockchain, my understanding is that witness data are no longer stored inside the blocks, so if blocks are linked to each other where theirs ...
1
vote
2answers
61 views

How does storing the witness outside of the block prevent malleability?

I have some question on how segregated witness work. I'm reading this post and in the answer exist this phrase Since signature data (witness data) is stored outside the transaction (and outside ...
0
votes
1answer
37 views

How Segwit makes transactions smaller? What about the witness?

I have seen similar questions without a clear answer. So, how does Segregated Witness make transactions smaller? I understand it removes data from the transaction hash and solves malleability ... But ...
2
votes
1answer
144 views

How to calculate p2wsh signature?

I read the bip143, but didn't understand how to calculate the scriptCode of p2wsh. bip143 told us: A new transaction digest algorithm is defined, but only applicable to sigops in version 0 witness ...
0
votes
1answer
138 views

Javascript library or code that can convert an “uncompressed” bitcoin private key to a compressed one

I forked a pretty old brain wallet generator: https://dvdbng.github.io/memwallet/ -- Currently it generates uncompressed bitcoin private keys. Is there a javascript library that can convert an ...
6
votes
2answers
411 views

Is there a difference between bytes and virtual bytes (vbytes)?

In an Optech newsletter, size is referred to using vbytes. Is there a difference between vbytes and bytes? If so, what is the difference?
0
votes
0answers
91 views

Mycelium not reading segwit bech32 (bc1) addresses from a private key

I'm trying to import my bitcoin private key into the Mycelium android wallet, but it keeps showing up as the legacy address that starts with 1xxx. I sent some coins to the bc1 address and I verified ...
2
votes
1answer
93 views

How to calculate txid for segwit transactions?

I'm having difficulty calculating txid for recent transactions. I followed bip-141 at https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki For the first transaction in the first block found ...
4
votes
1answer
82 views

How has the Bitcoin average block size recently risen above 3 MB?

I was aware that the block size could rise above the 1 MB cap due to SegWit. However, my understanding was that the block size would still be limited under SegWit. My understanding of SegWit is that ...
0
votes
2answers
81 views

Raw SegWit TX look solid and verifies, but is rejected. Need help figuring out why

Consider the following transaction expressed as hex: ...
1
vote
1answer
37 views

For the 3 bitcoin address types, which can send to each other? Can a valid tx be created that spends to an unspendable address?

I'm just getting started with using bech32 addresses instead of legacy addresses, and I'm not familiar with how the legacy vs segwit compatible vs bech32 addresses play with each other. Can I get an ...
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
2answers
69 views

Are non-SegWit transactions still malleable?

SegWit was (amongst other improvements) introduced to fix malleability issues. Does that mean that non-SegWit transactions are still malleable? If so, what types of malleability could still happen in ...
0
votes
1answer
51 views

P2WPKH - which private key is used to generate signature?

I am looking at the BIP143 P2WPKH example. I am kind of following until the generation of the sigHash: c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670 but then that is used to ...
0
votes
1answer
32 views

Alternative to Python pip bitcoin

This Python pip package https://pypi.org/project/bitcoin/ was originally developed by Vitalik Buterin (that Ethereum guy) but is no longer maintained. Is there any alternative equivalent pip package ...
2
votes
1answer
49 views

Why is a library's signature of a segwit tx different from Bitcoin Core signature?

I have been writing a (yet another) Bitcoin python library primarily for educational purposes; for me and my students. Signing a non-segwit transaction results in a signed tx that is identical to ...
0
votes
0answers
45 views

Will non-segwit addresses still be able to send bitcoin in 5+ years?

My public address starts with 1,and I can currently spend the Bitcoin from it. However, as more and more transactions become only segwit based, will miners eventually just abandon verifying ...
1
vote
2answers
167 views

Bitcoin API with bech32 support

Since a while, I have been using the insight-api to view bitcoin transactions. However, recently I have found out that bech32 addresses are not supported. Now I try to fix this issue and I am open ...
1
vote
1answer
136 views

Find sender's public key in SegWit Transaction

How can I retrieve the sender's public key in a Segwit transaction? For example: https://www.blockchain.com/btc/tx/3179d18d6f36fa77b88909496535485d8188d96b79d295843789a9e0ff6c3e6a I can happily ...

1
2 3 4 5
9