PC 2.0 Wiki
concept
  • lightning
  • infra
  • keys

Macaroon

A macaroon is a bearer credential that can be narrowed after it is issued — anyone holding one can produce a weaker version of it, but never a stronger one.

Why it matters

It is how LND answers "which of my applications is allowed to spend?" without handing every one of them full control of the node. The admin macaroon can do anything; an invoice macaroon can only create invoices. Giving a public-facing service the second one means a compromise costs you nothing but noise.

The bearer part is the trap. A macaroon is not tied to a user or a device — whoever has the file has the authority, so a macaroon in a screenshot or a config repo is a spent key.

How it works

The credential carries caveats — conditions that must hold, such as which operations are permitted or when it expires — chained together with HMACs. Adding a caveat is cheap and requires no contact with the issuer; removing one would require forging an HMAC, which is the security property.

LNbits exists partly to avoid distributing these at all: it holds the node credentials itself and issues per-wallet API keys instead.

Heard on the show

1 moment across 1 episode.

  1. E64 · 3 Dec 2021 · Dave's not here man

    • 13:13It just needs like a macaroon access to your node. Is that it?transcript

From chapter titles, show notes, the PC 2.0 Timeline and the clip notes. Where those say nothing, from the episode transcript — which reaches further but only records that a word was said. 214 of 266 episodes have curated notes; 177 moments come from transcripts.