Set Up Custody Lightning Wallets
Overview
Custody Lightning wallets provide a seamless way to interact with the Lightning Network without managing infrastructure. BitGo handles node operations, signing, channel management, liquidity provisioning, and network connectivity on your behalf. The nodes are professionally monitored and maintained, ensuring reliability and security.
Prerequisites
- Get Started
- Sign a custody Lightning license by contacting [email protected].
1. Create Lightning Wallet
Endpoint: Generate Wallet
export BITGO_EXPRESS_HOST="<YOUR_LOCALHOST>"
export COIN="tlntbc"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export LABEL="<YOUR_WALLET_NAME>"
export PASSPHRASE="<YOUR_BITGO_LOGIN_PASSPHRASE>"
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
curl -X POST \
http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/generate \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"label": "'"$LABEL"'",
"passphrase": "'"$PASSPHRASE"'",
"enterprise": "'"$ENTERPRISE_ID"'"
"type": "hot",
"subType": "lightningCustody"
}'const { BitGo } = require('bitgo');
// Fill in with actual access token
const accessToken = '<YOUR_ACCESS_TOKEN>';
// Initialize the SDK
const bitgo = new BitGo({
accessToken: accessToken,
env: 'test',
});
// Generate hot wallet
async function createCustodialHotWallet() {
const newWallet = await bitgo.coin('tlnbtc').wallets().generateWallet({
label: '<YOUR_WALLET_NAME>',
passphrase: '<YOUR_BITGO_LOGIN_PASSPHRASE>',
enterprise: '<YOUR_ENTERPRISE_ID>'
subType: 'lightningCustody'
});
console.log(JSON.stringify(newWallet, undefined, 2));
}Step Result
Once you create a Lightning wallet, BitGo creates a Lightning node with a hosting service provider. This process takes approximately 30 minutes to complete. BitGo sends you an email notification when the wallet is ready to use.
{
"wallet": {
"id": "67e43de27f977e954022b8eb8693f5a7",
"users": [
{
"user": "6101c3790293df0006fb99bc777152ce",
"permissions": [
"admin",
"spend",
"view"
]
}
],
"coin": "tlnbtc",
"label": "Test Custody Lightning Wallet",
"m": 1,
"n": 1,
"keys": [
"67e43de1551f8a42dadaabb0d2ac2264"
],
"keySignatures": {},
"enterprise": "65302ca0c3939600075905e213ca20dd",
"bitgoOrg": "BitGo Inc",
"tags": [
"67e43de27f977e954022b8eb8693f5a7",
"65302ca0c3939600075905e213ca20dd"
],
"disableTransactionNotifications": false,
"freeze": {},
"deleted": false,
"approvalsRequired": 1,
"isCold": false,
"coinSpecific": {
"keys": [
"67e43de1d19e3a9237bf558bed01f8e6",
"67e43de1ffc2dfc5c5994239ed002fb5"
]
},
"admin": {},
"clientFlags": [],
"walletFlags": [],
"allowBackupKeySigning": false,
"recoverable": true,
"startDate": "2025-03-26T17:48:18.000Z",
"type": "hot",
"buildDefaults": {},
"customChangeKeySignatures": {},
"hasLargeNumberOfAddresses": false,
"hasReceiveTransferPolicy": false,
"creator": "6101c3790293df0006fb99bc777152ce",
"subType": "lightningSelfCustody",
"config": {},
"inboundBalance": "0",
"inboundPendingBalance": "0",
"inboundUnsettledBalance": "0",
"outboundBalance": "0",
"outboundPendingBalance": "0",
"outboundUnsettledBalance": "0",
"balanceString": "0",
"confirmedBalanceString": "0",
"spendableBalanceString": "0",
"pendingApprovals": []
},
"userKeychain": {
"id": "67e43de1551f8a42dadaabb0d2ac2264",
"pub": "xpub661MyMwAqRbcFKQKbgT6uA46wmi5FrqrYoJjUzQjnPU5VY6Pk7nyqn2Jg9oHdn4gd1Eh8idDbh6wQ4mWMZ8CXBGBLGvoBbva3MpkDVmbjxL",
"ethAddress": "0x01e0c185c0652fc9d6b67fcb36149aa67a17fab4",
"source": "user",
"type": "independent",
"encryptedPrv": "{\"iv\":\"9tY/nQ9DsTXp71vypxNVGg==\",\"v\":1,\"iter\":10000,\"ks\":256,\"ts\":64,\"mode\":\"ccm\",\"adata\":\"\",\"cipher\":\"aes\",\"salt\":\"v6m97u751w4=\",\"ct\":\"E2d7SNUkJJspAz07uougA3lvih8dA9A0bm7aYt0LVtquUzGZgXji5x5Ez1gaZKb2mESuUOLrDfe8zHOnvDVhYcK015zM1llqxKH5/LOg715AcYKLNoE3hHrZoy4IZlaQV8LntKGX1+pOYlqkjlaZLWNtDMuoB+g=\"}"
},
"userAuthKeychain": {
"id": "67e43de1d19e3a9237bf558bed01f8e6",
"pub": "xpub661MyMwAqRbcH4SU8XsxRzbNkZWr3zB1Qksxp9b7mqv8f2btQgofwBQixHZFUrUSrtS8r8yH7cs6pMwYQUWuAg13upsCb72v7cnfY5sU7Xx",
"ethAddress": "0x83c3e1f73925c9013b1ae05da76eb67dbd85e374",
"source": "user",
"type": "independent",
"coinSpecific": {
"tlnbtc": {
"purpose": "userAuth",
"_requestId": "cm8q7x8kj0byf0eys63uk9nsf"
}
},
"encryptedPrv": "{\"iv\":\"7cxr+H0cT7g3xRsACg+Saw==\",\"v\":1,\"iter\":10000,\"ks\":256,\"ts\":64,\"mode\":\"ccm\",\"adata\":\"\",\"cipher\":\"aes\",\"salt\":\"4ZJflpV8Mu8=\",\"ct\":\"1R+f4etETgoyLBQ98ErQ7fMq2vZVJjnDev8Fe88BAfcZ9dGpkFfbKBgc6skJn2Qy0GjsCI0G9qFvSbjfAIWxCtkbrZ7KzLnXCnVyWH3SbagyZfOYNs4UgmCbdEoS7bIMF1ZiMzj+phIeeuP/QGaZZYcL9/Z6+Kk=\"}"
},
"nodeAuthKeychain": {
"id": "67e43de1ffc2dfc5c5994239ed002fb5",
"pub": "xpub661MyMwAqRbcFbNKN8P6pQuaieXxCdj38JniNNoiX8nL2LNf4RTdTvULEuua4pMxjyid6vFH3BiFoXQ1BHJbbxhwnkte7sd4o2jVtwgk9ig",
"ethAddress": "0x391004935442ad4237ab7adaae31e0056844f4e2",
"source": "user",
"type": "independent",
"coinSpecific": {
"tlnbtc": {
"purpose": "nodeAuth",
"_requestId": "cm8q7x8u90c7d0e0cekte5rum"
}
},
"encryptedPrv": "{\"iv\":\"9JmKBrVJvWtzsyWhoyqMPg==\",\"v\":1,\"iter\":10000,\"ks\":256,\"ts\":64,\"mode\":\"ccm\",\"adata\":\"\",\"cipher\":\"aes\",\"salt\":\"kxJFetnXI+U=\",\"ct\":\"hlquksFjZJ9EciSbjModTiHE7R4GoHenxRy6OPKHw9nHS2yTkU3ZyV1wMzqXC+/Yq0ZtPDqV7YOFKQ1r9+GWCCyKi8wdX+ZZS5mul0R2WJSsw7nBiFPuiUyqZlK7vrrt/6ERcobzrJBnqU9QN2TkUpWxPxHStLQ=\"}"
},
"responseType": "LightningWalletWithKeychains",
"encryptedWalletPassphrase": "{\"iv\":\"frevNIUliAXK5eS/YU4uaQ==\",\"v\":1,\"iter\":10000,\"ks\":256,\"ts\":64,\"mode\":\"ccm\",\"adata\":\"\",\"cipher\":\"aes\",\"salt\":\"pwl6aQtPxH0=\",\"ct\":\"/tBwHmRzyEo4dsyX0Zv5LSlh05XITpzqDU5rlA==\"}"
}Next Steps
See Also
Updated about 2 hours ago