--- Log opened Wed Jan 08 00:00:01 2020 02:52 -!- belcher [~belcher@unaffiliated/belcher] has joined #rust-bitcoin 02:55 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has quit [Ping timeout: 260 seconds] 03:04 -!- Elna75Mitchell [~Elna75Mit@ns334669.ip-5-196-64.eu] has joined #rust-bitcoin 03:18 -!- mauz555 [~mauz555@2a01:e35:8ab1:dea0:a099:a8db:bb4e:1019] has joined #rust-bitcoin 03:22 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 03:23 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 03:30 -!- mauz555 [~mauz555@2a01:e35:8ab1:dea0:a099:a8db:bb4e:1019] has quit [] 04:18 -!- jonatack [~jon@213.152.162.94] has joined #rust-bitcoin 06:42 -!- jonatack [~jon@213.152.162.94] has quit [Ping timeout: 268 seconds] 06:43 -!- jonatack [~jon@109.202.107.147] has joined #rust-bitcoin 07:14 -!- Kiminuo [~mix@141.98.103.220] has quit [Ping timeout: 268 seconds] 07:27 -!- jonatack [~jon@109.202.107.147] has quit [Ping timeout: 260 seconds] 08:10 < elichai2> why would #349 solve #372 08:12 < andytoshi> because it moves the hex code from rust-bitcoin to the bitcoin_hashes macros, i think 08:15 < elichai2> well it still have `extern crate hex;`, can we just drop the hex crate altogether if we have `hashes::hex`? 08:16 < andytoshi> i would like to, yeah 08:16 < andytoshi> iirc the hex crate is only used in unit tests 08:16 < andytoshi> and it has a nice `hex!` macro which is really convenient (ignores whitespace etc) 08:18 -!- Kiminuo [~mix@141.98.103.220] has joined #rust-bitcoin 08:26 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has joined #rust-bitcoin 08:46 < elichai2> any chance that `Sighash::from_hex(some)` and `Sighash::from_slice(&Vec::from_hex(some))` will result in 2 different things?! 08:47 < stevenroose> re:hex I thought I remember seeing/doing a PR that removes hex from tests as well, hmmm 08:49 -!- Elna75Mitchell [~Elna75Mit@ns334669.ip-5-196-64.eu] has quit [Ping timeout: 240 seconds] 08:49 < andytoshi> i probably have done some removal 08:49 < andytoshi> but not all 08:49 < andytoshi> elichai2: yes, there's a pretty high chance 08:49 < elichai2> andytoshi: why? 08:49 < andytoshi> given that sighashes are sha256d hashes which are always serialized backward 08:50 < elichai2> oh 08:50 < elichai2> yep I see now 08:50 < elichai2> `a0aaf7315e4b8c38ca9b92d36d4985b475a2c1a30ca498413c18f52a31dcaf74 != 74afdc312af5183c4198a40ca3c1a275b485496dd3929bca388c4b5e31f7aaa0` 08:50 < elichai2> damn it. so the test's hex aren't backwards, is that it? 08:51 < andytoshi> depends which test you mean 08:51 < andytoshi> and what "backwards" means 08:51 < elichai2> i'll give an example 08:51 < andytoshi> anything using the hex! macro for sha256d hashes will be serialized in the opposite order that bitcoin core would 08:52 < elichai2> here: https://github.com/rust-bitcoin/rust-bitcoin/blob/master/src/util/bip143.rs#L224 08:52 < elichai2> andytoshi: i'm trying to figure out "who's wrong" the hex in the tests or the `from_hex` function 08:52 < andytoshi> you'll have to check the BIP that the test vectors came from 08:52 < elichai2> (I never understood the opposite order in core) 08:52 < andytoshi> and probably bitcoin core's unit test implementation of those vectors 08:52 < andytoshi> it's just satoshi being an idiot 08:53 < elichai2> how do I know if the BIP meant the hex are in opposite order? https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki 08:53 < andytoshi> opposite of what 08:53 < andytoshi> the test vectors should be copy/pasted from the bip 08:53 < elichai2> exactly :P 08:53 < elichai2> hmm 08:53 < andytoshi> are they? 08:55 < elichai2> idk. currently I just know that when I replace `Sighash::from_slice(&Vec::from_hex(some))`(aka `hex_hash!`) with `Sighash::from_hex(some)` the tests file and it says that they're not equal but it seems the same except opposite order 08:56 < andytoshi> yeah that's because a sighash is a sha256d hash which traditionally rust-bitcoin has serialized in reverse byte order 08:56 < andytoshi> but in the BIP it is serialized in non-reversed order 08:57 < andytoshi> and there is no guidance whatsoever from core, which never serializes this kind of object 08:57 < elichai2> sounds right 08:57 < andytoshi> lol 08:57 < andytoshi> probbaly we should not reverse sighashes 08:58 < andytoshi> because whenever i serialize them, it's for debugging using xxd and sha256dsum, and it's super annoying that i need to satoshi them up.. 08:58 < andytoshi> i think there's a flag we can set in the hash type definition of sighash 08:58 < andytoshi> we shuold've caught this in #349, oops 09:00 < elichai2> hmm I think it's using `sha256d::Hash` as the "flag" 09:00 < elichai2> ie whenever it's a wrapper around sha256d then it's reversed 09:02 < andytoshi> oh lol 09:02 < andytoshi> are you sure? istr the macro having some sort of flag ... maybe i'm remembering wrong 09:02 < andytoshi> we iterated a bunch on this 09:04 < elichai2> well I don't see any other flag 09:06 < andytoshi> ok i guess i'm remmebering wrong 09:21 < elichai2> that's just great. the macros in bitcoin_hashes are still semi-broken and used `hex` :/ 09:21 < elichai2> why don't we have the `crate` keyword :( 09:27 < elichai2> wait. maybe we have it? 09:29 < elichai2> yep. my mistake 09:33 < andytoshi> lol are they broken? 09:33 < elichai2> yep 09:33 < andytoshi> in what way? 09:34 < elichai2> it used https://docs.rs/hex/0.4.0/hex/trait.FromHex.html this without noticing 09:35 < elichai2> https://github.com/rust-bitcoin/bitcoin_hashes/blob/master/src/serde_macros.rs#L10 09:36 < andytoshi> not sure what you mean by "without noticing", there are explicit use statements 09:37 < andytoshi> oh lol wait ... do you mean that the macro is using the trait from the `hex` crate 09:37 < andytoshi> instead of the one in the `hex` module? 09:37 < elichai2> I mean that the macro does `use hex::ToHex` 09:37 < andytoshi> bitcoin_hashes doesn't even depend on hex 09:37 < elichai2> doesn't specify which `hex` 09:37 < andytoshi> lol fucking rust 09:37 < elichai2> so yes. it used the hex crate until now 09:37 < elichai2> well even now 09:37 < andytoshi> ok, thanks for noticing this 09:38 < elichai2> I'll PR it in a sec, just running more tests 09:38 < elichai2> and my mouse just stopped working 09:38 < andytoshi> lol 09:38 < andytoshi> yeah, this morning i wrote a long detailed peer review and my harddrive overheated (or something) and took out my system 09:38 < andytoshi> frustrating 09:39 < elichai2> oh damn 09:39 < elichai2> for the MIT cryptosummit? 09:41 < andytoshi> yeah 09:41 < andytoshi> it's cool, i've almost rewritten it 09:41 < elichai2> is that bad or good for the writer? loool 09:43 < andytoshi> lol 09:45 < andytoshi> i'm gonna say "bad", there were a bunch of minor things (typos etc) that i think i completely lost 09:50 < elichai2> opened a PR in bitcoin_hashes 09:55 < andytoshi> thanks! i'll try to take a look rn 09:55 < andytoshi> but i have a lot of things pulling on me today, i'm at a conference so there are real-life people pulling me away from screens :) 09:57 -!- michaelfolkson [~textual@2a00:23c5:be04:e501:d831:3541:1e0f:d67e] has joined #rust-bitcoin 09:58 < elichai2> You're at RWC?! 09:59 < elichai2> so I restarted my laptop to fix my stuck mouse just so it won't boot. Here we go again... 10:04 < andytoshi> lol. linux. 10:04 < andytoshi> i am at rwc yep 10:07 < elichai2> damn I wanted to go heh 10:07 < elichai2> I'll just wait here for the vids :P 10:08 < elichai2> (which they haven't really uploaded(as separate talks) for 2019 yet ) 11:14 -!- Kiminuo [~mix@141.98.103.220] has quit [Ping timeout: 265 seconds] 12:13 -!- Kiminuo [~mix@141.98.103.220] has joined #rust-bitcoin 12:46 -!- Kiminuo [~mix@141.98.103.220] has quit [Ping timeout: 260 seconds] 12:55 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has quit [Remote host closed the connection] 12:57 -!- mryandao [~mryandao@gateway/tor-sasl/mryandao] has quit [Ping timeout: 240 seconds] 13:09 -!- mryandao [~mryandao@gateway/tor-sasl/mryandao] has joined #rust-bitcoin 13:54 -!- michaelfolkson [~textual@2a00:23c5:be04:e501:d831:3541:1e0f:d67e] has quit [Ping timeout: 252 seconds] 14:14 -!- michaelfolkson [~textual@host86-133-235-133.range86-133.btcentralplus.com] has joined #rust-bitcoin 15:44 -!- michaelfolkson [~textual@host86-133-235-133.range86-133.btcentralplus.com] has quit [Quit: Sleep mode] 15:52 -!- michaelfolkson [~textual@2a00:23c5:be04:e501:a430:fcab:6567:f900] has joined #rust-bitcoin 15:54 -!- michaelfolkson [~textual@2a00:23c5:be04:e501:a430:fcab:6567:f900] has quit [Client Quit] 16:12 -!- michaelfolkson [~textual@2a00:23c5:be04:e501:a430:fcab:6567:f900] has joined #rust-bitcoin 16:32 -!- jkczyz [~jkczyz@135.84.132.250] has quit [Ping timeout: 268 seconds] 16:33 -!- jkczyz [~jkczyz@135.84.132.250] has joined #rust-bitcoin 17:18 -!- mryandao_ [~mryandao@gateway/tor-sasl/mryandao] has joined #rust-bitcoin 17:20 -!- mryandao [~mryandao@gateway/tor-sasl/mryandao] has quit [Ping timeout: 240 seconds] 17:47 -!- mryandao_ [~mryandao@gateway/tor-sasl/mryandao] has quit [Ping timeout: 240 seconds] 17:50 -!- mryandao [~mryandao@gateway/tor-sasl/mryandao] has joined #rust-bitcoin 18:11 -!- michaelfolkson [~textual@2a00:23c5:be04:e501:a430:fcab:6567:f900] has quit [Quit: Sleep mode] 18:18 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has quit [Ping timeout: 252 seconds] 18:29 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 20:27 -!- mryandao_ [~mryandao@gateway/tor-sasl/mryandao] has joined #rust-bitcoin 20:27 -!- mryandao [~mryandao@gateway/tor-sasl/mryandao] has quit [Ping timeout: 240 seconds] 23:46 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has joined #rust-bitcoin --- Log closed Thu Jan 09 00:00:03 2020