Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZPUB Generation #5

Open
Goro2030 opened this issue Aug 20, 2021 · 8 comments
Open

ZPUB Generation #5

Goro2030 opened this issue Aug 20, 2021 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@Goro2030
Copy link

Goro2030 commented Aug 20, 2021

Is there a way to generate a ZPUB for the HD wallet to be able to see the balance of it ? Being this a multi-sig wallet, I'm not certain how that can be done ...

From what I've been reading (here), if I would know the 2 "Master private keys" (which I don't, at least they are not easily seen in the recovery pdf of course, nor are the groups of 4 letters ), then I could use a tool like this one:

https://unchained-capital.github.io/caravan/#/wallet

@kapishon
Copy link

mycelium

@Goro2030
Copy link
Author

mycelium

Hahaha ... no joke. Really, is there a way?

@kapishon
Copy link

I'm glad I made you laugh. it's healthy. have a nice day

@slezica
Copy link
Contributor

slezica commented Aug 20, 2021

Hello there!

Muun is multisig, has Lightning Network support, and uses other kinds of novel transaction output scripts. Generic watch tools and classic on-chain wallets are only capable of locating pay-to-public-key[-hash] scripts and (in some cases) plain multisig, but they can't handle complex scripts. In other words, they won't work with Muun or any other Lightning-enabled wallet.

This is why we wrote this specialized recovery tool, and made it open-source.

There's a BIP in the making right now (https://github.com/achow101/bips/blob/descriptors/bip-descriptors-general.mediawiki) that aims to standardize how tools scan the blockchain for wallet funds. When it matures, it will allow generic (and advanced) tools to work with complex scripts like the ones Muun and other Lightning wallets use.

All that said, your HD private keys are indeed contained in the Emergency Kit (the recovery PDF), and encrypted using the Recovery Code. This tool decrypts the keys using both components. If you follow main.go, you'll quickly spot where you could print your keys if you wanted to.

@Goro2030
Copy link
Author

Muun is multisig, has Lightning Network support, and uses other kinds of novel transaction output scripts. Generic watch tools and classic on-chain wallets are only capable of locating pay-to-public-key[-hash] scripts and (in some cases) plain multisig, but they can't handle complex scripts. In other words, they won't work with Muun or any other Lightning-enabled wallet.

There's one thing I never understood about the architecture of Muun: Somewhere, you have to have a funded Lightning channel to allow for the tx's of the user. Does the user funds it, or you have a big backbone that you control for that? If the channel is "with the user", what happens with any funding locked in the channel/s when you do the wallet recovery process?

There's a BIP in the making right now (https://github.com/achow101/bips/blob/descriptors/bip-descriptors-general.mediawiki) that aims to standardize how tools scan the blockchain for wallet funds. When it matures, it will allow generic (and advanced) tools to work with complex scripts like the ones Muun and other Lightning wallets use.

All that said, your HD private keys are indeed contained in the Emergency Kit (the recovery PDF), and encrypted using the Recovery Code. This tool decrypts the keys using both components. If you follow main.go, you'll quickly spot where you could print your keys if you wanted to.

In the meantime, while that BIP is developed and approved/implemented, wouldn't it be a good idea to use the codebase of your recovery tool and modify it to have it just output the balance of the wallet? Can it be done, technically?

Gracias @slezica !

@slezica
Copy link
Contributor

slezica commented Aug 31, 2021

Hey there! Sorry for the delay. Crazy days.

Muun relies on a heavily optimized implementation of submarine swaps to handle Lightning payments. In practice, this means all funds (whether received through LN or not) are quickly settled in on-chain transactions.

This approach has pros & cons. On one hand, it has enormous advantages for self-custody: since funds end up as UTXOs in the blockchain, the Recovery Tool can easily locate them and spend them. There's no private dynamic backup that can be lost. On the other hand, it introduces fees that are abnormally high for some outgoing Lightning payments.

In cases where a transaction is required to settle incoming payments, it's free of charge for the user (Muun covers any necessary fees). Outgoing payments that require transactions are paid for by the user.

We're currently working on the next version of our Lightning architecture, which will make great improvements on this. On-chain fees will be avoided in the large majority of cases, while preserving the on-chain boost to self-custody.

As for the second question, the tool can already do that :) after the scan, you'll see a summary of all addresses and funds. You can exit the tool right there, with no consequences. It doesn't have a special flag or interactive prompt for that, though.

@Goro2030
Copy link
Author

Goro2030 commented Sep 6, 2021

I've been playing with the code, and in trying to run a recovery process, I've noticed that the tool is not accounting for all the sats in my wallet . In my case, it's missing almost 1% of the balance.

Why is that happening? Maybe those funds are locked in the Lightning network backend?

@slezica
Copy link
Contributor

slezica commented Sep 8, 2021

Hey Goro!

We handle these cases via support, to keep the repository focused on code and development. Would you mind writing to support@muun.com, or sending a help/feedback request through the app?

@slezica slezica added the question Further information is requested label Sep 9, 2021
@slezica slezica self-assigned this Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants