Skip to main content

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.

Source: walletunlocker.proto

gRPC

rpc GenSeed (GenSeedRequest) returns (GenSeedResponse);

REST

HTTP MethodPath
GET /v1/genseed

Code Samples

const fs = require('fs');
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');

const GRPC_HOST = 'localhost:10009'
const TLS_PATH = 'LND_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync(['lightning.proto', 'walletunlocker.proto'], loaderOptions);
const lnrpc = grpc.loadPackageDefinition(packageDefinition).lnrpc;
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA';
const tlsCert = fs.readFileSync(TLS_PATH);
const sslCreds = grpc.credentials.createSsl(tlsCert);
let client = new lnrpc.WalletUnlocker(GRPC_HOST, sslCreds);
let request = {
aezeed_passphrase: <bytes>,
seed_entropy: <bytes>,
};
client.genSeed(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "cipher_seed_mnemonic": <string>,
// "enciphered_seed": <bytes>,
// }

Messages

lnrpc.GenSeedRequest

Source: walletunlocker.proto

FieldgRPC TypeREST TypeREST Placement
aezeed_passphrase
bytesstringquery
seed_entropy
bytesstringquery

lnrpc.GenSeedResponse

Source: walletunlocker.proto

FieldgRPC TypeREST Type
cipher_seed_mnemonic
string[]array
enciphered_seed
bytesstring