Bitcoin Forum
June 22, 2018, 09:59:42 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Clarification of Segwit: how is witness data retrieved for validation?  (Read 764 times)
1t0ph20
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
March 16, 2017, 08:09:04 PM
 #1

Hi, new to Bitcoin.

I understand that Segwit will separate the signatures from the transactions and put it in another section of witness data. Just to clarify, is this witness data propagated with the block in the form of a Merkle tree bound with the txid's Merkle tree? I'm just having a hard time understanding how the witness data is condensed (if it all), how the witness data is retrieved for validation, and how the txns are still connected with the respective signatures. Thanks!
1529661582
Hero Member
*
Offline Offline

Posts: 1529661582

View Profile Personal Message (Offline)

Ignore
1529661582
Reply with quote  #2

1529661582
Report to moderator
1529661582
Hero Member
*
Offline Offline

Posts: 1529661582

View Profile Personal Message (Offline)

Ignore
1529661582
Reply with quote  #2

1529661582
Report to moderator
1529661582
Hero Member
*
Offline Offline

Posts: 1529661582

View Profile Personal Message (Offline)

Ignore
1529661582
Reply with quote  #2

1529661582
Report to moderator
The World's Betting Exchange

Bet with play money. Win real Bitcoin. 5BTC Prize Fund for World Cup 2018.

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1529661582
Hero Member
*
Offline Offline

Posts: 1529661582

View Profile Personal Message (Offline)

Ignore
1529661582
Reply with quote  #2

1529661582
Report to moderator
1529661582
Hero Member
*
Offline Offline

Posts: 1529661582

View Profile Personal Message (Offline)

Ignore
1529661582
Reply with quote  #2

1529661582
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1442
Merit: 1352


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
March 16, 2017, 09:59:59 PM
 #2

Segwit essentially introduces a new transaction format. It introduces a new transaction format which is just the current one but with 2 additional bytes signalling that it is the new format, and the additional witnesses field before the nLocktime. When a node connects to another node, it tells that node that it supports segwit. So, that other node, if it also supports segwit, will send transactions with the segwit format. When it goes to send a block, it will send the block with the transactions also serialized in the segwit format. If a node does not say that it supports segwit or if a transaction does not use the witnesses field, then the transaction will be sent with the original format without the witnesses field.

The merkle root of the block header contains the hash of the txids. There will be an additional merkle root of the hashes of all the transactions in the block which will be put in an OP_RETURN output of the coinbase.

piotr_n
Legendary
*
Offline Offline

Activity: 1890
Merit: 1002


aka tonikt


View Profile WWW
March 17, 2017, 04:01:17 PM
 #3

You don't download witnesses data separately.

You use new network API to fetch txs (or blocks containing such txs) that have witness data already embedded inside.

Specifically you set an extra bit in the type field inside getdata commands

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!