Generating wallets using Tatum

Learn how to generate a wallet, deposit address, and private key for the address in 3 simple API calls.

Antonis Kazoulis
Tatum
3 min readNov 19, 2021

--

One of our most recent video tutorials showed you how to create a new wallet, generate a private key as well as a deposit address. Today, we will be putting it all down in writing, giving you some code snippets and insights on how to get the basics right.

Some definitions to begin with

If you’re just starting out with blockchain development, the first step in building any dApp is generating a wallet. Wallets are used to hold private keys and addresses. In simpler terms, it’s a medium that helps you manage, secure, and use cryptocurrencies.

A blockchain address is a unique sequence of numbers and letters generated every time you want to send crypto. These addresses are generated from the extended public key (xpub) which is the master public key of an account.

To use a blockchain address and actually send crypto you need a private key. A private key is a cryptographic code that functions as a secret password allowing you to sign off on a transaction and transfer the funds.

Now that we have the theory down, let’s learn how Tatum can help you generate a wallet, deposit address, and private key in a few simple steps. For the purposes of this example, we will use Bitcoin, but the same process is applicable to Ethereum, Flow, or any other blockchain in our API documentation.

Generate wallet

When you use the generate wallet call you will get two data strings: the first one is the mnemonic and the second one is the xpub. The mnemonic is a 24-word string responsible for generating all the data in the wallet. The xpub, as mentioned before, is the master public key, a read-only generator of addresses.

Generate address

To generate an address, you will need the xpub from the wallet and the index of the address you want to generate. It’s important to note that every wallet generated from Tatum can hold more than 2 billion addresses.

Generate private key

The next step is acquiring a private key so that you can sign transactions and send crypto from your wallet. For private keys, you need to use the mnemonic of the wallet and the index number of the address.

For a more extended breakdown, you can always visit our guide on how to create a blockchain wallet.

You’re ready to go!

Generating wallets, addresses, and private keys is step number one in your Tatum journey. Next, you can learn more about how Tatum can get you started with blockchain development or watch more of our YouTube workshops, read our documentation, API documentation, or blog.

You can also follow us on our Linkedin and Twitter, and if you need any help along the way, don’t hesitate to drop us a line on the Tatum Discord or subreddit.

Happy coding!

--

--

Antonis Kazoulis
Tatum
Writer for

Writing content that engages the mind and captures the imagination.