Ask or search…
K
Links

Generate Xpub

Generating an extended public key (xpub) is a way to allow the creation of public addresses without exposing the corresponding private keys. It's an important function for maintaining security while still being able to receive funds.
You can generate Xpub with or without mnemonic.
Typescript
Javascript
// Import the necessary library and initialize the SDK
import { UtxoWalletProvider } from '@tatumio/utxo-wallet-provider';
import { TatumSDK, Network, Bitcoin } from '@tatumio/tatum';
const tatumSdk = await TatumSDK.init<Bitcoin>({network: Network.BITCOIN,
configureWalletProviders: [
UtxoWalletProvider,
]});
// Generate xpub using the generated mnemonic
const xpubDetails = await tatumSdk.walletProvider.use(UtxoWalletProvider)
.generateXpub(mnemonic);
console.log(xpubDetails.xpub); // This will print the generated xpub
await tatum.destroy();
// Import the necessary library and initialize the SDK
import { UtxoWalletProvider } from '@tatumio/utxo-wallet-provider';
import { TatumSDK, Network } from '@tatumio/tatum';
const tatumSdk = await TatumSDK.init({network: Network.BITCOIN,
configureWalletProviders: [
UtxoWalletProvider,
]});
// Generate xpub using the generated mnemonic
const xpubDetails = await tatumSdk.walletProvider.use(UtxoWalletProvider)
.generateXpub(mnemonic);
console.log(xpubDetails.xpub); // This will print the generated xpub
await tatum.destroy();
© Tatum Technology, LLC