--- Log opened Thu Jun 16 00:00:55 2022 00:05 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 00:10 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 244 seconds] 00:12 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 00:16 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 256 seconds] 00:22 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 00:27 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 246 seconds] 00:27 -!- __gotcha [~Thunderbi@natx-145.kulnet.kuleuven.be] has joined #bitcoin-core-pr-reviews 00:27 -!- hashfunc1f17 [~user@2601:5c0:c280:7090:30da:f74b:fc0a:7f05] has quit [Remote host closed the connection] 00:52 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 00:57 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 01:20 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 01:20 -!- gleb7454386853 [~gleb@178.150.137.228] has joined #bitcoin-core-pr-reviews 01:21 -!- gleb745438685 [~gleb@178.150.137.228] has quit [Ping timeout: 246 seconds] 01:24 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 01:30 -!- hebasto_ [sid449604@id-449604.uxbridge.irccloud.com] has quit [] 01:30 -!- hebasto [sid449604@id-449604.uxbridge.irccloud.com] has joined #bitcoin-core-pr-reviews 01:31 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 01:35 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 240 seconds] 01:37 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 01:41 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 258 seconds] 01:59 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 02:03 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 260 seconds] 02:10 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 02:14 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 240 seconds] 02:16 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 02:26 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 272 seconds] 02:27 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 02:31 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 02:47 -!- TheRec [~toto@user/therec] has quit [Ping timeout: 256 seconds] 02:49 -!- __gotcha [~Thunderbi@natx-145.kulnet.kuleuven.be] has quit [Ping timeout: 246 seconds] 02:55 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 02:59 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 240 seconds] 03:05 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 03:10 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 03:11 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 03:16 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 244 seconds] 03:22 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 03:27 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 244 seconds] 03:33 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 03:37 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has quit [Ping timeout: 240 seconds] 03:38 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 03:44 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 03:49 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 272 seconds] 03:55 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 04:00 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 04:01 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 04:06 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 252 seconds] 04:12 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 04:17 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 252 seconds] 04:18 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 04:39 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Remote host closed the connection] 04:41 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 04:46 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 04:52 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 04:57 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 258 seconds] 04:58 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 05:03 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 252 seconds] 05:09 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 05:13 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 244 seconds] 05:20 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 05:24 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 258 seconds] 05:26 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 05:31 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 05:35 -!- TheRec [~toto@84.75.225.47] has joined #bitcoin-core-pr-reviews 05:35 -!- TheRec [~toto@84.75.225.47] has quit [Changing host] 05:35 -!- TheRec [~toto@user/therec] has joined #bitcoin-core-pr-reviews 05:37 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 05:38 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has joined #bitcoin-core-pr-reviews 05:41 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 260 seconds] 05:48 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 05:52 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 276 seconds] 05:54 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 05:58 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 240 seconds] 06:22 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 06:26 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 240 seconds] 06:33 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 06:41 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 248 seconds] 06:48 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 06:52 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 240 seconds] 06:59 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 07:03 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 07:05 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 07:07 -!- fanquake [sid369002@id-369002.ilkley.irccloud.com] has quit [Changing host] 07:07 -!- fanquake [sid369002@user/fanquake] has joined #bitcoin-core-pr-reviews 07:10 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 276 seconds] 07:10 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 07:15 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 07:18 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has quit [Ping timeout: 240 seconds] 07:21 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 07:24 -!- _0x0ff is now known as katsu 07:24 -!- katsu is now known as Guest1003 07:25 -!- Guest1003 is now known as _0x0ff 07:26 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 07:27 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 07:27 -!- _0x0ff is now known as katsu_ 07:28 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has joined #bitcoin-core-pr-reviews 07:32 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 07:34 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has quit [Ping timeout: 240 seconds] 07:38 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 07:43 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 258 seconds] 07:48 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has joined #bitcoin-core-pr-reviews 07:49 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 07:53 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has quit [Ping timeout: 240 seconds] 07:53 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 240 seconds] 07:55 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 07:59 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 252 seconds] 08:02 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 08:17 -!- ryanofsky_ is now known as ryanofsky 08:20 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has joined #bitcoin-core-pr-reviews 08:37 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has quit [Ping timeout: 240 seconds] 08:55 -!- evbo [~bosats@2601:47:4285:c7f0:ed8f:bf53:e0cf:e665] has joined #bitcoin-core-pr-reviews 09:04 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has joined #bitcoin-core-pr-reviews 09:30 -!- belcher [~belcher@user/belcher] has joined #bitcoin-core-pr-reviews 09:38 -!- evanlinjin [~evanlinji@gateway/tor-sasl/evanlinjin] has quit [Ping timeout: 240 seconds] 10:43 < pinheadmz> strict DER sigs in bitcoin are 70-72 bytes, but what affects that ultimate size? I find that when i sign the same TX with the same private key, the sig is always the same size. Is that expected? or should it be more random? 10:43 -!- Talkless [~Talkless@mail.dargis.net] has joined #bitcoin-core-pr-reviews 10:44 < sipa> signatures encode two integers, R and S, in a variable-length signed integer encoding. 10:45 < pinheadmz> so is this like, if a number is small enough we can eliminate a leading 00 or something? 10:45 < sipa> Not only can you, by BIP66 you must. 10:45 < pinheadmz> ah ok 10:46 < pinheadmz> so then does it make sense for a sig to always be the same size if key / msg are the same? 10:46 < sipa> If a value is between 2^248 and below 2^255, the encoding is 32 bytes. 10:46 < sipa> If it's at least 2^256, the encoding is 33 bytes. 10:46 < sipa> Eh, at least 2^255. 10:46 < sipa> Sorry, I'm being confusing. Let me start over. 10:47 < pinheadmz> what ive got here is a bcoin test on a wallet pull request, where for some reason i can not figure out, the new tx size in this test is 1 byte longer and both on master and in the branch, the test always produces the same size tx 10:47 < pinheadmz> so both branches are always consistent with themselves, but the branch sig is 1 byte longer 10:48 < sipa> Look at the bitlength of the number to encode. If it's at least 255 bits: 33 bytes. If it's at least 247 bits: 32 bytes. If it's at least 239 bits: 31 bytes. If it's at least 231 bits: 30 bytes. Etc. 10:49 < sipa> BIP62 rule 5 (not consensus, but adopted as policy) requires that the S value should be in the lower half, so S cannot exceed 2^255 already. This means that with probability 255/256, the S encoding will be 32 bytes. 10:50 < sipa> But once every 256 signatures, S will be 31 bytes only, or less. 10:51 < sipa> For the R value it's a bit more complicated. If you're doing low-R grinding, like Bitcoin Core does, the same rule applies for R, and 255 out of 256 signatures, R will be 32 bytes, and once every 256 sigs it will be 31 bytes or less. 10:51 < sipa> If you're not doing low-R grinding, there is roughly a 50% probability that R is 33 bytes, and 50% probability that's it's 32 bytes or less. 10:52 < pinheadmz> oh interesting -- i thought actually R was determinsitic somehow? 10:53 < sipa> Yes, but that's entirely orthogonal. 10:53 < pinheadmz> ok 10:53 < sipa> My probabilities are not for re-signing; they're across multiple signatures (with different keys/messages). 10:53 < pinheadmz> ok yes, thanks that makes sense 10:53 < pinheadmz> so lets talk about re-signing though 10:54 < pinheadmz> if you sign once and get 72 bytes, will it always be 72 bytes with every re-sign? 10:54 < sipa> If you use a deterministic signature algorithm, then by definition the signature is deterministic. 10:54 < sipa> Signing the same message again with the same key, you'll get the same signature. 10:55 < pinheadmz> right ofc 10:55 < pinheadmz> sorry for bugging you with a "by definition" answer ! :-P 10:56 < pinheadmz> whats really bonkers here is that the PR branch shouldnt be affecting the test vector or the signing function at all 10:56 < pinheadmz> and yet for some reason on the branch, the sig has changed size 10:56 < pinheadmz> i must be missing something 10:56 < sipa> Can you show me the signature? 10:57 < pinheadmz> https://gist.github.com/pinheadmz/d2c17d41c1861bb795ef4853ef603144 10:57 < pinheadmz> heres both 10:57 < pinheadmz> 3 inputs 10:58 < pinheadmz> first tx, sigs 2 & 3 are 72 bytes. second tx sigs 2 & 3 are 71 10:58 -!- yashraj [yashraj@gateway/vpn/protonvpn/yashraj] has joined #bitcoin-core-pr-reviews 10:59 < sipa> in your gistfile1, the (R,S) lengths are respectively (33, 32), (33, 32), (33, 32). 10:59 < sipa> in gistfile2, they are (33, 32), (32, 32), (32, 32) 11:00 < sipa> but all 3 signature are different 11:01 < sipa> so your signing algorithm must have changed 11:05 < sipa> Are all the signature valid? 11:25 < pinheadmz> yes but it is a test and the outputs being spent are from a regtest coinbase 11:25 < pinheadmz> so there could be some funny business in there 11:31 -!- MacroFake_ [~none@72.5.34.65] has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in] 11:31 -!- MacroFake [~none@72.5.34.65] has joined #bitcoin-core-pr-reviews 11:33 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Remote host closed the connection] 11:33 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 11:35 -!- MacroFake [~none@72.5.34.65] has quit [Client Quit] 11:35 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Remote host closed the connection] 11:36 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 11:36 -!- MacroFake [~none@72.5.34.65] has joined #bitcoin-core-pr-reviews 11:36 -!- MacroFake [~none@72.5.34.65] has quit [Remote host closed the connection] 11:37 -!- MacroFake [~none@72.5.34.65] has joined #bitcoin-core-pr-reviews 11:40 -!- yashraj [yashraj@gateway/vpn/protonvpn/yashraj] has quit [] 11:41 -!- yashraj [yashraj@gateway/vpn/protonvpn/yashraj] has joined #bitcoin-core-pr-reviews 11:42 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 244 seconds] 11:43 -!- yashraj [yashraj@gateway/vpn/protonvpn/yashraj] has quit [Client Quit] 11:43 -!- yashraj [yashraj@gateway/vpn/protonvpn/yashraj] has joined #bitcoin-core-pr-reviews 11:44 < pinheadmz> actually what changed was the tx size estimation used in fee calculation. so whats most likely happening i guess is that the tx on the branch is NOT identical to the one on master, there is a slight difference in one of the output amounts 11:45 < pinheadmz> that would be enough to derive a different R ? 11:45 < sipa> it is required to be enough :D 11:45 < sipa> if R doesn't change, the key doesn't change, but the message does change... your signatures reveal the private key. 11:46 < pinheadmz> haha right! 11:46 < Murch> If you change the size estimation to expect r-grinding, the calculated fee will be slightly less, the change thus bigger 11:46 -!- yashraj [yashraj@gateway/vpn/protonvpn/yashraj] has quit [Read error: Connection reset by peer] 11:46 < Murch> Ah wait, the first R is still 33 11:46 < Murch> so not r-grinding 11:46 < Murch> but the size estimation could have still changed the fee and thus the change 11:47 -!- MacroFake [~none@72.5.34.65] has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in] 11:47 < pinheadmz> yeah, bcoin uses libsecp256k1 for signing, so if thats where r-grinding happens, it should be the same as core 11:47 -!- MacroFake [~none@72.5.34.65] has joined #bitcoin-core-pr-reviews 11:47 < sipa> I'd suggest you implement R grinding independently of all of this, as it'll save a tiny bit of fees, and make tx sizes a bit more predictable. 11:47 < sipa> But that's not what's going on here. 11:47 < pinheadmz> but in the wallet, the size estimation is not perfect (JJ forgot the 2 bytes for witness marker, for example) 11:47 < sipa> No, r-grinding is done on top. 11:47 < pinheadmz> oh ok 11:49 -!- MacroFake [~none@72.5.34.65] has quit [Client Quit] 11:49 -!- MacroFake [~none@72.5.34.65] has joined #bitcoin-core-pr-reviews 11:50 -!- MacroFake [~none@72.5.34.65] has quit [Remote host closed the connection] 11:50 -!- Henry151_ is now known as Henry151 11:53 < Murch> "but in the wallet, the size..." <- yeah, if your estimate changed by two WU, it'll slightly change the size of the fee and thus your tx will be different and your sigs will be different 11:53 < Murch> :) 11:53 < pinheadmz> thats what we got here! 11:53 < pinheadmz> so whats r grinding ? 11:53 -!- MacroFake [~none@72.5.34.65] has joined #bitcoin-core-pr-reviews 11:54 < pinheadmz> my guess, finding a smaller R value so you pay less fee? 11:54 < sipa> just trying multiple signatures until you hit once whose R value is below 2^255 11:55 < sipa> which on average only needs 2 tries 11:55 < sipa> (if you're using a deterministic nonce algorithm, the iteration number needs to be fed to the nonce computation obviously, otherwise you'll always reach the same R) 11:55 < pinheadmz> aha 11:55 < pinheadmz> and the purpose paying less fee? smaller tx? 11:56 < sipa> i'd say the primary advantage is reducing variance in expected tx size 11:56 < pinheadmz> ahhh 11:57 < sipa> without R grinding, you have 50% chance of 72 byte sigs, 50% chance of 71 byte sigs or less 11:57 < sipa> with R grinding you have 99.6% of 71 byte sigs, and 0.4% for 70 bytes or less 11:57 < pinheadmz> makes sense - probably this whole conversation wouldnt have happened if we are r grinding then 11:58 < pinheadmz> and by "probably" i apparently mean 0.4% 11:58 < sipa> https://bitcoin.stackexchange.com/a/112666/208 11:59 < pinheadmz> cool thanks! 11:59 < sipa> so the exact numbers are: 12:00 < sipa> - without r grinding: 49.805% 71 bytes, 49.80% 70 bytes, 0.39% 69 bytes or less 12:01 < sipa> - with r grinding: 99.22% 70 bytes, 0.775% 69 bytes or less 12:01 < sipa> (this is excluding the sighash byte, so add one for actual script signatures) 12:01 < pinheadmz> really cool thanks 12:03 < Murch> pinheadmz: Yeah, your txsize is more predictable, and if it's not what you expect its smaller. Usually, you have to estimate with a 72 B signature so you never underestimate (which could e.g. get you in trouble with the minRelayTxFeerate or unnamed services that require a minimum feerate for payments), so you can generally estimate with one byte less per signature and thus save on fees, too. 12:04 < pinheadmz> makes sense, maybe we can integrate that as well 12:04 < Murch> Also, your transactions will look more like those of other wallets that have already adopted R-grinding 12:04 < Murch> ;) 12:04 < pinheadmz> its only June and my SoB student already wrote BnB plus two other coin selection algos 12:05 < sipa> what a great SoB story 12:05 < Murch> Someone gave a talk at BTC++ in Austin last week with a wishlist of things all wallets should be doing 12:05 < pinheadmz> bip69? 12:05 < Murch> Let me try to find the list of things 12:05 * pinheadmz ducks 12:06 < Murch> low-R grinding, anti-fee sniping, randomly sorted inputs/outputs (NOT BIP69) 12:06 < Murch> ^^ 12:07 < Murch> the other things aren't quite as low hanging fruits: design your wallet to lead users away from address reuse and use P2TR ^^ 12:08 < Murch> Note this is just the opinion of the speaker, tho 12:08 < Murch> which was me 12:08 < Murch> ^^ 12:09 < pinheadmz> haha 12:09 < Murch> pinheadmz: If you have multiple coin selection algorithms, what do you use to pick the input set from the generated candidates? 12:09 < pinheadmz> Murch Someone gave a talk at BTC++ in Austin last week 12:09 < pinheadmz> lol 12:09 < pinheadmz> we're working on that 12:09 < pinheadmz> not sure how well end up 12:09 -!- gleb7454386853 [~gleb@178.150.137.228] has quit [Quit: The Lounge - https://thelounge.chat] 12:10 -!- gleb745438685 [~gleb@178.150.137.228] has joined #bitcoin-core-pr-reviews 12:10 < Murch> The waste metric has been working pretty well for us 12:10 < pinheadmz> probably bnb x attempts then fallback to his value based picker then finally random knapsack if everything else fails 12:10 < pinheadmz> were also going to bench mark by speed 12:10 < Murch> aaaaaaah, you didn't implement Knapsack in bcoin, did you? 12:10 < pinheadmz> one of the main goals is to sort wallet coins by value to reduce DB calls and memory for big wallets 12:11 < Murch> https://murch.one/posts/waste-metric/ 12:11 < pinheadmz> right now bcoin basically just always picks the largets coin in your wallet and then adds more coins until > target 12:11 < pinheadmz> lots of room for improvement 12:11 < Murch> So, basically largest first selection 12:11 < sipa> that sounds a recipe for quickly grinding down your wallet's UTXO pool to dust 12:12 < Murch> Yeah largest-first does well to minimize the next transaction's fees, but pretty poorly for UTXO pool composition and overall fees 12:16 -!- evbo [~bosats@2601:47:4285:c7f0:ed8f:bf53:e0cf:e665] has quit [Ping timeout: 244 seconds] 12:17 < Murch> I think I also touch on LF here: https://bitcoin.stackexchange.com/a/32445/5406 12:25 -!- Talkless [~Talkless@mail.dargis.net] has quit [Quit: Konversation terminated!] 12:31 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 12:35 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 12:40 -!- belcher [~belcher@user/belcher] has quit [Quit: Leaving] 13:20 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 13:25 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 13:30 -!- fjahr_ is now known as fjahr 13:54 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 13:59 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 276 seconds] 14:26 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 15:08 -!- stick_ [sid403625@id-403625.lymington.irccloud.com] has quit [] 15:09 -!- stick [sid403625@user/prusnak] has joined #bitcoin-core-pr-reviews 15:20 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Remote host closed the connection] 15:20 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 15:25 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 15:31 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 15:36 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 15:37 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 15:42 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 15:48 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 15:53 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 260 seconds] 15:59 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 16:04 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 256 seconds] 16:05 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 16:10 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 16:16 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 16:20 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 16:22 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 16:26 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 16:27 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 16:32 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 16:38 -!- Guest3756 [~Guest37@138.199.43.89] has joined #bitcoin-core-pr-reviews 16:38 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 16:42 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 240 seconds] 16:44 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 16:49 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 17:06 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 17:10 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 240 seconds] 17:39 -!- Guest3756 [~Guest37@138.199.43.89] has quit [Ping timeout: 252 seconds] 17:40 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 17:45 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 18:07 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 18:12 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 260 seconds] 18:19 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 18:23 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 252 seconds] 18:29 -!- yashraj [yashraj@gateway/vpn/protonvpn/yashraj] has joined #bitcoin-core-pr-reviews 18:29 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 18:31 -!- yashraj [yashraj@gateway/vpn/protonvpn/yashraj] has quit [Client Quit] 18:34 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 244 seconds] 18:36 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 18:40 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 18:46 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 18:51 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 18:57 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 19:02 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 19:03 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 19:08 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 19:14 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 19:19 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 19:20 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 19:25 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 258 seconds] 19:31 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 19:35 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 19:42 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 19:46 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 19:53 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 19:58 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 19:59 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 20:03 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 20:10 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 20:15 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 20:16 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 20:20 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 20:49 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 20:53 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 240 seconds] 20:55 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 20:59 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 21:00 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 21:05 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 258 seconds] 21:39 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 21:44 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 21:50 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 21:54 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 258 seconds] 21:56 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 22:01 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 22:01 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 22:05 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 246 seconds] 22:12 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 22:17 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 244 seconds] 22:23 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 22:28 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 22:29 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 22:34 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 246 seconds] 22:46 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 22:51 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 22:51 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 22:56 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 258 seconds] 23:02 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 23:07 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 23:08 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 23:13 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 23:19 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 23:23 -!- hashfunc1813 [~user@2601:5c0:c280:7090:30da:f74b:fc0a:7f05] has joined #bitcoin-core-pr-reviews 23:23 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] 23:25 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 23:30 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 23:30 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 23:35 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 260 seconds] 23:41 -!- brunoerg [~brunoerg@187.183.43.40] has joined #bitcoin-core-pr-reviews 23:46 -!- brunoerg [~brunoerg@187.183.43.40] has quit [Ping timeout: 248 seconds] 23:47 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has joined #bitcoin-core-pr-reviews 23:52 -!- brunoerg [~brunoerg@2804:14d:5281:8ae2:e9a0:34e1:9d52:e288] has quit [Ping timeout: 248 seconds] --- Log closed Fri Jun 17 00:00:55 2022