--- Day changed Fri Oct 05 2018 03:42 < dongcarl> Back. Reading... 03:53 < dongcarl> I'm hearing the following things: 03:54 < dongcarl> 1. `PublicKey` and `PrivateKey` structs still look like this: https://www.irccloud.com/pastebin/KG0LFbjI/ 03:55 < dongcarl> 2. I need to address the comments on my PSBT PR 03:55 < dongcarl> 3. We need base64 encoding/decoding for PSBT 03:58 < dongcarl> stevenroose: the reason why I haven't made the fields public was because I was going to implement methods to update the PSBT struct such that it is always valid between transactions and people can't fuck it up 03:59 < dongcarl> methods to update the PSBT that are loosely based on the different roles in PSBT: updater, signer, etc. 04:03 < dongcarl> > what's the best (programmatic) way to know from a TxOut if it needs to fill witness_utxo or non_witness_utxo? The Script struct doesn't seem to have any analysis getters like "is_sw" or whatever. Can also be hidden (p2sh sw) 04:03 < dongcarl> andytoshi can confirm but I believe that script descriptors will help here, and according to the BIP174 spec: 04:03 < dongcarl> > if it is unknown whether an input spends a segwit output, this type (PSBT_IN_NON_WITNESS_UTXO) should be used. 04:04 < dongcarl> stevenroose: I wanna say I really appreciate the comments, makes me think more about ergonomics and stuff. Lmk if there are questions I haven't addressed, and I'll try to get to your comments on the PR as soon as possible. 13:00 < stevenroose> dongcarl: Yeah I'm not doing that much PSBT yet. I'm kinda finalized with the Bitcoin Core integration part because that part is the easiest (you just throw it a tx and it does everything). Next up would be Electrum or hardware wallets I guess 13:02 < dongcarl> ๐Ÿ‘๐Ÿ‘ 13:03 < dongcarl> Youโ€™re integrating what with Bitcoin Core? 17:01 < stevenroose> The proof-of-reserves tool. 17:01 < stevenroose> It has 2 stages: fetching and bundling UTXOs for a proof and signing a tx with the resulting UTXOs 17:02 < stevenroose> So there are (1) utxo collecting sources (hot wallets, watch-only wallets, manual using cli) and (2) signers (hot wallets, hw wallets, manual privkeys via cli) basically 17:03 < stevenroose> So I currently only have Bitcoin Core as both. So you can import the UTXOs a Core wallet manages. And in the second step delegate the signing to the same Core wallet. 17:04 < stevenroose> In the next steps, I'd probably better talk with some actual exchange wallet operators for how their desired procedures would be. I guess they would prefer manual UTXO provision because they probably all use some in-house proprietary wallet systems and then perhaps hardware wallet integration for signing. 17:05 < stevenroose> In step 1 I store a PSBT input with as much information as possible to make the signing possible with whatever system contains the private key for step 2. 17:06 < stevenroose> andytoshi, dongcarl I'm going down the macro road :D Having some trouble with tt matchers. I have multiple repeated tt matchers separated with a `;`. But it seems that the `;` or the `,` separators can also be a tt themselves, so I get an "ambiguity error". 17:07 < stevenroose> What matcher (tt or something else) should be used for variable names or function name, f.e.? 17:07 < stevenroose> I currently have this matches: ($cmd:tt, $res:ty, $($arg:tt: $argt:ty),*; $($oarg:tt: $oargt:ty: $oargv:expr),*) 17:08 < stevenroose> That I would like to use in the following way: macro!(getrawtransaction, ResultType, arg1: Sha256dHash, arg2: u32; optional1: String, optional2: u32) 17:09 < stevenroose> It works with a single required argument as follows: macro!(backupwallet, (), destination: &str;) 17:09 < stevenroose> But in a call with no arguments, it raises the ambiguity error: macro!(stop, (),;) (I also tried removing the last comma: macro!(stop, ();) ) 17:10 < stevenroose> Sorry to bother, it probably sucks to be looking at macros in an IRC window :D 17:11 < stevenroose> It seems that just tt is not the right matcher here because it matches all tokens, it should only match tokens that are allowed in var and function names. 17:12 < stevenroose> Ah... ident worked. I thought ident had to be already-existing identities... 17:13 < stevenroose> Oh well, nevermind then :) I'm trying to reduce all Core RPC methods to oneliners with macros :D 21:09 < stevenroose> Macronize all the things! https://github.com/stevenroose/rust-bitcoindrpc/commit/47f920902e781788aa14746a681e0fd3f823c277