Lnd: Add support for accounting-based macaroons

Created on 29 Aug 2017  路  2Comments  路  Source: lightningnetwork/lnd

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:

  • Giving a process or user a macaroon with a predetermined, one-time budget
  • Giving a process or user a macaroon with a predetermined, periodic budget
  • Giving a process or user the ability to manually open channels and send on-chain payments
  • Allowing a process or user to use only channels it has opened

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:

  • [ ] Add per-macaroon off-chain and on-chain balance tracking to the macaroon database with expiration and expired macaroon deletion.
  • [ ] Add on-chain balance macaroon generation to NewAddress, NewWitnessAddress, and CloseChannel and consumption to OpenChannel, OpenChannelSync, SendCoins, and SendMany.
  • [ ] Add off-chain balance macaroon generation to OpenChannel and OpenChannelSync and consumption to SendPayment, SendPaymentSync, and CloseChannel.
  • [ ] Add RPCs for 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.

P3 advanced authentication gRPC macaroons security

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.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Richard87 picture Richard87  路  3Comments

Roasbeef picture Roasbeef  路  3Comments

stevenroose picture stevenroose  路  3Comments

hxsquid picture hxsquid  路  3Comments

sunnya97 picture sunnya97  路  3Comments