Set Up Lightning Custody Wallets
Create a custody Lightning wallet on BitGo. See the Guide.
-
You create a custody Lightning wallet by calling the Generate Wallet endpoint with
subType: "lightningCustody". BitGo creates a Lightning node with a hosting service provider and initializes it. This process can take up to 24 hours. BitGo sends you an email notification when the wallet is ready.Prerequisites: Sign a custody Lightning license (
custodyLightningWalletfor custody wallets,custodyGoLightningfor Go Lightning) for your enterprise by contacting support@bitgo.com.
// 1. Create Lightning Wallet
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="tlnbtc"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export LABEL="<YOUR_WALLET_NAME>"
export WALLET_PASSPHRASE="<YOUR_BITGO_LOGIN_PASSPHRASE>"
export PASSCODE_ENCRYPTION_CODE="<YOUR_BITGO_PASSPHRASE_ENCRYPTION_CODE>"
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": "'"$WALLET_PASSPHRASE"'",
"passcodeEncryptionCode": "'"$PASSCODE_ENCRYPTION_CODE"'",
"enterprise": "'"$ENTERPRISE_ID"'",
"type": "hot",
"subType": "lightningCustody"
}'
// 1. Create Lightning Wallet
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>',
passcodeEncryptionCode: '<YOUR_BITGO_PASSPHRASE_ENCRYPTION_CODE>',
enterprise: '<YOUR_ENTERPRISE_ID>',
subType: 'lightningCustody'
});
console.log(JSON.stringify(newWallet, undefined, 2));
}
Response
// 1. Create Lightning Wallet Response
{
"wallet": {
"id": "67e43de27f977e954022b8eb8693f5a7",
"coin": "tlnbtc",
"label": "Test Custody Lightning Wallet",
"m": 1,
"n": 1,
"keys": ["67e43de1551f8a42dadaabb0d2ac2264"],
"enterprise": "65302ca0c3939600075905e213ca20dd",
"type": "hot",
"subType": "lightningSelfCustody",
"inboundBalance": "0",
"outboundBalance": "0",
"balanceString": "0",
"confirmedBalanceString": "0",
"spendableBalanceString": "0"
},
"userKeychain": {
"id": "67e43de1551f8a42dadaabb0d2ac2264",
"source": "user",
"type": "independent"
},
"responseType": "LightningWalletWithKeychains"
}