Lightning Nodes
...
Node Guides
Macaroons

Generate Macaroons with lncli

3min

Generate a New Macaroon

To generate a new macaroon, you use the lncli bakemacaroon command. You can specify the permissions (read, write, etc.) that you want the macaroon to have.

Text


This command will create a new macaroon with the specified permissions. The permissions should be in the format service:method. For example, to create a macaroon that can read invoices and write invoices, you would use invoice:read and invoices:write.

Here is an example of generating an administrative level Macaroon:

Text


You can also add the --timeout <seconds> flag to add automatic expiration to any macaroon you generate.

Learn more about macaroon permissions: