19:00:45 #startmeeting 19:00:45 Meeting started Fri Mar 1 19:00:45 2019 UTC. The chair is meshcollider. Information about MeetBot at http://wiki.debian.org/MeetBot. 19:00:45 Useful Commands: #action #agreed #help #info #idea #link #topic. 19:00:47 hi 19:00:48 present 19:00:51 #bitcoin-core-dev Wallet Meeting: wumpus sipa gmaxwell jonasschnelli morcos luke-jr sdaftuar jtimon cfields petertodd kanzure bluematt instagibbs phantomcircuit codeshark michagogo marcofalke paveljanik NicolasDorier jl2012 achow101 meshcollider jnewbery maaku fanquake promag provoostenator aj Chris_Stewart_5 dongcarl gwillen jamesob ken281221 ryanofsky gleb 19:00:58 hi 19:01:17 Topics for this week? 19:01:31 Hi 19:01:50 i guess there isn't anything wallet-related for 0.18 19:02:27 #15453 19:02:29 https://github.com/bitcoin/bitcoin/issues/15453 | Starting bitcoin-qt with -nowallet and then opening a wallet does not show the wallet · Issue #15453 · bitcoin/bitcoin · GitHub 19:02:36 Is tagged with 0.18 anyway 19:03:02 With a cliff-hanger from promag 19:03:23 That's a Qt issue though right 19:03:59 It only effects people who self compile 19:04:26 As the issue is with qt versions 19:06:21 It seems so, in which case it should be OK as long as we backport the fix onto the 0.18 branch. 19:07:17 Mhm 19:07:35 Other than that, yeah, we managed to get all the wallet PRs for 0.18 reviewed and merged pretty efficiently so nice work 19:09:11 Proposed topic: descriptor based wallets 19:09:36 (briefly anyway, since everyone is focussed on 0.18) 19:11:30 sipa: one thing we talked about before that would be useful for my HWW PR is away to compose descriptors in code 19:12:01 If you're able to whip up an example for e.g. sh(wpkh(xpub)) I can probably figure out the rest 19:12:25 It's just my C++ is a bit rusty when it comes to unique_ptr and abstract classes. 19:12:38 provoostenator: it's not that trivial anymore in the current code 19:12:56 i briefly had a look, but it would need some restructuring 19:13:07 Ok, glad to know it's not just me :-) 19:14:33 The use case here is that we fetch an xpub from a hardware wallet and then construct a descriptor with that. 19:14:45 with the 0.18 things out of the way, i'll try to find time to do the ismine/keypool abstraction i've talked about before 19:15:13 ismine/keypool stuff also very useful. 19:16:12 An alternative approach would be to be require the hardware wallet (driver) to give a full descriptor, or a set of potential desrciptors from which we pick one or more. 19:16:39 #topic descriptor based wallets 19:16:47 But that choice shouldn't be determined by implementation details such as this I think. 19:17:02 provoostenator: you can always construct the descriptor in string form 19:17:25 i agree that's suboptimal, but it means having an API to construct descriptors shouldn't be a blocker 19:17:47 That's what I'm doing in the prototype. 19:18:15 I've done this previously as well, constructing manually 19:18:18 There's not really any blockers left in that PR, so I'm mostly focussing on getting it merge-worthy. 19:19:19 Although it would be safer when combined with native-descriptor wallets, because the behavior of getnewaddress doesn't jive well with BIP44/49/84 that wallets use. 19:19:45 (that hardware wallets tend to use) 19:19:55 provoostenator, you're safe as long as you don't use getnewaddress with a watchonly wallet :D 19:20:24 are hardware wallets working on implementing things like returning descriptors? 19:20:26 instagibbs: so you use deriveaddresses? 19:20:43 provoostenator, no I just assume people aren't going to dust my cold wallet :P 19:20:49 meshcollider: not that I know, but HWI python coud easiliy do that. 19:20:56 meshcollider, unlikely to get that standardized, no 19:21:15 Mhm 19:21:30 ledger has basically said they won't bother supporting PSBT like ever 19:21:42 Oh, thats a shame 19:21:43 I can't imagine they'd do descriptors 19:21:46 well they don't need to 19:21:52 sipa, right, it's fine 19:22:07 just giving context 19:22:09 i mean: i wouldn't even recommend that hw wallets directly implement psbt 19:22:18 all you need is a software driver that supports it 19:22:25 same with descriptors 19:22:36 they're a software (and bitcoin core specifically...) kinda thing 19:22:58 Basically Bitcoin Core could give an account number and then HWI would, if the device supports SegWit return three descriptors: "pkh([44'/0'/account]xpub/0/*])", "sh(wpkh([49'/0'/account]xpub/0/*]))" and "wpkh([84'/0'/account]xpub/0/*])" (plus change), and then our wallet imports one or all 19:23:10 hwi already uses descriptors 19:24:04 But the current importmulti logic doesn't handle the above correctly, native descriptor wallets would. 19:24:30 So then you can get a bech32 address and it will grab it from the wpkh(84' tree, or fail if that's absent. 19:25:45 We probably only need two address types: default and wrapped-segwit. Default is either legacy pkh() or native segwith (wpkh or script hash). 19:26:17 you'd mark certain records as the provider for certain types of addresses 19:27:43 if you don't have one for native segwit addresses, then requesting a native segwit address will fail 19:28:15 Right, I guess it's fine to hold on to the current address_type concept then. 19:28:29 legacy, p2sh_segwit and bech32 19:28:48 But simply fail if the right descriptor isn't available. 19:29:27 Do descriptors needs to "marked" for that? Or can you just infer it? 19:29:50 The default ones would need to be marked in case you have others too 19:29:58 well i'm imagining you can have multiple records 19:32:13 One default record in case there's multiple records of the same address type. 19:32:13 (especially if you have a wallet that at some point switched over to a new key/descriptor/hwwallet for whatever reason, but still want to keep access to old transaction history with the previous ones) 19:32:13 I was thinking of adding a purpose enum: receive, change, other 19:32:13 yes 19:32:14 For each address type there can only be one descriptor with receive/change 19:32:23 why? 19:32:32 Because that indicates the default 19:32:47 what a descriptor is used for should be independent of whether it's the default imo 19:32:54 That makes sense 19:33:06 So then in addition to purpose, we also need to track the default descriptors. 19:33:11 if you transition to a new one, the one you used for change before doesn't stop being change 19:33:52 i think that's all in https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2 already 19:34:11 How do we identify descriptors if there's more than one? Just an increasing int as we add them, or by their checksum (seems brittle) or something else? 19:34:48 seems like an implementation detail 19:35:38 Well, it matters for RPC arguments, but for now I'm avoiding that problem by not allowing more than one of each purpose :-) 19:36:11 do you need to expose internal identifiers? 19:36:44 (i haven't thought much about this) 19:36:51 Identify them by checksum :p 19:37:28 if so, it seems best that records have a unique user-provided name, and you use that name in rpc to refer to them 19:37:31 sipa: getnewaddress "Buy new cow" bech32 [how do I tell which non-default descriptor to use] 19:37:48 why not force them to switch first, then call getnewaddress 19:37:50 provoostenator: is that necessary? 19:38:00 Name makes sense 19:38:08 provoostenator: you can't getnewaddress from an old keypool now either 19:38:21 Other records are more for things like watch-only, etc 19:38:38 Internal stuff 19:38:42 True, if non-default descriptors can only be used for archival purposes then there's no need to support them in getnewaddress 19:39:03 that's what i was thinking yes; they're just there to not lose old transaction history 19:39:07 or to watch 19:39:12 It also depends on how much we want to push for 1-wallet-1-goal 19:39:23 Rather than put-whatever-you-want-in-a-single-walllet 19:40:09 right; but in a pure watch-only wallet (where "watch only" truly means you're watching someone else's wallet, not just "i don't have the private key right here"), you probably don't want to have any "default newaddress provider" 19:40:15 I also prefer keeping wallets simple in that sense, especially to keep the GUI sane. 19:40:19 because there shouldn't be a way to create new addresses 19:41:29 Agree that getnewaddress should require >= IsSolveable 19:41:40 descriptors are always solvable 19:41:59 (except the "raw" and "script" ones, but those can't be used to derive anything anyway) 19:42:06 Ah yes 19:42:12 solvability is not the point 19:42:37 thats the difference between is "mine" and is "spendable" 19:43:04 so right now "watchonly" means "i don't happen to have the private key in my wallet.dat file" 19:43:10 i think that's a mistake 19:43:44 Agree, this rework is the perfect time to tighten up definition of things like that too 19:43:45 the distinction between "my money" and "watched money" is useful, but it's somewhat independent from where the private keys live 19:44:23 especially in a hwwallet/offline storage/... kinda world... the case where the private key is actually in your wallet.dat file (even for your own coins) should be the exception 19:45:34 oh, i guess i should bring this up here, i did a talk at SBC19 about miniscript, and i'll work on getting support for it in core 19:45:53 so that our signer (including psbt, etc) can deal with more complicated scripts than just single key and multisig 19:46:46 So we can do things like GreenAddress style multisig or timeout & single sig? 19:46:50 yeah 19:47:16 Was the talk recorded 19:47:28 https://www.youtube.com/watch?v=XM1lzN4Zfks 19:47:34 Thanks 19:47:38 I wonder what the setup UX would look like if e.g. you had two hardware wallets and wanted such a 2-of-2 or timeout & 1-of-2. 19:47:53 provoostenator: that's a question for you :) 19:48:00 i'm perfectly fine with psbt rpcs :P 19:48:20 gui coin control tho 19:48:20 sipa: replacing the signer with miniscript would probably be a good time to also distinguish between signing and finalizing 19:48:32 achow101: hmm? 19:48:55 Right, I guess there would be an RPC where you give it a meta-descriptor or miniscript, then it goes and fetches xpubs from both devices in sequence and imports the right descriptors 19:49:11 Plus asking some sanity check questions to the driver like "can you sign stuff with nlocktime" 19:49:20 ProduceSignature makes both the signature and scriptSig/witness 19:49:20 provoostenator, the descriptor will be parsed into miniscript, afaik 19:49:25 provoostenator: the workflow is that you'd use the miniscript compiler to convert a policy to a descriptor 19:49:28 ^ 19:49:29 and then import the descriptor 19:49:30 yeah 19:49:42 the compiler could be built-in, but doesn't need to be 19:49:51 Do you put xpubs in the miniscript or does that happen later? 19:50:00 But under the psbt model, those should be distinct. 19:50:06 provoostenator: yeah 19:50:17 the compiler just passes those though, i imagine 19:50:58 (miniscript is just the name of the subset of script; i use "policy" language to refer to the input of the compiler) 19:51:06 i know, i suck at naming things 19:51:21 and this is genuinely confusing because there are several things that look kinda similar 19:51:47 signerfetchkeys "miniscript with rules $device_fingerprint_1 $device_fingerprint_1" 19:51:50 achow101: yeah, i guess it can simplify things if we split up the signer and finalizer in the code too 19:51:53 Piece of cake 19:54:48 Is there anything else anyone wants to talk about in the last few minutes 19:58:53 #endmeeting