Documentation ¶
Index ¶
- type UnlockerService
- func (u *UnlockerService) GenSeed(ctx context.Context, in *lnrpc.GenSeedRequest) (*lnrpc.GenSeedResponse, error)
- func (u *UnlockerService) InitWallet(ctx context.Context, in *lnrpc.InitWalletRequest) (*lnrpc.InitWalletResponse, error)
- func (u *UnlockerService) UnlockWallet(ctx context.Context, in *lnrpc.UnlockWalletRequest) (*lnrpc.UnlockWalletResponse, error)
- type WalletInitMsg
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 // UnlockPasswords is a channel where passwords provided by the rpc // client to be used to unlock and decrypt an existing wallet will be // sent. UnlockPasswords chan []byte // 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 (*UnlockerService) GenSeed ¶
func (u *UnlockerService) GenSeed(ctx context.Context, in *lnrpc.GenSeedRequest) (*lnrpc.GenSeedResponse, error)
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 ¶
func (u *UnlockerService) InitWallet(ctx context.Context, in *lnrpc.InitWalletRequest) (*lnrpc.InitWalletResponse, error)
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 ¶
func (u *UnlockerService) UnlockWallet(ctx context.Context, in *lnrpc.UnlockWalletRequest) (*lnrpc.UnlockWalletResponse, error)
UnlockWallet sends the password provided by the incoming UnlockWalletRequest over the UnlockPasswords 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 }
WalletInitMsg is a message sent to 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.