Solana — Wallet Creation and Sending Tokens

Aman Verma
4 min readDec 14, 2021

Solana is an open-source project implementing a new, high-performance, permissionless blockchain. It is also the most performant permissionless blockchain where a network of 200 physically distinct nodes supports a throughput of more than 50,000 transactions per second.

Solana has innovated a mempool-less transaction forwarding protocol. A mempool is a set of transactions that have been submitted to the network and are yet to be processed by the network. Leveraging its protocol, Solana validators can manage a mempool size of 100,000 without having to increase network throughput. In Solana, with a network throughput of 50,000 TPS, a 100,000 transaction mempool is executed within seconds.

Solana Cluster

A cluster is a set of computers that work together and can be viewed from the outside as a single system. A Solana cluster is a set of independently owned computers working together (and sometimes against each other) to verify the output of untrusted, user-submitted programs.

The cluster produces a record of events called the ledger. It will be preserved for the lifetime of the cluster. As long as someone somewhere in the world maintains a copy of the ledger, the output of its programs (which may contain a record of who possesses what) will forever be reproducible, independent of the organization that launched it.

Wallet

A crypto wallet is a device or application that stores a collection of keys and can be used to send, receive, and track ownership of cryptocurrencies. Wallets can take many forms. A wallet might be a directory or file in your computer’s file system, a piece of paper, or a specialized device called a hardware wallet. There are also various smartphone apps and computer programs that provide a user-friendly way to create and manage wallets.

Install Solana Tool Suite

To create your own file system wallet in Solana, you need Solana Tool Suite which is a collection of various command-line tools for Solana. To install the tool suite, run the following command in your terminal.

sh -c "$(curl -sSfL https://release.solana.com/v1.8.6/install)"

This will install all the necessary command-line tools. To check if you have installed it correctly, run the following command to check Solana version

solana --version

Create your own Solana Wallet

To create your own wallet in Solana You will need a common-line tool called solana-keygen. We already installed Solana Tools Suite so we are good to go.

First, create a directory store your keypair.

mkdir ~/my-solana-wallet

Now run the following command to create your own file system wallet by generating a new keypair.

solana-keygen new --outfile ~/my-solana-wallet/my-keypair.json

It will ask for a passphrase. Press enter. This will create a JSON file inside the my-solana-wallet directory by the name my-keypair.json.

You will also see the following output in the terminal.

Generating a new keypair For added security, enter a BIP39 passphrase NOTE! This passphrase improves security of the recovery seed phrase NOT the keypair file itself, which is stored as insecure plain text BIP39 Passphrase (empty for none): Wrote new keypair to /home/knoldus/my-solana-wallet/my-keypair.json ====================================================================pubkey: 2qs68wocHp2fR4EF8xkKpscoKU6gRwtQAHz2FfLXj5Hs ====================================================================Save this seed phrase and your BIP39 passphrase to recover your new keypair: grocery cube mind chuckle alcohol album mean olympic unusual gate hover girl ====================================================================

You will see your public key. This is your wallet address and you should save this as you will need this in future.

The seed phrase is very important and you should never disclose it to anyone as using this anyone may recover your private key. This is a test wallet so there is no problem.

Send and Receive tokens

Now we will see how you can send and receive SOL, which is Solana Cryptocurrency, using Command Line Tools.

First of all, you need some SOLs that you can send to another wallet. Use the command below to airdrop yourself some SOLs from the devnet. The Solana devnet is a Solana cluster for development purposes.

solana airdrop 1 <RECIPIENT_ACCOUNT_ADDRESS> --url https://api.devnet.solana.com

Use your Public Key in place of <RECIPIENT_ACCOUNT_ADDRESS> and press enter. You will see something like this.

Requesting airdrop of 1 SOL Signature: 21jG4XFiU5jsziBiBy3HsVyQzmUudRgA9Q2xsnHnBvhNCfjfh6L7cqKX6jks4jiBUbLrYuUoeLH1JjK28NtBQ8mz 1 SOL

This means that now you have 1 SOL on the Solana Devnet which you can send to another wallet. Now create another wallet.

solana-keygen new --no-passphrase --no-outfile

This will create another key pair. Copy the pub key of this wallet and save it somewhere. Now use the command below to send 0.5 SOL to the newly created address.

solana transfer --from <KEYPAIR> <RECIPIENT_ACCOUNT_ADDRESS> 0.5 --allow-unfunded-recipient --url https://api.devnet.solana.com --fee-payer <KEYPAIR>

Here you replace <KEYPAIR> with your pub key and <RECIPIENT_ACCOUNT_ADDRESS> with the newly generated pub key.

Now check the balance of the recipient wallet by the command.

solana balance <ACCOUNT_ADDRESS> --url http://api.devnet.solana.com

You will see that the recipient wallet has 0.5 SOL which you transferred just now.

So, This was all about Solana wallet creation and sending tokens. Stay tuned for more such content.

If you want to read more content like this? Subscribe to Rust Times Newsletter and receive insights and latest updates, bi-weekly, straight into your inbox. Subscribe to Rust Times Newsletter: https://bit.ly/2Vdlld7.

Originally published at https://blog.knoldus.com on December 14, 2021.

--

--

Aman Verma

A Rust and wasm enthusiast. Always ready to learn and explore new things.