Skip to main content

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

conditional spending from P2WSH address

What im doing wrong? Sinse I found out that Bitcoin is programmable money Im trying to use it potential. Using this site https://improvein.github.io/bitcoin-forge/?#/script/create I’ve created a ...
4 votes
1 answer
65 views

What are the malleability threat vectors when passing PSBTs to other actors?

If I am passing a PSBT (Partially Signed Bitcoin Transaction) between multiple people, and I pass on my signature for my UTXOs for given inputs, can someone take advantage of malleability and cheat me ...
0 votes
1 answer
68 views

How to create and sign a segwit transaction using any npm pacakge

So I am using this NPM package ( https://www.npmjs.com/package/bitcore-lib ) to create and sign a Bitcoin legacy transaction locally and it was working fine for legacy. But when I tried to do the same ...
-6 votes
1 answer
1k views

Could miners possibly steal SegWit transactions on The Real Bitcoin? [closed]

Going to be lolz epic when all the SegWit transactions are double-spent, i.e. stolen by miners on The Real Bitcoin (the legacy Satoshi blockchain). Can anyone offer any refutation, confirmation, or ...
1 vote
0 answers
30 views

Why is Taproot important to Ordinals? [duplicate]

I've learned SegWit, Taproot, Schnoor and Ordinals recently. I can understand all these terms. But I don't understand why people say Taproot makes Ordinals possible. Taproot is actually the version 1 ...
0 votes
2 answers
510 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-...
5 votes
1 answer
1k views

How can the segwit witness data be "off-chain"? What does it really mean?

I have several questions regarding the segwit witness data. My current understanding is as follows. Before segwit, the witness data was part of the input that the user had to provide so that they ...
1 vote
1 answer
324 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<...
1 vote
1 answer
54 views

How can a replace occur with a tx with lower fee and feerate?

I have seen a tx A get replaced by a tx B, where B had a lower fee and feerate than A and it was broadcasted later. How is it possible? These are the txs details: Tx A: segwit, ̶t̶a̶p̶r̶o̶o̶t̶, ...
1 vote
1 answer
281 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 ...
17 votes
2 answers
480 views

How thoroughly has Segregated Witness been tested?

I've encountered claims that Segregated Witness was "not really tested" and is being "rushed". It is my understanding that SegWit had been running on Elements for more than half a year already, and ...
1 vote
3 answers
597 views

Bitcoin segwit addresses from HEX

I loved those two https://github.com/grondilu/bitcoin-bash-tools https://www.bitaddress.org/ because you can convert HEX into WIF private key. Is there something similar what allows to create ...
4 votes
1 answer
407 views

SegWit with BitCore-Lib

How to create a SegWit address and transaction using bitcore-lib?
3 votes
1 answer
50 views

What's the reason for the scriptCode format for a P2WPKH? (BIP 143)

When signing a P2WPKH input, the P2WPKH locking script is converted to the pattern of a legacy P2PKH when creating the scriptCode. From BIP 143: For P2WPKH witness program, the scriptCode is ...
0 votes
2 answers
43 views

marker byte interpretation by legacy transaction parser [duplicate]

The marker byte is interpreted by a legacy transaction parser as number of inputs in the transaction and is always 0. My question is, why is a transaction with 0 inputs considered valid by a legacy ...
0 votes
0 answers
16 views

How to spend one or more p2tr inputs in python?

I see that bitcoinlib does not support taproot yet. Is there any good lib out there to spend one or more taproot inputs? I would like to create txs like this: ... "inputs": [ { &...
1 vote
1 answer
116 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
170 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 ...
0 votes
2 answers
66 views

How do pre-Segwit nodes interpret transactions containing Taproot OP_CHECKSIGADD?

When pre-Segwit nodes encounter blocks with Segwit transactions, they'll see them as "spent anyone can spend" transactions and so can validate them and move on to the next block. However, ...
2 votes
1 answer
101 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
76 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", ...
0 votes
1 answer
54 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
2k 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
516 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
85 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
85 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
298 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
664 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
46 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
35 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
721 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
37 views

Example of computing segwit txid from raw tx data

txid = 4508d55cf0d93ac43cbbb13a3b63d7a1e146911745f049893fc6b2d84e4e1256 raw block data = ...
0 votes
1 answer
87 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
69 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
81 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
589 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
108 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
189 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
27 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
116 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 ...
5 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 ...
2 votes
1 answer
88 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
147 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
658 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
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
2 3 4 5
13