Skip to content

walletunlocker+lnd: add command line flag to allow passing macaroons after wallet creation #1236

@Roasbeef

Description

@Roasbeef

In the current state, there's a bit of a gap when initializing a wallet for the first time remotely. The set of RPC's (GenSeed and InitWallet) allow users to programmatically instantiate a wallet for the first time. However, once the seed is created and returned to the user, in order to issue any further commands, they'll need to set of macaroons. Atm, the only way to obtain these macaroons is to either use sftp/rsync, etc to grab the macaroon on disk. Instead, we can extend the InnitWallet RPC call to return the serialized binary macaroon over the RPC, and not write it to disk. This bridges the gap and allows the client to provision a new node in a purely remote fashion only using our set of RPC's. In the future, once we add rich macaroon baking capabilities to the RPC interface, the user that created the node (the alleged admin) will be able to instruct lnd to bake macaroons on the fly.

Steps To Completion

  • Extend the InitWalletResponse to also optionally return the binary serialized admin.macaroon within the response.
  • Add a new command line flag (something like --stateless-init) which instructs lnd to not write the macaroons to disk, and instead will only return them to the user over RPC.
  • Implement the new logic in the walletunlocker package and update tests to exercise both operating modes

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3might get fixed, nice to haveauthenticationbeginnerIssues suitable for new developersdatabaseRelated to the database/storage of LNDrpcRelated to the RPC interfacesecurityGeneral label for issues/PRs related to the security of the softwarewalletThe wallet (lnwallet) which LND uses

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions