-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
lncli printmacaroon does not show the nonce used in the macaroon:
litd@charlie-69cdbb4746-q9z4m:/$ lncli printmacaroon $(lncli bakemacaroon peers:read peers:write)
{
"version": 2,
"location": "lnd",
"root_key_id": "0",
"permissions": [
"peers:read",
"peers:write"
],
"caveats": null
}
litd@charlie-69cdbb4746-q9z4m:/$
I think we should show it because we have no way of distinguishing one macaroon from another with the same permissions.
If I put a macaroon into https://guggero.github.io/cryptography-toolkit/#!/macaroon , it gives me an output like
{
"v": 2,
"s64": "sx5iIqgqGlw8q6Ly5oJ_uGQipBDPPrBAQ2ezyvA4FJY",
"i64": "AwoQccwvvjdwbeQ89YFu7IrbkRIBMBoUCgVwZWVycxIEcmVhZBIFd3JpdGU",
"l": "lnd",
"identifier_decoded": {
"nonce": "71cc2fbe37706de43cf5816eec8adb91",
"storageId": "30",
"ops": [
{
"entity": "peers",
"actions": [
"read",
"write"
]
}
]
}
}
which does include the nonce.
Note: https://guggero.github.io/cryptography-toolkit/#!/macaroon shows a storageId instead of a root_key_id. The difference seems to be that a 3 is prepended to every digit of the root_key_id. I'm not sure if this is a bug in https://guggero.github.io/cryptography-toolkit/#!/macaroon or if the root_key_id has a special encoding and storageId is a more general field used by macaroons that we happen to be putting root_key_id inside of.