There is a large set of functionality that can be added by extending lnd's macaroon implementation by adding internal state. This partially draws on #286, but also adds root key deletion/expiration with garbage collection. This functionality could enable use cases described in issue #20 such as:
This would be a pretty massive functionality addition as well as reimagining of much of the API. To do this, we would need to do the following:
NewAddress, NewWitnessAddress, and CloseChannel and consumption to OpenChannel, OpenChannelSync, SendCoins, and SendMany.OpenChannel and OpenChannelSync and consumption to SendPayment, SendPaymentSync, and CloseChannel.CheckMacaroonBalance, SubdivideMacaroonBalance, and CombineMacaroonBalance to manage macaroon balances.There are other possibilities and potential issues to watch out for listed in my previous comment on issue #20, so this is only preliminary. This implementation is likely to get fairly complicated.
I'll start working on accounting-based macaroons. This issue lists features for several PRs IMHO, so I'll start with a basic off-chain balance macaroon. Then we'll see where we get from there.
I'm definitely interested in this. It would be useful for mitigating attacks against Joule browser extension.
Most helpful comment
I'll start working on accounting-based macaroons. This issue lists features for several PRs IMHO, so I'll start with a basic off-chain balance macaroon. Then we'll see where we get from there.