Transcript for #bitcoin-dev 2017/04/12

16:45 arubi comboy, this transaction for example should be valid in a block: 0200000001185CFA49ECEF94EA5B5D8060EE54F8B712E3BC70C796104283AB608E4035A4AE01000000823F303902153B78CE563F89A0ED9414F5AA28AD0D96D6795F9C63022007A8587BDBF2403AE8A906097C698D3EEE8E2CA060E874F2ABF8BD7D74A4EF7A010000004106C820A097E351082D630171B6BB4A88CDCDD65861574134A0C1115AC36C5947E8B02684723E4CAF3390EA8B6E8D7B589EDBBB0A33B73154E7CBE6D18F59CAA46AFDFFFFFF01005A6202000000001976A9141677
16:45 arubi 5C283DA58904E1E9EDF77849750191B2B74288AC00000000 . if anyone can push that into a testnet block (I lack the specialized software :) ), that should be interesting
16:46 arubi using 0x01000000 as sighash, and a short 'r' value to keep the signature under 72 bytes just in case
17:39 comboy arubi: sa are you saying it's not last byte but instead parse DER and last 4 bytes of what remains? wouldn't that make that check https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L142 fail?
17:41 comboy wait, it's "- 7" so I guesss 1 byte total length 1 byte R length and 1 byte S length and that would leave 4 for sighash type, but the comment at the top says that sighash is 1-byte value
17:42 arubi 0x30, <compound length>, 0x02, <r length>, 0x02, <s length>
17:42 comboy I meant +7
17:42 arubi that's 6, one more for sighash byte
17:42 arubi you're right
17:43 arubi but.. hmm..
17:43 comboy ah there are those separators too I missed that
17:43 arubi does it /have/ to run? what if strictder isn't enforced
17:44 arubi comboy, this transaction will either be on testnet or my node will be banned from every peer. you will see :)
17:44 comboy arubi: I haven't yet found place in code where this sighash byte(s) is extracted
17:44 arubi function is consensus critical since bip66..
17:44 arubi maybe that's why it worked on regtest and fails on testnet
17:44 Chris_Stewart_5 comboy: IIRC there is a 'TransactionSignatureChecker' that it is done in
17:45 comboy arubi: lol, but If the rest would match, I think 0x00 as the type is allowed too
17:46 arubi Chris_Stewart_5, I think 4 bytes are just consumed and checked against known rules
17:46 arubi 4, or 1 byte, shouldn't matter. the sighash type function doesn't check for length at all
17:46 arubi comboy, 0x00 isn't allowed
17:47 arubi well, maybe it is
17:47 JackH can wallet dir be separate from datadir in core?
17:47 arubi in sighashv2 it means NONE
17:47 JackH are those settings possible?
17:47 arubi dunno :(
17:47 arubi /brb
17:49 comboy Chris_Stewart_5: thanks, I guess it is one byte https://github.com/bitcoin/bitcoin/blob/8152d3fe57a991e9088d0b9d261d2b10936f45a9/src/script/inter...
17:59 arubi I still maintain that the block that I mined on regtest with bip66 being inactive and a 4 byte sighash was valid, but seems that not anymore