Transcript for #bitcoin-dev 2017/12/16

04:02 LowKey Hi, I did some tx test and getting Output data mismatch for txcreate1.hex, how todo proper for create txcreate1.hex ?
11:18 DSidH can I use the same code to parse non-segwit and segwit coinbase transaction? (assuming I am not interested in the outputs)
11:18 DSidH Its not very clear from the specs how a segwit coinbase tx differs from non-segwit ones
11:31 arubi no you can't because again the transaction will have a witness
11:32 arubi what are you actually trying to do?
11:52 DSidH arubi: I need to parse a raw block
11:53 DSidH so I am getting tx one by one. When I reach a normal coinbase tx, I know how to parse it and ignore it (whether segwit or non-segwit)
11:54 DSidH correct that to: "When I reach a coinbase tx, I want to skip that many bytes and ignore it (whether segwit or non-segwit)"
11:56 DSidH will the witness be part of some older unused data or does it have new fields that older parser will not understand?
11:58 DSidH actually, another way to state the question is, if I write code to parse non-coinbase segwit tx, will that same code work for coinbase segwit tx?
11:59 DSidH (I am ignoring the actual inputs, not parsing the scripts, just need to get to end markers of each transaction for now)
12:01 arubi it will not work because of different encoding
12:01 arubi unless you have some magical way of skipping stuff without parsing its size
12:19 DSidH arubi: Lol no. finding the size is what I'm stuck at
12:20 DSidH I was reading this: --> "A coinbase transaction follows the same format as a normal transaction"
12:20 DSidH so I assumed the same would hold for segwit case
12:20 DSidH Is this true? ---> "A coinbase SEGWIT transaction follows the same format as a normal SEGWIT transaction"
12:21 arubi it is, the same as a segwit transaction
12:21 arubi it has a marker, version, witness.. just like a normal segwit transaction
12:21 arubi yep
12:21 DSidH great! thanks
12:21 arubi yw
12:25 DSidH out of curosity, why does coinbase have to be segwit? It is not spending any segwit outputs? Is it to encode other data for remaining segwit tx in the block?
12:30 DSidH nvm: I think I got my answer .. I think if the block has any (ordinary) segwit tx then it must have a segwit coinbase tx.. Hope I got this right
13:07 Sentineo all blocks must have sw coinbase ... afaik, that is the new rule byt the softfork
13:09 Sentineo is there a way to know core is doing block validation at some mkment?
13:09 Sentineo moment?
13:09 Sentineo e.g. an rpc or something?
13:09 Sentineo other than checking cpu utilisation
13:18 DSidH Sentineo: only if the block has other segwit tx. If the block has only non-segwit tx then the coinbase CAN be non-segwit too
13:18 DSidH "Segwit-incapable miners can however contribute blocks that only include non-segwit transactions that build on top of the chain that includes segwit-blocks." from
13:19 Sentineo DSidH: good to know, ty. Thought it is a strict rule. But yeah what would be the use of it without segwit tx.
14:49 DSidH I am looking at references on how to decode the witness stack items
14:49 DSidH looking for*
14:50 DSidH any recommendations?
14:54 Sentineo Imthinkmthe bip had it nicely documented
15:41 waxwing DSidH, BIP141, 143, 144 iirc
15:42 waxwing 144 tells you what the transaction serialization on-the-wire looks like
18:01 jb55 thinking about writing a cli calc that understands btc denominations... something like bcalc '50 mBTC + 200 sat'
18:01 jb55 if that doesn't exist...