--- Day changed Thu Sep 27 2018 02:02 < dongcarl> andytoshi: Just to confirm, we're going to write a wrapper around PublicKey, supporting only `Compressed` and `Uncompressed` variants? 05:20 -!- itaseski [~itaseski@213.135.176.159] has joined #rust-bitcoin 06:05 -!- itaseski_ [~itaseski@213.135.176.159] has joined #rust-bitcoin 06:07 -!- itaseski__ [~itaseski@213.135.176.159] has joined #rust-bitcoin 06:07 -!- itaseski_ [~itaseski@213.135.176.159] has quit [Read error: Connection reset by peer] 06:08 -!- itaseski [~itaseski@213.135.176.159] has quit [Ping timeout: 272 seconds] 06:22 -!- itaseski__ [~itaseski@213.135.176.159] has quit [Quit: Leaving] 11:07 < stevenroose> Quite annoying that GitHub doesn't recognize Rust functions: http://imagizer.imageshack.com/img924/7638/flg3EK.png 11:08 < dongcarl> It seems to syntax highlight fine... I think it only gives context for top-level blocks? 11:08 < dongcarl> I might be wrong tho 13:02 < andytoshi> dongcarl: yes, only compresed and uncompressed 13:10 -!- elichai2 [uid212594@gateway/web/irccloud.com/x-jylyzqyvintyjhku] has joined #rust-bitcoin 16:41 < stevenroose> dongcarl: what's the rationale for having non_witness_utxo be a Transaction and witness_utxo be a TxOut? 16:42 < dongcarl> stevenroose: I did it according to the BIP spec 16:43 < stevenroose> Is that because in the witness case, the input amount is encodable? 16:43 < dongcarl> Yes, I believe so, you can verify with achow 16:43 < stevenroose> Ah, yeah that makes sense.. It seems weird that in the witness case, you're not storing the "prevout" the outpoint you're spending in the Input, only in the Global.transaction 16:44 < andytoshi> stevenroose: yes, this reflects how actual hardware wallets work today 16:44 < andytoshi> with segwit you send them the data they need to sign (which is sufficient for them to verify change and fees) 16:45 < andytoshi> with non-segwit you have to do this ridiculous protocol where you give them the transaction corresponding to every input, they have to parse the whole stupid thing and output an encrypted signed blob attesting that they did so, then you use that blob during signing 16:46 < stevenroose> wait,what? :D 16:46 < stevenroose> what's wrong with doing that in one go? 16:47 < stevenroose> or is that exactly what psbt is trying to make them do? 17:16 < andytoshi> that's what psbt is trying to make them do...but the reason not to do it in one go is memory 17:17 < andytoshi> it'd have to keep track of its state in the transaction to be signed while parsing and extracting data from other transactiosn 17:17 < andytoshi> ledger, for example, basically streams transactions over USB and funnels the data into a signature hash, it never stores the entire thing at once 17:19 < andytoshi> mainly because they have no malloc() and C provides no way to put variable-sized data structures on the stack 17:20 < gmaxwell> andytoshi: [XKCD386] sure it does, alloca, C99 var arrays, or ...recursion (0_o). 17:21 < andytoshi> hehe, i didn't realize you were in this channel 17:22 < andytoshi> alloca is not part of the C standard; C99 var arrays give no way to tell if you're going to stack overflow, you just UB ... and ditto with recursion, but for some reason it bothers me less 17:22 < andytoshi> oh, TIL alloca is not even POSIX 17:23 < andytoshi> but yeah, you're correct, and the ledger people could do that 17:23 < gmaxwell> (alloca also doesn't tell you if you're going to overflow the stack) 17:23 < gmaxwell> I think the greater issue is that they just don't have the memory at all. 17:23 < andytoshi> that may be true. i actually don't know, i just know they're super stingy with memory in their code 17:24 < gmaxwell> esp as a transaction can be up to 100kb... 17:24 < gmaxwell> quick google claims they have 12kb ram. 17:24 < gmaxwell> in ledger blue, 10kb in nano s. 17:25 < andytoshi> heh, ok, so there's your answer stevenroose ... these signed encrypted blobs basically use the host as extra untrusted memory 17:25 < andytoshi> segwit made this _much_ easier. not to mention it allowed computing sighashes without needing to understand how to serialize transactions 17:47 < stevenroose> well, thanks :) 17:48 < stevenroose> si there code for ICBOC online available? :D 18:09 -!- Tralfaz [~none@185.156.175.43] has joined #rust-bitcoin 19:23 -!- elichai2 [uid212594@gateway/web/irccloud.com/x-jylyzqyvintyjhku] has quit [Quit: Connection closed for inactivity] 19:57 < andytoshi> stevenroose: github.com/apoelstra/icboc 19:57 < andytoshi> oh oops https://github.com/apoelstra/icebox 19:57 < andytoshi> you need pr 9 for segwit tho 19:57 < andytoshi> (review would be welcome :}) 20:41 -!- freannrak [~ar@188.166.55.44] has joined #rust-bitcoin 20:54 -!- elichai2 [uid212594@gateway/web/irccloud.com/x-xbcuhzcyamfocbun] has joined #rust-bitcoin 23:26 -!- grubles [~grubles@unaffiliated/grubles] has quit [Quit: Leaving] 23:36 -!- gribble [~gribble@unaffiliated/nanotube/bot/gribble] has quit [Read error: Connection reset by peer] 23:42 -!- gribble [~gribble@unaffiliated/nanotube/bot/gribble] has joined #rust-bitcoin