--- Day changed Thu Jul 30 2020 00:32 < sanket1729> I don't think there is any safety benefit. Current rust-miniscript does not have to deal with any secret data, which makes coding and reviewing easier in some sense. 00:33 < sanket1729> But the new PR from afilini also adds logic for creating partial sigs from extended keys for psbt. 00:34 < sanket1729> Right now, the role of rust-miniscript psbt is limited to finalizer where it only finalizes it given partialsigs 00:42 < sanket1729> Another benefit that miniscript offers while signer role in psbt is that it can list all keys in the spending script. The signer can then check whether it controls any of those and then sign with them. So, as such there is benefit to miniscript for signers too, not just the finalizer. 01:17 -!- jeremyrubin [~jr@2601:645:c200:f539:149c:f818:6125:256e] has quit [Ping timeout: 244 seconds] 01:19 < sanket1729> andytoshi: Can you also take a look at this comment https://github.com/rust-bitcoin/rust-miniscript/pull/116#issuecomment-666218638 ? 01:38 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has quit [Quit: jonatack] 01:53 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has joined ##miniscript 02:51 -!- shesek [~shesek@unaffiliated/shesek] has quit [Remote host closed the connection] 02:51 -!- shesek [~shesek@164.90.217.137] has joined ##miniscript 02:51 -!- shesek [~shesek@164.90.217.137] has quit [Changing host] 02:51 -!- shesek [~shesek@unaffiliated/shesek] has joined ##miniscript 10:10 -!- jeremyrubin [~jr@2601:645:c200:f539:149c:f818:6125:256e] has joined ##miniscript 10:24 -!- jb55 [~jb55@gateway/tor-sasl/jb55] has quit [Quit: jb55] 10:29 -!- jb55 [~jb55@gateway/tor-sasl/jb55] has joined ##miniscript 10:59 -!- jb55 [~jb55@gateway/tor-sasl/jb55] has quit [Remote host closed the connection] 14:03 < andytoshi> sanket1729: i'm not sure what you mean by accepting private keys at the API level? 14:03 < andytoshi> like, implement Satisfier for private keys? 14:04 < sanket1729> Yup 14:05 < sanket1729> The PR by sgeisler and afilini also adds signing logic for signer in psbt. I wanted your opinion if that should be in the scope of rust-miniscript or not. 14:06 < sanket1729> There is some discussion on #116 14:07 < sanket1729> Maybe, my understand of miniscript will pbst is off. Would appreciate your input on #116 dicussion. The diff is 1000 lines plus, and you don't need look at the PR for following the discussion. 14:08 < andytoshi> heh ok, let me get caught up on this 14:08 < andytoshi> yeah at first glance i'm suspicious of having a Signer trait 14:17 < sanket1729> My initial understanding was that miniscript is only useful while finalizing. But it can also useful in Signing process. Say there are multiple keys in an input, you want to extract out all pubkeys, see which belong to you and add a partial sig to those. 14:17 < sipa> the descriptor notation may be useful to an updater 14:17 < sipa> the generic signing may be useful to a signer 14:17 < sipa> and a finalizer 14:17 < andytoshi> sanket1729: yeah, sure, but the existing library has all the functionality you need for that 14:18 < sipa> i guess signers could be implemented without miniscript at all; 14:18 < andytoshi> i'm really having trouble figuring out what affini was hoping to accomplish with this Signer trait 14:18 < andytoshi> and i'm also trying to untangle what's going on with `DescriptorKeyWithSecrets` 14:18 < sipa> but if you want to understand what you're signing, maybe you do 14:18 < sanket1729> Look at the example `signer.rs` 14:18 < sanket1729> I think that can help in understanding. 14:19 < sanket1729> andytoshi: The existing library indirectly supports that. 14:20 < sanket1729> My understanding of what afilini is trying to do is: 1) Creator creates psbt. 2) Signer parses descriptor, figures out which keys are present in it that it controls and partial sig to it. (This is where the Signer trait comes in) 14:20 < andytoshi> ok, signers.rs uses this object `PSBTSigningContext` which i get the purpose of, and which i could be convinced this library ought to have (beacuse it contains all the data needed to impl Satisfier) 14:21 < andytoshi> i don't get why there's an Arc involved 14:21 < andytoshi> or why he has this `SignersContainer` object or why he is using boxed traits inside that 14:25 < andytoshi> oh i see, the point of `Signer` is to abstract over a normal privkey and a bip32 privkey? 14:25 < andytoshi> i don't like this 14:33 < sanket1729> re: About implementing satisfier for private key, public key map, how is that related to psbt? 14:33 < andytoshi> i don't know, it's all jumbled up in this PR 14:34 < andytoshi> oh 14:34 < andytoshi> the issue is that you can't impl `Satisfier` for a private->public key map 14:34 < andytoshi> because `Satisfier` has no way to provide a sighash 14:35 < andytoshi> so to impl `Satisfier`, you need a richer type, which has private keys and also knows how to compute a sighash 14:36 < sanket1729> Makes sense. The akward part about the current API is that we can't mutate the psbt in `Satisfier`. 14:37 < andytoshi> oh that's frustrating 14:37 < andytoshi> yeah, interesting ... i think this is an API bug 14:38 < andytoshi> though can't we do something like `struct PSBTSigningContext<'a, 'b> { index: usize, keymap: &'a HashMap, psbt: &'b Psbt }` 14:38 < andytoshi> though can't we do something like `struct PSBTSigningContext<'a, 'b> { index: usize, keymap: &'a HashMap, psbt: &'b mut Psbt }` 14:39 < andytoshi> this will be a bit unergonomic to use because &mut references are annoying to put into structs, but this structure is only ever intended to exist as a local variable 14:40 < sanket1729> The lookup_sig method has signature (&self). 14:40 < andytoshi> if &self has a &mut reference in it you should still be able to mutate through that 14:41 < andytoshi> hm maybe not actually 14:43 < andytoshi> actually 14:43 < andytoshi> i don't think `Satisfier` is the place to mutate the PSBT 14:44 < sanket1729> Yeah. 14:45 < sanket1729> I am thinking the same. That is where the Signer should come in? 14:45 < andytoshi> no 14:45 < andytoshi> just stick stuff in the PSBT without using any fancy traits 14:45 < andytoshi> in the finalizer, use `Satisfier` to get a witness from the complete PSBT 14:45 < andytoshi> and then put that witness into a transaction 14:47 < sanket1729> So, you are suggesting that rust-miniscript should not care about how the partial sigs are filled in. And that should be the user code 14:48 < andytoshi> yes 14:50 < andytoshi> i posted another comment on the issue 14:50 < andytoshi> summarizing this 14:52 < sanket1729> One final point, and I think this is something maybe sipa and achow101 can also help with: 14:52 < sanket1729> This comment from afilini 14:52 < sanket1729> I don't know how realistic this is, I was just thinking that maybe some wallets could decide in the future to always include non_witness_utxos and potentially remove witness_utxos entirely to save some space, because after all you can find everyting you need from the non_witness_utxo. If that was the case, PSBTs built by these wallets would be mistaken for non-segwit with the logic I have implemented currently 14:53 < andytoshi> heh, i think that's a horrible wallet design and we should take zero effort to support it 14:59 < andytoshi> but i think it's also a moot point, i think the `sighash` function in the PR can have a simpler signature (i added another comment) 14:59 < andytoshi> where it's not rooting around inside a PSBT to try to compute a sighash 16:05 < sipa> andytoshi: is the actual script used in liquid today constructed using miniscript? 17:08 -!- ghost43 [~daer@gateway/tor-sasl/daer] has quit [Quit: Leaving] 17:43 < sanket1729> no 17:43 < sanket1729> sipa: it is some handwritten script written with OP_DEPTH etc 18:11 < shesek> do you know is the handwritten one is more or less optimized compared to the script generated with policy? 18:44 -!- jb55 [~jb55@gateway/tor-sasl/jb55] has joined ##miniscript