Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ZephramC on January 19, 2016, 07:05:25 PM



Title: SegWit question
Post by: ZephramC on January 19, 2016, 07:05:25 PM
Hallo.
I have read BIPs 141-144 about Segregate witness and I have a question about validity of SegWit "witnessed" tx for old (non-upgraded) nodes.
Quote
Non-upgraded nodes, however, will not see nor validate the witness data and will consider all witness programs as anyone-can-spend scripts.

So they consider such transactions as valid. But what if someone constructs SegWit-like tx (but without valid SegWit script/witness program). Non-upgraded node (eg. merchant selling goods) would see and accept such transaction as valid (and send goods to customer). But the majority of upgraded network would refuse such tx.
Is there any workaround (besides upgrading node to include segwit and besides waiting for several confirmations for all anyone-can-spend scripts)?


Title: Re: SegWit question
Post by: pianist on January 19, 2016, 07:16:55 PM
Non-upgraded node (eg. merchant selling goods) would see and accept such transaction as valid (and send goods to customer).

All miners will upgrade software, otherwise they will mine block which will be rejected by majority.

So, this transaction will be unconfirmed for this merchant. :)

But I recommend you to upgrade your wallet!


Title: Re: SegWit question
Post by: ZephramC on January 19, 2016, 07:29:44 PM
Non-upgraded node (eg. merchant selling goods) would see and accept such transaction as valid (and send goods to customer).

All miners will upgrade software, otherwise they will mine block which will be rejected by majority.

So, this transaction will be unconfirmed for this merchant. :)

But I recommend you to upgrade your wallet!

So waiting for at least one confirmation (if all miner upgrade) and 2-3 confirmations if majority upgrade. OR Upgrading wallet.
Exactly those two solutions I excluded and did not ask for.  :)
Quote
(besides upgrading node to include segwit and besides waiting for several confirmations for all anyone-can-spend scripts)


Title: Re: SegWit question
Post by: achow101 on January 19, 2016, 10:03:17 PM
Hallo.
I have read BIPs 141-144 about Segregate witness and I have a question about validity of SegWit "witnessed" tx for old (non-upgraded) nodes.
Quote
Non-upgraded nodes, however, will not see nor validate the witness data and will consider all witness programs as anyone-can-spend scripts.

So they consider such transactions as valid. But what if someone constructs SegWit-like tx (but without valid SegWit script/witness program). Non-upgraded node (eg. merchant selling goods) would see and accept such transaction as valid (and send goods to customer). But the majority of upgraded network would refuse such tx.
Is there any workaround (besides upgrading node to include segwit and besides waiting for several confirmations for all anyone-can-spend scripts)?
From what I understand, there is no workaround to this without either upgrading or waiting for confirmations. However, that is the risk that merchants take by accepting unconfirmed transactions. Without some changes to software to recognize those transactions, then those merchants risk losing money. With that risk, they will probably upgrade to accept segwit transactions or at least recognize segwit transactions and wait for confirmations on them.


Title: Re: SegWit question
Post by: shorena on January 20, 2016, 05:39:03 AM
Im really confused here and I dont know if this is me or you, so I will just put this out there.

My understanding is that in order to create a SigWit transaction you pay to a SegWit address first. Thus its always the receiving party that deceides whether or not they want to use SegWit or not. If I create a "anyone can spend" address that is not SegWit, its my own fault that literally anyone can spend my funds as soon as someone else paid me. SegWit would introduce a new address type[1] to clearify on the highest level whats going on. So if I just dont upgrade, I keep using the same old version 1 addresses and nothing is going wrong, except that I might have to pay more in fees when I spend the coins.



[1] not sure which prefix though, 1, 2, 3, 5 are used, so maybe 4? or S for SegWit?


Title: Re: SegWit question
Post by: ZephramC on January 20, 2016, 10:24:32 AM
[1] not sure which prefix though, 1, 2, 3, 5 are used, so maybe 4? or S for SegWit?

It depends on SegWit program. I think it will be p... for P2WPKH address and 7... for a P2WSH address.
But it looks that BIPs change on the go.
Quote
BIP142:
For P2WPKH address, the address version is 6 (0x06) for a main-network address or 3 (0x03) for a testnet address.
For P2WSH address, the address version is 10 (0x0A) for a main-network address or 40 (0x28) for a testnet address.