Transcript for #bitcoin-dev 2017/12/24

00:12 eck how do i enable segwit for a regtest bitcoind instance
00:13 eck when i use the addwitnessaddress rpc with my regtest node i get an error "Segregated witness not enabled on network"
00:14 eck oh it appears i just needed to generate more blocks
00:14 eck got it now
03:29 jb55 updated my bitcoin unit calculator: I've expanded the grammer so it can do stuff like: 'bcalc 100 mbtc + 300 bits in btc' -> 0.1003 BTC
04:27 eck what is the vsize in decoderawtransaction
04:27 eck i thought it was block weight, but in that case i would have expected it to be at least as large as size
04:34 eck i think i get it now
04:34 eck src/core_write.cpp: entry.pushKV("vsize", (GetTransactionWeight(tx) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR);
04:58 adiabat eck: vsize is just weight / 4
04:59 adiabat which is kindof confusing that both appear in different places
05:03 eck the extra + 3 term was throwing me off but i realize now it's to force the value to be rounded up to the next integer
05:08 eck how do you create a native (not embedded within p2sh) p2wpkh address with bitcoin core?
07:02 DSidH eck: I am not an expert on segwit but I think its not possible to have native (non-P2SH) segwit address.
07:04 eck they're in bip141:
07:05 eck but it looks like there's only human-readable syntax for them defined in bech32
07:21 DSidH yes I have not seen much about non P2SH P2WKH addresses
07:22 DSidH quick question: Even if I start using segwit, I won't see much difference in tx confirmation time if rest of the network is not using it.. Right?
07:22 eck it will not affect tx confirmation time at all
07:23 eck from a miner's pov the best thing to do is to include the most profitable transactions, whether they are segwit or not
07:24 DSidH yup but since the segwit tx will be smaller, it will be equivalent to a
07:24 DSidH "high fee" normal tx
07:25 DSidH unless the miner thinks that even having extra witness payload is "not profitable"
07:26 eck also note, you only get the lower block weight if you're spending *from* a sw address
07:29 DSidH yup, and that too a pure segwit tx, since mixed inputs don't give as much benefit
07:33 DSidH I am having trouble understanding the RFC6979 for deterministic generation of k values for ECDSA
07:34 DSidH Is there a dummies version of it? What do others use for deterministic k values?
07:34 DSidH this is the document:
07:35 arubi what are you not understanding, it's pretty much a bunch of hmac-sha512
07:35 DSidH I got lost in various bit conversions
07:36 DSidH and the examples do not use Secp256k1 so I am not able to test the algorithm
07:36 DSidH are there any test vectors for Secp256k1 for this algorithm?
07:37 arubi and
07:37 DSidH (examples in the rfc use ansix9t163k1)
07:38 arubi hmac itself is
07:38 DSidH arubi: thanks.. these should help
07:38 arubi but -- I'm a hobbyist, this is definitely not something you should use on actual money :)
07:41 DSidH arubi: you mean the test vectors may not be correct or the RFC itself may not be secure ?
07:41 arubi s/hmac-sha512/hmac-sha256/ . got confused with bip32
07:42 arubi the test vectors are correct, this code is consistent with what core gets for k
07:42 arubi but maybe I got some edge case wrong, not sure. it's hard to know
07:48 DSidH and does core also use RFC6979 ?
07:49 echeveria the underlying crypto library does.
07:52 arubi right, the code is in libsecp256k1
07:52 DSidH ok so I think Im on the right track. I was otherwise thinking of writing a custom algorithm for k = Hash(x, h)
07:53 arubi if it's just for testnet then it's fine, but there has to be a good reason for a simple hash(x,h) not being used
08:04 DSidH its currently testnet but the goal is to use in mainnet
08:22 arubi ah, alright. probably best to use the standard practices then
14:50 DSidH eck: based on this the only examples are P2SH-P2WPKH.
14:51 DSidH I mean the others don't seem to be that popular
15:09 arubi what else are you looking for DSidH ?
16:10 DSidH arubi: I am good for now. Just need to test my RFC implementation.
16:10 arubi cool DSidH
16:11 DSidH arubi: btw you saved me several days ot trial and error
16:11 arubi yw :)