Skip to content

Commit 574b3c4

Browse files
authored
Merge pull request #5607 from BitGo/BTC-1851
chore(express): encode passphrase to base64 before sending to lnd
2 parents 0990bce + 020dcfc commit 574b3c4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/express/src/lightning/lightningSignerRoutes.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export async function handleInitLightningWallet(req: express.Request): Promise<u
9191
const macaroonRootKey = getMacaroonRootKey(passphrase, nodeAuthKey.encryptedPrv, bitgo.decrypt);
9292

9393
const { admin_macaroon: adminMacaroon } = await lndSignerClient.initWallet({
94-
wallet_password: passphrase,
94+
// The passphrase at LND can only accommodate a base64 character set
95+
// For more information, see BTC-1851
96+
wallet_password: Buffer.from(passphrase).toString('base64'),
9597
extended_master_key: signerRootKey,
9698
macaroon_root_key: macaroonRootKey,
9799
});
@@ -220,5 +222,9 @@ export async function handleUnlockLightningWallet(req: express.Request): Promise
220222
);
221223

222224
const lndSignerClient = await LndSignerClient.create(walletId, req.config);
223-
return await lndSignerClient.unlockWallet({ wallet_password: passphrase });
225+
// The passphrase at LND can only accommodate a base64 character set
226+
// For more information, see BTC-1851
227+
return await lndSignerClient.unlockWallet({
228+
wallet_password: Buffer.from(passphrase).toString('base64'),
229+
});
224230
}

0 commit comments

Comments
 (0)