--- Log opened Thu Feb 18 00:00:33 2021 00:06 -!- jonatack_ [~jon@37.167.103.144] has quit [Quit: jonatack_] 00:07 -!- jonatack [~jon@37.167.103.144] has joined #rust-bitcoin 00:20 -!- dongcarl [~dongcarl@unaffiliated/dongcarl] has quit [Quit: Ping timeout (120 seconds)] 00:21 -!- dongcarl [~dongcarl@unaffiliated/dongcarl] has joined #rust-bitcoin 01:01 -!- jeremyrubin [~jr@024-176-247-182.res.spectrum.com] has quit [Ping timeout: 256 seconds] 02:10 -!- shesek [~shesek@unaffiliated/shesek] has quit [Remote host closed the connection] 03:54 -!- jonatack [~jon@37.167.103.144] has quit [Read error: Connection reset by peer] 03:57 -!- Beau27Will [~Beau27Wil@static.57.1.216.95.clients.your-server.de] has joined #rust-bitcoin 04:08 -!- Beau27Will [~Beau27Wil@static.57.1.216.95.clients.your-server.de] has quit [Ping timeout: 240 seconds] 04:37 -!- tibo [~tibo@2400:4050:2a83:7000:9dee:b292:7cab:a170] has quit [Remote host closed the connection] 05:02 -!- Mateo18Walter [~Mateo18Wa@static.57.1.216.95.clients.your-server.de] has joined #rust-bitcoin 05:30 -!- Mateo18Walter [~Mateo18Wa@static.57.1.216.95.clients.your-server.de] has quit [Remote host closed the connection] 05:32 -!- Kiminuo [~Kiminuo@141.98.103.140] has quit [Ping timeout: 240 seconds] 05:34 -!- Isom18Jacobs [~Isom18Jac@static.57.1.216.95.clients.your-server.de] has joined #rust-bitcoin 07:12 -!- gribble [~gribble@unaffiliated/nanotube/bot/gribble] has quit [Remote host closed the connection] 07:16 -!- gribble [~gribble@unaffiliated/nanotube/bot/gribble] has joined #rust-bitcoin 07:19 -!- jonatack [~jon@37.169.13.22] has joined #rust-bitcoin 07:33 -!- jonatack [~jon@37.169.13.22] has quit [Quit: jonatack] 07:42 -!- Kiminuo [~Kiminuo@141.98.103.140] has joined #rust-bitcoin 08:02 -!- belcher_ is now known as belcher 08:03 -!- Kimi [~Kiminuo@193.9.112.252] has joined #rust-bitcoin 08:06 -!- Kiminuo [~Kiminuo@141.98.103.140] has quit [Ping timeout: 256 seconds] 08:13 -!- da39a3ee5e6b4b0d [~da39a3ee5@2403:6200:8876:b8ec:d51f:19ab:810a:831a] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…] 08:50 -!- jeremyrubin [~jr@024-176-247-182.res.spectrum.com] has joined #rust-bitcoin 09:20 -!- Kimi [~Kiminuo@193.9.112.252] has quit [Ping timeout: 256 seconds] 09:50 -!- ghost43 [~daer@gateway/tor-sasl/daer] has joined #rust-bitcoin 09:50 -!- ghost43_ [~daer@gateway/tor-sasl/daer] has quit [Quit: Leaving] 10:22 < darosior> andytoshi: what was the rationale for having SIgHashType from() and as() u32 instead of u8? I'm preparing a patch for from_standard() to err on policy-invalid sighashes and wanted to take an u8 as parameter 10:24 -!- Isom18Jacobs [~Isom18Jac@static.57.1.216.95.clients.your-server.de] has quit [Ping timeout: 256 seconds] 10:25 < andytoshi> darosior: they are u32s when encoded in the sighash 10:42 < darosior> andytoshi: but why are they encoded as u32 ? Double checked with bitcoind and it serializes them as int32 fwiw, but i'm not sure how it could be >1 bytes in any case 10:44 < andytoshi> hmm i guess it should be i32 then 10:44 < andytoshi> and no, there is no way to get outside the range 0-255 in bitcoin today 10:45 < andytoshi> it's mostly 32-bits wide so that i could easily get my bcash out with minimal changes to my wallet code 10:45 < andytoshi> i could be convinced to narrow it, but i'm unconvinced that we won't have another bcash-like scenario in future, and "changing the bits of the sighashflag that aren't otherwise accessible" seems to be the standard way to do replay protection on bitcoin forks 10:45 < darosior> Ok, would a patch unnecessarily breaking the API to make it i32 be a good idea then? Probably not 10:46 < andytoshi> i don't think so, there isn't any difference between u32 and i32 in terms of serialization 10:46 < andytoshi> except that i32 is a bit harder to think about 10:46 < darosior> Ok, thanks for the explanation definitely didn't consider this! 10:47 < darosior> What do you think about from_u32_standard() btw? 10:47 < andytoshi> what would that do? 10:47 < darosior> Error if the sighash type is not standard 10:47 < andytoshi> oh, neat, yeah that seems reasonable 11:15 -!- fjahr [sid374480@gateway/web/irccloud.com/x-fnsvciziwascrtax] has quit [Remote host closed the connection] 11:15 -!- sgeisler [sid356034@gateway/web/irccloud.com/x-tlwxmxwknqasjvbg] has quit [Remote host closed the connection] 11:52 -!- sgeisler [sid356034@gateway/web/irccloud.com/x-bidhhbtsnurujrsf] has joined #rust-bitcoin 11:58 -!- fjahr [sid374480@gateway/web/irccloud.com/x-hhqouwnzitxxomzo] has joined #rust-bitcoin 13:05 -!- fjahr [sid374480@gateway/web/irccloud.com/x-hhqouwnzitxxomzo] has quit [Remote host closed the connection] 13:05 -!- sgeisler [sid356034@gateway/web/irccloud.com/x-bidhhbtsnurujrsf] has quit [Remote host closed the connection] 13:18 -!- sgeisler [sid356034@gateway/web/irccloud.com/x-fvjrgdnvkypgaqjk] has joined #rust-bitcoin 13:28 -!- fjahr [sid374480@gateway/web/irccloud.com/x-wtgxofjmyomzqblb] has joined #rust-bitcoin 13:34 < darosior> FWIW re the discussion above, Taproot *does* define the SIGHASH type as an "8-bit unsigned number" 13:40 < andytoshi> oh interesting 13:40 < andytoshi> ah yeah darosior you're right 13:41 < darosior> And since it's invalid already to not have u8 SIGHASH types on today Bitcoin... It might make sense to go this way ? 13:43 < andytoshi> yeah i think that's reasonable 13:43 < andytoshi> though an alternate strategy might be to have a bip341 sighash type 13:43 < andytoshi> which is different from the old-school one 14:02 < darosior> Yes it seems a better idea too as the standardness rules i proposed would become consensus. The API would become a mess :/ 14:02 < darosior> But u8 applies to both 14:13 < sanket1729> I don't think we ever deserialize a sighashtype from u32 sighashmessage? Almost all cases, we are get it from last byte of the sig. 14:16 -!- DeanWeen [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 14:18 < andytoshi> or we set it by hand 14:18 < andytoshi> when signing 14:18 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has quit [Ping timeout: 268 seconds] 14:20 < sanket1729> darosior, andytoshi: The 9f mask is a bug right? 14:20 < sanket1729> https://github.com/rust-bitcoin/rust-bitcoin/pull/573#discussion_r578767912 14:21 < sanket1729> We have same mask for from_u32 method 14:23 < andytoshi> yeah, my read is that it should b eff 14:24 < darosior> Yes, to be honest i just took it from from_u32.. 14:24 < darosior> Been looking for a rationale in bitcoind source but.. 14:26 < andytoshi> o.O 14:27 < andytoshi> yeah i have no idea what i was thinking there 14:27 < andytoshi> lol i didn't realize this was my code 14:27 < andytoshi> i think i must have just been confused 14:27 < darosior> hehe, ok so correcting it since i'm at it 14:30 < andytoshi> thanks :P 14:35 < darosior> Now this gets interesting 14:35 < darosior> thread 'blockdata::transaction::tests::test_sighash' panicked at 'assertion failed: `(left == right)` 14:35 < darosior> left: `0f5647c4e5939ee2a782d6be1d4e323e4e88cdb485df49b33f97703ca30fab09`, 14:35 < darosior> right: `1e0da47eedbbb381b0e0debbb76e128d042e02e65b11125e17fd127305fc65cd`', src/blockdata/transaction.rs:982:9 14:46 < sanket1729> interesting 14:46 < darosior> Yep, see 43cb41859 in Bitcoin-Core 14:47 < darosior> Chasing ghosts, but glad this test was here! 14:50 < sanket1729> can you push your code? I am also curious what is going on here. 14:50 < sanket1729> Is it just changing 9f to ff? 14:55 < darosior> No, removing it (which has the same effect): https://0bin.net/paste/83J7xuHm#XTi25X8j4RMaahUgmSwwTvBRYrrvb7ZtxOIxCzaW-qN 14:59 < ariard> BlueMatt: left a review on #794, I think we can still dry-up the checks (standardness implies size restriction), but once done I would be glad to land this 15:00 < BlueMatt> ariard: awesome, thanks. will take a look tomorrow. I'm still knee-deep in updating rust-bitcoin (mostly cause of the secp fuzz changes) 15:00 < BlueMatt> only spent about all day on it :( 15:00 < ariard> galderz: btw don't hesitate to review beg on this chan, we're far more reactive here than GH :) 15:01 < ariard> BlueMatt: cool, reviewed again MPP today, #762 is the next one promised! 15:01 < BlueMatt> thanks 15:02 < sanket1729> I think i found it. It's a strange check in bitcoin core which I don't understand. While checking for sighash singel we are masking the last 5 bits. 15:03 < sanket1729> darosior: https://github.com/bitcoin/bitcoin/blob/b805dbb0b9c90dadef0424e5b3bf86ac308e103e/src/script/interpreter.cpp#L1628-L1633 15:03 < darosior> sanket1729: it's to deactivate ACP 15:04 < sanket1729> but why not do 7f? 15:04 < sanket1729> acp is with 0x80 15:04 < darosior> Good point, i have no idea 15:05 < sanket1729> That is why andytoshi that 9f which acp & 0x1f. Turns out we don't about bits 5 and 6 15:05 < sanket1729> acp || 0x1f 15:05 < darosior> gg 15:05 < darosior> :) 15:06 < sanket1729> well, andytoshi. Turns out that you were right all along :) . Glad that we had the exhaustive sighash tests. 15:06 < darosior> Overlooked it but yeah it's masking 1 bit more than necessary and it matches perfectly with the mysterious 0xaf 15:06 * andytoshi reading 15:06 < andytoshi> i don't get it 15:06 < andytoshi> give me a moment :P 15:07 < andytoshi> huh. ok, i guess this is consistent with Core then 15:07 < andytoshi> and maaaaybe i remember seeing this 0x1f mask, but i might be making up a memory 15:07 < andytoshi> that's so weird 15:08 < darosior> Bitcoin is ... Interesting :p 15:08 < darosior> Going to add a comment documenting it anyways 15:08 < sanket1729> darosior: Can you add another commit with a comment about how that 0x9f comes 15:08 < sanket1729> yeah 15:10 < andytoshi> thanks! 15:16 < sanket1729> darosior, andytoshi: The way to interpret it is last 5 bits are reserved output related sighash operations. (we only use 3 out of the 32 possible). 15:16 < sanket1729> The first three bits are reserved for inputs (we only use 2 out of the 8 possible) 15:17 < darosior> sanket1729: but it would be a hardfork to change it ? What is it reserved for? 15:17 < andytoshi> sanket1729: lol, ok, that interpretation makes sense i suppose 15:17 < sanket1729> I should have not used the word reserved. 15:17 < andytoshi> though as darosior says, you can't really change it 15:18 < ariard> darosior: SIGHASH_MAKE_MY_OFFCHAIN_CONTRACT_FEE_SAFE 15:18 < darosior> ariard: xD 15:18 < darosior> sanket1729: where did you get this info btw? 15:18 < sanket1729> It is more clear in taproot where the code explicitly decomposes hashtype into input_hashtype and output_hashtype 15:19 < sanket1729> I remembered looking the taproot code where it decomposed it into individual flags 15:19 < darosior> Ok, thanks! 15:19 < darosior> Definitely makes more sense now 15:45 -!- da39a3ee5e6b4b0d [~da39a3ee5@2403:6200:8876:b8ec:d51f:19ab:810a:831a] has joined #rust-bitcoin 16:21 -!- tibo [~tibo@2400:4050:2a83:7000:c481:3bff:537a:82de] has joined #rust-bitcoin 17:53 -!- belcher_ [~belcher@unaffiliated/belcher] has joined #rust-bitcoin 17:56 -!- belcher [~belcher@unaffiliated/belcher] has quit [Ping timeout: 260 seconds] 17:58 -!- belcher_ is now known as belcher 18:27 -!- belcher_ [~belcher@unaffiliated/belcher] has joined #rust-bitcoin 18:29 -!- belcher [~belcher@unaffiliated/belcher] has quit [Ping timeout: 240 seconds] 18:33 -!- da39a3ee5e6b4b0d [~da39a3ee5@2403:6200:8876:b8ec:d51f:19ab:810a:831a] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…] 18:51 -!- ghost43 [~daer@gateway/tor-sasl/daer] has quit [Remote host closed the connection] 18:51 -!- ghost43 [~daer@gateway/tor-sasl/daer] has joined #rust-bitcoin 18:57 -!- da39a3ee5e6b4b0d [~da39a3ee5@184.22.159.161] has joined #rust-bitcoin 21:32 -!- da39a3ee5e6b4b0d [~da39a3ee5@184.22.159.161] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…] 21:37 -!- reallll [~belcher@unaffiliated/belcher] has joined #rust-bitcoin 21:39 -!- belcher_ [~belcher@unaffiliated/belcher] has quit [Ping timeout: 260 seconds] 22:17 -!- da39a3ee5e6b4b0d [~da39a3ee5@node-yof.pool-118-173.dynamic.totinternet.net] has joined #rust-bitcoin 22:25 -!- da39a3ee5e6b4b0d [~da39a3ee5@node-yof.pool-118-173.dynamic.totinternet.net] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…] 22:26 -!- dongcarl [~dongcarl@unaffiliated/dongcarl] has quit [Quit: Ping timeout (120 seconds)] 22:27 -!- dongcarl [~dongcarl@unaffiliated/dongcarl] has joined #rust-bitcoin 22:39 -!- da39a3ee5e6b4b0d [~da39a3ee5@node-yof.pool-118-173.dynamic.totinternet.net] has joined #rust-bitcoin 22:39 -!- DeanWeen [~dean@gateway/tor-sasl/deanguss] has quit [Remote host closed the connection] 23:03 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 23:50 -!- DeanWeen [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 23:51 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has quit [Remote host closed the connection] --- Log closed Fri Feb 19 00:00:34 2021