Bitcoin Forum
October 31, 2024, 05:54:08 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How is a tx in a block displayed? And Segwit Question.  (Read 201 times)
?QuestionMark? (OP)
Member
**
Offline Offline

Activity: 79
Merit: 28


View Profile
December 22, 2020, 11:52:56 AM
Merited by ranochigo (1)
 #1

Hi

Is a tx in a block just displayed as a txid or is the whole tx displayed (like: decoderawtransction HEX)?

Because I recently watched a video about SegWit and I learned that SegWit takes away the witness data and puts it in a additional block.

So why not just storing the txid, since the txid is stored in the mempool?

Is this just for security reasons in case someone hasn't a txid which is in a block but not in his mempool?

And when a node doesnt support segwit, how can he validate and accept a block when is bitcoin core version rejects the additional segwit block and the witness data is missing?

Thanks for your replies.
ABCbits
Legendary
*
Offline Offline

Activity: 3052
Merit: 8016


Crypto Swap Exchange


View Profile
December 22, 2020, 12:04:02 PM
Last edit: December 22, 2020, 12:20:16 PM by ETFbitcoin
Merited by pooya87 (1)
 #2

Is a tx in a block just displayed as a txid or is the whole tx displayed (like: decoderawtransction HEX)?

If you actually meant stored (rather than displayed), the answer is the block contain whole tx.

But to send block between nodes, usually compact block is used to save bandwidth/fasten verification time since the node already have most/all transaction on it's mempool and node can simply ask another node for missing transaction.

More info, https://bitcoincore.org/en/2016/06/07/compact-blocks-faq/

Because I recently watched a video about SegWit and I learned that SegWit takes away the witness data and puts it in a additional block.

I think they're using the term incorrectly.

And when a node doesnt support segwit, how can he validate and accept a block when is bitcoin core version rejects the additional segwit block and the witness data is missing?

Node which support SegWit will send block without witness data and older node will see SegWit input as "anyone-can-see" "anyone-can-spend" script.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
?QuestionMark? (OP)
Member
**
Offline Offline

Activity: 79
Merit: 28


View Profile
December 22, 2020, 12:15:01 PM
 #3

Thanks for your fast answer.

It answers all my question.

Can you tell me more about / explain "anyone-can-see" script. Or do you have material where I could read more about it.

pooya87
Legendary
*
Offline Offline

Activity: 3626
Merit: 10993


Crypto Swap Exchange


View Profile
December 22, 2020, 12:39:02 PM
 #4

Think of it as new nodes dumbing down the blocks for old not-upgraded nodes so that they can still operate without having to upgrade. Otherwise it is not really anyone-can-spend, it is dumbed down so that the old nodes think that way.

It is the same process as any other upgrade that bitcoin received although they didn't need dumbing down but the old nodes couldn't verify those either and they could be considered "anyone-can-spend" in the same way.
For instance when P2SH was added many years ago, an old node would simply see a bunch of data pushed in signature script and a simple hash and equality check in pubkey script without doing anything else (that includes signature verification most of the times). Same with 2 new OP codes that replaced OP_NOPs (OP_CSV and OP_CLTV), old nodes can not evaluate these.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
December 22, 2020, 01:19:55 PM
 #5

Is a tx in a block just displayed as a txid or is the whole tx displayed (like: decoderawtransction HEX)?
I think this has been elaborated sufficiently. Just want to add that the ordering of the transactions is also determined by the merkle root.
So why not just storing the txid, since the txid is stored in the mempool?

Is this just for security reasons in case someone hasn't a txid which is in a block but not in his mempool?
Mempool is just the intermediate holding space for transactions which have yet to be included in the block. Transactions are always removed when they are included in a block. The transactions are only concrete with the POW when a block has been mined which includes the transactions. If it doesn't get included in a block, then it won't be in the blockchain.

And when a node doesnt support segwit, how can he validate and accept a block when is bitcoin core version rejects the additional segwit block and the witness data is missing?
From my understanding, I consider older nodes which cannot validate Segwit transactions akin to an SPV wallet. They cannot validate that a segwit transaction is valid but they will always follow the longest POW chain difficulty-wise.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1293


There is trouble abrewing


View Profile
December 22, 2020, 02:42:34 PM
 #6

From my understanding, I consider older nodes which cannot validate Segwit transactions akin to an SPV wallet. They cannot validate that a segwit transaction is valid but they will always follow the longest POW chain difficulty-wise.

there need to be a good term describing this types of nodes that are too old now. they still have a UTXO set and validate that too which is something SPV clients will never do. there is also a lot of other checks such as script evaluations and validation of a lot of other consensus rules.

There is a FOMO brewing...
ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
December 22, 2020, 02:50:06 PM
Merited by BrewMaster (1)
 #7

there need to be a good term describing this types of nodes that are too old now. they still have a UTXO set and validate that too which is something SPV clients will never do. there is also a lot of other checks such as script evaluations and validation of a lot of other consensus rules.
I don't think they are the same as SPV clients but they are similar to a certain extent, obsolete client would be a good word. There is no need for fancy naming because no one should be running those in the first place.

They can do many things that SPV can't, privacy-wise, and to some extent on it's security. But I think we can all agree that with their inability to validate segwit signatures in a block, they are kind of similar.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
?QuestionMark? (OP)
Member
**
Offline Offline

Activity: 79
Merit: 28


View Profile
December 23, 2020, 12:46:13 PM
Last edit: December 23, 2020, 01:00:22 PM by ?QuestionMark?
 #8

Think of it as new nodes dumbing down the blocks for old not-upgraded nodes so that they can still operate without having to upgrade. Otherwise it is not really anyone-can-spend, it is dumbed down so that the old nodes think that way.

Thanks, now I get It even better. But why isn't Bitcoin Core designed to reject peers which run an old node after some time? Because isn't changing the block for a older node not more work. As far as I know Segwit got implemented somewhere in 2017. I think after 3-4 years its time to upgrade. I know that it would lead in an hardfork, but I don't know how many people are running still an old version and how big the consequences of that hard fork would be. I also know Is that the network needed support from 95% from the miners for segwit which they got. When I take a look at the 50 recently mined block there isn't any block with a size of just MB. Always about 1.2-1.4MB. (Except does who mine blocks just with the coinbase tx)

ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
December 23, 2020, 01:10:08 PM
 #9

Thanks, now I get It even better. But why isn't Bitcoin Core designed to reject peers which run an old node after some time? Because isn't changing the block for a older node not more work. As far as I know Segwit got implemented somewhere in 2017. I think after 3-4 years its time to upgrade. I know that it would lead in an hardfork, but I don't know how many people are running still an old version and how big the consequences of that hard fork would be. I also know Is that the network needed support from 95% from the miners for segwit which they got. When I take a look at the 50 recently mined block there isn't any block with a size of just MB. Always about 1.2-1.4MB. (Except does who mine blocks just with the coinbase tx)
Honestly, one of the reasons why they decided to pursue Segwit was that it allows for the network to be soft forked so that older clients could be compatible as well. A hard fork like a sudden block size increase would result in everyone having to upgrade before it can start producing bigger blocks. Having to reject older peers wouldn't really benefit or harm the network and would just result in a portion of the network being disconnected from the rest.

I don't see the rationale in refusing connections just because they are running an older version. The incentive for them to upgrade is there and it allows them to upgrade at their own convenient time.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!