Title: Segwit and decoderawtransaction Post by: TheArchaeologist on August 27, 2018, 09:33:23 AM Am I right to assume when the response of a the bitcoin-cli request for decoderawtransaction contains at least one txinwitness in the input section ("vin") the transaction is a segwit transaction? And the other way around: when there is no txinwitness in the vin-section it should not be considered a segwit transaction?
Any input is appreciated! Title: Re: Segwit and decoderawtransaction Post by: HCP on August 28, 2018, 01:23:14 AM That is a fairly safe assumption.
If there are no "txinwitness" blocks, then none of the inputs being used are "SegWit" inputs... therefore, it isn't a SegWit "transaction"... or more correctly, it doesn't contain any SegWit data. Title: Re: Segwit and decoderawtransaction Post by: TheArchaeologist on August 28, 2018, 06:40:02 AM That is a fairly safe assumption. Thanks for your input! Good to know I didn't make a false assumption. If there are no "txinwitness" blocks, then none of the inputs being used are "SegWit" inputs... therefore, it isn't a SegWit "transaction"... or more correctly, it doesn't contain any SegWit data. BTW: I will use this to check the number transactions containing Segwit data vs number of transactions without Segwit data in a block. Title: Re: Segwit and decoderawtransaction Post by: nc50lc on August 28, 2018, 06:50:25 AM BTW: I will use this to check the number transactions containing Segwit data vs number of transactions without Segwit data in a block. In that case, start from block cluster (blk.dat files) blk00971.dat onwards.Check for the dates, since SegWit was started on August 24, 2017, you might save some time by skipping the older blocks. ;) Title: Re: Segwit and decoderawtransaction Post by: TheArchaeologist on August 28, 2018, 07:06:50 AM In that case, start from block cluster (blk.dat files) blk00971.dat onwards. Thanks, I'm aware of when Segwit activated ;) I already marked all transactions from blocks prior to 481,824 being "Non segwit". Check for the dates, since SegWit was started on August 24, 2017, you might save some time by skipping the older blocks. ;) Title: Re: Segwit and decoderawtransaction Post by: Thirdspace on August 28, 2018, 10:09:46 AM Code: "txid": "c7da009b85f48502023e5be467bef367092ed7d3ce25ce0b3b13f9a4945d932a", @TheArchaeologist you've done the "blockhash as private key" experiment on the other thread while you're compiling data on segwit vs non-segwit txs in all blocks, you should also do "private key" experiment on segwit txhashes too ;D segwit tx has 2 possible hex numbers (txid and hash) that can be used as private keys Title: Re: Segwit and decoderawtransaction Post by: TheArchaeologist on August 28, 2018, 12:15:28 PM Code: "txid": "c7da009b85f48502023e5be467bef367092ed7d3ce25ce0b3b13f9a4945d932a", @TheArchaeologist you've done the "blockhash as private key" experiment on the other thread while you're compiling data on segwit vs non-segwit txs in all blocks, you should also do "private key" experiment on segwit txhashes too ;D segwit tx has 2 possible hex numbers (txid and hash) that can be used as private keys Title: Re: Segwit and decoderawtransaction Post by: TheArchaeologist on September 14, 2018, 11:58:24 AM That is a fairly safe assumption. I am currently doing some more research into this and maybe there is at least one other scenario where a transaction is a "Segwit transaction" without a single "txwitness" block. That scenario is when the coinbase reward is collected by a native Segwit address (bc1...).If there are no "txinwitness" blocks, then none of the inputs being used are "SegWit" inputs... therefore, it isn't a SegWit "transaction"... or more correctly, it doesn't contain any SegWit data. An example: Code: bitcoin-cli getrawtransaction 2d531f2d4bf1227a6492656b4b340d36c810d313d94a413a965524ae71086bb9 1 Note: the vout-part mentions a type of "witness_v0_keyhash". I'm not sure if this should be counted as a "Segwit transaction" or not. I guess it all comes down to the question if a coinbase transaction always counts as a non-segwit input or not. Any feedback is welcome! |