Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnlockerService

type UnlockerService struct {
	// InitMsgs is a channel that carries all wallet init messages.
	InitMsgs chan *WalletInitMsg

	// UnlockMsgs is a channel where unlock parameters provided by the rpc
	// client to be used to unlock and decrypt an existing wallet will be
	// sent.
	UnlockMsgs chan *WalletUnlockMsg
	// contains filtered or unexported fields
}

    UnlockerService implements the WalletUnlocker service used to provide lnd with a password for wallet encryption at startup. Additionally, during initial setup, users can provide their own source of entropy which will be used to generate the seed that's ultimately used within the wallet.

    func New

    func New(authSvc *macaroons.Service, chainDir string,
    	params *chaincfg.Params) *UnlockerService

      New creates and returns a new UnlockerService.

      func (*UnlockerService) GenSeed

        GenSeed is the first method that should be used to instantiate a new lnd instance. This method allows a caller to generate a new aezeed cipher seed given an optional passphrase. If provided, the passphrase will be necessary to decrypt the cipherseed to expose the internal wallet seed.

        Once the cipherseed is obtained and verified by the user, the InitWallet method should be used to commit the newly generated seed, and create the wallet.

        func (*UnlockerService) InitWallet

          InitWallet is used when lnd is starting up for the first time to fully initialize the daemon and its internal wallet. At the very least a wallet password must be provided. This will be used to encrypt sensitive material on disk.

          In the case of a recovery scenario, the user can also specify their aezeed mnemonic and passphrase. If set, then the daemon will use this prior state to initialize its internal wallet.

          Alternatively, this can be used along with the GenSeed RPC to obtain a seed, then present it to the user. Once it has been verified by the user, the seed can be fed into this RPC in order to commit the new wallet.

          func (*UnlockerService) UnlockWallet

            UnlockWallet sends the password provided by the incoming UnlockWalletRequest over the UnlockMsgs channel in case it successfully decrypts an existing wallet found in the chain's wallet database directory.

            type WalletInitMsg

            type WalletInitMsg struct {
            	// Passphrase is the passphrase that will be used to encrypt the wallet
            	// itself. This MUST be at least 8 characters.
            	Passphrase []byte
            
            	// WalletSeed is the deciphered cipher seed that the wallet should use
            	// to initialize itself.
            	WalletSeed *aezeed.CipherSeed
            
            	// RecoveryWindow is the address look-ahead used when restoring a seed
            	// with existing funds. A recovery window zero indicates that no
            	// recovery should be attempted, such as after the wallet's initial
            	// creation.
            	RecoveryWindow uint32
            }

              WalletInitMsg is a message sent by the UnlockerService when a user wishes to set up the internal wallet for the first time. The user MUST provide a passphrase, but is also able to provide their own source of entropy. If provided, then this source of entropy will be used to generate the wallet's HD seed. Otherwise, the wallet will generate one itself.

              type WalletUnlockMsg

              type WalletUnlockMsg struct {
              	// Passphrase is the passphrase that will be used to encrypt the wallet
              	// itself. This MUST be at least 8 characters.
              	Passphrase []byte
              
              	// RecoveryWindow is the address look-ahead used when restoring a seed
              	// with existing funds. A recovery window zero indicates that no
              	// recovery should be attempted, such as after the wallet's initial
              	// creation, but before any addresses have been created.
              	RecoveryWindow uint32
              }

                WalletUnlockMsg is a message sent by the UnlockerService when a user wishes to unlock the internal wallet after initial setup. The user can optionally specify a recovery window, which will resume an interrupted rescan for used addresses.

                Source Files