Skip to content

Cannot deserialize a LND macaroon admin.macaroon file #4

@sezaru

Description

@sezaru

Hello,

I'm trying to use your library inside an Elixir project to deserialize a LND macaroon admin.macaroon file.

I'm using this code inside the REPL:

{:ok, file} = File.read "admin.macaroon"
encoded = Base.encode64(file)
{:ok, mac} = :macaroon.deserialize(encoded)

which will give me the error:

** (MatchError) no match of right hand side value: {:error, :macaroon_invalid}

Testing the same file with pythons pymacaroons works, so it seems a specific deserialization problem with the library.

Since I cannot paste here the binary data from admin.macaroon I will post a link to the file directly and also the base64 with it:
admin.macaroon

AgEDbG5kArsBAwoQ5TMSJjie992RIEsCGCuq5xIBMBoWCgdhZGRyZXNzEgRyZWFkEgV3cml0ZRoTCgRpbmZvEgRyZWFkEgV3cml0ZRoXCghpbnZvaWNlcxIEcmVhZBIFd3JpdGUaFgoHbWVzc2FnZRIEcmVhZBIFd3JpdGUaFwoIb2ZmY2hhaW4SBHJlYWQSBXdyaXRlGhYKB29uY2hhaW4SBHJlYWQSBXdyaXRlGhQKBXBlZXJzEgRyZWFkEgV3cml0ZQAABiBoyNHs3jlsGlXIZEV8HtJuIiCh+vA56AFg9poHdCG6zA==

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions