Questions tagged [segregated-witness]

A 2017 softfork that introduced a new transaction format to fix third-party transaction malleability and increased the blocksize.

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

Why can I not find my transaction in the mempool?

I built a native segwit raw v2 transaction with the pwpkh addresses, and get the decoded transaction as the follows { "version": "02000000", "marker": "00", ...
2 votes
1 answer
62 views

Exact witness requirements for a segwit transaction with P2PKH and P2WPKH inputs

Segwit transactions can mix segwit and non-segwit inputs: Segwit transaction from mixed addresses (segwit and non-segwit) Can I build a raw segwit transaction with no segwit inputs? But how exactly ...
0 votes
1 answer
41 views

how to create txid from transaction.json

Consider this is the transaction.json file: { "version": 1, "locktime": 0, "vin": [ { "txid": "...
1 vote
1 answer
1k views

Segwit transaction in golang

I tried to create transaction which spends p2sh(p2wpkh) output: from wif I derived compressed pub key: "035476e55521c97cf0489e6c57893a99d67e84d306a69e6b6904f324c11b3cef8d". created witness program: "...
1 vote
1 answer
1k views

how to generate bech32/segwit address from pubkey in golang

I am trying to generate bech32/segwit address in golang with the following code: var pubkey *btcec.PubKey address, err := btcutil.NewAddressPubKey(pubkey.SerializeCompressed(), chainParams) if err != ...
1 vote
1 answer
510 views

Pycoin: How to sign SegWit transaction via Pycoin?

My target is to make transaction with unspent transaction outputs(UTXOS). The information of UTXOs is as follow. [ { "pt_idx": 0, "subaccount": 37, "ga_asset_id": 1, "value": "...
0 votes
1 answer
84 views

Node doesn't find segwit transactions

I had to move around wallets and so on, and when I re-installed Knots (yeah I'm that edgy), it doesn't find the transactions to my segwit addresses. I can probably find the SW addresses somewhere, but ...
1 vote
1 answer
70 views

Nonstandard witness when building a transaction

i try to spend a P2WSH 2of2 multisig input in Python for learning purposes. When i check my assembled TX with testmempoolaccept i get "bad-witness-nonstandard". This is my function to ...
4 votes
0 answers
295 views

Creating a P2SH-P2WPKH using Bitcoin Functional Test Framework

I'm using the Bitcoin Functional Test framework to understand how SegWit works by analyzing and building a P2SH-P2WPKH transaction. When I run my code the transaction gets created, but when I inspect ...
2 votes
1 answer
663 views

What is a "serialized signed transaction"?

Shown in the gray area here, describing how to apply, I think, Segwit to a transaction (particularly a Bitcoin Cash tx). The last section is titled "serialized signed transaction" however ...
0 votes
0 answers
22 views

Getting error "non-mandatory-script-verify-flag (Witness program hash mismatch)" when trying to send raw signed transaction

I'm trying to send a fairly simple segwit transaction with multiple input and outputs using bitcoinlib, here's how the simplified code looks like: from bitcoinlib.transactions import Output, Key, ...
1 vote
1 answer
30 views

Transaction Validation

What will it mean if the tranasaction input contains both signature script and witness, in case of scriptpubkey_type of p2sh or p2pkh, will it be invalid or valid ? As we use witness for SegWit ...
7 votes
1 answer
2k views

Why does BIP141 define both virtual transaction size and weight?

Why does BIP 141 (segwit) define both virtual transaction size and weight? Weight seems to be just four times virtual transaction size (or vice versa, depending on what you define first). Why are ...
8 votes
2 answers
1k views

What was the number of the block in which SegWit got activated? And first transaction?

It was definitely on August 24th 2017, but not sure about the block number. Many sources reference block 481,822; but others state 481,824. Also, even if this was the first block to allow segwit ...
6 votes
3 answers
696 views

What are the risks of running a pre-SegWit node (0.12.1)?

Many in the anti-spam faction have contemplated running a pre-SegWit node. But they're told that it is an insecure downgrade and a detrimental idea. So, Is it safe to assume that Bitcoin is not soft-...
5 votes
2 answers
2k views

Birthday attack on P2SH

The Segwit Benefits document has this to say about P2SH security for base transactions: Multisig payments currently use P2SH which is secured by the 160-bit HASH160 algorithm (RIPEMD of SHA256). ...
0 votes
1 answer
31 views

Example of computing segwit txid from raw tx data

txid = 4508d55cf0d93ac43cbbb13a3b63d7a1e146911745f049893fc6b2d84e4e1256 raw block data = ...
0 votes
1 answer
62 views

Meaning of xPub in SegWit wallet on blockchain.com and their legacy-type addresses

According to my understanding, an xPub of a Legacy sub-wallet should begin with xpub... and of a SegWit sub-wallet with zpub.... And the addresses begin with 1 and bc1 respectively. But on blockchain....
3 votes
1 answer
54 views

Creating a raw Segwit transaction from scratch and getting Signature must be zero for failed CHECK(MULTI)SIG operation

I am trying to create a Segwit transaction on TESTNET from scratch while referencing an online guide: https://medium.com/coinmonks/creating-and-signing-a-segwit-transaction-from-scratch-ec98577b526a ...
1 vote
1 answer
77 views

Bitcoin transaction malleability is it only for unconfirmed transaction?

I do understand what is transaction malleability and how to do it in practice eg. DER-encoded ASN.1, ECDSA and know that these 2 have been fixed. Also there are some other types (do not know examples),...
3 votes
2 answers
578 views

How to calculate P2WSH signatures with OP_CODESEPARATOR?

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 ...
2 votes
1 answer
101 views

the purpose of the field before signature in P2WPKH

what is the purpose of that 02 in this P2WPKH transaction : 01000000 0001 01 d6f3994ab779ac849996a6235699ced672fa4b8334f825a2f1fcb4081c5b0c62 00000000 00 ffffffff 02 1027000000000000 16 ...
0 votes
1 answer
120 views

What is arbitrary witness data and unspent transaction output?

I'm learning about bitcoin, and I keep seeing arbitrary witness data and I'm confused what it really means. Like what do they mean about arbitrary, does that just mean the data can be anything you ...
-2 votes
1 answer
23 views

Problem identifying the transaction hash for a new segwit uxto wallet

How do I the transaction id or transaction hash of a new segwit wallet I just created and sent tokens to? The transaction hash I see from blochian.info refers to the hash of the previous transaction. ...
2 votes
1 answer
93 views

Which private key is used in Taproot transactions?

The transaction only has one input, where its scriptPubKey is --> Op_1 Q , where Q is the tweaked public key. Let p = private key, P = Public key, q = p + tweak, Q = tweaked Public key To create ...
4 votes
1 answer
2k views

Redeem script. script hash, witness script and witness program

I have a little confusion about naming in Bitcoin. Redeem script is the conditions that will be satisfy. For example P2PKH inside P2SH OP_DUP OP_HASH160 <PubKHash> OP_EQUALVERIFY OP_CHECKSIG ...
0 votes
1 answer
472 views

Missing Witness field in p2wpkh decoded tx hex

I have placed together a raw tx hex but when it's unable to be broadcasted as I keep getting an error below sendrawtransaction RPC error: {"code":-25,"message":"bad-txns-...
0 votes
1 answer
290 views

Using the Bitcoin Crate to Sign a Segwit Transaction

Using the Bitcoin crate, I'm trying to create a transaction programmatically in Rust that spends an output associated with a P2WPKH address. This is the relevant code snippet: fn sign_transaction<...
2 votes
1 answer
70 views

What is the default private key type for legacy and segwit addresses?

In a library I'm reading, I can export a private key to a WIF, which takes a compressed boolean parameter. It reads: "...False if you want a standard WIF export (the most standard option). True ...
1 vote
1 answer
267 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 ...
1 vote
1 answer
129 views

Are there plans to make a script invalid if there is more than one element left in the stack?

In BIP62, it was proposed to make a script invalid if there was more than one element left in the stack after execution. This proposal was eventually withdrawn. From what I read, some people have ...
4 votes
3 answers
14k 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
1 answer
335 views

Accidently sent BTC to taproot wallet on Phantom. Wondering how i can get it back to Segwit so i can buy ordinals with it

Hey Guys i sent BTC to my Phantom Taproot account, but now i realize i should have sent it to my segwit acccount. Im wondering how i can transfer it over and if its even possible on Phantom. It was 0....
1 vote
1 answer
98 views

P2WSH Bitcoin Core Witness Script Empty Error

I am trying to spend a P2WSH output. Here are the steps I have taken: I have created a P2WSH output via bitcoin-cli. These are the details of the P2WSH output: Type V0_P2WSH scriptPubKey (asm) OP_0 ...
1 vote
1 answer
1k views

Segwit Address Supporting Testnet Faucet [duplicate]

Looking for a good Segwit supporting testnet faucet and preferably one that supports P2WPKH addresses, however answers that allow only P2WSH are fine too.
1 vote
1 answer
148 views

Error Validating Segwit Transactions using Python Blockcypher API: Error Running Input Script

As the title states, I'm trying to send a Litecoin transaction using the Blockcypher API Python SDK, and using Bitcoinlib for key management. I have extensively reviewed the documentation and source ...
2 votes
1 answer
85 views

Is a BIP required for the removal of SegWit Discount for Inscriptions?

Is a BIP required for the removal of SegWit Discount for Inscriptions? The rationale of such a change is to standardize the fee structure across all data types included in a block, ensuring that ...
9 votes
3 answers
1k views

Why is the witness data fee discounted by a factor of four?

I've read that it encourages users to consolidate UTXO sets. How would it be doing that?
0 votes
1 answer
75 views

What happens when we send MSG_WITNESS_TX/MSG_WITNESS_BLOCK to non-segWit node?

Unknown services flag are ignored by node that don't know them, but what about GETDATA messages and identifiers? For services flag, if node is not updated e.g to segWit, it will just not check (1<&...
1 vote
2 answers
476 views

Sent Bitcoin Cash to a Bitcoin address [closed]

By mistake I have sent BCH to my BTC address in my own wallet. My wallet service is BitGo. I know they have a tool to recover the BCH when they are sent to a non-segwit addresses. I have already tried ...
1 vote
1 answer
3k views

How can I generate SegWit addresses from a mnemonic using python?

So, I have written a script that generates BIP39 mnemonics. I now want to generate N native SegWit public keys from this mnemonic. I have found this, but it generates legacy addresses. It uses the ...
5 votes
1 answer
1k views

How do I calculate the witness commitment hash for a given block?

From my understanding, every SegWit enabled block has an added output script which is used as a place to store the "Witness commitment" specified in BIP 141. One issue I've stumbled upon was ...
2 votes
1 answer
749 views

What is the "witness reserved value" for BIP-141?

BIP-141 defines a witness reserved value as part of a flexible commitment structure: Double-SHA256(witness root hash|witness reserved value) The purpose is to support commitments (i.e., data ...
4 votes
1 answer
296 views

If a block contains no SegWit transactions, does a miner send an (empty) witness?

Also, would that block's Coinbase contain some kind of empty witness commitment?
1 vote
1 answer
222 views

Why is the bytestring 0xaa21a9ed used as the witness commitment header in SegWit?

As per BIP 141, the witness Merkle root hash is stored in a scriptPubkey field of a coinbase transaction output with a header consisting of the 4-byte string 0xaa21a9ed. What is the reasoning behind ...
0 votes
1 answer
78 views

Is the "witness commitment" introduced in bip-0141 optional?

In BIP-0141, it states: a new block rule is added which requires a commitment to the wtxid. the coinbase's input's witness must consist of a single 32-byte array for the witness reserved value. ...
0 votes
2 answers
892 views

SegWit witness commitment merkle root location

BIP 141 defines the commitment structure here What i am unsure about is the location of this data. I know it will be in scriptPubKey. Does this mean Coinbase tx will have more than one output? Also is ...
3 votes
1 answer
152 views

Are all transactions, whether SegWit or non-SegWit, part of the commitment in a coinbase transaction?

A merkle root in a block header is a way to commit all transactions in that block. However, since it does not cover transaction witness data, another commitment needs to be made in a coinbase ...
2 votes
1 answer
76 views

What would happen if we provide witness program different than 32 bytes for SegWit 1?

If the witness program (at the time of writing this question) is greater than 1, it is considered as anyone-can-spend output. Also, if the witness version is 1 and the witness program is 32 bytes, ...
6 votes
2 answers
231 views

How could a 2 byte witness program make sense?

BIP141 requires the witness program to be 2-40 bytes for segwit versions 1-16 (for v0 it must be either 20 or 32 bytes). When would a 2 byte witness program ever make sense? The 16 bits entropy is ...

1
2 3 4 5
13