

Solana - Wallet Creation and Sending Tokens - Knoldus Blogs
source link: https://blog.knoldus.com/solana-wallet-creation-and-sending-tokens/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Solana – Wallet Creation and Sending Tokens
Reading Time: 4 minutes
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.
Recommend
-
11
Extending Functionality Reading Time: 2 minutesWe had an interesting case of enhancing the functionality of a logging library with our own case to feed data into DataDog....
-
10
User Authorization using JWT Reading Time: 4 minutesAround all the buzz words flying in the micro-service development area, one of the hottest is JWT (JSON Web Token). We often encounter JWT in already establish...
-
9
Building API with gRPC – Part 1 Reading Time: 3 minutes Hey everyone, have you ever faced the problem to create the applic...
-
5
Reading Time: 2 minutes Welcome folks!In most of the client calls, we come across the following questions :– “Send me the entire logs of the file”– “I want the logs with timestamp”– “I want the log file of th...
-
12
Program Increment and It’s Planning Reading Time: 4 minutes SAFe is no Magic except for Program Increment Planning. No eve...
-
11
Scripting Library in Scala – Ammonite Reading Time: 4 minutesAmmonite is a Scala library that lets us use Scala language f...
-
6
Reading Time: 5 minutes You would always get a ton of literature on Event Sourcing and CQRS. The key question is WHEN do you use it? Under what circumstances? Is your problem really in need of ES? I would not go into the details of...
-
10
Reading Time: 4 minutes DC/OS is a distributed systems kernel that lets you manage multiple machines as if they were a single computer. Its included web interface facilitates user to interact with its services. Now, this is where it gets qui...
-
11
Working on Substrate? Must know about Runtime APIs. Knoldus Blog Audio Reading Time:...
-
11
A Non-blocking "Email sending" functionality in Scala Reading Time: < 1 minuteIn our last blog “Adding a...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK